Skip to main content
API request format, response structure, and error handling.

Quick Start

  1. Use JSON for request and response bodies with Content-Type: application/json.
  2. Authenticate as required by the API (e.g. sign, or JWT for Issuing endpoints).
  3. Handle responses using the numeric code and msg fields.

Request Format

Content Type

  • Content-Type: application/json
  • Request bodies must be valid JSON. Responses are JSON.

Headers

Some Issuing endpoints may support an Idempotency-Key header for POST requests. See the endpoint documentation.

Example Request

Response Format

Response Body

All responses use the same structure:
  • code – Numeric result or error code (e.g. 200 for success).
  • msg – Human-readable message (may be localized).
  • data – Response payload on success; often null on error.
Success example:
Error example:
Use the numeric code for programmatic handling. The full list of codes is in Response Codes.

Response Headers

HTTP Status Codes

Error Handling

  1. Check HTTP status first; treat 4xx and 5xx appropriately.
  2. Use the numeric code in the body for logic; see Response Codes.
  3. Log x-request-id when present for support and debugging.
  4. Retry only on 5xx or 429; fix 4xx requests before retrying.
  5. Respect Retry-After on 429.