Skip to main content

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"
}'
FieldRequiredNotes
originalTransactionIdYesThe transactionId from the settlement response.
merchantIdYesYour merchant ID.
amountCentsYesInteger, greater than 0.
currencyYesISO currency code, same as the original.
webhookUrlNoReceives 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

HTTPerrorCause
400INVALID_REFUND_PARAMETERSMissing transaction ID, or amountCents missing or not above 0.
400MERCHANT_ID_MISMATCHmerchantId differs from the settled transaction's merchant.
400CURRENCY_MISMATCHcurrency differs from the settled transaction.
400REFUND_AMOUNT_EXCEEDS_ORIGINAL_TRANSACTIONAmount is more than the remaining refundable balance. The body includes totalRefundedCents and remainingRefundableCents.
404ORIGINAL_TRANSACTION_NOT_FOUNDThe 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.

note

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": "…"
}
FieldUse in a dispute
ppcbInvoiceHashFingerprint of the cart (merchant, currency, amount, items) the gateway recorded. Recompute it from your stored cart to show they match.
cartTotalCents, currencyAmount and currency recorded at gateway handover.
nonRepudiationSignaturesHMAC 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, dpanLastFourThe tokenized payment instrument; no card number is exposed.
proofDigestIntegrity digest over the transaction ID, hash and timestamp.

Dispute workflow​

  1. Collect the transactionId from your order record.
  2. Fetch the proof bundle and save it with the order. Do this at settlement time, not only when a dispute arrives.
  3. Recompute the Invoice Hash from your stored cart with examples/invoice-hash.js. It must equal ppcbInvoiceHash.
  4. Assemble the evidence your acquirer requires, including original signed authorization where available, processor confirmation and delivery or fulfillment evidence.
  5. Reconcile with your acquirer before issuing any credit to avoid duplicating a refund or chargeback.
note

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.