Skip to main content

API Reference

Machine-readable version: openapi.yaml.

Base URL: https://<ixopay-payment-agent-host>, provided by IXOPAY (separate sandbox and production values). Format: JSON request and response bodies. Content-Type: application/json on all POSTs. Make authenticated API requests from your server. Browser CORS behavior depends on gateway configuration. Authentication. Send credentials only to the HTTPS gateway origin provisioned for your environment. The application accepts a gateway key in X-API-Key, tx-apikey or Authorization: Bearer … when key authentication is configured. Confirm the managed entry point enforces the scheme issued during onboarding. Use the TokenEx Customer Secret Key only on your server for iFrame operations. Send your provisioned tenant ID in tx-tokenex-id on /v1/* calls. Environments that enforce tenant scoping require it. Save the returned tx-refid header or ReferenceNumber JSON field when contacting support.

Money: Integers in minor units (4200 = $42.00).

Endpoint summary​

MethodPathPurpose
GET/health (aliases /api/health, /readyz)Storage readiness
GET/health/live (alias /livez)Process liveness
GET/.well-known/ai-payments.jsonDiscovery manifest
GET/.well-known/jwks.jsonPublic signing keys
POST/v1/negotiateLock a cart; get sessionId and invoiceHash
POST/v1/transactSubmit a signed mandate for gateway handover (AP4M, Visa TAP, or TokenEx REST)
POST/v1/transact/step-upResolve a FIDO2 step-up challenge and unlock the session
POST/v1/transact/splitSplit-mandate verification and execution (AP4M_SPLIT)
POST/v1/checkout/completeComplete a hosted-iFrame (UT) checkout
POST/v1/refundRecord a full or partial refund in the gateway ledger
GET/v1/audit/proofGateway-generated transaction record

GET /health​

Readiness returns HTTP 200 with HEALTHY when the configured store responds, or HTTP 503 with DEGRADED when the check fails. Use /health/live for process liveness. Check version and buildSha to identify the build running in your environment.

{
"status": "HEALTHY",
"service": "ixopay-payment-agent",
"version": "0.2.0",
"buildSha": "<deployed-build>",
"database": { "store": "sql-server", "healthy": true, "latencyMs": 2 },
"slaTarget": "<10ms core routing",
"uptimeSeconds": 10,
"timestamp": "2026-10-16T15:00:00.000Z"
}

GET /.well-known/ai-payments.json​

Returns the capability manifest for your environment. See the Agent Developer Guide for signed discovery and negotiation.

{
"version": "0.0.4",
"gateway": "IXOPAY Payment Agent",
"supportedProtocols": ["TOKENEX_IFRAME_HPP", "TOKENEX_REST", "VISA_TAP", "AP4M", "TILOPAY", "X402"],
"endpoints": {
"jwks": "/.well-known/jwks.json",
"negotiate": "/v1/negotiate",
"transact": "/v1/transact",
"discovery": "/.well-known/ai-payments.json"
},
"security": {
"ppcbRequired": true,
"jcsHashing": "RFC-8785-SHA256",
"supportedAlgorithms": ["AES-GCM-256", "Ed25519", "RSA-PSS-SHA256", "ES256", "EIP-712"]
},
"visaTapCapabilities": {
"supportedAuthTags": ["agent-browser-auth", "agent-payer-auth"],
"supportedCredentialModes": ["ENCRYPTED_TAVV", "DYNAMIC_CVV_HASH"],
"supportedJweAlgorithms": ["RSA-OAEP-256", "A256GCM"],
"consumerRecognitionSupported": true
},
"adapters": [
{ "protocol": "VISA_TAP", "enabled": true, "version": "1.0", "algorithms": ["Ed25519", "RSA-PSS-SHA256"] }
]
}

GET /.well-known/jwks.json​

A standard JWK Set. Keys carry kid, alg (ES256 or Ed25519) and use: "sig". IXOPAY configures the issuer keys used to verify Mastercard mandates for your account.


POST /v1/negotiate​

Locks a cart and returns its RFC 8785 JCS Invoice Hash.

Request

FieldTypeRequiredNotes
agentIdstringYesIdentifier of the buying agent.
cartParamsobjectYes (or cart)See Cart object. cart is accepted as an alias.

Cart object

FieldTypeRequiredNotes
merchantIdstringYes
currencystringYesUpper-cased before hashing.
amountintegerYesTotal, minor units (> 0).
itemsarrayYesNon-empty array of { id: string, name: string, price: integer, qty: integer }.
taxCentsintegerNoHashed when present.
shippingCentsintegerNoHashed when present.
shippingMethodstringNoHashed when present.
destinationPostalCodestringNoHashed when present.

Response 200

{
"sessionId": "sess_0f2f9565-ba19-479f-af8a-43cb9f53e44c",
"invoiceHash": "e53d7b6af2c008d2fbec41e8ef8ddfac1fcaf3daa41a1c687369d5de7991a627",
"status": "PARAMETER_NEGOTIATION",
"expiresIn": 300
}

Errors

HTTPBodyCause
400{"error":"INVALID_REQUEST_STRUCTURE"}Missing agentId or cart.
400{"error":"INVALID_CART_STRUCTURE"}Cart failed structural validation (merchantId, currency, amount <= 0, or empty items).

POST /v1/transact​

Submits the locked cart with a signed mandate (Visa TAP or Mastercard Agent Pay) or an existing vault token (TOKENEX_REST). For TokenEx REST, include agentId and send the token in credentials.cardData.

Request

FieldTypeRequiredNotes
protocolstringYesAP4M / MASTERCARD_AP4M, VISA_TAP / VISA, or TOKENEX_REST / TOKENEX.
cartParamsobjectYes (or cart)Must match the negotiated session.invoiceHash when sessionId is supplied.
sessionIdstringRecommendedFrom /v1/negotiate. If omitted, a one-shot session is created.
credentialsobjectAP4M / TokenExAlias ap4mCredentials. { layer1, layer2, layer3a, layer3b, mandateInvoiceHash } for AP4M, or { cardData } for TOKENEX_REST.
bodyobjectVisa TAPPayment container; also the object covered by content-digest.
l2MandateobjectNoSpending rules (validUntil, maxAmountCents, currency, allowedMerchantIds, allowedSkus).
webhookUrlstringNoOptional merchant webhook URL to receive asynchronous signed payment.settled delivery.

Headers (Visa TAP): Signature-Input, Signature (RFC 9421). Sign the provisioned gateway authority and the exact request path.

Response 200

FieldAP4MVisa TAPTokenEx RESTNotes
status✓✓✓SETTLEMENT_HANDOVER
sessionId✓✓✓
transactionId✓✓✓tx_ap4m_…, tx_visa_…, or session ID
vaultReference✓✓✓TokenEx UT reference (also aliased as tokenExUttReference)
authCode✓✓✓MC_…, VISA_…, or REST_TKX_…
receipt✓✓✓Canonical CryptographicReceipt (receiptId, authCode, invoiceHash, settlementRail, tokenExUttReference, settledAt, latencyMs, pciScope: "SAQ_A_ISOLATED", merkleLeaf)
routingLatencyMs✓✓✓Sub-10ms routing latency (also in X-Gateway-Routing-Latency-Ms header)

Errors (all 401 responses include errorCategory: "POLICY_DENIAL" | "AUTH_FAILURE")

HTTPerrorerrorCategoryCause
400INVALID_REQUEST_STRUCTURE—protocol or cart missing.
400UNSUPPORTED_PROTOCOL—Protocol not supported.
401MANDATE_EXPIRED, CURRENCY_MISMATCH, UNAUTHORIZED_MERCHANT, UNAUTHORIZED_SKUPOLICY_DENIALL2 rule failed.
401BUDGET_CAP_EXCEEDEDPOLICY_DENIALCap exceeded. A request-level denial can include stepUpChallenge.
401SESSION_EXPIRED_OR_NOT_FOUNDAUTH_FAILUREUnknown or expired sessionId.
401INVOICE_HASH_MISMATCHAUTH_FAILURECart differs from negotiated session hash or signed mandate hash (PI2PI blocked).
401INTEGRITY_VIOLATION, INVALID_SIGNATURE, CRYPTOGRAM_EXPIRED, CLOCK_SKEW_LIMIT_EXCEEDED, NONCE_REPLAY_DETECTEDAUTH_FAILURECryptographic or replay failure.
409INVALID_STATE_TRANSITION—Reusing a session that has already settled or terminated.
502<vault error code>—Upstream vault mapping failed.

POST /v1/transact/step-up​

The pilot verifies a challenge and assertion signature with the configured credential and unlocks that session. Use this flow only when a budget denial includes a challenge. Production buyer authentication requires a separately verified enrollment and WebAuthn flow.

FieldTypeRequired
sessionIdstringYes (stepUpChallenge.sessionId)
assertionobjectYes: { credentialId, authenticatorData, clientDataJSON, signature } (verified against server-registered passkey; caller-supplied publicKeyPem overrides are rejected)

200 → { "status": "SUCCESS", "sessionId": "…", "stepUpVerified": true, "message": "…" } 400 → INVALID_STEPUP_PAYLOAD 401 → CHALLENGE_NOT_FOUND, CHALLENGE_EXPIRED, INVALID_FIDO2_CHALLENGE, FIDO2_SIGNATURE_INVALID, INVALID_FIDO2_ASSERTION

POST /v1/transact/split​

Body { l3aToken, l3bToken, cartParams, mandateInvoiceHash? }. Computes and verifies the RFC 8785 JCS invoiceHash, verifies ES256 JWT signatures on l3aToken and l3bToken, records the settled transaction, and returns 200 { status: "SUCCESS", protocol: "AP4M_SPLIT", l3aStatus: "VERIFIED", l3bStatus: "VERIFIED", mandateHashMatch: true, invoiceHash, transactionId }.

POST /v1/checkout/complete​

Completes an HPP / TokenEx iFrame checkout, verifies invoiceHash (and cart snapshot) against the negotiated session, transitions the session to SETTLEMENT_HANDOVER, records the transaction for /v1/audit/proof and /v1/refund, and dispatches webhooks when configured.

FieldTypeRequiredNotes
uttTokenstringYesSingle-use TokenEx token returned by the iFrame.
sessionIdstringYesPre-negotiated session from /v1/negotiate. Transitioned to SETTLEMENT_HANDOVER. Re-submitting an already settled session returns 409 INVALID_STATE_TRANSITION.
invoiceHashstringNoChecked against negotiated session.invoiceHash when present.
protocolstringNoAP4M or TOKENEX_DIRECT. Send TOKENEX_DIRECT for hosted-iFrame payments.

200 → { "status": "SETTLEMENT_COMPLETE", "sessionId": "…", "transactionId": "tx_hpp_…", "tokenExUttReference": "utt_…", "authCode": "…", "pciScope": "SAQ_A_LEVEL_1_ISOLATED", "invoiceHashMatch": true, "zeroPanScrubbed": true } 400 → MISSING_UTT_TOKEN or MISSING_SESSION_ID 401 → SESSION_EXPIRED_OR_NOT_FOUND or INVOICE_HASH_MISMATCH 409 → INVALID_STATE_TRANSITION (session or uttToken already settled)

POST /v1/refund​

Records a full or partial refund in the gateway ledger. refund.settled reports that entry. Reconcile the refund with your processor before telling the customer that money was returned.

FieldTypeRequiredNotes
originalTransactionIdstringYesSettled transactionId.
merchantIdstringYesMust match the settled transaction's merchant identifier.
amountCentsintegerYesMust be > 0 and within the remaining refundable balance of the original transaction.
currencystringYesISO currency code (USD).
webhookUrlstringNoOptional webhook receiver URL.

200 → { "success": true, "refundId": "ref_…", "status": "REFUND_SETTLED" | "PARTIAL_REFUND_SETTLED", "amountRefundedCents": 2500, "totalRefundedCents": 2500, "remainingRefundableCents": 5000, "authorizationCode": "REF_AUTH_…" } 400 → INVALID_REFUND_PARAMETERS, MERCHANT_ID_MISMATCH, CURRENCY_MISMATCH, or REFUND_AMOUNT_EXCEEDS_ORIGINAL_TRANSACTION 404 → ORIGINAL_TRANSACTION_NOT_FOUND (unseen originalTransactionId)

GET /v1/audit/proof​

Query with transactionId (alias transaction_id) to retrieve the gateway record. nonRepudiationSignatures contains gateway-generated HMAC values. Retain original signed mandates and processor records separately for disputes.

200 → Proof bundle JSON 400 → MISSING_TRANSACTION_ID 404 → TRANSACTION_NOT_FOUND