Overview
Introduction
Use JSON/RPC to invoke methods of version 3.0 of the Avangate API. JavaScript Object Notation remote procedure call protocol is a lightweight data-interchange format.
Workflow
- Use the following URL: https://api.avangate.com/rpc/3.0/
- Authenticate using the login method and create a session (connection).
- Throughout the lifetime of the session (max 10 minutes) you can invoke all Avangate API methods. To invoke methods you need to send a request to Avangate. Read more on the request object below.
- The Avangate system provides responses for all requests. Read more on the response object below.
Request
Invoke remote methods by sending requests to Avangate. Request contain single objects serialized using JSON. Read request properties below.
{
"jsonrpc": 2.0,
"id": < intidentifier >,
"method": "<methodName>",
"params": [ < parametersarray > ]
}
Request object
jsonrpc |
required (String) |
|
The version of the JSON-RPC protocol. Needs to be 2.0. |
id |
required (Int) |
|
A mandatory identifier you control used to identify the request and the response. Use only integers. |
method |
required (String) |
|
The name of the method invoked. Case sensitive. |
params |
optional (Object) |
|
An object containing the parameters valid for invoking the method used. Parameters structure:
|
Response
When the method invocation completes, Avangate replies with a response. The response is a single object serialized using JSON. There are two types of response, with the properties detailed below.
Valid
{
"id": < intidentifier > ,
"jsonrpc": 2.0,
"response": { < return object > }
}
jsonrpc |
required (String) |
|
The version of the JSON-RPC protocol. Needs to be 2.0. |
id |
required (Int) |
|
A mandatory identifier you control used to identify the request and the response. Use only integers. |
response |
required on success only (Object) |
|
Provided on success (Avangate does not provide it if there is an error invoking the method). Actual value depends on the method invoked. |
Invalid
{
"id": < intidentifier >,
"jsonrpc":2.0,
"error":{
"code": < interrorcode >,
"message":"<error message>"
}
}
jsonrpc |
required (String) |
|
The version of the JSON-RPC protocol. Needs to be 2.0. |
id |
required (Int) |
|
A mandatory identifier you control used to identify the request and the response. Use only integers. |
error |
required on error only (Object) |
|
|