Skip to main content

Response Formats

Successful Response

Our backend will return a JSON response to all requests. The format of successful responses follows the following format:

{
"message": "A_MESSAGE", // What action was performed
"success": true, // true for successful request
"data": { ... } // the data of the response depending on request made
}

Unsuccessful Response

Unsuccessful requests will return a non-200 status code as is standard for a REST API. A 400 code is returned for "Bad Request" which typically means the input data is not to specification.

For example, preparing a purchase for an amount less than R100.00 will return the following response body (along with the 400 HTTP Status code)

{
"success": false,
"status": 400,
"message": [
"amount must not be less than 100"
]
}