Skip to main content

Errors

Voucherly uses conventional HTTP response codes to indicate the success or failure of an API request. In general: Codes in the 2xx range indicate success. Codes in the 4xx range indicate an error that failed given the information provided (e.g., a required parameter was omitted, a charge failed, etc.). Codes in the 5xx range indicate an error with Voucherly's servers (these are rare).

Errors are returned as problem details (RFC 7807). Please referer to official guides. Additional attribute can be returned for 400 errors.

Error object:

  • type (string) URI reference of the RFC to identify the problem types
  • title (string) Short human readable problem summary
  • status (int) Http status code
  • details (string) A human readable explanation for what exactly happened
{
"type": "https://tools.ietf.org/html/rfc7231#section-6.5.1",
"title": "ReferenceId is duplicated.",
"status": 400,
"detail": "You provided 'eb8f57f8-241b-4142-b7b0-d308d724541f' as ReferenceId. But there is an already existing payment.",
"code": "PAYMENT_DUPLICATED",
"parameter": "ReferenceId"
}