Skip to main content
Kyren Pay uses conventional HTTP status codes to indicate the success or failure of an API request.

HTTP Status Codes

Status CodeDescription
200OK — Request succeeded
201Created — Resource created successfully
400Bad Request — Invalid parameters
401Unauthorized — Missing or invalid API key
403Forbidden — Insufficient permissions
404Not Found — Resource does not exist
429Too Many Requests — Rate limit exceeded
500Internal Server Error — Something went wrong on our end

Error Response Format

When an error occurs, the response body contains a JSON object with the following structure:
{
  "code": 400,
  "message": "Bad Request",
  "error": {
    "field": "productId",
    "reason": "Product ID is required"
  }
}
FieldTypeDescription
codeintegerHTTP status code
messagestringA human-readable error message
error.fieldstringThe parameter that caused the error (if applicable)
error.reasonstringDetailed explanation of what went wrong
The error object is only present for validation errors (400). Other error types only include code and message.

Common Errors

400 Bad Request

Returned when the request body or parameters are invalid.
{
  "code": 400,
  "message": "Bad Request",
  "error": {
    "field": "price",
    "reason": "Price must be at least 0.01"
  }
}

401 Unauthorized

Returned when the API key is missing or invalid.
{
  "code": 401,
  "message": "Unauthorized"
}

404 Not Found

Returned when the requested resource does not exist.
{
  "code": 404,
  "message": "Not Found"
}

429 Too Many Requests

Returned when you exceed the API rate limit (100 requests per minute).
{
  "code": 429,
  "message": "Too Many Requests"
}
Implement exponential backoff in your integration to handle rate limiting gracefully.

Success Response Format

Successful responses always include code: 0 and message: "success":
{
  "code": 0,
  "message": "success",
  "data": {
    // Response data here
  }
}
For paginated endpoints, the data field contains items and pagination:
{
  "code": 0,
  "message": "success",
  "data": {
    "items": [...],
    "pagination": {
      "page": 1,
      "size": 20,
      "total": 42,
      "totalPages": 3
    }
  }
}