API Access & Integration

Authentication

Access the SP Pay RESTful API.

All resources in this API are protected. You will need a token to access any resource.

API Tokens can only be generated by users in your domain, who have the permissions to do so.

Before attempting to generate a token, please make sure your user has access to do so, otherwise Grant API Access to the user.

Granting API Access

To be able to grant API Access, you need to have the required permission to do so.

  1. Access the manage API Access page from API Access Management
  2. ...

Generating API Token

To generate an API Token, you will need your username and password, along with your client ID and Secret that is generated and sent for you, when you activate API access for your user.

All subsequent calls, must be made with this token passed as a Bearer Authorization Key

POST - Generate API Token

Request to generate an API Token for subsequent requests as a Bearer Token.

Endpoint

{{sppay-host}}/v1/api/token

Request

{
    "grant_type" : "password",
    "client_id": "9aeb3c7d-a851-41af-b392-629c548c7596",
    "client_secret": "YqNyGOHq5PpEwbLVpbi1BYs5TXjZgVGKrqkdi4Bz",
    "username": "[email protected]",
    "password": "Yourp@ssw0rd"
}

grant_typerequired
String

Grant type your application requires. Set value to password.

client_idrequired
String

A unique ID given to every API accessing user. This is generated when creating API Access for a user.

client_secretrequired
String

A unique password given to every API accessing user. This is generated when creating API access for a user.

usernamerequired
String

Your email you use to login to the SP Pay portal.

passwordrequired
String

Your password you use to login to the SP Pay portal.

Response

{
    "token_type": "Bearer",
    "expires_in": 31622400,
    "access_token": "eyJ0eXAiOiJKV1QiLCJ...",
    "refresh_token": "def50200e7465a07dbd7fdd05..."
}

token_type
String

Token type returned.

expires_in
integer

Token expiration time in seconds. After a token expires, it will not be usable.

access_token
String

Your access token. This should be passed as a Bearer token is subsequent requests.

refresh_token
String

Refresh token, optionally used to extend expiration time of access token.


Copyright © 2024