HomeGuidesRecipesAPI ReferenceChangelog
Treasury Portal Login
Guides

Errors

The Yellow Card API returns clear, structured error responses to help you quickly diagnose issues during integration or in production. Errors follow a consistent format and include an HTTP status code, an Internal error code and a descriptive message. Use this section as a reference when handling errors.

API error's are returned with the following schema.

{
    "code": "The error code",
    "message": "The error message"
}

Code: A machine-readable Yellow Card error code.
Message: Human-readable explanation of the error.


Authentication Errors

CodeHTTP StatusDescription
AuthenticationError401Invalid API key or Signature; authentication failed.
PermissionError403API key lacks the required permission for the requested endpoint.

Request Validation Errors

Code

HTTP Status

Description

PaymentValidationError

400

Invalid request payload (e.g. missing required fields or metadata) In particular this can occur if full KYC/metadata is required but not provided.

InvalidRequestBody

400

Returned when an invalid body is passed in resolve bank Account API

InvalidPhoneNumberFormat

400

Phone number in the request is not in international format (e.g. missing “+234” prefix)

ResolveAccountError

400

Failed to resolve the bank account number (no match for the provided bank account number on the selected bank)


Transaction Errors

CodeHTTP StatusDescription
PaymentExpired400On approve or Deny. (payment request has expired)
PaymentInvalidState400Payment is in an invalid state for the requested operation
PaymentNotFound404The payment with the given id does not exist.
CollectionNotFoundError404Failed to resolve the bank account number (no match for the provided bank account number on the selected bank)