Skip to Content
Docs

Errors

The errors of the Vault forwarding API, what upstream_sent says about each, and what to do.

Errors use the API's usual shape. Errors from a forward also carry upstream_sent:

{
  "error": {
    "type": "invalid_request_error",
    "code": "destination_pending",
    "message": "The destination is waiting for review."
  },
  "upstream_sent": false
}

type is api_error for a 5xx status and invalid_request_error otherwise. A provider's own 4xx or 5xx isn't an error here. It comes back with 200, in the forward's response.status.

Determine whether the provider received the request

upstream_sent indicates whether the provider received the request:

upstream_sentMeaning
Absent or falseNothing reached the provider. It is absent when Pay.com rejected the request before evaluating the destination.
trueThe provider received the full request and may have acted on it. Confirm with the provider before retrying unless the endpoint is idempotent.
"unknown"Pay.com couldn't confirm delivery. Retrieve the forward using the ID from the x-pay-com-forward-id header before retrying.

A 409 with idempotency_in_flight, a 429, and a 503 include a Retry-After header with the number of seconds to wait.

Codes

Check error.code to determine what failed and how to respond.

CodeStatusMeaningWhat to do
invalid_request400The request is invalid (for example, a placeholder in the URL). The message identifies the field. Unknown paths return 404 and unsupported methods return 405.Fix the request.
card_data_not_tokenized400A raw card number appeared outside a placeholder.Send card data only through placeholders.
unauthenticated401Missing or invalid sk-pay-com- API key in Basic or Bearer auth.Send a valid API key with Basic auth.
field_not_allowed403A placeholder references a card field the destination doesn't allow, or an unknown credential field.Check the field name or request a destination that allows it.
credential_not_allowed403The credential isn't associated with this destination.Store or associate the credential for this destination.
destination_not_allowed403The destination doesn't belong to your account, was rejected or disabled, or doesn't match the request host, port, path, or method.Verify the URL and method against the active destination.
token_not_found404The tok_card_ or pm_card_ ID doesn't belong to your account.Verify the card token or payment method ID.
forward_not_found404No forward record matches this ID, or it is older than 30 days.Verify the forward ID.
destination_pending409The destination is awaiting Pay.com review.Wait for the activation email.
idempotency_in_flight409A request with this Idempotency-Key is still in progress.Retry after Retry-After.
request_too_large413The request exceeds 5 MB before or after placeholder substitution.Send a smaller request.
token_not_supported422The card has no network token for a network_token.* placeholder.Send standard card fields instead of network token fields.
cvc_unavailable422The CVV is no longer available because it was already forwarded or expired after 15 minutes.Ask the customer to re-enter the CVV.
idempotency_key_reused422The Idempotency-Key was already used for a different request payload.Generate a new idempotency key.
rate_limited429Too many requests for your account or destination.Retry after Retry-After.
upstream_connect_failed502Pay.com couldn't connect to the provider or the connection dropped.Check upstream_sent before retrying.
upstream_response_too_large502The provider's response exceeds 5 MB.Check with the provider, since it received the request.
key_check_unavailable503Pay.com couldn't verify the API key. Nothing was sent.Retry after Retry-After.
vault_unavailable503Pay.com couldn't read the card, look up a pm_card_ ID, or generate a cryptogram. Nothing was sent.Retry after Retry-After.
forwarder_unavailable500, 503Temporary Pay.com error (500 internal error or 503 service unavailable). Nothing was sent.Retry after Retry-After (for 503) or with exponential backoff.
upstream_timeout504The provider didn't respond in time or Pay.com couldn't confirm the outcome.Check upstream_sent.
Was this page helpful?