Skip to main content

Errors & Troubleshooting

How errors look​

Errors are JSON with an error code. Payment-path 401 errors also include errorCategory ("POLICY_DENIAL" or "AUTH_FAILURE"), plus message and context:

{ "error": "INVOICE_HASH_MISMATCH", "errorCategory": "AUTH_FAILURE" }
{ "error": "BUDGET_CAP_EXCEEDED", "errorCategory": "POLICY_DENIAL", "message": "Cart amount (15000 cents) exceeds mandate budget limit (5000 cents)", "stepUpChallenge": { … } }

Branch on error (and errorCategory), not on message text.

A stateful payment request can return 503 DATABASE_UNAVAILABLE when the gateway cannot access its store. Save tx-refid and check readiness at /readyz. If a payment or refund was already submitted, reconcile the order with your gateway and processor records before submitting another attempt.

Error codes seen on the payment path​

Request and structure​

CodeHTTPMeaningFix
INVALID_REQUEST_STRUCTURE400Missing agentId/cart on negotiate, or protocol/cart on transact.Send the required fields.
INVALID_CART_STRUCTURE400Cart is missing merchantId, currency, amount (> 0) or items, or a field has the wrong type.Fix the cart; amounts are integers in minor units.
UNSUPPORTED_PROTOCOL400protocol isn't AP4M/VISA_TAP/TOKENEX_REST (or aliases).Use a supported protocol and include credentials.
MALFORMED_RFC9421_HEADERS / MALFORMED_RFC9421_PARAMS401Signature / Signature-Input missing or unparseable.Send both headers; include keyid and created.
MALFORMED_PAYLOAD_STRUCTURE, MALFORMED_JSON, MISSING_MANDATE_HASH400Body or hash input is invalid.Send valid JSON and include the mandate hash.
UNAUTHORIZED_API_KEY401Gateway key authentication failed.Verify your gateway origin, credential and header against the onboarding configuration.

Visa TAP may return 401 INVALID_ENCRYPTED_BUNDLE for an unreadable encrypted payment bundle, or 401 INVALID_CREDENTIAL_HASH when dynamic verification fails. Verify the provisioned recipient key, credential mode and locked invoice hash on your server. Share only the error code and request reference with support.

Session and replay​

CodeHTTPMeaningFix
SESSION_EXPIRED_OR_NOT_FOUND401sessionId unknown or older than 300 s.Call /v1/negotiate again.
NONCE_REPLAY_DETECTED401Visa TAP keyid+created+nonce reused within 300 s.Fresh nonce per request.
INVALID_STATE_TRANSITION409A session that already failed or settled was submitted again.One session per attempt; negotiate a new session.

Cryptographic​

CodeHTTPMeaningFix
INVOICE_HASH_MISMATCH401Submitted cart doesn't hash to the negotiated session hash or signed mandate hash.Rebuild the cart exactly as locked; recompute the hash (rules).
INVALID_SIGNATURE401Signature failed verification.Check key, algorithm and signature base string.
INTEGRITY_VIOLATION401AP4M layer2.sd_hash doesn't match layer1.Mint L2 from the same L1 you submit.
CRYPTOGRAM_EXPIRED401AP4M layer exp passed, or Visa expires passed.Re-issue; sync clocks.
CLOCK_SKEW_LIMIT_EXCEEDED401Visa created more than 300 s in the future.Sync clock (NTP).
INVALID_TAG_SCOPE401Visa tag isn't agent-payer-auth.Set the tag.
UNRESOLVED_KEY_ID401The keyid can't be resolved to a public key.Use a gateway JWKS key or configure the external JWKS URL.
UNSUPPORTED_SIGNATURE_ALGORITHM401alg not ed25519, rsa-pss-sha256 or ps256.Use a supported algorithm.

Spending rules and step-up (errorCategory: "POLICY_DENIAL")​

CodeHTTPMeaningFix
MANDATE_EXPIRED401Mandate validUntil timestamp has passed.Issue a fresh L2 mandate.
CURRENCY_MISMATCH401Mandate and cart currencies differ.Align currencies.
UNAUTHORIZED_MERCHANT401Merchant not in allowedMerchantIds.Ask the user to approve the merchant.
UNAUTHORIZED_SKU401An item id isn't in allowedSkus.Remove the item or get approval.
BUDGET_CAP_EXCEEDED401Amount exceeds the mandate cap.Stop. In the pilot, continue only if the response includes a challenge and the user completes it. A signed AP4M policy denial can omit the challenge.
INVALID_STEPUP_PAYLOAD400sessionId or assertion missing on step-up.Send both.
CHALLENGE_NOT_FOUND / CHALLENGE_EXPIRED / INVALID_FIDO2_CHALLENGE / FIDO2_SIGNATURE_INVALID / INVALID_FIDO2_ASSERTION401No live challenge, challenge older than 300 s, challenge mismatch, or invalid assertion signature.Request a new challenge and complete it within 300 s.

Vault and checkout​

CodeHTTPMeaningFix
VAULT_AUTH_FAILED and other vault codes502 (AP4M), or TOKENEX_FAILED in the iFrameVault authentication or mapping failed.Contact your IXOPAY integration manager.
MISSING_UTT_TOKEN / MISSING_SESSION_ID400/v1/checkout/complete called without uttToken or without a pre-negotiated sessionId.Send both sessionId and the iFrame's uttToken.
PCI_SCOPE_VIOLATION_RAW_PAN_PROHIBITED400Raw 13–19 digit card number sent to TOKENEX_REST on /v1/transact.Tokenize browser-direct first and send only the vault token.
DO_NOT_CREATE_TOKEN, UNAUTHORIZED_INTENT_GATE, UNAUTHORIZED_PPCB_GATE403Token creation refused because intent or cart binding wasn't verified.Complete verification first.
TOKEN_NOT_FOUND404Network token not in the vault.Re-tokenize through the TokenEx iFrame.
ORIGINAL_TRANSACTION_NOT_FOUND404/v1/refund called for a transactionId that has not settled.Pass a valid settled originalTransactionId.
REFUND_AMOUNT_EXCEEDS_ORIGINAL_TRANSACTION400Cumulative refund amount exceeds the original settled transaction amount.Request an amount within remainingRefundableCents.
MISSING_TRANSACTION_ID400/v1/audit/proof called without transaction_id / transactionId.Supply the query parameter.
TRANSACTION_NOT_FOUND404/v1/audit/proof called for an unknown transactionId.Query a settled transactionId.

WebMCP​

CodeHTTPMeaning
USER_CONFIRMATION_REQUIRED403Transact-tier tool called without a valid single-use session consent token.
INVALID_ARGUMENTS400Tool arguments missing or not an object.
UNKNOWN_TOOL400Tool isn't registered.

Troubleshooting by symptom​

"INVOICE_HASH_MISMATCH but my cart is the same"​

Nine times in ten it is one of these. Check them in order:

  1. Item order or extra fields. Items are sorted by id; only id, name, price, qty are hashed. A differing name string (even whitespace) changes the hash.
  2. Optional fields. shippingCents: 0 ≠ omitted. Include optional fields in both places or neither.
  3. Number formats. Use integers. 42.00 vs 4200 are different hashes (and wrong units).
  4. Currency case. The Payment Agent upper-cases the currency before hashing, so usd and USD match. If you compute the hash yourself, upper-case it too.
  5. Different merchantId. The lock and the transact call must use the identical value.
  6. Wrong hash in mandateInvoiceHash. It must equal the hash for the cart you submit.

Debug: run examples/invoice-hash.js on both carts and diff the canonical strings.

"INVALID_SIGNATURE on Visa TAP"​

  1. Does the signature base match your request's Host / X-Forwarded-Host (@authority) and request path (@path, e.g. /v1/transact)? (Details.)
  2. Is content-digest computed over JSON.stringify of the object under the body key, and does that key's content match what you send byte-for-byte after JSON parsing?
  3. Is @signature-params the whole Signature-Input header value, including sig1=?
  4. Does the keyid resolve to the public half of the key you signed with?
  5. Compare against examples/visa-tap-sign.js.

"SESSION_EXPIRED_OR_NOT_FOUND right after negotiating"​

  • More than 300 seconds passed, or the session was already used. Sessions are single-use; negotiate again.
  • If it happens within seconds on every attempt, report it to your IXOPAY integration manager with the sessionId.

"Works in one environment, 401s in another"​

  • Clock drift on the agent host: created/expires and AP4M exp are checked against the server's clock.
  • Sandbox and production use different keys; sign with keys published in the JWKS of the environment you are calling.

"BUDGET_CAP_EXCEEDED but the user is fine with it"​

Stop on a budget denial. A response containing stepUpChallenge can start the pilot step-up flow. A denial without a challenge requires a newly authorized mandate before a new attempt.

Webhook signature fails​

You are probably verifying a re-serialized body. Use the raw bytes, build "<t>.<raw>", and use the v1 value. See Webhooks.

Getting support​

Include: the error code, HTTP status, approximate time (UTC), the sessionId, and the Payment Agent host. Never send private keys, full mandates, card data or tokens.