Volumedocs

Errors

One error shape for every failure. Switch on its code, quote its request id.

Every failure has the same body:

{
  "error": {
    "type": "conflict",
    "code": "invoice_not_open",
    "message": "The invoice is paid; only an open invoice can be paid.",
    "request_id": "req_4f1c9a2e7b3d4c5e8f9a0b1c2d3e4f5a"
  }
}
  • type is a broad category, and code the specific reason. Both are stable: write your code against code.
  • message is for a person reading logs. It may be reworded at any time, so never match on it.
  • request_id is also on every response, error or not, as the Request-Id header. Quote it when you write to us about a request.

Codes worth handling

StatusCodeWhat to do
400invalid_request, unknown_parameterA field is missing, malformed, or not one the endpoint takes. The message names it.
400invalid_amount, amount_too_largeAn invoice is for $0.01 to $100,000.00, as a string with at most two decimals.
400customer_email_requiredThe checkout needs a payer email, because the invoice names no customer.
400customer_mismatchThe invoice is for another customer_email.
400invalid_urlReturn URLs must be https in live mode.
400idempotency_key_requiredSend an Idempotency-Key with this POST.
401invalid_api_keyThe key is missing, wrong or revoked.
403live_access_requiredLive mode opens once Volume activates the account.
403account_suspendedA suspended account can read, but not create.
403test_mode_onlyA test helper was called with a live key.
404invoice_not_found, checkout_session_not_foundNo such object in this mode. A test object is invisible to a live key.
409invoice_not_openThe invoice is already paid. Do not open another checkout for it.
409idempotency_key_reuse_mismatchThe key was used for a different request.
409no_payment_methodA test checkout can be paid only once the payer has chosen a coin.
429too_many_requestsWait for the Retry-After header's seconds, then retry.
5xxinternal_errorSomething failed on our side. Retry with the same Idempotency-Key.

Another account's object is 404, exactly as a missing one is, so ids cannot be probed.

Retrying

Retry a 429 after Retry-After, and a 5xx or a network failure with backoff. With the same Idempotency-Key a retry cannot create anything twice. Do not retry a 4xx other than 429 unchanged: it will fail the same way.

Rate limits

Requests are counted per key. Ordinary use is far below the limit; a refusal is 429 too_many_requests with a Retry-After header, in seconds, and the same number as error.retry_after.

On this page