Introduction

You can use the swagger console to test all the APIs. Please make sure you are using the right environment. If you are building a marketplace app, your app should be approved and live in the staging or production environments before you can test it.

If your app is not live (you cannot see it in the marketplace) you can contact [email protected].

Make sure you have got the correct credentials and they are included in the request's header. All API calls need to have the header set.

How to read the APIs?

For simplicity, we have removed all the authentication headers in this documentation. And they are explained in the Credentials section.

Handling Errors

All error responses are following the below structure:

{
"error": {
"code": "number",
"title": "string",
"message": "string",
"status": "number",
"reason": "string"
}
}

Property

Type

Description

code

number

Error Code

title

string

Title of the occurred error.

message

string

A message which describes why the error has happened.

status

number

HTTP status code.

reason

string

Reason of the error (optional).

Sample Error

{
"error": {
"code": 6,
"title": "ALREADY_EXISTS",
"message": "This document already exists",
"status": 409,
"reason": "pmsNumberIsDuplicate"
}
}

Error Code

CANCELLED = 1
UNKNOWN = 2
INVALID_ARGUMENT = 3
DEADLINE_EXCEEDED = 4
NOT_FOUND = 5
ALREADY_EXISTS = 6
PERMISSION_DENIED = 7
RESOURCE_EXHAUSTED = 8
FAILED_PRECONDITION = 9
ABORTED = 10
OUT_OF_RANGE = 11
UNIMPLEMENTED = 12
INTERNAL = 13
UNAVAILABLE = 14
DATA_LOSS = 15
UNAUTHORIZED = 16
METHOD_NOT_ALLOWED = 17
NOT_ACCEPTABLE = 18

General Errors

There are some errors that are common between all APIs.

Authentication error

When your provided authentication tokens are wrong, you will get the following error

{
"error": {
"code": 16,
"title": "UNAUTHORIZED",
"status": 401,
"message": "valid credential required",
"reason": "invalidCredentials"
}
}

Validation Error

When your provided data is wrong (you missed a required field or type of a field is not match with what the API expects) you will get a validation error.

{
"error": {
"code": 3,
"title": "INVALID_ARGUMENT",
"status": 400,
"message": "A message which describes the error."
}
}