Skip to main content

HTTP Error Response Examples (System Errors)

The API returns specific JSON bodies for common system errors to aid in debugging. These are distinct from business logic declines (FAILED status).

JSON Structure:

{
"code": "ERROR_CODE",
"message": "Human readable message",
"detailed": "Additional context (optional)"
}
HTTP CodeError CodeDescriptionRecommended Action
401UNAUTHORIZEDInvalid API Key or Signature mismatch.Verify your X-TW-Signature, secret_key, and api_key.
401UNAUTHORIZEDTimestamp differs too much from now.Verify your server time synchronization (X-TW-Timestamp).
403FORBIDDENIP address not allowed.Check IP allowlist settings in the Merchant Dashboard.
404NOT_FOUNDInvalid request URI.Verify the endpoint path (e.g., /v1/payments).
404NOT_FOUNDOrder not found.The transaction/order ID does not exist or belongs to another merchant.
400INVALID_REQUESTRequest validation failed.Check JSON structure and required fields (e.g., amount must be integer).
429RATE_LIMITEDToo many requests.Implement backoff logic; retry after 60 seconds.
409DUPLICATEOrder id was used before.Use a unique idempotency_key or change the order ID and retry.
500INTERNAL_ERRORTemporally system malfunction.Retry the request; contact support if persistent.

Example Error Responses

401 Unauthorized (Signature Mismatch)

{
"code": "UNAUTHORIZED",
"message": "Invalid API Key or Signature mismatch.",
"detailed": "Please verify your X-TW-Signature and Secret Key."
}

429 Rate Limited

{
"code": "RATE_LIMITED",
"message": "Too many requests.",
"detailed": "Retry after 60 seconds."
}

409 Conflict (Duplicate Order)

{
"code": "DUPLICATE",
"message": "Order id was used before",
"detailed": "Order id was used before. Change order_id and retry"
}