processReaderPayment
mutation · in the family Selling
What it does
Take a card-present payment on the card reader paired to this till.
Start one card-present payment on the caller's paired reader: requires the composite POS session (the x-at-device-session facet — the reader resolves from the device, never caller-named: active + register-paired, exactly ONE active registered card reader; the device's org chain must equal the order's selling org). The selling org must hold a connected chargeable account (NO platform arm — the direct-charge money-destination law; CONFLICT/REF_STATE otherwise). Record-first: the Payment mints created with methodRef = the reader's readerRef, then the processor intent hands to the reader and this op returns — the customer taps; the payment_intent.amount_capturable_updated truth commits the Tender row + the Order rollup + the created→authorized flip in ONE transaction, and a reader decline lands the attempt failed via payment_intent.payment_failed. Poll the payment record for the outcome (the CQRS shape). A reader refusal (busy/offline — NO card presented) refuses PAYMENT/READER_UNAVAILABLE with the attempt recorded failed (retryable — record-per-attempt). Requires the unrestricted capability. Template class (the applyTender ring plane — hand-derived v32).
Before you call
A signed-in user’s session — the call refuses an API key (AUTHZ/FORBIDDEN).
The session must be a register’s: the card reader is the paired device’s, and a session without the device is refused (CONFLICT/REF_STATE).
Capability area: Selling — Ringing sales, serving customers and issuing invoices.
Roles that may call it:
- Owner
- Manager
- Associate Manager
- Sales Associate
- Cashier
What happens
The order’s remaining amount goes to the physical reader; the customer taps or inserts; the payment confirms back onto the order.
Careful
Real card money. A busy or offline reader refuses retryably — the customer has not paid until the reader confirms.
Arguments
| Name | Type | Required | Notes |
|---|---|---|---|
input | ProcessReaderPaymentInput ProcessReaderPaymentInput! | yes | Input for processReaderPayment: the reader is never named here — it resolves from the caller'S device session (the composite-POS law: exactly ONE active registered card reader on the paired device). |
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
Payment Payment! — A Payment — a processor-backed payment (the integrated processing mode), spawned by a card Tender. Aligned to the deposit→recognition model: authorize = the hold = deposit at tender; capture = recognized at delivery — POS carry-out collapses authorize+capture by arriving at delivery in the same request, never by skipping states. Record-first/processor-after: minted created before any processor call; the StripePort attempt fires post-commit; state flips ride the ACK/webhook path; 32 attempts bound each order (the Order.paymentIds cap). PCI-min: the PAN never touches AT/stack — the record holds the opaque tokenized methodRef + processor refs + at most brand/last4. The StripePort is faked at 7.7a (deterministic, keyless); the live adapter + webhook ingress are 7.7b.
Example request
mutation ExampleProcessReaderPayment($input: ProcessReaderPaymentInput!) {
processReaderPayment(input: $input) {
id
sysId
type
caption
status
parentId
rootId
createdAt
updatedAt
revisionNum
revision
organizationId
amountMinor
tipMinor
currency
methodRef
tenderId
stripeAccountRef
sagaId
intentRef
chargeRef
brand
last4
declineReason
}
}Variables:
{
"input": {
"orderId": "01900000-0000-7000-8000-18e782370000",
"expectedRevision": "01900000-0000-7000-8000-e02b2e6c0000",
"amountMinor": 1250,
"tipMinor": 0
}
}Send it with the envelope naming the version: "extensions": {"at": {"version": {"name":"genesis","number":0}}}.
Example response
{
"data": {
"processReaderPayment": {
"id": "01900000-0000-7000-8000-20f641110000",
"sysId": "PY-EXMP-0000-000F",
"type": "Payment",
"caption": "Blue jeans",
"status": "created",
"parentId": "01900000-0000-7000-8000-18e782370000",
"rootId": "01900000-0000-7000-8000-a1295a650000",
"createdAt": "2027-01-31T00:00:00.000Z",
"updatedAt": "2027-01-31T00:00:00.000Z",
"revisionNum": 1,
"revision": "01900000-0000-7000-8000-53c6eea90000",
"organizationId": "01900000-0000-7000-8000-1971e30a0000",
"amountMinor": 1250,
"tipMinor": 0,
"currency": "USD",
"methodRef": "<method ref>",
"tenderId": "01900000-0000-7000-8000-337e28070000",
"stripeAccountRef": "<stripe account ref>",
"sagaId": "01900000-0000-7000-8000-4d522e410000",
"intentRef": "01900000-0000-7000-8000-0cb528b40000",
"chargeRef": "01900000-0000-7000-8000-ae314a160000",
"brand": "<brand>",
"last4": "<last4>",
"declineReason": "<decline reason>"
}
},
"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)