refundTender
mutation · in the family Refunds and payment corrections
What it does
Refund a specific payment on an order (the record-only lane for cash/external tenders).
cancelOrder refuses CONFLICT/TENDERED while net tendered > 0 — refund-then-cancel. Requires the unrestricted capability.
Before you call
A bearer session from an API key (see Authentication and key hygiene) or a signed-in user.
Capability area: Refunds and payment corrections — Refunds, corrective notes and voiding invoices.
Roles that may call it:
- Owner
- Manager
- Associate Manager
- An API key whose scope allows
api:refundTender
Careful
Money out, recorded forever.
Arguments
| Name | Type | Required | Notes |
|---|---|---|---|
input | RefundTenderInput RefundTenderInput! | yes | Refund-input for refundTender: a positive magnitude (the port stamps the negative sign); cap = the net tendered (CONFLICT/OVER_TENDERED); cash is live; the stored-value types joined. |
Concurrency
Send the record’s current revision from your last read as expectedRevision. A stale revision is refused as CONFLICT/REVISION_STALE — read the record again and retry with the new value.
Returns
Tender Tender! — Posted only by applyTender, refundTender, and the refund writers (refundReturn/posReturn method=cash) — each in ONE transaction with the Order rollup stamp (+ the drawer entries for cash).
Example request
mutation ExampleRefundTender($input: RefundTenderInput!) {
refundTender(input: $input) {
id
type
caption
status
parentId
rootId
tenderType
appliedMinor
currency
collectedMinor
changeMinor
tipMinor
roundingDeltaMinor
paymentId
instrumentId
orgCustomerId
returnId
tillSessionId
reason
refs
createdAt
updatedAt
revision
revisionNum
}
}Variables:
{
"input": {
"orderId": "01900000-0000-7000-8000-18e782370000",
"expectedRevision": "01900000-0000-7000-8000-e02b2e6c0000",
"tenderType": "cash",
"amountMinor": 1250,
"tillSessionId": "01900000-0000-7000-8000-4ed885220000",
"reason": "Correcting a miscount."
}
}Send it with the envelope naming the version: "extensions": {"at": {"version": {"name":"genesis","number":0}}}.
Example response
{
"data": {
"refundTender": {
"id": "01900000-0000-7000-8000-37386ae00000",
"type": "<type>",
"caption": "Blue jeans",
"status": "<status>",
"parentId": "01900000-0000-7000-8000-eacdfcfd0000",
"rootId": "01900000-0000-7000-8000-a1295a650000",
"tenderType": "cash",
"appliedMinor": -1250,
"currency": "USD",
"collectedMinor": 1250,
"changeMinor": 0,
"tipMinor": 0,
"roundingDeltaMinor": 0,
"paymentId": null,
"instrumentId": null,
"orgCustomerId": null,
"returnId": null,
"tillSessionId": "01900000-0000-7000-8000-4ed885220000",
"reason": "Correcting a miscount.",
"refs": [
"<refs>"
],
"createdAt": "2027-01-31T00:00:00.000Z",
"updatedAt": "2027-01-31T00:00:00.000Z",
"revision": "01900000-0000-7000-8000-53c6eea90000",
"revisionNum": 1
}
},
"extensions": {
"at": {
"callId": "01EXAMPLE-CALL-ID",
"version": {
"requested": {
"name": "genesis",
"number": 0
},
"serviced": {
"name": "genesis",
"number": 0
}
}
}
}
}Errors this call can answer
VALIDATION/INVALID— Something in the request is not valid. Retry: no. (VALIDATION)AUTHN/REQUIRED— Sign in to do this. Retry: no. (AUTHN)AUTHZ/FORBIDDEN— Your role does not allow this action. Retry: no. (AUTHZ)RATE_LIMIT/THROTTLED— Too many requests in a short time. Retry: yes. (RATE_LIMIT)NOT_FOUND/*— That record could not be found. Retry: no. (NOT_FOUND)CONFLICT/*— The record’s state, or a change made in the meantime, does not allow this; the codes are on the CONFLICT page. (CONFLICT)VALIDATION/VERSION_REQUIRED— The request did not say which app version it came from. Retry: no. (VALIDATION)