Errors & Status Codes

Standardized JSON error envelope, HTTP status definitions, and retry guidelines for Hashpay API endpoints.

Unified JSON error envelope

All Hashpay API errors return a standard JSON envelope containing status_code, message, and data: null:

Error Envelope Example
{
  "status_code": 400,
  "message": "amount is below the minimum order limit of 10000 IDR",
  "data": null
}

HTTP status code reference

Status CodeCategoryDescription & Recommended Action
400Bad RequestValidation error (e.g. invalid amount, missing fields, or amount below limit). Check request payload.
401UnauthorizedInvalid or missing api-key header, expired JWT token, or incorrect signature. Verify credentials in dashboard.
403ForbiddenAction not allowed for your account tier or key permission level.
404Not FoundTarget resource, merchant ID, or order number does not exist.
429Too Many RequestsRate limit exceeded. Implement exponential backoff before retrying.
500Internal Server ErrorTransient server issue. Retry with exponential backoff; if persistent, contact Hashpay support.