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_sent | Meaning |
|---|---|
Absent or false | Nothing reached the provider. It is absent when Pay.com rejected the request before evaluating the destination. |
true | The 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.
| Code | Status | Meaning | What to do |
|---|---|---|---|
invalid_request | 400 | The 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_tokenized | 400 | A raw card number appeared outside a placeholder. | Send card data only through placeholders. |
unauthenticated | 401 | Missing or invalid sk-pay-com- API key in Basic or Bearer auth. | Send a valid API key with Basic auth. |
field_not_allowed | 403 | A 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_allowed | 403 | The credential isn't associated with this destination. | Store or associate the credential for this destination. |
destination_not_allowed | 403 | The 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_found | 404 | The tok_card_ or pm_card_ ID doesn't belong to your account. | Verify the card token or payment method ID. |
forward_not_found | 404 | No forward record matches this ID, or it is older than 30 days. | Verify the forward ID. |
destination_pending | 409 | The destination is awaiting Pay.com review. | Wait for the activation email. |
idempotency_in_flight | 409 | A request with this Idempotency-Key is still in progress. | Retry after Retry-After. |
request_too_large | 413 | The request exceeds 5 MB before or after placeholder substitution. | Send a smaller request. |
token_not_supported | 422 | The card has no network token for a network_token.* placeholder. | Send standard card fields instead of network token fields. |
cvc_unavailable | 422 | The 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_reused | 422 | The Idempotency-Key was already used for a different request payload. | Generate a new idempotency key. |
rate_limited | 429 | Too many requests for your account or destination. | Retry after Retry-After. |
upstream_connect_failed | 502 | Pay.com couldn't connect to the provider or the connection dropped. | Check upstream_sent before retrying. |
upstream_response_too_large | 502 | The provider's response exceeds 5 MB. | Check with the provider, since it received the request. |
key_check_unavailable | 503 | Pay.com couldn't verify the API key. Nothing was sent. | Retry after Retry-After. |
vault_unavailable | 503 | Pay.com couldn't read the card, look up a pm_card_ ID, or generate a cryptogram. Nothing was sent. | Retry after Retry-After. |
forwarder_unavailable | 500, 503 | Temporary Pay.com error (500 internal error or 503 service unavailable). Nothing was sent. | Retry after Retry-After (for 503) or with exponential backoff. |
upstream_timeout | 504 | The provider didn't respond in time or Pay.com couldn't confirm the outcome. | Check upstream_sent. |
Was this page helpful?