API Errors


Response

If an API error occurs, all responses will follow the format below:

{
    "status": "error",
    "code": 500,
    "message": "Error message"
}

Missing Fields

If the request fails due to missing request fields, it will have an attached "fields" object:

{
    "status": "error",
    "code": 422,
    "message": "The given data was invalid.",
    "fields": {
        "first_name": [
            "The first name field is required."
        ]
    }
}

Gateway Errors

If an error occurs at the gateway level, including declines, it will have an attached "transaction" object:

{
    "status": "error",
    "code": 402,
    "message": "The transaction has been declined.",
    "transaction": {
        "id": "6A59E0F36695B2FC",
        "gateway": "DB5A25FA",
        "amount": "70.71",
        "currency": "USD",
        "status": "declined",
        "response": "The transaction has been declined.",
        "is_captured": false
    }
}