Trustpair uses conventional HTTP response codes to indicate the success or failure of an API request.

In general:

  • Codes in the 2xx range indicates success.
  • Codes in the 4xx range indicates an error due to the information that were provided (e.g., a required parameter was omitted, a charge failed, etc.)
  • Codes in the 5xx range indicates an error with Trustpair's servers (these are rare).
HTTP Status CodeDescription
200 - OKEverything worked as expected
202 - AcceptedThe request has been accepted and processing has not been completed yet
401 - UnauthorizedNo valid API key or no API key was provided.
403 - ForbiddenThe API key does not have the necessary permissions to perform the request
404 - Not FoundThe requested resource could be not found.
422 - Un-processable entityThe request format was invalid. See more below.
429 - Too many requestsToo many requests were received. We recommend spacing requests increasing the interval between your requests, for instance using an exponential backoff.
500 - Internal Server ErrorThe Trustpair API experienced an internal server error. Our team has been notified and is working to fix it.

πŸ“˜

More infos about 422 errors

For all POST requests, when there are format errors or missing mandatory or conditional data, Trustpair's API will answer with a 422 HTTP answer code. The answer will contain more information about the more specific reason why the format was invalid. Here is the list of potential answers:

TypeKeyReason for failureEN message
BankibanMissing "At least one of the bank account identifiers must be present"
Bankbank_account_numberMissing "At least one of the bank account identifiers must be present"
Bankbank_account_typeIncorrect"Invalid account number" _OR "This country uses the IBAN format, please select IBAN as the account type"_
Bankbank_account_bicMissing"Required if bank_account_number is present"
BankbicIncorrect"Invalid BIC number"
Companycompany_country_codeMissing/Incorrect "Required"
Companycompany_registrationMissing"At least one of the company identifiers must be present"
Companytax_numberMissing"At least one of the company identifiers must be present"
CompanydunsMissing"At least one of the company identifiers must be present"
Companycompany_registration_typeIncorrect"Invalid company registration"

Note that the answer will contain the list of errors if there are more than one (see example below)

{
  "errors": {
    "company_country_code": [
      "Required"
    ],
    "bank_account_bic": [
      "Required if bank_account_number is present"
    ]
  }
}