Authorize · Guide
Ask once
One cart can be asked about by the agent's operator, by the store and by a network order. Use ask once so the person confirms that order once: every party that asks after the first reuses the answer, and a store verifies the token the agent already carries before it asks at all.
Before you begin: a store returns cart approvals as in ask your own customer and verifies retries as in verify agent checkouts. Reuse is free on every plan and doesn't meter a second decision.
export PROVENANCE_API=https://sandbox-api.provenanceauth.com
export PROVENANCE_KEY=prv_test_ent_E7nT2vQ9bW4mK8sYd3cFjLh6gAe1pR5x
- The agentattaches its token
- Your checkoutverifies it first
- Provenancereuses an earlier yes
- The personasked only when nothing valid exists
1. Verify first, ask only when nothing valid is attached
When the agent retries your checkout, it sends its token in the Provenance-Intent header, the ACP com.provenanceauth.intent extension or the x402 v2 extension. Pass that value as intent_token when you create the cart approval:
const approval = await prov.authorize.checkoutApprovals.create({
cart: order,
display: { merchantName: "Quillstack" },
retryUrl: "https://quillstack.example/checkout",
intentToken: req.header("Provenance-Intent"),
});
if (approval.status === "approved") return fulfill(order, approval.intentToken);
res.status(401).set(approval.challenge!.headers).send(approval.challenge!.body);
A token that approves this exact cart comes back at once, with no prompt, no send and no rate limit spent:
{
"id": "coap_01M6GZ3K8Q2V7N4T6YBA9RJ5DM",
"object": "checkout_approval",
"status": "approved",
"route": "agent_relay",
"intent_token": "eyJhbGciOiJFUzI1NiIsImtpZCI6...",
"reused": { "source": "intent_token" }
}
The token is checked as verifyAgentCheckout checks it:
| Check | Refused with |
|---|---|
| Signed by our ES256 key and unexpired | invalid_, token_ |
aud is the cart's origin and payload_ is the cart's binding hash | binding_ |
| Not revoked (the token, its session, device or grant) | token_ |
| A person approved it, or a live grant covers it | approval_ |
A refused token is a 400 intent_token_refused with error.details.reason. It is never turned into a prompt, so you decide whether to ask the person: create the approval again without intent_token.
2. Reuse an answer another party got
Before any new approval request, Provenance looks for an answer to the same binding. It runs on every path that asks a person:
| Path | Who asks |
|---|---|
| Step-up approval and the checkout step-up | The agent's operator |
| Cart approval | The store |
| Network order | An agent buying under a person's network grant |
| Routed approval | The operator, through an approver link |
What happens depends on the earlier request:
| Earlier request | This request |
|---|---|
| Approved, inside its window | No prompt. You get your own receipt and a fresh token bound to your own audience (so your own pairwise sub), with reused: { source } |
| Still pending | Attached: you get approval_ with your own id, and the person's one decision resolves both |
| Denied, inside its window | approval_ with no reason text, and no prompt |
A payment is reused only when it names one payment
An approved payment answers a second request only when the payload carries an order or cart id, an idempotency key or an ACP checkout session id; an identical wire with none is a second payment, and the person is asked again.A payment is any cart (a checkout binding, ACP, AP2, x402 or a network order) or any action with an amount in its payload or context. Carts always carry their order id, so carts reuse. Pending requests are attached and denials are reused for payments too. Other actions reuse as described above.
Another amount, cart, payee or action is another binding, so it asks as usual. The binding is the canonical cart binding hash for carts (checkoutBinding(order)), and payload_hash with action_hash for other actions. A payload is normalized before it's hashed, so two descriptions of one order can miss each other, and two different orders never match.
The window is the earlier token's exp, capped at one hour (a self-hosted API can change the cap). After it, the next request asks again.
3. Know who counts as the same person
A person is recognized by their passkey. Approval pages share one passkey domain, so the passkey a person used for an operator's approver link also signs a store's cart approval and their network orders.
An approval made without a passkey (an enrolled device key, a console click, an API key) is reused only by the same account and the same subject. A store that doesn't know the person yet (the agent shows the link) matches on the binding alone, which names its origin and order, and only when your account holds a verified store proof for that origin, checked in the last 48 hours. See list or unlist your store for the proof.
Hold your store proof
A store without a current proof for the cart's origin gets reuse only through its own token check in step 1.4. Revoke and budget the way the original does
Revoking the original token (revocation) revokes every token minted from it for other parties. A network grant reserves budget once per binding: a second network order for a cart the grant already holds budget for answers order_already_reserved.
5. Accept confirmations given outside Provenance
Available on Pro, Growth and Enterprise
A person may already have confirmed the cart somewhere you can verify: an AP2 mandate signed in their wallet, a Secure Payment Confirmation at your checkout, or a confirmation signed by an agent platform you work with. List the kinds you accept in your policy's external_confirmations, then send the evidence as external_confirmation on the cart approval (or as approval.external_confirmation on the agent's checkout step-up):
const approval = await prov.authorize.checkoutApprovals.create({
cart: order,
display: { merchantName: "Quillstack" },
retryUrl: "https://quillstack.example/checkout",
checkoutJwt, // your own Checkout JWT, for a Checkout Mandate
externalConfirmation: { kind: "ap2_user_mandate", evidence: mandateSdJwt },
});
| Kind | What is verified |
|---|---|
ap2_ | A closed AP2 0.2 Checkout or Payment Mandate SD-JWT: the issuer's ES256 signature against a JWKS you list in ap2_, every disclosure digest, the key-binding JWT when cnf is present (aud is your origin, sd_ matches), then the content against your cart: the checkout_ of your own Checkout JWT, or the payee, amount and currency. Open mandates aren't accepted |
spc | A Secure Payment Confirmation assertion (clientDataJSON. is payment.) over the challenge from POST /, whose payment. and payee match the cart. The passkey was set up on a Provenance approval page, or your store registered it and sends its public_ (then it's labelled as your store's credential) |
platform | A compact ES256 JWS from a platform you list in platforms, with aud = your origin, binding_ = the cart's binding hash and an unexpired exp. It's labelled everywhere as that platform's word |
Screenshots, chat transcripts and "the agent says the person confirmed" are never a kind. Passkeys created before this feature lack the WebAuthn payment extension, so SPC works only with passkeys set up after the approval page added it.
An accepted confirmation answers the request like an approval:
statusstringapproved, with the cart-bound token.decided_viastringexternal.confirmed_viaobject- The kind, the issuer it's labelled with, and the evidence hash. Also on the decision and its receipt, present only then.
It meters one approval_resolved, in place of the approval it replaces. A refused one comes back as external_confirmation with its reason, and the request asks the person as usual:
| Reason | Why |
|---|---|
issuer_ | No issuer or platform you list holds the signing key |
issuer_ | A listed JWKS couldn't be fetched (never accepted on a cached failure) |
signature_ | The signature, a disclosure or the key-binding JWT doesn't verify |
binding_ | Another cart, amount, payee, origin or challenge |
kind_ | Your policy doesn't list the kind, or it's an open mandate or a webauthn. assertion |
expired | The mandate, its key-binding JWT or the SPC challenge is past its time |
Many refusals for one account in an hour raise the external_confirmation_refusals alert for operators: someone may be probing with forged mandates.
Outside confirmations are on every plan. A cart approval an AP2 mandate confirmed also covers the cart on a later checkout assessment: its authority names the wallet as a third_party_mandate.
What each party learns
A requester learns only what its own token carries: its own pairwise subject, how the person approved and when. It never learns the other party's account, approval id, contact, deny reason or what the person saw. A miss, a match hidden by the store-proof rule and an unrelated cart look the same.
Decisions and receipts carry reused: { source } only when they reused an answer; every other record's hash is unchanged. The decision ledger shows it, and so does the console's Decisions page.
Errors you might see
| Code | Why | Fix |
|---|---|---|
intent_ | The attached token didn't verify for this cart; error. says why | Leave intent_ out to ask the person |
cart_ | The cart doesn't add up | Send the cart exactly as checkoutBinding(order) builds it |