Authorize the quote total of a checkout session
POST/payment-authorizations
AuthorizePayment. One authorization per checkout session (ErrDuplicateAuthorization; a replay with the same Idempotency-Key returns the existing one; so does a new key while the session holds a live authorization, answered 200 instead of 201). checkout calls this with key <sessionId>:auth and one allocation per shipment group (1 to 50, distinct groupNo); allocations must sum to the authorized total (ErrAllocationMismatch). On a provider decline the record is DECLINED (terminal, 201 with declineReason) and the checkout session stays open for another token.
Request
Responses
- 200
- 201
- 400
- 409
- 422
- 500
- 503
The live authorization the checkout session already holds (no new authorization was created).
Response Headers
"true" when the answer is the stored response of an earlier request with the same Idempotency-Key; absent on the first execution.
The authorization this call created (AUTHORIZED or DECLINED).
Response Headers
"true" when the answer is the stored response of an earlier request with the same Idempotency-Key; absent on the first execution.
idempotency-key-required (no Idempotency-Key header), idempotency-key-invalid (not 1 to 128 printable ASCII characters) or malformed-request.
duplicate-authorization (ErrDuplicateAuthorization, only when two concurrent authorizes for one checkout session race; a sequential repeat returns the existing authorization with 200) or concurrent-update; neither is stored, the key is released and the same Idempotency-Key runs again. Or idempotency-key-reused (the Idempotency-Key was already used with a different request).
validation-failed (not stored; the key is released), negative-amount or allocation-mismatch (ErrAllocationMismatch, also a groupNo that appears twice); both stored and replayed.
internal-error (an unexpected failure; the detail never carries the internal message).
payment-provider unreachable or timed out (payment-provider-unavailable). Nothing is stored; retry with the same Idempotency-Key, provider keys are deterministic.