Refund Terminal payments through the public API
Summary
refundPayment now supports Terminal (in-person reader) payments as well as Stripe card and non-card payments. Requires the issueRefund right.
This extends the refund support described in the June and August release notes, where Terminal refunds were out of scope. No new mutation is introduced.
Behaviour
- Terminal payments with a Stripe charge id — refunds money back to the original card through Stripe and records the refund on the invoice. Returns
refundIdandrefundExternalId(the Stripe refund id) for reconciliation. - Terminal payments without a Stripe charge id — returns an error without recording a refund or calling Stripe.
- Partial refunds are supported, up to the payment's remaining unrefunded amount.
- No credit note is created by this mutation.
Stripe card refunds and document-only non-card refunds keep their existing behaviour.
Example
Use the Terminal payment's Invoice.payments[].id as paymentId:
mutation RefundTerminalPayment {
refundPayment(
invoiceId: "INVOICE_ID"
paymentId: "TERMINAL_PAYMENT_ID"
amount: 50.0
reason: REQUESTED_BY_CUSTOMER
comment: "Refund for cancelled visit"
) {
data {
id
refunded
}
refundId
refundExternalId
error
}
}
Migration
No breaking schema changes. Partners can use the existing refundPayment mutation for Terminal payments and store refundExternalId to reconcile with Stripe.