Error Reasons
Error Response
All Sprinque API errors will be of the below 2 formats.
- When the known error from the below list has occurred, Sprinque will return the below error code snippet
{
”trace_id”: 12345,
“error_code”: “auth-declined”,
“errors”: {”AuthDeclinedError”: [”Charge authorization hold declined.”]}
}
- When an unknown error occurs, Sprinque will return the below error code snippet
{
“trace_id”: 12345,
“error_code”: “sprinque-error”,
“errors”: {”SprinqueError”: [”Something bad happened. Try later.”]
}
The complete list of errors can be found below.
HTTP Error Codes
Sprinque uses conventional HTTP response codes to indicate the success or failure of an API request. In general:
- Codes in the 2xx range indicate success
- Codes in the 4xx range indicate an error that failed given the information provided
- Codes in the 5xx range indicate an error with Sprinque's servers
4xx errors should be handled programmatically. We recommend writing code that gracefully handles all possible API exceptions. The possible 4xx errors Sprinque returned are below.
Error | Description |
---|---|
400 Bad Request | Request sent to Sprinque is incorrect or corrupt, and the server receiving the request can't understand it. Recommended fix - Try making sure all required parameters are present and are sent in the right format. |
401 Unauthorized | When the Sprinque API key from the merchant control center is not present along with the request, is incorrect or has expired. Recommended fix - Use the latest API key for that environment or regenerate a new one. |
403 Forbidden | The API key used in the request does not have the right permissions or is inactive. Recommended fix - Use the latest API key for that environment or regenerate a new one. |
409 Conflict | The request could not be processed because of a conflict in the request. Recommended fix - Ensure it is not a duplicate request and try again. |
422 Unprocessable Entity | The server understands the content type of the request entity, and the syntax of the request entity is correct, but it was unable to process the contained instructions Recommended fix - Use the error messages returned for the exact reason of failure and mitigate it. |
429 Too Many Requests | The user has sent too many requests in a given amount of time. Recommended fix - Back off for a fixed period of time before trying again. |
500 Internal Server Error | The Sprinque server encountered an unexpected condition that prevented it from fulfilling the request. Recommended fix - Contact Sprinque support or retry after some time. |
504 Gateway Time-Out | This indicates that the server while acting as a gateway or proxy, did not get a response in time from the upstream server that it needed in order to complete the request. Recommended fix - Contact Sprinque support or retry after some time. |
Detailed List of Errors
Along with the conventional HTTP errors, below is the breakdown of the 4xx errors that Sprinque supports for the various API calls.
Validation Errors
HTTP Response Code | Error Code | Error Message |
---|---|---|
400 | missing-and-invalid-field | The format of a field does not match the required input format or required fields are missing. |
404 | resource-not-found | Could not find the resource(s) specified in the request. |
API Key Errors
HTTP Response Code | Error Code | Error Message |
---|---|---|
401 | api-key-not-specified | API key is a required field. |
401 | api-key-invalid | Invalid API key. |
401 | api-key-inactive | Inactive API key. |
Buyer Onboarding Errors
HTTP Response Code | Error Code | Error Message |
---|---|---|
409 | duplicate-business | Business with the same name or registration number is already registered. |
409 | duplicate-user | User with the same email has already registered. |
Transaction Processing Errors
HTTP Response Code | Error Code | Error Message |
---|---|---|
422 | auth-credit-exceeded | The buyer has exceeded their available credit limit. |
403 | auth-buyer-under-review | The buyer is still under review. |
403 | auth-buyer blocked | The buyer has been blocked. |
403 | auth-buyer-inactive | The buyer is inactive. |
403 | auth-buyer-blocked | The buyer is blocked. |
403 | auth-credit-not-found | This can happen when you're using the wrong API key vs buyer_id |
404 | credit-qualification-not-found | Can not find credit qualification. API key might be wrong or not match the environment |
409 | auth-duplicate-request | Duplicate request for merchant_order_id. |
403 | auth-credit-rejected | Rejected for credit. |
404 | auth-buyer-not-found | buyer_id not found. |
422 | auth-credit-pending | Credit limit for this buyer has not approved yet |
422 | auth-credit-manual-review | This buyer is under manual review. |
422 | auth-overdue-invoice-exceeded-60-days | Order is blocked because you have invoice(s) 60 days past due, please pay it/them first. |
409 | authorized-order-exists | Order with this merchant_order_id is already authorized |
422 | auth-amount-exceeded | Authorized amount is more the default setting |
409 | auth-currency-doesnt-match-order | Currency doesn't match order currency (in case of multiple invoices per order) |
404 | payment-account-collection-not-found | This might happen in case of misconfiguration of the merchant account on the Sprinqiue side. |
422 | buyer-not-eligible-payment-terms | This business is not eligible for the selected payment terms |
422 | does-not-belongs-to-buyer | The user email does not belongs to buyer organisation |
404 | void-transaction-not-found | transaction_id not found. |
422 | void-captured | The transaction has already been captured or refunded. |
409 | void-duplicate-pending-transaction | Transaction is already cancelled. |
403 | capture-credit-exceded | Capture exceeds the available credit limit. |
422 | capture-voided | This transaction has already been voided. |
404 | capture-transaction-not-found | transaction_id not found. |
403 | refund-exceeded | The total amount of credit notes exceeds the invoice amount. |
403 | refund-exceeded | The credit note cannot have a higher amount than the invoice. |
404 | refund-transaction-not-found | transaction_id not found. |
422 | refund-currency-mismatch | The credit note's currency must be the same as the invoice. |
422 | refund-voided | This transaction has already been voided. |
422 | refund-uncaptured | This transaction has not yet been captured. |
Updated 7 months ago