Errors

Handling errors in Pivot's API

The error object explains the error details of your request. It is encapsulated as an 'error' object in the response, if no error is found then you should expect the error object to be omitted from the response.

Error Object

{
    "code": "400100xxx",
    "message": "human-readable message response",
    "error": {      
        "type": "API_ERROR",      
        "details": [
            {
                "field": "Email",
                "message": "Email is required"
            }
        ],      
        "trace_id": "ed9ef145530fc386190ddd7612ed61c7"
    },
    "data": { 
        // resource object
    }

The error object contains the following information:

Type

Error Type, values will be one of API_ERROR, GATEWAY_ERROR, PARTNER_ERROR

  • API_ERROR: Either error is caused by validation error or invalid request. Usually will have http status 4xx

  • GATEWAY_ERROR: Error is on Pivot Gateway side. You should expect this to rarely happen. Usually will have http status 5xx

  • PARTNER_ERROR: Interaction with one of our Payment channels is causing an error, error reasons are various. Usually will be accompanied by http status 5xx

Detail

Error details are exclusive for validation error. You may expect it will contain an array of invalid fields.

Trace ID

ID to trace your request, if a request is not accompanied by traceId, then Pivot's system will generate the trace id for you. You can use the traceId when raising a helpdesk ticket to Pivot

Last updated