Skip to main content
PrimeVault error responses combine an HTTP status with a human-readable message and, for known failures, a machine-readable custom code. The HTTP status remains authoritative for the broad failure class; the custom code enables precise handling inside that class.

Error response format

Branch program logic on code when a documented code exists. Use message as diagnostic context, not as a stable identifier.

Handling order

1
Inspect the HTTP status and typed SDK error class.
2
Read the custom errorCode when present.
3
Apply handling for that documented code.
4
Fall back to the HTTP status and message when no custom code is available.
5
Preserve the original status and code in structured logs, without logging credentials or sensitive request data.

SDK examples

The SDK error carries message, errorCode, status, and responseText.

Retry safety

  • Do not retry a known validation, permission, compliance, or insufficient-balance error unchanged.
  • Retry 429 and transient 5xx responses only with bounded backoff. See Status Codes for retry guidance by status.

Transaction error codes

Transaction endpoints return the following custom codes, typically with a 400 status. Use the Safe to retry? column to decide whether to fix the request, wait for an external change, or stop.

Safe retries with externalId

Send a stable, unique externalId for each logical payment and reuse the same value on every retry of that payment. externalId is unique per customer, so:
  • If the transaction was never created, the retry creates it.
  • If it was already created, the retry is safely rejected as a duplicate (A record with the same information already exists), so a second payment is impossible.