Skip to main content

Overview

Last updated: 31-Jul-2019
Rate this article:

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

  1. Use the following URL: https://api.avangate.com/rpc/3.0/
  2. Authenticate using the login method and create a session (connection).
  3. 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.
  4. 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:

  • Provide RPC call parameters by-position using an Array. (structured value)
  • by-position: include all parameters into an Array. Put values in the order expected by Avangate.
  • At this point Avangate doesn’t support by-name parameters.

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)

 

  • Code - Integer identifying the error.
  • Message - Error description (string).

 

Rate this article:

Need help?

Do you have a question? If you didn’t find the answer you are looking for in our documentation, you can contact our Support teams for more information. If you have a technical issue or question, please contact us. We are happy to help.

Not yet a Verifone customer?

We’ll help you choose the right payment solution for your business, wherever you want to sell, in-person or online. Our team of experts will happily discuss your needs.

Verifone logo