Refunds & Disputes
Refunds
POST /v1/refund records all or part of a refund against a transaction in the gateway ledger. Call it from your server.
curl -X POST https://<ixopay-payment-agent-host>/v1/refund \
-H "Content-Type: application/json" \
-H "X-API-Key: $IXOPAY_GATEWAY_KEY" -H "tx-tokenex-id: $TOKENEX_ID" \
-d '{
"originalTransactionId": "tx_hpp_0f2f9565-ba19-479f-af8a-43cb9f53e44c",
"merchantId": "<your-merchant-id>",
"amountCents": 1600,
"currency": "USD",
"webhookUrl": "https://shop.example.org/ixopay-webhook"
}'
| Field | Required | Notes |
|---|---|---|
originalTransactionId | Yes | The transactionId from the settlement response. |
merchantId | Yes | Your merchant ID. |
amountCents | Yes | Integer, greater than 0. |
currency | Yes | ISO currency code, same as the original. |
webhookUrl | No | Receives a signed refund.settled event. |
Success (200)
{
"success": true,
"refundId": "ref_1792676266614_ebf71a",
"originalTransactionId": "tx_hpp_…",
"amountRefundedCents": 1600,
"totalRefundedCents": 1600,
"remainingRefundableCents": 2600,
"currency": "USD",
"status": "PARTIAL_REFUND_SETTLED",
"timestamp": "2026-10-22T13:37:46.614Z",
"authorizationCode": "REF_AUTH_0BF9F8E1"
}
The Payment Agent keeps a running balance per settled transaction. Use totalRefundedCents and remainingRefundableCents to update your ledger. status is REFUND_SETTLED when a single refund covers the whole amount and PARTIAL_REFUND_SETTLED otherwise.
Errors
| HTTP | error | Cause |
|---|---|---|
| 400 | INVALID_REFUND_PARAMETERS | Missing transaction ID, or amountCents missing or not above 0. |
| 400 | MERCHANT_ID_MISMATCH | merchantId differs from the settled transaction's merchant. |
| 400 | CURRENCY_MISMATCH | currency differs from the settled transaction. |
| 400 | REFUND_AMOUNT_EXCEEDS_ORIGINAL_TRANSACTION | Amount is more than the remaining refundable balance. The body includes totalRefundedCents and remainingRefundableCents. |
| 404 | ORIGINAL_TRANSACTION_NOT_FOUND | The Payment Agent has no settled transaction with that ID. |
Keep your own ledger too
Store each refundId with the order. A verified refund.settled event acknowledges the gateway entry. Reconcile the refund against the processor’s records before confirming a credit to the customer. If a request times out, reconcile before retrying to avoid recording a second partial refund.
Confirm the processor refund workflow and the authoritative refund status with your integration manager before taking live traffic.
Disputes and chargebacks
The audit bundle links the gateway’s transaction record to the recorded cart hash. Retain any original signed mandate or buyer authorization separately, along with the processor and fulfillment records your acquirer accepts for disputes.
curl "https://<ixopay-payment-agent-host>/v1/audit/proof?transactionId=tx_hpp_0f2f9565-…" \
-H "X-API-Key: $IXOPAY_GATEWAY_KEY" -H "tx-tokenex-id: $TOKENEX_ID"
{
"status": "SUCCESS",
"transactionId": "tx_hpp_…",
"timestamp": "2026-10-21T16:28:13.897Z",
"merchantId": "<your-merchant-id>",
"cartTotalCents": 4200,
"currency": "USD",
"ppcbInvoiceHash": "e53d7b6a…a627",
"nonRepudiationSignatures": { "l1IssuerSignature": "…", "l2UserMandateSignature": "…", "l3CheckoutSignature": "…" },
"vaultReference": "utt_…",
"dpanLastFour": "1111",
"proofDigest": "…"
}
| Field | Use in a dispute |
|---|---|
ppcbInvoiceHash | Fingerprint of the cart (merchant, currency, amount, items) the gateway recorded. Recompute it from your stored cart to show they match. |
cartTotalCents, currency | Amount and currency recorded at gateway handover. |
nonRepudiationSignatures | HMAC values generated by the gateway from the transaction ID, cart hash and timestamp. The original issuer, buyer and checkout signatures must come from their respective authorization records. |
vaultReference, dpanLastFour | The tokenized payment instrument; no card number is exposed. |
proofDigest | Integrity digest over the transaction ID, hash and timestamp. |
Dispute workflow
- Collect the
transactionIdfrom your order record. - Fetch the proof bundle and save it with the order. Do this at settlement time, not only when a dispute arrives.
- Recompute the Invoice Hash from your stored cart with
examples/invoice-hash.js. It must equalppcbInvoiceHash. - Assemble the evidence your acquirer requires, including original signed authorization where available, processor confirmation and delivery or fulfillment evidence.
- Reconcile with your acquirer before issuing any credit to avoid duplicating a refund or chargeback.
An unrecognized transactionId returns 404 TRANSACTION_NOT_FOUND, and a missing ID returns 400 MISSING_TRANSACTION_ID. Archive each bundle yourself when the transaction settles, and ask your IXOPAY integration manager how long proofs are retained in your environment.