Errors
Errors in the OpenTransact API in general follow the specification for JSON-API. You can find more info here: https://jsonapi.org/format/#error-objects . The error should provide enough detail for you to fix the issue with your request. If not please contact support@opentransact.com with the details of the error.
Example Error
{
"errors": [
{
"status": "404",
"title": "Not Found",
"detail": "Could not locate requested resource" ,
"code": "10001"
}
]
}
Common Errors
The following is a table of errors that are returned by the API for common issues.
| Error Name | Error Code | HTTP Status Code | Error Detail |
|---|---|---|---|
| Not Found | 10001 | 404 | Could not locate requested resource |
| Unauthorized | 10002 | 401 | Unauthorized request. |
| Missing Authorization Header | 10003 | 401 | See: https://docs.opentransact.com/authentication/. |
| Authorization Token Expired | 10004 | 401 | See: https://docs.opentransact.com/authentication/. |
| Unauthorized | 10005 | 401 | See: https://docs.opentransact.com/authentication/. |
| Missing Required Request Parameter | 10006 | 422 | The request param %{attribute} is missing. |
| Incorrect Type for Parameter | 10007 | 422 | %{attribute} cannot be of type null |
| Incorrect Type for Parameter | 10008 | 422 | %{attribute} cannot be of type String. See: https://docs.opentransact.com/types/. |
| Incorrect Type for Parameter | 10009 | 422 | %{attribute} cannot be of type Boolean. See: https://docs.opentransact.com/types/. |
| Incorrect Type for Parameter | 10010 | 422 | %{attribute} cannot be of type Array. See: https://docs.opentransact.com/types/. |
| Incorrect Type for Parameter | 10011 | 422 | %{attribute} cannot be of type Object. See: https://docs.opentransact.com/types/. |
| Incorrect Type for Parameter | 10012 | 422 | %{attribute} cannot be of type Number. See: https://docs.opentransact.com/types/. |
| Invalid Param Value | 10013 | 422 | %{attribute} must be set to a whitelisted value. |
| Invalid Type Param | 10014 | 422 | Type param must be set to '%{attribute}' for the requested resource. |
| Forbidden | 10015 | 403 | |
| Missing Required Request Parameter | 10015 | 422 | The query string param %{attribute} is missing. |
| Bad Gateway | 10016 | 502 | |
| Non-permitted Parameter | 10016 | 422 | %{attribute} is not a permitted parameter. |
| Incorrect Type for Parameter | 10017 | 422 | %{attribute} cannot be of type Float |
| Idempotency Key Conflict | 10018 | 409 | An identical request has already been processed. |
| Idempotency Key Conflict | 10019 | 409 | The provided Idempotency-Key was previously used with a diferent request. |
| Missing Required Attribute | 11001 | 422 | %{attribute} can't be blank |
| Invalid Attribute | 11002 | 422 | %{attribute} is not valid |
| Invalid Attribute | 11003 | 422 | %{attribute} must be unique |
| Cannot Transition State | 11004 | 422 | %{attribute} |
| Missing Required Relationship | 11005 | 422 | %{attribute} could not be located |
| Record Exists | 11006 | 422 | Record already exists for %{attribute} |
| Invalid Attribute | 11007 | 422 | %{attribute} value is too long |
| Unrelated Objects Provided | 11008 | 422 | %{attribute} is unrelated to data provided |
| Invalid account type | 12001 | 422 | %{attribute} value not supported |
| Invalid transaction type | 12002 | 422 | #{attribute} value is invalid |
| Invalid transaction method | 12003 | 422 | The combination of transaction type and account type is unsupported. |
| Invalid currency | 12004 | 422 | We do not support the supplied currency. |
| Invalid precision | 12005 | 422 | We do not support the supplied precision. |
| Invalid Account | 12006 | 422 | The supplied account is not currently active. |
| Account or Payment Method Required | 12007 | 422 | One of either Account or Payment Method must be provided. |
| Item is Not Returnable | 12008 | 422 | A return cannot be created for the related item. |
| Item has already been returned | 12009 | 422 | A return cannot be created for the related item, which has previously been returned. |
| Refund would exceed transaction amount | 13001 | 422 | Total refunds may not be greater than the original transaction amount. |
| Invalid Expiration Date | 13002 | 422 | The expiration date is in an invalid format. |
| Bank or Branch Must Be Set | 13003 | 422 | Either the bank or the branch must be set to a valid value. |
| Bank and Branch Both Set | 13004 | 422 | Both the Bank and Branch values cannot be set simultaneously. |
| Permission Statement Invalid | 13005 | 422 | The permisison statement is invalid. |