Support


Rest
Https
Request headers
Errors
Method errors




Rest

The Scalapay API is organised around REST. The API attempts to use predictable, resource-oriented URLs and to use HTTP status codes to indicate errors.




Https

The Scalapay API requires all communications to be secured using TLS 1.2 or greater.




Request headers

Clients must send appropriate headers with all the requests.

FieldnameRequiredDescription
AcceptYesPOST and PUT requests must declare the content-type as application/json
Content-TypeYesAll requests must accept application/json
AuthorizationYessee here



Errors

HTTP Status codes

The Scalapay API uses the conventional HTTP status codes to indicate success or failure of an API request.

HTTP Status CodeDescription
200-299The request was processed successfully
400-499The request was not valid (e.g. a required parameter was missing).
500-599The request could not be processed for an unexpected reason.

Response

Returns a JSON object and an appropriate HTTP status code.

Please note that the human-readable textual messages included within the error object are improved over time. For validation and mapping purposes, please use the error code or HTTP status code values.

AttributeTypeDescription
errorCodestringThe type of error returned. E.g.: order_amount_exceeds_maximum_limit
errorIdstringA unique error ID
messagestringA human-readable message which provides more details about the error. In most cases, these messages can be displayed to the end user.
httpStatusCodeintegerThe HTTP status code
{
    "errorCode": 400,
    "errorId": "error-sktwiapnkhy2ynv8",
    "message": "startDate cannot be greater than endDate",
    "httpStatusCode": 400
}



Method errors

GET Errors

HTTP Status CodeerrorCodeDescription
401 UnauthorizedunauthorizedInvalid Merchant API credentials were passed in the Authorization header

POST and PUT Errors

HTTP Status CodeerrorCodeDescription
400 Bad Requestinvalid_jsonThe request body contains invalid, improperly formatted JSON or empty body.
401 UnauthorizedunauthorizedInvalid Merchant API credentials were passed in the Authorization header