Unreferenced Refund
An unreferenced refund is a card-present credit that is not tied to any original sale. Instead of pointing at a previous payment, you start a brand new transaction and the customer presents their card at the terminal to receive the money back.
Use this when you need to return funds but don't have, or don't want to use, the original payment's reference. If you do have the original payment, prefer a Referenced Refund, which links the credit back to the initial sale for cleaner reconciliation.
Unreferenced refunds is currently not open to new applications. You may implement and test but not board any live customers.
Referenced refunds are strongly recommended wherever possible.
An unreferenced refund sends a credit to a card without any link to a prior payment. Because there is no original transaction to validate against, these refunds are subject to additional fraud screening. As a result:
- Some merchants may not be eligible to process unreferenced refunds at all.
- An individual unreferenced refund may be declined even where the same refund would succeed as a referenced refund.
- Eligibility cannot be reliably predicted, so building exclusively on unreferenced refunds risks unexplained refusals for merchants.
Use unreferenced refunds only where the originalgateway_payment_idis genuinely unavailable.
Make an unreferenced refund
Call the makeUnreferencedRefund JSON-RPC method. Unlike refundPayment, which refunds a specific previous payment by its gatewayPaymentId and returns a single result, an unreferenced refund reuses the payment state machine and streams state updates, just like makePaymentAndSubscribe.
public async Task<JsonElement> MakeUnreferencedRefund(string id, int refundAmount)
{
var refundParams = new
{
transactionId = id, // business id for this refund, or a random UUID. Must be unique within the linked store.
amount = refundAmount, // amount to refund in minor units
currency = "GBP", // The ISO 4217 currency code (e.g., "GBP", "EUR").
useTeyaDefaultUi = true, // if true, the SDK app shows an interactive "in progress" UI window
};
return await SendRequestAsync("makeUnreferencedRefund", refundParams);
}
The SDK app streams state updates the same way as makePaymentAndSubscribe: intermediate states arrive as notifications, which have no id field in the json-rpc body and are matched by transactionId, and the final state is the response to your request. Each update looks like this:
{
"type": "makeUnreferencedRefund->onPaymentStateChanged",
"transactionId": "tx-123",
"amount": 500,
"currency": "GBP",
"gatewayRefundId": "tr_019851ef-29f2-70e8-800d-fdd875bfa0a4",
"state": "SUCCESSFUL",
"inProgressState": null,
"isFinal": true,
"reason": null,
"transactionTimestamp": 1736175612000,
"debugErrorMessage": null,
"metadata": null
}
The structure mirrors makePaymentAndSubscribe->onPaymentStateChanged, described on the Make Payment page, with one difference: it carries a gatewayRefundId, the id of the created refund, instead of gatewayPaymentId. You can reuse the same handling for the shared fields state, inProgressState, isFinal, reason and metadata. If you reuse the PaymentStateReason enum from the Make Payment example, add the FEATURE_NOT_ACTIVATED_UNREFERENCED_REFUNDS value to it so the refund-specific reason deserializes. See the note below.
Unreferenced refunds are not available for tab, or Pay at Table, payments.
Re-attach to a refund in progress
If your ePOS loses track of a refund it started, you can re-attach to it with subscribeToPayment and the transactionId you started it with - see Subscribe to an existing payment.
Contact us at partnersupport@teya.com to have unreferenced refunds enabled for your account. Until the feature is activated, the refund reaches a failed state whose reason field is FEATURE_NOT_ACTIVATED_UNREFERENCED_REFUNDS in the state-change payload.