Skip to main content

Error Codes

Standard error format for all failed responses:

{
"error": "human readable message",
"code": "machine_readable_code"
}

4xx — Client Errors

400 Bad Request

CodeDescriptionAction
invalid_cursorPagination cursor is invalid or expiredStart from the first page (no cursor)
invalid_bank_codebank_code is not in the reference listCheck the valid bank code with the Kesles team
invalid_timestamp_formatX-Timestamp is not in unix secondsUse an int64 unix timestamp
missing_required_paramA required query param was not providedCheck the endpoint documentation

401 Unauthorized

CodeDescriptionAction
invalid_signatureHMAC signature does not matchRe-check the string-to-sign and the secret
timestamp_expiredX-Timestamp is more than ±300 seconds from server timeSync your clock via NTP, regenerate the timestamp
api_key_not_foundX-API-Key-ID is unknownContact the Kesles team
api_key_revokedKey has been revokedContact the Kesles team for a new key
api_key_expiredKey has passed expires_atPerform a key rotation

403 Forbidden

CodeDescriptionAction
ip_not_allowedCaller IP is not in the allowlistContact the Kesles team to update the IP allowlist
tier_internal_requiredEndpoint is not available to PSPsDo not call this endpoint

404 Not Found

CodeDescriptionAction
merchant_not_foundMerchant does not exist, is inactive, has no NMID, or belongs to another bankVerify the NMID; merchant may not be active or may not belong to your bank

429 Too Many Requests

CodeDescriptionAction
rate_limit_exceededExceeded rate limit per API keyWait for the Retry-After header (in seconds), then retry

Headers included on 429:

Retry-After: 30
X-RateLimit-Limit: 1000
X-RateLimit-Remaining: 0
X-RateLimit-Reset: 1716453000

5xx — Server Errors

HTTPCodeDescriptionAction
500internal_server_errorUnexpected error on the Kesles sideRetry with backoff; if persistent, contact the Kesles team with X-Request-ID
502upstream_errorInternal Kesles dependency did not respondRetry with backoff
503service_unavailableMaintenance or overloadWait for Retry-After if present, then retry
Retry Policy for 5xx

Implement exponential backoff for all 5xx errors:

  1. Retry immediately
  2. 1 second
  3. 5 seconds
  4. 30 seconds
  5. 2 minutes (stop after this, alert)

Do not retry 4xx (except 429 with Retry-After).


Tracing & Debugging

Always include X-Request-ID (uuid v4) on every request. When reporting an error to the Kesles team, include:

  • X-Request-ID from the failed request
  • Request timestamp
  • HTTP status code and error code received
  • Your bank code and API Key ID