When a request fails, the response body always follows the standard envelope with "success" set to false and a human-readable message in "error":

{
  "success": false,
  "data": null,
  "error": "Product not found or inactive."
}

The HTTP status code indicates the category of failure. Check the HTTP status code first, then read "error" for details to surface to your logs or user.

HTTP Status Codes

400 — Bad request. Missing action or malformed JSON body.

401 — Invalid or missing API key.

404 — Resource not found. The product, activation, or payment method does not exist or is inactive.

405 — Wrong HTTP method for this action (e.g. GET used on a POST-only endpoint).

422 — Validation error. A required field is missing or a value is invalid.

429 — Rate limit exceeded. Slow down and retry after a short delay.

500 — Server error. Provisioning failure or unexpected database error.

How to Handle Each Error

401 — Stop immediately. The key is wrong or has been regenerated. Do not retry until the key is corrected.

404 — The referenced resource does not exist or is inactive. Verify your IDs before retrying.

422 — Read the "error" message — it will identify which field failed and why.

429 — Back off and retry. Use exponential backoff for automated flows.

500 — Log the full response and retry once after a short delay. If the problem persists, the issue is on the server side.