# Ask your own customer

Get a shopper's approval for an agent's order when nobody has an account, by handing the agent a link it shows its person, or by sending the link to a customer you already know.

An agent is checking out at your store for someone. Before you take the order, the person approves this exact cart with a passkey on a Provenance page. There are two ways to reach them, and both start with [`POST /v1/authorize/checkout_approvals`](https://provenanceauth.com/docs/api/checkout-approvals.md#post-v1-authorize-checkout-approvals):

- **The agent shows the link** (the default). Nobody needs an account: not the shopper, not the agent's maker. The agent hands `approve_url` to its person in its own conversation and collects the token from `status_url`.
- **You send the link to your customer.** When the shopper is signed in at your store, or you have their phone or email from an earlier order, we text or email the link for you.

**Before you begin:** return the challenge from your checkout as in [show the full cart](https://provenanceauth.com/docs/authorize/guides/show-the-full-cart.md), and verify the retry as in [verify agent checkouts](https://provenanceauth.com/docs/authorize/guides/verify-agent-checkout.md). Creating an approval is free.

```bash
export PROVENANCE_API=https://sandbox-api.provenanceauth.com
export PROVENANCE_KEY=prv_test_ent_E7nT2vQ9bW4mK8sYd3cFjLh6gAe1pR5x
```

1. **Your checkout**: answers 401 with the link
2. **The person**: approves with a passkey
3. **The agent**: collects the token
4. **Your checkout**: verifies it offline

To decide in one call whether to ask at all, [assess the order](https://provenanceauth.com/docs/authorize/guides/assess-checkouts.md) first: a challenge opens this approval for you.

Verify first, ask only when nothing valid is attached: pass the agent's `Provenance-Intent` value as `intent_token`, and a token that already approves this cart comes back `approved` with no prompt. When the person already answered this cart for another party, and you hold a verified store proof for its origin, that answer is reused. See [ask once](https://provenanceauth.com/docs/authorize/guides/ask-once.md).

## 1. The agent shows the link

Create the approval with no `customer`, and return its `challenge` as your checkout's `401`:

**curl**

```bash
curl -s -X POST $PROVENANCE_API/v1/authorize/checkout_approvals \
  -H "Authorization: Bearer $PROVENANCE_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "cart": { "order_id": "ord_8813", "total": 3800, "currency": "USD", "merchant_id": "quillstack", "origin": "https://quillstack.example",
              "items": [{ "sku": "nb-a5", "name": "Linen notebook, A5", "quantity": 2, "unit_amount": 1900 }] },
    "display": { "merchant_name": "Quillstack" },
    "retry_url": "https://quillstack.example/checkout",
    "expires_in": 900
  }'
```

**Node**

```ts
const approval = await prov.authorize.checkoutApprovals.create({
  cart: order,
  display: { merchantName: "Quillstack" },
  retryUrl: "https://quillstack.example/checkout",
  expiresIn: 900,
});
res.status(401).set(approval.challenge.headers).send(approval.challenge.body);
```

**Python**

```python
approval = prov.authorize.checkout_approvals.create(
    cart=order, display={"merchant_name": "Quillstack"},
    retry_url="https://quillstack.example/checkout", expires_in=900,
)
```

```json
{
  "id": "coap_01M5WX3K8Q2V7N4T6YBA9RJ5DM",
  "object": "checkout_approval",
  "status": "pending",
  "route": "agent_relay",
  "binding_version": 1,
  "approve_url": "https://app.provenanceauth.com/approve/c/Hq2vN8xK4tB7mW3sYd9cFj",
  "status_url": "https://api.provenanceauth.com/v1/authorize/checkout_approvals/requests/Hq2vN8xK4tB7mW3sYd9cFj/status"
}
```

The challenge's `approval_request` carries `approve_url` (`/approve/c/…`, a 128-bit link that works for this one request until `expires_at`) and `status_url`. We send nothing, so the Free trial's texts don't apply. At most 300 of these an hour per account.

Any agent that reads the `401` can show the link: "Quillstack needs your approval for 2 notebooks: Approve". Agents that speak MCP use a keyless tool on [Provenance MCP](https://provenanceauth.com/docs/provenance-mcp/agent-tools.md#tools-that-need-no-key) and in `@provenanceauth/mcp-server`:

| Tool | What it returns |
| --- | --- |
| `request_checkout_approval({ challenge })` or `({ approve_url })` | `approve_url`, `summary` (the cart in one line) and `expires_at` |
| `request_checkout_approval({ approve_url, wait })` | Waits up to `wait` seconds (25 at most) and returns `status`, and once approved `intent_token` for the `Provenance-Intent` header |

The tool acts only on the request in the link and need no API key. It tells the model to show the link as-is and never to open it or approve for the person. Opening the link isn't enough to approve: approving needs a passkey with user verification on the person's own device.

### If your store runs its own MCP server

Return `mcpApprovalResult(challenge)` from your `checkout` tool instead of an error. The agent gets `{ status: "approval_required", approve_url, summary, expires_at }` and shows the link without our MCP server:

```ts
import { mcpApprovalResult } from "@provenanceauth/rails/checkout";

const approval = await prov.authorize.checkoutApprovals.create({ cart: order, display: { merchantName: "Quillstack" }, retryUrl });
return { content: [{ type: "text", text: JSON.stringify(mcpApprovalResult(approval.challenge.body)) }] };
```

## 2. The person approves

The page shows your logo and name, one sentence, the cart in your own line order, the card in use when you sent `payment_method`, and **Approve** and **Decline**. The first item's picture leads; "+2 more items" opens the rest in place, and each item links to its `url`.

The person approves with a passkey they set up on this page before, or creates one on the spot: no sign-up, no email or phone number. **Decline** offers a reason, a short note and "Don't ask me for this store again".

The note comes back as `decline_note` at the status link, on your reads and in `authorize.checkout_approval.declined`: at most 280 characters, with links and phone numbers removed.

Send `payment_method` (`{ "brand": "visa", "last4": "4242", "wallet": "apple_pay" }`) to show the card as "Visa ···· 4242 · Apple Pay". `last4` is exactly four digits; anything longer is refused. It isn't part of the signed cart, since your payment provider may retry on another card without the order changing.

When an approval expires, the page says the person can ask their agent to try again. Turn on `resend_on_expiry` with [`PUT /v1/authorize/settings/checkout_approvals`](https://provenanceauth.com/docs/api/checkout-approvals.md#put-v1-authorize-settings-checkout-approvals) to also offer "Ask Harbor Bean to send a new link" (with your store's name): one tap sends `authorize.checkout_approval.resend_requested` with the cart, and the agent sees `resend_requested_at` at the status link. Send a fresh approval for the same cart; Provenance never makes one itself.

## 3. The agent collects the token

`GET /v1/authorize/checkout_approvals/requests/status` waits up to `wait` seconds (at most 60) and returns the outcome only:

```json
{
  "object": "checkout_approval_status",
  "status": "approved",
  "expires_at": "2026-10-26T20:15:00.000Z",
  "intent_token": "eyJhbGciOiJFUzI1NiIsImtpZCI6...",
  "intent_token_expires_at": "2026-10-27T00:00:00.000Z"
}
```

When you send `billing_address` and one of your after-approval rules holds the order, the status reads `in_review` with `review.expires_at` and `retry_after: 30`, and no token until you decide; the long poll returns as soon as you do. The person's page says your store is checking the order. See [review orders](https://provenanceauth.com/docs/authorize/guides/review-orders.md).

The agent retries your checkout with `Provenance-Intent: <intent_token>`. Verify it with `verifyAgentCheckout` against your order and `require: { biometric: true }`: `source.approved.method` is `passkey`. Each approval mints one token for one order.

## 4. Read what you learn about the approver

[`GET /v1/authorize/checkout_approvals/{id}`](https://provenanceauth.com/docs/api/checkout-approvals.md#get-v1-authorize-checkout-approvals-id) and the `authorize.checkout_approval.approved` / `.declined` webhooks carry the token and `approval_context`, on every plan. (A cart approval an [assessment](https://provenanceauth.com/docs/authorize/guides/assess-checkouts.md#when-the-person-decides) opened reports through the assessment instead: `authorize.checkout_assessment.updated`.)

```json
{
  "object": "approval_context",
  "id": "apc_01JD5HT9QK3M8V2XR7N4B6WZTC",
  "subject": { "type": "checkout_approval", "id": "coap_01JD5HT2QZ6Y1K9F3R8M4V7NXB" },
  "decision": "approved",
  "decided_at": "2026-10-26T19:02:11Z",
  "method": { "kind": "passkey", "authenticator": "platform_passkey", "user_verified": true, "step_up": null },
  "passkey": { "status": "existing", "age": { "days": 14, "minutes": 0 }, "created_during_approval": false, "synced": true, "provider": "iCloud Keychain", "provider_attested": false },
  "device": { "os": "ios", "os_version": "26.1", "browser": "safari", "source": "user_agent", "verified": false, "time_zone": { "name": "America/New_York", "utc_offset_minutes": -240, "source": "browser", "verified": false }, "locale": "en-US" },
  "network": { "country": null, "region": null, "city": null, "city_status": "not_enabled", "flags": { "vpn": false, "proxy": false, "hosting_provider": false, "tor": false, "private_relay": false }, "source": "published_lists", "ip": null },
  "billing": null,
  "person": { "pseudonym": "hum_6f1c2a9e0b7d4c3a8e5f", "link": "not_applicable" },
  "external": null,
  "unavailable": { "network.country": "ip_intel_not_configured", "network.region": "ip_intel_not_configured" }
}
```

A person approved this exact cart with user verification on a passkey. `person.pseudonym` is the same for the same passkey at your store and different at every other store, so a returning shopper is recognizable to you without anyone learning who they are. See [approval context](https://provenanceauth.com/docs/concepts/approval-context.md) for every field.

The approval also carries `signals`, on every plan ([approval signals](https://provenanceauth.com/docs/authorize/concepts/approval-signals.md)): the account and ships-to signals, and the commitment to the approving device's IP where your deployment shares it.

The approval doesn't establish who the person is, or that they hold the card. Set your own limits, for example:

- cap the amount when `approval_context.passkey.status` is `new`;
- above that, require `existing` with a passkey older than a day;
- above your highest limit, ask a customer you know (step 5).

## 5. Send the link to your own customer

When you already know the shopper, pass `contact` with a phone (E.164), an email or both from your own records, and `customer_source: "merchant_account"`, which attests that the contact belongs to your customer's account with you:

**curl**

```bash
curl -s -X POST $PROVENANCE_API/v1/authorize/checkout_approvals \
  -H "Authorization: Bearer $PROVENANCE_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "cart": { "order_id": "ord_8814", "total": 3800, "currency": "USD", "merchant_id": "quillstack", "origin": "https://quillstack.example",
              "items": [{ "sku": "nb-a5", "name": "Linen notebook, A5", "quantity": 2, "unit_amount": 1900 }] },
    "display": { "merchant_name": "Quillstack" },
    "retry_url": "https://quillstack.example/checkout",
    "contact": { "phone": "+14155550142", "email": "dana@shopper.example" },
    "customer_source": "merchant_account"
  }'
```

**Node**

```ts
await prov.authorize.checkoutApprovals.create({
  cart: order, display: { merchantName: "Quillstack" }, retryUrl,
  contact: { phone: account.phone, email: account.email }, customerSource: "merchant_account",
});
```

**Python**

```python
prov.authorize.checkout_approvals.create(
    cart=order, display={"merchant_name": "Quillstack"}, retry_url=retry_url,
    contact={"phone": account.phone, "email": account.email}, customer_source="merchant_account",
)
```

With both contacts your customer gets two messages: the app notification and the email when their contact is one they verified in the Provenance app, the text and the email otherwise. Each goes on its own, so a text that fails doesn't stop the email.

`channels` narrows which of our messages may go (your account's default when left out), and `"delivery": "self"` with no contact is the agent relay above. The older field `customer` is refused: send `contact`. The response carries `channels` and `deliveries`, one entry per message with the masked contact it went to.

When the approval went to the shopper's app as a notification, a text follows if it isn't opened within 5 minutes. `follow_up_text` changes the wait and the trigger; with `not_finished` it waits for the cart to be approved or declined. A cart approval lives 15 minutes by default, so a wait you give must be shorter than `expires_in`. See [the follow-up text](https://provenanceauth.com/docs/messaging/reminders.md#11-the-follow-up-text).

A reminder reaches both contacts the same way: the notification or the text, with the email. A customer who replied STOP to our texts is reminded by email when you gave one. `reminders` (`{ "enabled": true, "after": ["10m"] }`) gives the approval its own automatic reminders, in the shape of your cart approval schedule in Settings; an offset at or past `expires_in` is left out. See [a request's own schedule](https://provenanceauth.com/docs/messaging/reminders.md#set-a-requests-own-schedule).

### The shopper's name

Add `name` to `contact` (`{ "name": "Maya Chen", "email": "maya@shopper.example" }`) and your own reads say who approved: the assessment and the cart approval carry `contact: { name }`, and your Orders panel reads "Approved by Maya Chen" in place of "The shopper". A name sent alone is no contact to send to, so the agent relay asks the shopper.

The name is stored encrypted, shown only to your account, opened in your account export and deleted with the order. It never reaches a webhook, a share link, a rule or another store. Keep it to one line of at most 100 characters.

The message names your store and says an AI agent placed the order. It goes out with your [approval page branding and sending domain](https://provenanceauth.com/docs/mandate/guides/approver-network.md), and on Free a text counts toward the trial's texts. The contact is stored encrypted and never shown on the page or returned by the API. Use only a contact your customer gave you: never one from an agent, an Identify check or a disclosure.

Pass `billing_address` too when you hold one (`country` required, ISO 3166-1 alpha-2), on a cart approval or on the [assessment](https://provenanceauth.com/docs/authorize/guides/assess-checkouts.md#your-customers-billing-address) that opens it. It is stored encrypted with the approval.

Once your customer decides, your reads of the approval ([`GET /v1/authorize/checkout_approvals/{id}`](https://provenanceauth.com/docs/api/checkout-approvals.md#get-v1-authorize-checkout-approvals-id) and the list) return the full address as `approval_context.billing`, on every plan. Every read and webhook carries `billing`, the country, the ISO 3166-2 region and the postal prefix; webhooks never carry the full address.

The approval page shows your customer the city and region ("Billing: Portland, OR"), never the street or the postal code. The address isn't part of what the passkey signs, so the token is the same with or without it.

Once your customer decides, the approval and its webhook carry `location`: the time zone their browser reported and the network's country and region, each with its source. How that compares with the billing address is for your [checkout rules](https://provenanceauth.com/docs/authorize/guides/assess-checkouts.md#where-the-person-approved-from), not the response.

Hold the order as **Waiting for your approval**. When `authorize.checkout_approval.approved` arrives, complete the order on your server with its `intent_token`, so an agent that doesn't understand the challenge never has to. The shopper is protected by these defaults:

- one pending approval per customer and store origin, matched on either contact (a second create returns the pending one with `deduped: true`);
- at most 5 an hour and 20 a day per customer;
- "Don't ask me for this store again" stops your requests to that customer's phone and email (a create then returns `customer_routing_not_allowed`);
- the email's **Unsubscribe** stops your approval emails to that address, and carries the one-click `List-Unsubscribe` header.

## Errors you might see

| Symptom | Cause | Fix |
| --- | --- | --- |
| `customer_routing_not_allowed` (400) | `contact` without `customer_source: "merchant_account"`, or the customer chose not to get your requests | Send the attestation, or ask the shopper at checkout. |
| `parameter_invalid` (400) on `customer` | The older field name | Send `contact` instead. |
| `parameter_invalid` (400) on `contact.phone` | The phone isn't E.164 | Send it with its country code, like `+14155550142`. |
| `parameter_invalid` (400) on `contact.name` | The name is empty, not text, or over 100 characters | Send the name as your store shows it. |
| `rate_limit_exceeded` (429) | Over 300 agent-relay requests an hour, or a customer's hourly or daily limit | Don't create an approval on every request; reuse the pending one. |
| `resource_missing` (404) on a request link | The link is wrong, or the request expired | Create a new approval. |
| `approval_already_decided` (409) | The request was approved or declined already | Read its status. |
| `checkout_resend_unavailable` (409) | A new-link request while `resend_on_expiry` is off or the approval hasn't expired (`details.state`) | Turn the setting on, or wait for the approval to expire. |
| `delivery.reason: "channel_not_configured"` | Email or SMS isn't set up for your account | Configure delivery, or let the agent show the link. |

## See also

- [Show the full cart](https://provenanceauth.com/docs/authorize/guides/show-the-full-cart.md)
- [Reminders](https://provenanceauth.com/docs/messaging/reminders.md), to send a pending cart approval to your customer again
- [AP2 without a mandate](https://provenanceauth.com/docs/authorize/guides/ap2-without-mandate.md)
- [3-D Secure for agentic commerce](https://provenanceauth.com/docs/authorize/guides/assess-checkouts.md)
- [Provenance MCP](https://provenanceauth.com/docs/provenance-mcp.md)
- [Verify agent checkouts](https://provenanceauth.com/docs/authorize/guides/verify-agent-checkout.md)
