# Review orders

Decide the agent orders your after-approval rules hold for review, from your own admin or the console, and set how long a review waits.

When a customer approves a cart, your after-approval rules run once before the token is minted. A rule with the Review action holds the order: the customer said yes, and the order waits for your decision. This guide covers deciding it from your own admin, from the console, and what happens when nobody does.

**Before you begin:** after-approval rules run on every plan. Every account has the default rows below; to change them, see [set your checkout rules](https://provenanceauth.com/docs/authorize/guides/assess-checkouts.md#rules-after-the-customer-approves). The decision itself is free.

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

1. **The customer approves**: with a passkey on the approval page
2. **Your after-approval rules**: approve, review or reject
3. **You decide**: your API, the console, or the timeout

## 1. When an order waits for you

The default rows hold an order when the customer approves from somewhere that doesn't match the billing address you sent:

| Order | Rule id | When | Then |
| --- | --- | --- | --- |
| 3 | `rul_default_declined` | `approval.decision` `eq` `declined` | Reject |
| 4 | `rul_default_location_matches_billing` | `approval.location` `eq` `matches_billing` | Approve |
| 5 | `rul_default_location_differs` | `approval.location` `in` `differs`, `unavailable` | Review |

An order sent without `billing_address` reads `no_billing` and matches none of these rows, so it is approved when the customer says yes. An integration that doesn't send billing addresses never meets a review.

A held order stays a challenge on its checkout assessment, with `challenge.status: "in_review"`, `reason: "policy_review"`, the rule that held it in `policy`, and how the customer approved in `approval_context`. No token exists yet. Your endpoint gets `authorize.checkout_assessment.updated`, the assessment itself:

```json
{
  "object": "checkout_assessment",
  "id": "cas_01M7JD3RF2X8N4PQ6T0VZKWG8M",
  "outcome": "challenge",
  "previous_outcome": "challenge",
  "reason": "policy_review",
  "policy": {
    "id": "pol_AC2A5612965B31B91188589F91",
    "version": 3,
    "rule": {
      "id": "rul_default_location_differs",
      "name": "Location doesn't match billing",
      "phase": "after_approval",
      "action": "review",
      "conditions": [{ "fact": "approval.location", "op": "in", "value": ["differs", "unavailable"], "actual": "differs" }]
    }
  },
  "challenge": { "channel": "agent_relay", "sent_to": null, "status": "in_review", "expires_at": "2026-11-17T14:47:02.114Z" },
  "approval_context": { "object": "approval_context", "subject": { "type": "checkout_approval", "id": "coap_01M7JD3RFRNGQ5742W9ZZKWG8M" }, "decision": "approved" },
  "order_id": "ord_8817",
  "updated_at": "2026-11-16T14:47:02.114Z"
}
```

`challenge.expires_at` is when the review times out. The webhook's `approval_context.billing` is always null; your own read of the assessment carries the full address. The comparison itself appears only as the rule's condition. List what's waiting with [`GET /v1/authorize/checkout_assessments`](https://provenanceauth.com/docs/api/assessments.md#get-v1-authorize-checkout-assessments) and `?approval_status=in_review`.

Meanwhile the agent's `status_url` answers `status: "in_review"` with `review.expires_at` and `retry_after: 30`, and its long poll returns as soon as you decide. The customer's page says "Approved. Your store is checking the order and will confirm." A later assessment of the same cart attaches to the open approval and answers `challenge.status: "in_review"`; nobody is asked twice.

## 2. Decide from your own admin

Send [`POST /v1/authorize/checkout_assessments/{id}/review`](https://provenanceauth.com/docs/api/assessments.md#post-v1-authorize-checkout-assessments-id-review) with `approve` or `reject`, and an optional note for your records:

**Node**

```ts
import { Provenance } from "@provenanceauth/sdk";

const prov = new Provenance({ apiKey: process.env.PROVENANCE_KEY!, baseUrl: process.env.PROVENANCE_API });
const assessment = await prov.authorize.assessments.review("cas_01M7JD3RF2X8N4PQ6T0VZKWG8M", {
  decision: "approve",
  note: "Called the customer; the new address is theirs.",
});
```

**Python**

```python
import os
from provenanceauth import Provenance

prov = Provenance(api_key=os.environ["PROVENANCE_KEY"], base_url=os.environ["PROVENANCE_API"])
assessment = prov.authorize.assessments.review(
    "cas_01M7JD3RF2X8N4PQ6T0VZKWG8M", decision="approve", note="Called the customer; the new address is theirs."
)
```

The answer is the assessment, updated:

- **Approve** mints the cart-bound token for the agent; the assessment reads `outcome: "frictionless"` with `reason: "review_approved"`. The agent's next poll returns the token.
- **Reject** reads `outcome: "reject"` with `reason: "store_review"`. Tell your customer the order didn't go through.

Either sends `authorize.checkout_assessment.updated` with `previous_outcome: "challenge"`. Sending the same decision again returns the assessment. The other decision after one answers `review_already_decided` (409); an order that isn't in review answers `review_not_open` (409). Another account's assessment is a 404.

A cart approval you created yourself with [`POST /v1/authorize/checkout_approvals`](https://provenanceauth.com/docs/api/checkout-approvals.md#post-v1-authorize-checkout-approvals) has no assessment: decide it from the console, and its own `authorize.checkout_approval.*` events tell you the outcome.

## 3. Decide from the console

Under **Approvals → Cart approvals**, an order in review shows **Your review**: the rule, when it opened and when it ends, an optional note, and **Approve** and **Reject**. The buttons need the Manage policies permission and record `decided_by: "console"`. A decision from the console updates the assessment at once, and the 409 rule is the same.

## 4. Set how long a review waits

Two account settings, beside the approval expiry default, in **Rules → Orders** or `PUT /v1/account/policies/settings`:

| Setting | Values | Default |
| --- | --- | --- |
| `checkout_review_timeout` | 300 to 604800 seconds (5 minutes to 7 days) | 86400 (24 hours) |
| `checkout_review_at_expiry` | `reject` or `approve` | `reject` |

```text
{ "checkout_review_timeout": 3600, "checkout_review_at_expiry": "reject" }
```

They apply to reviews opened after the change; each review keeps its own `expires_at` and `at_expiry`. At the timeout, `reject` makes the assessment `reject` with `reason: "review_expired"`; `approve` mints the token and makes it `frictionless` with `reason: "review_approved"`. Either sends `authorize.checkout_assessment.updated`. Changing either is on Pro and above, and needs Manage policies and a recent second-factor check in the console. On Free a review waits 24 hours and then rejects.

## 5. When your rules can't run

If the after-approval rules can't be read when the customer approves, the order waits in review (the assessment's `reason: "rules_unavailable"`) rather than going ahead. Decide it as any other.

## Errors you might see

| Symptom | Cause | Fix |
| --- | --- | --- |
| `review_already_decided` (409) | The review was decided already, by your API, the console or the timeout | Read the assessment's `outcome` and `reason`. |
| `review_not_open` (409) | The order isn't in review | Check `challenge.status`; list reviews with `?approval_status=in_review`. |
| `dashboard_session_required` (403) | An API key called the console's route | Use `POST /v1/authorize/checkout_assessments/{id}/review`. |
| `parameter_invalid` (400) on `checkout_review_timeout` | Outside 5 minutes to 7 days | Send seconds between 300 and 604800. |
| `plan_required` (402) on `checkout_review_timeout` or `checkout_review_at_expiry` | Setting them is on Pro and above | Upgrade, or keep the defaults (24 hours, then reject). |

## See also

- [Assess an agent checkout](https://provenanceauth.com/docs/authorize/guides/assess-checkouts.md)
- [Ask your own customer](https://provenanceauth.com/docs/authorize/guides/ask-your-own-customer.md)
- [Webhook events](https://provenanceauth.com/docs/integrate/webhooks.md)
- [Reason codes](https://provenanceauth.com/docs/platform/reason-codes.md)
