Api Response Codes
The API will return HTTP status codes to indicate success or failure.
Responses from the API follow standard HTTP response codes.
Success - 2xx
A successful call to the API will return a 2xx series status code.
Status Code | Usages |
---|---|
201 | A 201 response will be returned for HTTP POST calls which create an object (eg Creating a Customer) |
200 | All other successful calls (eg Searching for Transactions) |
Failure - 4xx
A failed call to the API will return a 4xx series status code.
Status Code | Usages |
---|---|
401 | Authentication failure, returned if the authentication details are incorrect |
404 | Incorrect URL, check the URL matches the documentation |
409 | Conflicted, returned if the requests conflicts with existing data |
400 | General Error, see returned error object |
Error Response data
A 4xx error will also return an error objects.
Invalid request data
If the request is invalid (eg missing a required parameter), you'll get an error listing the issues with the request data.
{
"message": "Validation Error",
"details": {
"Amount": "The field Amount must be between 0.01 and 10000."
},
"resource": null,
"gatewayCode": null,
"gatewayMessage": null,
"code": 90,
"isRetryable": false,
"type": "https://docs.payfurl.com/errorscodes#90"
}
Provider Information
Errors may also include return an error information from the payment provider.
Error with provider information:
{
"message": "Unknown Error",
"details": {
"invalid_cvc": "{
"charge": null,
"code": "invalid_cvc",
"decline_code": null,
"doc_url": "https://stripe.com/docs/error-codes/invalid-cvc",
"message": "Your card's security code is invalid.",
"param": "cvc",
"payment_intent": null,
"payment_method": null,
"source": null,
"type": "card_error",
"error": null,
"error_description": null
}",
"Email": null,
"PaymentType": "CARD",
"Cardholder": "test test",
"ExpiryDate": "12/23",
"CardType": "VISA"
},
"resource": "/charge/card",
"gatewayCode": "invalid_cvc",
"gatewayMessage": null,
"code": 1,
"isRetryable": false,
"type": "https://docs.payfurl.com/errorscodes#1"
}