applyTender
mutation · in the family Selling
What it does
Take payment on a placed order — cash, card, or other tender.
Apply one tender to a placed order: cash — roundedDue per the CASH_ROUNDING increments (the sale total never changes); (collected − tip) ≥ roundedDue ⇒ settling (applied = the exact remainder, change = collected − tip − roundedDue, the ± roundingDelta stamps); else partial. external_card — the recorded capture (≤ the remainder exactly; no drawer). card — the integrated lane. The cash/recorded lanes stay ONE transaction: the tender row + the Order tenderedNetMinor/tipTotalMinor/paymentState stamp + for cash the cash_sale (+ change_given) entries + the drawerTotals stamp. A fully-tendered order refuses CONFLICT/OVER_TENDERED. Requires the unrestricted capability.
Before you call
A signed-in user’s session — the call refuses an API key (AUTHZ/FORBIDDEN).
Capability area: Selling — Ringing sales, serving customers and issuing invoices.
Roles that may call it:
- Owner
- Manager
- Associate Manager
- Sales Associate
- Cashier
What happens
Records the payment against the order; cash lanes need an open till session and record change given.
Careful
This is the money moment of a sale. Over-tendering refuses; every tender is permanent and feeds the drawer’s expected totals.
Arguments
| Name | Type | Required | Notes |
|---|---|---|---|
input | ApplyTenderInput ApplyTenderInput! | yes | Apply-input for applyTender: collectedMinor = the cash physically handed over (before change, tip included) or the externally-authorized amount. |
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 ExampleApplyTender($input: ApplyTenderInput!) {
applyTender(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",
"collectedMinor": 1250,
"tillSessionId": "01900000-0000-7000-8000-4ed885220000"
}
}Send it with the envelope naming the version: "extensions": {"at": {"version": {"name":"genesis","number":0}}}.
Example response
{
"data": {
"applyTender": {
"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)