On this page
authorizePayment
mutation · in the family Payment
What it does
Authorize a card payment — reserve the money on the customer’s card without taking it yet.
Authorize a created Payment: the CREATED-ZOMBIE REPAIR lane for an attempt whose applyTender request crashed between the mint and the ACK (the normal path drives this edge inside applyTender). Re-checks the order remainder live (a moved order refuses CONFLICT/OVER_TENDERED), fires the processor authorize POST-commit-style (never inside a transaction), and on the ACK commits the Tender row + the Order rollup stamp + this flip in ONE transaction. A decline refuses PAYMENT/AUTH_DECLINED (retryable — try another instrument) and the ultimate-failure edge lands the payment failed. Requires the unrestricted capability + the record's CURRENT revision.
Careful
An authorization holds the customer’s funds; capture or void it — do not leave it hanging.
Who may call it
Capability area: Selling — Ringing sales, serving customers and issuing invoices.
- Owner
- Manager
- Associate Manager
- Sales Associate
- Cashier
- An API key whose scope allows
api:authorizePayment
Arguments
| Name | Type | Required | Notes |
|---|---|---|---|
id | ID ID! | yes | The id of the record. |
revision | ID ID! | yes | The revision id you read on the record; the change is refused if an edit landed in the meantime. |
reason | String | no | No further notes. |
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 (the settle instant delivers), 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 ExampleAuthorizePayment($id: ID!, $revision: ID!, $reason: String) {
authorizePayment(id: $id, revision: $revision, reason: $reason) {
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:
{
"id": "01900000-0000-7000-8000-37386ae00000",
"revision": "01900000-0000-7000-8000-b7960e180000",
"reason": "Correcting a miscount."
}
Send it with the envelope naming the version: "extensions": {"at": {"version": {"name":"genesis","number":0}}}.
Example response
{
"data": {
"authorizePayment": {
"id": "01900000-0000-7000-8000-37386ae00000",
"sysId": "PY-EXMP-0000-000F",
"type": "Payment",
"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",
"amountMinor": 1,
"tipMinor": 1,
"currency": "USD",
"methodRef": "<method ref>",
"tenderId": "01900000-0000-7000-8000-0ae1978a0000",
"stripeAccountRef": "<stripe account ref>",
"sagaId": "01900000-0000-7000-8000-8b3fa5540000",
"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. (VALIDATION)AUTHN/REQUIRED— Sign in to do this. (AUTHN)AUTHZ/FORBIDDEN— Your role does not allow this action. (AUTHZ)RATE_LIMIT/THROTTLED— Too many requests in a short time. (RATE_LIMIT)NOT_FOUND/*— That record could not be found. (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. (VALIDATION)