Error Handling

Pliant uses standard HTTP status codes to indicate whether an API request was successful or resulted in an error.

  • 2xx codes indicate a successful operation.
  • 4xx codes indicate client-side errors — for example, when required parameters are missing or the request is malformed.
  • 5xx codes indicate server-side errors on Pliant's infrastructure. These are usually temporary, and retries should include a backoff strategy to avoid excessive traffic.

HTTP Response Codes

Status CodeDescription
200OK — The request was successful, and everything worked as expected.
202Accepted — The request was accepted and is being processed asynchronously. A callback will be triggered once the operation completes.
204No Content — The request was successful, but there's no content to return. This may indicate a disabled feature module for the requested entity.
400Bad Request — The request was malformed or invalid and could not be processed.
401Unauthorized — The API consumer is not authenticated.
403Forbidden — The API consumer is authenticated but not allowed to access the requested resource.
404Not Found — The requested resource does not exist.
409Conflict — The request could not be completed due to a resource conflict (e.g., locked object).
500Internal Server Error — An unexpected error occurred on Pliant’s servers.
503Service Unavailable — A temporary error occurred on Pliant’s servers. Retry after a short delay using an exponential backoff strategy.

Common Error Messages

Below are examples of common business-logic-related error messages. This list is not exhaustive but is a good starting point for implementing granular error handling. All other unexpected errors should be caught by a generic handler.

Endpoint GroupError CodeError Message
CardholderUSER_ALREADY_EXISTSUser with the same email already exists in organization [${organizationId}].
ReceiptRECEIPT_FILE_ERRORReceipt file type not supported: image/gif
ReceiptRECEIPT_UPLOAD_NOT_ENABLEDreceiptUploadEnabled set to false for transactionId=${transactionId}.
CardILLEGAL_ARGUMENTS_PROVIDEDActivation code doesn't match.
CardINVALID_ACCESS_CODEInvalid card access code for activation.
CardILLEGAL_STATUS_TRANSITIONCard in status ${card.status} cannot be unlocked.
CardLOCKED_BY_CARD_CONTROLCard is locked by card control and cannot be unlocked manually.
CardNOT_ACTIVE_ORGCard can only be issued for ACTIVE organizations. organizationId=${organizationId}, status=${organization.status}.
CardINVALID_PHONE_NUMBERPhone number must start with '+' followed by 8 to 15 digits. memberId=${cardholderId}, phoneNumber=${phoneNumber}.
CardCARD_NAME_NOT_SUPPORTEDCard names are not supported for {cardType} cards.
CardILLEGAL_ARGUMENTS_PROVIDEDUnsupported validity period. Valid periods for virtual cards: [3, 6, 9, 12, 18, 24, 30, 36].
CardILLEGAL_ARGUMENTS_PROVIDEDIf card control categories are used, all fields are mandatory.
CardILLEGAL_ARGUMENTS_PROVIDEDIf card control merchants are used, all fields are mandatory.
CardILLEGAL_ARGUMENTS_PROVIDEDIf card control dates are used, all fields are mandatory.
CardILLEGAL_ARGUMENTS_PROVIDEDIf card control times are used, all fields are mandatory.
CardILLEGAL_ARGUMENTS_PROVIDEDDATE or TIME card controls can't be set while using card validity parameters.
Card RequestISSUANCE_LIMIT_EXCEEDEDIssuance limit reached. Card not created. memberId=${memberId}, organizationId=${organizationId}, cardConfig=${cardConfig}.
Card RequestCOMMENT_IS_MANDATORYComment is mandatory for SINGLE_USE cards.
GeneralAPI_VERSION_NOT_SUPPORTEDMinimum API version is 2.1.0. Provided version is 2.0.0.
GeneralILLEGAL_ARGUMENTS_PROVIDEDPayload is missing mandatory fields.