Skip to content
Last updated

API Errors, Statuses, and Responses

This document outlines the standard error handling and status codes used across all Payconiq public APIs, including Payments, Refunds, and Merchant Reconciliation.

HTTP Status Codes

Payconiq APIs use conventional HTTP response codes to indicate success or failure.

Success Responses

Status CodeDescription
200OK – The request was successful.
201Created – The resource was successfully created.
204No Content – The request was successful, and there is no content to return.

Error Responses

Status CodeDescription
400Bad Request – The request is malformed or contains invalid parameters.
401Unauthorized – API key or credentials are missing or invalid.
403Forbidden – You are not allowed to perform this action.
404Not Found – The requested resource could not be found.
409Conflict – The request could not be completed due to a conflict.
422Unprocessable Entity – The request is semantically incorrect.
429Too Many Requests – Rate limit exceeded.
500Internal Server Error – An unexpected error occurred on the server.
503Service Unavailable – Temporary server overload or maintenance.

Payment Statuses

Payment statuses reflect the lifecycle stage of a transaction. Satuses may be final or intermediary. Once a transaction hits a final status, the status will not change again.

Payment statuses are included in the body of the following calls:

  • Create Payment Response
  • Get Payment Details Response
  • Search Payment Response
  • Callback request
Status NameStatusDescription
PENDINGIntermediaryThe transaction has been created but not yet initiated by the user.
IDENTIFIEDIntermediaryThe user has interacted with the transaction (e.g., scanned QR code).
AUTHORIZEDIntermediaryThe transaction has passed initial verification and is ready for final processing.
AUTHORIZATION_FAILEDFinalThe transaction failed bank-side validation. Common reasons: insufficient funds, card limits.
SUCCEEDEDFinalThe transaction was completed successfully.
FAILEDFinalThe transaction failed due to a technical or logical error.
CANCELLEDFinalThe transaction was explicitly cancelled.
EXPIREDFinalThe transaction was not completed in time and has expired.
PENDING_MERCHANT_AKNOWLEDGMENTIntermediaryThe transaction has been confirmed by the consumer and is pending aknowledgement from the Merchant. Applicable only when VOID is active.
VOIDEDFinalThe transaction has been voided after consumer confirmation. Applicable only when VOID is active.

Error Response Structure

Error responses are standardized across APIs and follow this structure:

{
  "code": "UNAUTHORIZED",
  "message": "API key is missing or invalid.",
  "traceId": "abc123xyz456",
  "spanId": "op789trace"
}
AttributeDescription
codeUnique error identifier. Use this to programmatically react to specific errors.
messageHuman-readable message describing the issue.
traceIdIdentifier for tracing the error in logs. Provide this when contacting support.
spanIdOperation-level identifier, useful for distributed tracing.

Common Error Codes

CodeDescription
UNAUTHORIZEDThe API key or credentials are invalid or missing.
ACCESS_DENIEDThe authenticated user or key does not have permission to access the resource.
PAYMENT_NOT_FOUNDNo payment found for the specified ID.
REFUND_NOT_FOUNDThe refund does not exist or cannot be accessed.
TECHNICAL_ERRORA backend system error occurred. Try again later or contact support.
CALLER_NOT_ALLOWED_TO_CANCELYou do not have permission to cancel this payment.
PAYMENT_NOT_PENDINGThe requested operation is invalid because the payment is no longer pending.
PAYMENT_CONFLICTThe resource is in conflict (e.g., duplicate operation).
BODY_MISSINGThe HTTP request body is empty when one was expected.
FIELD_REQUIREDOne or more required fields are missing.
QR_NO_LONGER_IN_USEThe QR code has expired or is no longer valid.
UNABLE_TO_PAY_CREDITORPayout to merchant failed.
TRY_AGAIN_LATERTemporary failure – the operation may succeed if retried after a delay.

Best Practices for Error Handling

  • Log traceId and spanId: These identifiers help Payconiq investigate issues efficiently.

  • Differentiate error classes:

    • 4xx: Client errors – fix request content.
    • 5xx: Server errors – retry with exponential backoff.
  • Rate limiting: Respect HTTP 429 responses with retry-after logic.

  • Monitoring: Track recurring error codes to detect integration issues early.

If persistent or unexplained issues occur, contact devsupport@payconiq.be with error details and traceId.