Errors

A failed request returns an HTTP status and a body like this:

{
  "success": false,
  "error": {
    "message": "Validation failed",
    "code": "VALIDATION_FAILED",
    "details": [
      { "field": "amount.value", "message": "must be a positive decimal with at most 4 decimal places" }
    ]
  }
}

Errors by HTTP status#

StatusMeaning
400The request was not valid.
401The API key is missing, wrong, inactive or expired. See Authentication.
403The key lacks a permission, or your organization is not approved for the provider.
404No such payment or bank in your organization.
409The payment is not in a state that allows this.
410The payment has expired.
502, 504The provider failed or timed out.
503A provider or the hosted pages cannot be used right now.

Error codes#

CodeStatusWhat happened and what to do
VALIDATION_FAILED400A field is missing or wrong. Fix the fields listed in details.
PROVIDER_NOT_SUPPORTED400The provider you named does not take payments. Call GET /api/payments/providers to see what you can use.
MOCK_BANK_ONLY400You sent mockBank with a provider other than mock. Remove it.
PROVIDER_NOT_APPROVED403Your organization has no approval for this provider. See Providers and going live.
PAYMENT_NOT_CANCELLABLE409The payment already finished, so it cannot be cancelled. Read it to see its final status.
PAYMENT_NOT_PENDING409The payment has already been decided or has finished. Read it to see where it is.
PAYMENT_EXPIRED410Returned to the Mock bank page when the customer took too long. Your own calls see the payment as EXPIRED. Create a new payment.
PROVIDER_ERROR502, 504The provider could not be reached or answered badly. The payment is marked FAILED. Create a new one.
PROVIDER_NOT_CONFIGURED503The provider cannot be used at the moment. Try again later or contact Syntropi.
HOSTED_PAGES_NOT_CONFIGURED503The hosted payment pages are unavailable. Use API_ONLY, or try again later.

Anything else that goes wrong on Syntropi's side returns 500 with the message Internal Server Error and no detail. Contact Syntropi if it keeps happening.

Provider failures are not retried#

If a provider fails while a payment is being created, the payment ends as FAILED and the call returns the error. Do not retry the same request, because that would create a second payment. Create a new payment instead.