Refund a payment
Refund a specific payment on an order — the record-only lane for cash and external tenders — and read the refunds as recorded.
Payments & fulfillment · a play in 2 steps.
The steps
- Refund the payment — money out, recorded forever. — refundTender
- Read the refunds — money going back to customers. — refunds
The calls
Every operation this use case runs, in the order it first appears, with the request and the response its reference page shows.
refundTender
refundTender — mutation · Refund a specific payment on an order (the record-only lane for cash/external tenders).
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-f6d8263a0000",
"expectedRevision": "01900000-0000-7000-8000-e02b2e6c0000",
"tenderType": "cash",
"amountMinor": 1,
"tillSessionId": "01900000-0000-7000-8000-83d61fef0000",
"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-065235280000",
"rootId": "01900000-0000-7000-8000-a093dd800000",
"tenderType": "cash",
"appliedMinor": 1,
"currency": "USD",
"collectedMinor": 1,
"changeMinor": 1,
"tipMinor": 1,
"roundingDeltaMinor": 1,
"paymentId": "01900000-0000-7000-8000-a7c488a40000",
"instrumentId": "01900000-0000-7000-8000-736f3dcd0000",
"orgCustomerId": "01900000-0000-7000-8000-ba56ff800000",
"returnId": "01900000-0000-7000-8000-4d4c03d20000",
"tillSessionId": "01900000-0000-7000-8000-83d61fef0000",
"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-b7960e180000",
"revisionNum": 1
}
},
"extensions": {
"at": {
"callId": "01EXAMPLE-CALL-ID",
"version": {
"requested": {
"name": "genesis",
"number": 0
},
"serviced": {
"name": "genesis",
"number": 0
}
}
}
}
}
refunds
refunds — query · The refund list — each entry is a refund — money going back to a customer.
Example request
query ExampleRefunds($filter: FilterInput) {
refunds(filter: $filter) {
items {
id
sysId
type
caption
status
parentId
rootId
createdAt
updatedAt
revisionNum
revision
organizationId
orderId
returnId
amountMinor
currency
stripeAccountRef
refundRef
failureReason
}
nextToken
matchCount
}
}
Variables:
{
"filter": {
"clauses": [
{
"field": "caption",
"op": "contains",
"values": [
"Blue"
]
}
]
}
}
Example response
{
"data": {
"refunds": {
"items": [
{
"id": "01900000-0000-7000-8000-37386ae00000",
"sysId": "RF-EXMP-0000-000F",
"type": "Refund",
"caption": "Blue jeans",
"status": "created",
"parentId": "01900000-0000-7000-8000-065235280000",
"rootId": "01900000-0000-7000-8000-a093dd800000",
"createdAt": "2027-01-31T00:00:00.000Z",
"updatedAt": "2027-01-31T00:00:00.000Z",
"revisionNum": 1,
"revision": "01900000-0000-7000-8000-b7960e180000",
"organizationId": "01900000-0000-7000-8000-44b781470000",
"orderId": "01900000-0000-7000-8000-f6d8263a0000",
"returnId": "01900000-0000-7000-8000-4d4c03d20000",
"amountMinor": 1,
"currency": "USD",
"stripeAccountRef": "<stripe account ref>",
"refundRef": "01900000-0000-7000-8000-e362bf900000",
"failureReason": "<failure reason>"
}
],
"nextToken": "<the cursor from the previous page>",
"matchCount": 1
}
},
"extensions": {
"at": {
"callId": "01EXAMPLE-CALL-ID",
"version": {
"requested": null,
"serviced": {
"name": "genesis",
"number": 0
}
}
}
}
}