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
| Method | Path | Purpose |
|---|---|---|
| GET | /health (aliases /api/health, /readyz) | Storage readiness |
| GET | /health/live (alias /livez) | Process liveness |
| GET | /.well-known/ai-payments.json | Discovery manifest |
| GET | /.well-known/jwks.json | Public signing keys |
| POST | /v1/negotiate | Lock a cart; get sessionId and invoiceHash |
| POST | /v1/transact | Submit a signed mandate for gateway handover (AP4M, Visa TAP, or TokenEx REST) |
| POST | /v1/transact/step-up | Resolve a FIDO2 step-up challenge and unlock the session |
| POST | /v1/transact/split | Split-mandate verification and execution (AP4M_SPLIT) |
| POST | /v1/checkout/complete | Complete a hosted-iFrame (UT) checkout |
| POST | /v1/refund | Record a full or partial refund in the gateway ledger |
| GET | /v1/audit/proof | Gateway-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
| Field | Type | Required | Notes |
|---|---|---|---|
agentId | string | Yes | Identifier of the buying agent. |
cartParams | object | Yes (or cart) | See Cart object. cart is accepted as an alias. |
Cart object
| Field | Type | Required | Notes |
|---|---|---|---|
merchantId | string | Yes | |
currency | string | Yes | Upper-cased before hashing. |
amount | integer | Yes | Total, minor units (> 0). |
items | array | Yes | Non-empty array of { id: string, name: string, price: integer, qty: integer }. |
taxCents | integer | No | Hashed when present. |
shippingCents | integer | No | Hashed when present. |
shippingMethod | string | No | Hashed when present. |
destinationPostalCode | string | No | Hashed when present. |
Response 200
{
"sessionId": "sess_0f2f9565-ba19-479f-af8a-43cb9f53e44c",
"invoiceHash": "e53d7b6af2c008d2fbec41e8ef8ddfac1fcaf3daa41a1c687369d5de7991a627",
"status": "PARAMETER_NEGOTIATION",
"expiresIn": 300
}
Errors
| HTTP | Body | Cause |
|---|---|---|
| 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
| Field | Type | Required | Notes |
|---|---|---|---|
protocol | string | Yes | AP4M / MASTERCARD_AP4M, VISA_TAP / VISA, or TOKENEX_REST / TOKENEX. |
cartParams | object | Yes (or cart) | Must match the negotiated session.invoiceHash when sessionId is supplied. |
sessionId | string | Recommended | From /v1/negotiate. If omitted, a one-shot session is created. |
credentials | object | AP4M / TokenEx | Alias ap4mCredentials. { layer1, layer2, layer3a, layer3b, mandateInvoiceHash } for AP4M, or { cardData } for TOKENEX_REST. |
body | object | Visa TAP | Payment container; also the object covered by content-digest. |
l2Mandate | object | No | Spending rules (validUntil, maxAmountCents, currency, allowedMerchantIds, allowedSkus). |
webhookUrl | string | No | Optional 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
| Field | AP4M | Visa TAP | TokenEx REST | Notes |
|---|---|---|---|---|
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")
| HTTP | error | errorCategory | Cause |
|---|---|---|---|
| 400 | INVALID_REQUEST_STRUCTURE | — | protocol or cart missing. |
| 400 | UNSUPPORTED_PROTOCOL | — | Protocol not supported. |
| 401 | MANDATE_EXPIRED, CURRENCY_MISMATCH, UNAUTHORIZED_MERCHANT, UNAUTHORIZED_SKU | POLICY_DENIAL | L2 rule failed. |
| 401 | BUDGET_CAP_EXCEEDED | POLICY_DENIAL | Cap exceeded. A request-level denial can include stepUpChallenge. |
| 401 | SESSION_EXPIRED_OR_NOT_FOUND | AUTH_FAILURE | Unknown or expired sessionId. |
| 401 | INVOICE_HASH_MISMATCH | AUTH_FAILURE | Cart differs from negotiated session hash or signed mandate hash (PI2PI blocked). |
| 401 | INTEGRITY_VIOLATION, INVALID_SIGNATURE, CRYPTOGRAM_EXPIRED, CLOCK_SKEW_LIMIT_EXCEEDED, NONCE_REPLAY_DETECTED | AUTH_FAILURE | Cryptographic or replay failure. |
| 409 | INVALID_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.
| Field | Type | Required |
|---|---|---|
sessionId | string | Yes (stepUpChallenge.sessionId) |
assertion | object | Yes: { 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.
| Field | Type | Required | Notes |
|---|---|---|---|
uttToken | string | Yes | Single-use TokenEx token returned by the iFrame. |
sessionId | string | Yes | Pre-negotiated session from /v1/negotiate. Transitioned to SETTLEMENT_HANDOVER. Re-submitting an already settled session returns 409 INVALID_STATE_TRANSITION. |
invoiceHash | string | No | Checked against negotiated session.invoiceHash when present. |
protocol | string | No | AP4M 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.
| Field | Type | Required | Notes |
|---|---|---|---|
originalTransactionId | string | Yes | Settled transactionId. |
merchantId | string | Yes | Must match the settled transaction's merchant identifier. |
amountCents | integer | Yes | Must be > 0 and within the remaining refundable balance of the original transaction. |
currency | string | Yes | ISO currency code (USD). |
webhookUrl | string | No | Optional 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