ShiftxPay
Core concepts

Errors

The error envelope and what each status means.

When a request fails, ShiftxPay returns a non-2xx HTTP status and a JSON body in a single, consistent envelope. Branch on the HTTP status for the broad category and on the code for the specific reason.

The error envelope

Every error has exactly this shape:

{
  "error": {
    "code": "validation_error",
    "message": "amount must be greater than zero"
  }
}
  • code — a stable, machine-readable string. Switch on this.
  • message — a human-readable explanation for logs and debugging. Do not parse it; it may change.

Statuses and codes

HTTPcodeMeaning
400invalid_bodyMalformed JSON, or an unknown field in the body.
400validation_errorA field is present but invalid (range, type, format).
401unauthorizedMissing or invalid API key.
403forbiddenThe key lacks the required scope.
403payment_blockedThe payment is not permitted (e.g. risk or status rules).
403feature_disabledThe requested feature is not enabled for this merchant.
404not_foundNo such object, or not visible to this caller.
409no_connectorNo PSP connector is configured for this merchant/currency.
409not_refundableThe payment is not in a refundable state.
409already_refundedThe payment has already been fully refunded.
409idempotency_conflictA request with the same idempotency key is in flight.
422idempotency_key_reuseThe idempotency key was reused with a different body.
422amount_too_largeThe amount exceeds the allowed maximum.
422raw_card_rejectedThe body carried card-shaped fields (PAN/CVC) and was blocked.
429rate_limitedToo many requests; back off and retry.
502connector_errorThe upstream PSP returned an error.
500internalAn unexpected server-side error.

Unknown fields are rejected

ShiftxPay validates request bodies strictly. Sending a JSON field the endpoint does not recognize returns 400 invalid_body — it is not silently ignored. This catches typos (ammount) and stale integrations early, but it means you must send only documented fields.

Notes on specific codes

  • 422 raw_card_rejected comes from the RawCardGuard middleware. The gateway never accepts raw card data; the card belongs in the PSP surface only. See How card data stays off your servers.
  • 409 idempotency_conflict and 422 idempotency_key_reuse are covered in detail under Idempotency.
  • 502 connector_error is an upstream PSP failure, not a problem with your request. It is generally safe to retry with the same idempotency key.

On this page