Invoice refunds
Invoice refunds can optionally be triggered in scenarios where end-users send more or less cryptocurrency than they were initially quoted, or they send their cryptocurrency after the invoice expires.
For each of the payment scenarios below, Txn can configure your account to handle them individually. For example:
Overpayment:
The end-user sends more cryptocurrency than required, e.g., 150 USDT instead of 100 USDT.
Txn processes the payment in full and credits the funds to the merchant's balance, OR
Txn processes the initial invoice amount of 100 USDT and creates a refund link for the overpayment of 50 USDT, OR
Txn rejects the entire payment and creates a refund link for the full amount of 150 USDT.
Underpayment:
The end-user sends less cryptocurrency than required, e.g., 50 USDT instead of 100 USDT.
Txn processes the payment in full and credits the funds to the merchant's balance, OR
Txn rejects the entire payment and creates a refund link for the full amount of 50 USDT.
Late payment The end-user sends their cryptocurrency after the invoice expires, and the initial exchange rate is no longer valid.
Txn processes the payment in full and credits the funds to the merchant's balance, OR
Txn rejects the entire payment and creates a refund link for the full amount.
Unless Txn has configured your account otherwise, all three scenarios are processed in full. A late payment of the wrong amount follows the overpayment or underpayment option, and the late payment option applies only when the amount is exact; see Invoice status flow.
Upon creating a refund request, Txn will provide a refund link via the invoice API and webhook.
A few things to be aware of:
Refunds are payment links to web pages hosted by Txn that you will need to share with your end-users so they can submit their wallet address to claim the funds, e.g.,
https://sandbox.txn.io/redirect?payment_link_id=7312928e-f5b1-46b3-94cd-b7356e2c6825&request_type=payment_link_hosted_pageEnd-users can only claim funds in the same currency and network as the original payment. They would not be able to claim BTC if they paid in USDT.
Processing and network fees are deducted from the refund amount. If the combined total of both processing and network fees exceeds the refund amount, Txn will be unable to broadcast the refund transaction.
Below is an overpaid invoice as returned by Reading invoice. The end user sent 17 USDT against 14.211788 USDT charged, so Txn completed the invoice for the charged amount and created a refund link for the 2.788212 USDT difference. The link is listed in data.relationships.refundLinks and returned in included[] as a paymentLinks entity, with status created until the end user submits a wallet address.
Refund links are listed in data.relationships.refundLinks.data[] (type paymentLinks), and each link is returned as an entity in included[]. The other entities in the payload are described in Read invoice; the payment that was refunded is the coinDeposits entity, and the settlement record (invoiceTransactions) carries the outcome of the invoice.
Refund link fields
data.relationships.refundLinks
array
Refund links created for this invoice. data[].type is paymentLinks; the entities are returned in included[]. Empty when nothing was refunded.
included[].type(paymentLinks)
object
A refund link, in the shape returned by Reading payment link. The values specific to refund links are listed below.
included[].type(paymentLinks).attributes.paymentType
string
Always Refund.
included[].type(paymentLinks).attributes.amount
string
Amount refunded, in currency: the received payment before network and processing fees. The fees are deducted when the end user claims the refund.
included[].type(paymentLinks).attributes.currency
string
Currency of the refunded payment. Equals the invoice chargedCurrency.
included[].type(paymentLinks).attributes.accountCurrency
string
Same as currency. The refund is paid from your account in that currency.
included[].type(paymentLinks).attributes.network, included[].type(paymentLinks).attributes.networkName
string
Network of the original payment. The refund can only be claimed on this network.
included[].type(paymentLinks).attributes.reference
string
REFUND-<invoice reference>-<unix timestamp>. The invoice ID is used when the invoice has no reference.
included[].type(paymentLinks).attributes.hostedPageUrl
string
The hosted page to share with the end user.
included[].type(paymentLinks).attributes.status
string
created until the end user submits a wallet address, then the regular payment link statuses; see Payment links concept.
included[].type(paymentLinks).attributes.approvalStatus
string
Approval workflow status when a payout approval rule applies to the refund, otherwise null.
included[].type(paymentLinks).attributes.expiresAt
string
When the link expires: 30 days after it was created.
included[].type(paymentLinks).attributes.createdAt
string
When the refund link was created.
included[].type(paymentLinks).attributes.paymentMethods
array
Always ["on_chain"].
included[].type(paymentLinks).attributes.successRedirectUrl, included[].type(paymentLinks).attributes.unsuccessRedirectUrl
string
Always null for refund links.
included[].type(paymentLinks).relationships.target
object
The payout created when the end user claims the refund; data is null until then. Not expanded in the invoice payload (meta.included is false); read the payment link to get it.
Refund Links
As mentioned, each refund request is essentially a payment link to a web page hosted by Txn, for example,
https://sandbox.txn.io/redirect?payment_link_id=d1a2c04c-adab-4c01-8483-eeef02340a82&request_type=payment_link_hosted_page
After a refund link is returned by Txn in the invoice API and webhook, the merchant will need to share the link with the end-user.
Below are the steps and UI examples that the end-user will follow.





Last updated