# Deals

Agent-to-agent commerce: check who you're paying, accept a seller agent's signed offer under a mandate, record the delivery and confirm it. Provenance holds the proof, never the money.

Related guide: [Buy from agents](https://provenanceauth.com/docs/authorize/guides/buy-from-agents.md)

## Endpoints

- `GET /v1/authorize/agents/{id}/selling`: [Retrieve an agent's selling details](#get-v1-authorize-agents-id-selling)
- `GET /v1/authorize/deals/{id}`: [Retrieve a deal](#get-v1-authorize-deals-id)
- `GET /v1/authorize/deals/{id}/receipt`: [Retrieve a deal receipt](#get-v1-authorize-deals-id-receipt)
- `GET /v1/authorize/settings/commerce`: [Retrieve your confirmation policy](#get-v1-authorize-settings-commerce)
- `GET /v1/authorize/settings/seller_rules`: [Retrieve your seller rules](#get-v1-authorize-settings-seller-rules)
- `PUT /v1/authorize/settings/commerce`: [Update your confirmation policy](#put-v1-authorize-settings-commerce)
- `PUT /v1/authorize/settings/seller_rules`: [Update your seller rules](#put-v1-authorize-settings-seller-rules)
- `GET /v1/authorize/deals`: [List deals](#get-v1-authorize-deals)
- `GET /v1/public/counterparties/check`: [Check who you're paying](#get-v1-public-counterparties-check)
- `POST /v1/authorize/agents/{id}/seller_check`: [Check a seller origin](#post-v1-authorize-agents-id-seller-check)
- `POST /v1/authorize/deals`: [Accept an offer](#post-v1-authorize-deals)
- `POST /v1/authorize/deals/{id}/payment`: [Record a payment reference](#post-v1-authorize-deals-id-payment)
- `POST /v1/authorize/deals/{id}/delivery`: [Record a delivery](#post-v1-authorize-deals-id-delivery)
- `POST /v1/authorize/deals/{id}/confirm`: [Confirm a delivery](#post-v1-authorize-deals-id-confirm)
- `POST /v1/authorize/deals/{id}/cancel`: [Cancel a deal](#post-v1-authorize-deals-id-cancel)
- `POST /v1/authorize/deals/{id}/rating`: [Rate a deal](#post-v1-authorize-deals-id-rating)

## The deal object

### Attributes

| Name | Type | Required | Description |
| --- | --- | --- | --- |
| `object` | enum | no | The type of object. One of `deal`. |
| `id` | string | no | Unique identifier for the object. |
| `status` | enum | no | Where the deal is. One of `pending_approval`, `awaiting_seller`, `accepted`, `delivered`, `completed`, `completed_unconfirmed`, `delivery_mismatch`, `overdue`, `cancelled`, `declined`, `expired`. |
| `reason` | string \| null | no | Why it was declined or expired (a reason code). |
| `role` | enum | no | Your side. One of `buyer`, `seller`, `both`. |
| `counter_offer_id` | string | no | The buyer's side only: the accepted proposal (counter-offer) the deal was opened from. Absent otherwise. |
| `offer_id` | string | no | The seller's offer ID. |
| `offer_hash` | string | no | The sha256 of the offer's canonical payload. |
| `offer` | object | no | The decoded offer payload. |
| `seller` | object | no | The seller agent: agent_id, name, origin, domain_verified. |
| `buyer` | object | no | The buyer agent and the buyer's pairwise subject at this seller (never the person). |
| `total` | number | no | The offer's total. |
| `currency` | string | no | The currency. |
| `deadline` | timestamp | no | The delivery deadline. |
| `confirm_window` | integer | no | Hours the buyer has to confirm a delivery. |
| `offer_expires_at` | timestamp | no | When the offer expires. |
| `requires` | object | no | Who must approve: buyer_person, seller_person. |
| `buyer_approval` | object \| null | no | How the buyer's person approved: method (passkey, device_key, console), tier, approved_at, terms_hash. |
| `seller_approval` | object \| null | no | How the seller's person approved: method, approved_at, role, and approver_name when the seller shows it. |
| `approval` | object \| null | no | The approval waiting now: id, side, status, expires_at. |
| `grant_id` | string \| null | no | The mandate (buyer only). |
| `intent_token` | string \| null | no | The acceptance: an intent token with a `deal` claim (buyer only, once accepted). |
| `token_expires_at` | timestamp \| null | no | When the token expires. |
| `jti` | string | no | The acceptance's jti (the revocation key). |
| `run_id` | string \| null | no | An agent-team run. |
| `purpose` | string \| null | no | Why the agent bought (buyer only). |
| `chain` | enum | no | Agent-team chains aren't checked in this release. One of `not_checked`. |
| `payment` | object \| null | no | The payment reference: rail, reference, recorded_by, recorded_at. |
| `delivery` | object \| null | no | The delivery: content_hash, content_size, parts, delivered_at, on_time. |
| `confirmed_content_hash` | string \| null | no | The hash the buyer confirmed. |
| `cancelled_by` | string \| null | no | Who cancelled: buyer or seller. |
| `timeline` | array of objects | no | Each transition: status, at, by. |
| `replayed` | boolean | no | Present on the first deal returned again for the same offer. |
| `created_at` | timestamp | no | When it was created. |
| `updated_at` | timestamp | no | When it last changed. |
| `accepted_at` | timestamp \| null | no | When it was accepted. |
| `completed_at` | timestamp \| null | no | When it completed. |

### Example

```json
{
  "object": "deal",
  "id": "deal_01M67P48EVJBZY5CPN6WGF8TB3",
  "status": "accepted",
  "reason": null,
  "role": "buyer",
  "offer_id": "ofr_eu_storage_2026q4",
  "offer_hash": "72f6e1e8623486a35cda7ecdd8415506e4dbd96df7c2f3b6da0b490ad4522aa3",
  "offer": {
    "iss": "agt_01M67P48DDK4HRGG0BR457KQJN",
    "offer_id": "ofr_eu_storage_2026q4",
    "items": [
      {
        "sku": "rpt-eu-storage",
        "name": "EU storage market report",
        "quantity": 1,
        "unit": "report",
        "unit_price": 40,
        "description": "20 pages, PDF"
      }
    ],
    "total": 40,
    "currency": "USD",
    "delivery": {
      "kind": "file",
      "format": "application/pdf",
      "deadline": "2026-11-02T00:35:35.506Z"
    },
    "refund_terms": [
      "full_if_late"
    ],
    "terms": {
      "summary": "PDF delivery. A full refund if it arrives late.",
      "url": "https://saltmarsh.example/terms",
      "hash": "b5bb9d8014a0f9b1d61e21e796d78dccdf1352f23cd32812f4850b878ae4944c"
    },
    "seller_confirmation": {
      "offered": "never",
      "response_time": "1bd"
    },
    "kid": "BOc17mSMPyytFjYbgUeoHXOmv9dlSIOgqx_uTW0CYjA",
    "nonce": "GmC11LV_diFWA0uJPwoJPw",
    "iat": 1793406935,
    "exp": 1793493335
  },
  "seller": {
    "agent_id": "agt_01M67P48DDK4HRGG0BR457KQJN",
    "name": "saltmarsh-reports",
    "origin": "https://saltmarsh.example",
    "domain_verified": true
  },
  "buyer": {
    "agent_id": "agt_01M67P48EHM4K5EDYJTMJZVZDP",
    "agent_name": "scout",
    "subject": "psub_plij7qooukmv7swr6uxg2zbz7e"
  },
  "total": 40,
  "currency": "USD",
  "deadline": "2026-11-02T00:35:35.506Z",
  "confirm_window": 72,
  "offer_expires_at": "2026-11-01T00:35:35.000Z",
  "requires": {
    "buyer_person": false,
    "seller_person": false
  },
  "buyer_approval": null,
  "seller_approval": null,
  "approval": null,
  "grant_id": null,
  "intent_token": "eyJhbGciOiJFUzI1NiIsInR5cCI6IkpXVCIsImtpZCI6IjExM2MyMzdjZDdiMjkyZWIifQ.eyJpc3MiOiJwcm92ZW5hbmNlLWF1dGhvcml6ZSIsImp0aSI6Ijg0ZWEzYzE5LWIxZGItNGVjOC1iNzgxLTQ1MTU2M2E4NjFmZCIsInN1YiI6InBzdWJfcGxpajdxb291a212N3N3cjZ1eGcyemJ6N2UiLCJzZXNzaW9uIjoic2Vzc19zY291dF83IiwiYWN0aW9uX2hhc2giOiJiZjNkN2ExOWE0YWEzOGYzMjEzNThiMGVkOTVkM2Y2Y2Y1N2Q4MDRmNmIyMjhiYzk4NjRmYzhlMzAyZTMyMDM2IiwiaGFyZHdhcmVfYXR0ZXN0ZWQiOmZhbHNlLCJiaW9tZXRyaWNfYm91bmQiOmZhbHNlLCJpc3NfYWNjb3VudCI6IjAwMDAwMDAwLTAwMDAtMDAwMC0wMDAwLTAwMDAwMDAwMDBhOSIsImlzc19jYXJyaWVyIjpudWxsLCJpYXQiOjE3OTM0MDY5MzUsImV4cCI6MTc5MzQ5MzMzNSwicGF5bG9hZF9oYXNoIjoiNzJmNmUxZTg2MjM0ODZhMzVjZGE3ZWNkZDg0MTU1MDZlNGRiZDk2ZGY3YzJmM2I2ZGEwYjQ5MGFkNDUyMmFhMyIsImFnZW50Ijp7ImlkIjoiYWd0XzAxTTY3UDQ4RUhNNEs1RURZSlRNSlpWWkRQIiwibmFtZSI6InNjb3V0IiwiaW50ZWdyYXRpb24iOiJub25lIiwic2RrX3ZlcnNpb24iOm51bGx9LCJhdWQiOiJhZ3RfMDFNNjdQNDhEREs0SFJHRzBCUjQ1N0tRSk4iLCJkZWFsIjp7ImlkIjoiZGVhbF8wMU02N1A0OEVWSkJaWTVDUE42V0dGOFRCMyIsIm9mZmVyX2hhc2giOiI3MmY2ZTFlODYyMzQ4NmEzNWNkYTdlY2RkODQxNTUwNmU0ZGJkOTZkZjdjMmYzYjZkYTBiNDkwYWQ0NTIyYWEzIiwic2VsbGVyIjoiYWd0XzAxTTY3UDQ4RERLNEhSR0cwQlI0NTdLUUpOIn19.rYhqxkyu7H_-n7T3t1u6U0b90eoLAWit5YmWKXdTHe7NrcmTaSpdKpXFt13L6lFg3yGxINcfrqZAfo5rlSQgWw",
  "token_expires_at": "2026-11-01T00:35:35.000Z",
  "jti": "84ea3c19-b1db-4ec8-b781-451563a861fd",
  "run_id": null,
  "purpose": "Market sizing for the Q4 plan",
  "chain": "not_checked",
  "payment": null,
  "delivery": null,
  "confirmed_content_hash": null,
  "cancelled_by": null,
  "timeline": [
    {
      "status": "pending_approval",
      "at": "2026-10-31T00:35:35.515Z",
      "by": "buyer"
    },
    {
      "status": "accepted",
      "at": "2026-10-31T00:35:35.530Z",
      "by": "provenance"
    }
  ],
  "created_at": "2026-10-31T00:35:35.515Z",
  "updated_at": "2026-10-31T00:35:35.530Z",
  "accepted_at": "2026-10-31T00:35:35.529Z",
  "completed_at": null,
  "replayed": true
}
```

## Events

Sent to your [webhook endpoints](https://provenanceauth.com/docs/integrate/webhooks.md) when they subscribe:

- `authorize.deal.accepted`
- `authorize.deal.delivered`
- `authorize.deal.completed`
- `authorize.deal.delivery_mismatched`
- `authorize.deal.overdue`
- `authorize.deal.cancelled`
- `authorize.deal.declined`
- `authorize.deal.expired`
- `authorize.deal.change_requested`
- `authorize.agent.seller_check_failed`

## Retrieve an agent's selling details

`GET /v1/authorize/agents/{id}/selling`

Your agent's seller origin and its last check, its signing keys, open deals and tabs, and its track record. `track_record.loop_flagged` is true when most of your account's deals are with one company or a small group, so those deals don't count; only you and Provenance see it.

Auth: an API key, as `Authorization: Bearer <key>`.

### Parameters

| Name | In | Type | Required | Description |
| --- | --- | --- | --- | --- |
| `id` | path | string | yes | The agent's ID. |

### Returns

The agent's selling details.

### Errors

- [`authentication_required`](https://provenanceauth.com/docs/platform/errors.md#authentication_required)
- [`resource_missing`](https://provenanceauth.com/docs/platform/errors.md#resource_missing)
- [`rate_limit_exceeded`](https://provenanceauth.com/docs/platform/errors.md#rate_limit_exceeded)

### Request

**curl**

```bash
export PROVENANCE_KEY=prv_test_acct_P9xN2vQ7bT4mW8sYd3cFjLh6gAe1kR5
curl -s -X POST "$PROVENANCE_API/v1/mandate/agents" \
  -H "Authorization: Bearer $PROVENANCE_KEY" \
  -H "Content-Type: application/json" \
  -d '{ "name": "saltmarsh-reports" }' > step.json
export AGENT_ID=$(jq -r '.id' step.json)
curl -s -X POST "$PROVENANCE_API/v1/identify/agents/$AGENT_ID/signing_keys" \
  -H "Authorization: Bearer $PROVENANCE_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "jwk": {
      "kty": "OKP",
      "crv": "Ed25519",
      "x": "11qYAYKxCrfVS_7TyWQHOg7hcvPapiMlrwIaaPcHURo"
    }
  }' > /dev/null
curl -s -X PATCH "$PROVENANCE_API/v1/mandate/agents/$AGENT_ID" \
  -H "Authorization: Bearer $PROVENANCE_KEY" \
  -H "Content-Type: application/json" \
  -d '{ "selling": true, "seller_origin": "https://saltmarsh.example" }' > /dev/null
curl "$PROVENANCE_API/v1/authorize/agents/$AGENT_ID/selling" \
  -H "Authorization: Bearer $PROVENANCE_KEY"
```

**Node**

```ts
const step1 = await (await fetch(`${process.env.PROVENANCE_API}/v1/mandate/agents`, {
  method: "POST",
  headers: { Authorization: "Bearer prv_test_acct_P9xN2vQ7bT4mW8sYd3cFjLh6gAe1kR5", "Content-Type": "application/json" },
  body: JSON.stringify({ "name": "saltmarsh-reports" }),
})).json();
const agentId = step1.id;
const step2 = await (await fetch(`${process.env.PROVENANCE_API}/v1/identify/agents/${agentId}/signing_keys`, {
  method: "POST",
  headers: { Authorization: "Bearer prv_test_acct_P9xN2vQ7bT4mW8sYd3cFjLh6gAe1kR5", "Content-Type": "application/json" },
  body: JSON.stringify({
    "jwk": {
      "kty": "OKP",
      "crv": "Ed25519",
      "x": "11qYAYKxCrfVS_7TyWQHOg7hcvPapiMlrwIaaPcHURo"
    }
  }),
})).json();
const step3 = await (await fetch(`${process.env.PROVENANCE_API}/v1/mandate/agents/${agentId}`, {
  method: "PATCH",
  headers: { Authorization: "Bearer prv_test_acct_P9xN2vQ7bT4mW8sYd3cFjLh6gAe1kR5", "Content-Type": "application/json" },
  body: JSON.stringify({ "selling": true, "seller_origin": "https://saltmarsh.example" }),
})).json();
const data = await (await fetch(`${process.env.PROVENANCE_API}/v1/authorize/agents/${agentId}/selling`, {
  headers: { Authorization: "Bearer prv_test_acct_P9xN2vQ7bT4mW8sYd3cFjLh6gAe1kR5" },
})).json();
```

**Python**

```python
import os
import httpx

api = os.environ["PROVENANCE_API"]
step1 = httpx.post(f"{api}/v1/mandate/agents", headers={"Authorization": "Bearer prv_test_acct_P9xN2vQ7bT4mW8sYd3cFjLh6gAe1kR5"}, json={
    "name": "saltmarsh-reports"
}).json()
agent_id = step1["id"]
step2 = httpx.post(f"{api}/v1/identify/agents/{agent_id}/signing_keys", headers={"Authorization": "Bearer prv_test_acct_P9xN2vQ7bT4mW8sYd3cFjLh6gAe1kR5"}, json={
    "jwk": {
        "kty": "OKP",
        "crv": "Ed25519",
        "x": "11qYAYKxCrfVS_7TyWQHOg7hcvPapiMlrwIaaPcHURo"
    }
}).json()
step3 = httpx.patch(f"{api}/v1/mandate/agents/{agent_id}", headers={"Authorization": "Bearer prv_test_acct_P9xN2vQ7bT4mW8sYd3cFjLh6gAe1kR5"}, json={
    "selling": True,
    "seller_origin": "https://saltmarsh.example"
}).json()
data = httpx.get(f"{api}/v1/authorize/agents/{agent_id}/selling", headers={"Authorization": "Bearer prv_test_acct_P9xN2vQ7bT4mW8sYd3cFjLh6gAe1kR5"}).json()
```

### Response 200

```json
{
  "object": "agent_selling",
  "agent_id": "agt_01M6VQDEA02B4ZN4ZEC15VE4FV",
  "name": "saltmarsh-reports",
  "selling": true,
  "seller_origin": "https://saltmarsh.example",
  "check": {
    "status": null,
    "checked_at": null,
    "domain_verified": false,
    "well_known_url": "https://saltmarsh.example/.well-known/provenance-agent.json",
    "expected": {
      "agents": [
        {
          "id": "agt_01M6VQDEA02B4ZN4ZEC15VE4FV",
          "kids": [
            "kPrK_qmxVWaYVA9wwBF6Iuo3vVzz7TxHCTwXBygrS4k"
          ]
        }
      ]
    }
  },
  "keys": [
    {
      "kid": "kPrK_qmxVWaYVA9wwBF6Iuo3vVzz7TxHCTwXBygrS4k",
      "status": "active",
      "created_at": "2026-11-07T19:22:53.632Z"
    }
  ],
  "track_record": {
    "deals_completed_count": 0,
    "on_time_rate": null,
    "delivery_mismatch_rate": null,
    "cancel_rate": null,
    "buyer_companies_count": 0,
    "tab_usage_contest_rate": null,
    "rating": null,
    "rating_count": 0,
    "dispute_rate": null,
    "disputes_seller_favored_rate": null,
    "has_record": false,
    "loop_flagged": false
  },
  "deals": {
    "open": 0,
    "total": 0
  },
  "tabs": {
    "open": 0,
    "total": 0
  }
}
```

## Retrieve a deal

`GET /v1/authorize/deals/{id}`

One deal, readable by the buyer's and the seller's account. The seller sees the buyer agent and a pairwise subject, never the person, the mandate or the token.

Auth: an API key, as `Authorization: Bearer <key>`.

### Parameters

| Name | In | Type | Required | Description |
| --- | --- | --- | --- | --- |
| `id` | path | string | yes | The deal's ID. |

### Returns

The deal. See [the deal object](#object).

### Errors

- [`authentication_required`](https://provenanceauth.com/docs/platform/errors.md#authentication_required)
- [`resource_missing`](https://provenanceauth.com/docs/platform/errors.md#resource_missing)
- [`rate_limit_exceeded`](https://provenanceauth.com/docs/platform/errors.md#rate_limit_exceeded)

### Request

**curl**

```bash
export PROVENANCE_KEY=prv_test_acct_P9xN2vQ7bT4mW8sYd3cFjLh6gAe1kR5
curl "$PROVENANCE_API/v1/authorize/deals/deal_01M67P48EVJBZY5CPN6WGF8TB3" \
  -H "Authorization: Bearer $PROVENANCE_KEY"
```

**Node**

```ts
const data = await (await fetch(`${process.env.PROVENANCE_API}/v1/authorize/deals/deal_01M67P48EVJBZY5CPN6WGF8TB3`, {
  headers: { Authorization: "Bearer prv_test_acct_P9xN2vQ7bT4mW8sYd3cFjLh6gAe1kR5" },
})).json();
```

**Python**

```python
import os
import httpx

api = os.environ["PROVENANCE_API"]
data = httpx.get(f"{api}/v1/authorize/deals/deal_01M67P48EVJBZY5CPN6WGF8TB3", headers={"Authorization": "Bearer prv_test_acct_P9xN2vQ7bT4mW8sYd3cFjLh6gAe1kR5"}).json()
```

### Response 200

```json
{
  "object": "deal",
  "id": "deal_01M67P48EVJBZY5CPN6WGF8TB3",
  "status": "accepted",
  "reason": null,
  "role": "seller",
  "offer_id": "ofr_eu_storage_2026q4",
  "offer_hash": "72f6e1e8623486a35cda7ecdd8415506e4dbd96df7c2f3b6da0b490ad4522aa3",
  "offer": {
    "iss": "agt_01M67P48DDK4HRGG0BR457KQJN",
    "offer_id": "ofr_eu_storage_2026q4",
    "items": [
      {
        "sku": "rpt-eu-storage",
        "name": "EU storage market report",
        "quantity": 1,
        "unit": "report",
        "unit_price": 40,
        "description": "20 pages, PDF"
      }
    ],
    "total": 40,
    "currency": "USD",
    "delivery": {
      "kind": "file",
      "format": "application/pdf",
      "deadline": "2026-11-02T00:35:35.506Z"
    },
    "refund_terms": [
      "full_if_late"
    ],
    "terms": {
      "summary": "PDF delivery. A full refund if it arrives late.",
      "url": "https://saltmarsh.example/terms",
      "hash": "b5bb9d8014a0f9b1d61e21e796d78dccdf1352f23cd32812f4850b878ae4944c"
    },
    "seller_confirmation": {
      "offered": "never",
      "response_time": "1bd"
    },
    "kid": "BOc17mSMPyytFjYbgUeoHXOmv9dlSIOgqx_uTW0CYjA",
    "nonce": "GmC11LV_diFWA0uJPwoJPw",
    "iat": 1793406935,
    "exp": 1793493335
  },
  "seller": {
    "agent_id": "agt_01M67P48DDK4HRGG0BR457KQJN",
    "name": "saltmarsh-reports",
    "origin": "https://saltmarsh.example",
    "domain_verified": true
  },
  "buyer": {
    "agent_id": "agt_01M67P48EHM4K5EDYJTMJZVZDP",
    "agent_name": "scout",
    "subject": "psub_plij7qooukmv7swr6uxg2zbz7e"
  },
  "total": 40,
  "currency": "USD",
  "deadline": "2026-11-02T00:35:35.506Z",
  "confirm_window": 72,
  "offer_expires_at": "2026-11-01T00:35:35.000Z",
  "requires": {
    "buyer_person": false,
    "seller_person": false
  },
  "buyer_approval": null,
  "seller_approval": null,
  "approval": null,
  "jti": "84ea3c19-b1db-4ec8-b781-451563a861fd",
  "run_id": null,
  "purpose": null,
  "chain": "not_checked",
  "payment": null,
  "delivery": null,
  "confirmed_content_hash": null,
  "cancelled_by": null,
  "timeline": [
    {
      "status": "pending_approval",
      "at": "2026-10-31T00:35:35.515Z",
      "by": "buyer"
    },
    {
      "status": "accepted",
      "at": "2026-10-31T00:35:35.530Z",
      "by": "provenance"
    }
  ],
  "created_at": "2026-10-31T00:35:35.515Z",
  "updated_at": "2026-10-31T00:35:35.530Z",
  "accepted_at": "2026-10-31T00:35:35.529Z",
  "completed_at": null
}
```

## Retrieve a deal receipt

`GET /v1/authorize/deals/{id}/receipt`

The signed receipt for the deal's current state, verifiable offline against the JWKS: the offer hash, the acceptance's jti, how each person approved (method and tier, never who), the payment reference and the delivered content hash. Free.

Auth: an API key, as `Authorization: Bearer <key>`.

### Parameters

| Name | In | Type | Required | Description |
| --- | --- | --- | --- | --- |
| `id` | path | string | yes | The deal's ID. |

### Returns

The receipt.

### Errors

- [`authentication_required`](https://provenanceauth.com/docs/platform/errors.md#authentication_required)
- [`resource_missing`](https://provenanceauth.com/docs/platform/errors.md#resource_missing)
- [`deal_state_invalid`](https://provenanceauth.com/docs/platform/errors.md#deal_state_invalid)
- [`rate_limit_exceeded`](https://provenanceauth.com/docs/platform/errors.md#rate_limit_exceeded)

### Request

**curl**

```bash
export PROVENANCE_KEY=prv_test_acct_P9xN2vQ7bT4mW8sYd3cFjLh6gAe1kR5
curl "$PROVENANCE_API/v1/authorize/deals/deal_01M67P48EVJBZY5CPN6WGF8TB3/receipt" \
  -H "Authorization: Bearer $PROVENANCE_KEY"
```

**Node**

```ts
const data = await (await fetch(`${process.env.PROVENANCE_API}/v1/authorize/deals/deal_01M67P48EVJBZY5CPN6WGF8TB3/receipt`, {
  headers: { Authorization: "Bearer prv_test_acct_P9xN2vQ7bT4mW8sYd3cFjLh6gAe1kR5" },
})).json();
```

**Python**

```python
import os
import httpx

api = os.environ["PROVENANCE_API"]
data = httpx.get(f"{api}/v1/authorize/deals/deal_01M67P48EVJBZY5CPN6WGF8TB3/receipt", headers={"Authorization": "Bearer prv_test_acct_P9xN2vQ7bT4mW8sYd3cFjLh6gAe1kR5"}).json()
```

### Response 200

```json
{
  "object": "receipt",
  "id": "rcpt_baf4c452a56afa889a5651934c696a89",
  "claims": {
    "receipt_id": "rcpt_baf4c452a56afa889a5651934c696a89",
    "type": "deal",
    "deal_id": "deal_01M67P48EVJBZY5CPN6WGF8TB3",
    "status": "completed",
    "offer_id": "ofr_eu_storage_2026q4",
    "offer_hash": "72f6e1e8623486a35cda7ecdd8415506e4dbd96df7c2f3b6da0b490ad4522aa3",
    "seller_agent_id": "agt_01M67P48DDK4HRGG0BR457KQJN",
    "buyer_agent_id": "agt_01M67P48EHM4K5EDYJTMJZVZDP",
    "buyer_subject": "psub_plij7qooukmv7swr6uxg2zbz7e",
    "total": 40,
    "currency": "USD",
    "deadline": "2026-11-02T00:35:35.506Z",
    "acceptance_jti": "84ea3c19-b1db-4ec8-b781-451563a861fd",
    "accepted_at": "2026-10-31T00:35:35.529Z",
    "buyer_approval": null,
    "seller_approval": null,
    "payment": {
      "rail": "x402",
      "reference": "0x9f2c41d0b7e3"
    },
    "delivery": {
      "content_hash": "2138e20f2c6de32409659c519601a485e21fe056a5e3d6c019f075e4203ce608",
      "content_size": 482113,
      "delivered_at": "2026-10-31T00:35:35.542Z",
      "on_time": true
    },
    "confirmed_content_hash": "2138e20f2c6de32409659c519601a485e21fe056a5e3d6c019f075e4203ce608",
    "complet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
```

## Retrieve your confirmation policy

`GET /v1/authorize/settings/commerce`

When a person on your team confirms an agent's purchase from your agents (Settings → Store → Selling → Confirmations), how many approvers you have, and the measured median response time.

Auth: an API key, as `Authorization: Bearer <key>`.

### Parameters

No parameters.

### Returns

The settings.

### Errors

- [`authentication_required`](https://provenanceauth.com/docs/platform/errors.md#authentication_required)
- [`rate_limit_exceeded`](https://provenanceauth.com/docs/platform/errors.md#rate_limit_exceeded)

### Request

**curl**

```bash
export PROVENANCE_KEY=prv_test_acct_P9xN2vQ7bT4mW8sYd3cFjLh6gAe1kR5
curl "$PROVENANCE_API/v1/authorize/settings/commerce" \
  -H "Authorization: Bearer $PROVENANCE_KEY"
```

**Node**

```ts
const data = await (await fetch(`${process.env.PROVENANCE_API}/v1/authorize/settings/commerce`, {
  headers: { Authorization: "Bearer prv_test_acct_P9xN2vQ7bT4mW8sYd3cFjLh6gAe1kR5" },
})).json();
```

**Python**

```python
import os
import httpx

api = os.environ["PROVENANCE_API"]
data = httpx.get(f"{api}/v1/authorize/settings/commerce", headers={"Authorization": "Bearer prv_test_acct_P9xN2vQ7bT4mW8sYd3cFjLh6gAe1kR5"}).json()
```

### Response 200

```json
{
  "object": "commerce_settings",
  "seller_confirmation": {
    "offered": "never",
    "response_time": "1bd"
  },
  "show_approver_name": false,
  "show_buyer_record": {
    "mode": "never",
    "below_rating": 4
  },
  "approvers_count": 0,
  "confirmation_response_median_s": null,
  "updated_at": null
}
```

## Retrieve your seller rules

`GET /v1/authorize/settings/seller_rules`

The five templates for buying from other agents (Settings → Seller rules), read back from your Authorize policy, and "Ask sellers to confirm when they offer it". Before the first save the templates show their suggested values and nothing applies.

Auth: an API key, as `Authorization: Bearer <key>`.

### Parameters

No parameters.

### Returns

The seller rules.

### Errors

- [`authentication_required`](https://provenanceauth.com/docs/platform/errors.md#authentication_required)
- [`rate_limit_exceeded`](https://provenanceauth.com/docs/platform/errors.md#rate_limit_exceeded)

### Request

**curl**

```bash
export PROVENANCE_KEY=prv_test_acct_P9xN2vQ7bT4mW8sYd3cFjLh6gAe1kR5
curl "$PROVENANCE_API/v1/authorize/settings/seller_rules" \
  -H "Authorization: Bearer $PROVENANCE_KEY"
```

**Node**

```ts
const data = await (await fetch(`${process.env.PROVENANCE_API}/v1/authorize/settings/seller_rules`, {
  headers: { Authorization: "Bearer prv_test_acct_P9xN2vQ7bT4mW8sYd3cFjLh6gAe1kR5" },
})).json();
```

**Python**

```python
import os
import httpx

api = os.environ["PROVENANCE_API"]
data = httpx.get(f"{api}/v1/authorize/settings/seller_rules", headers={"Authorization": "Bearer prv_test_acct_P9xN2vQ7bT4mW8sYd3cFjLh6gAe1kR5"}).json()
```

### Response 200

```json
{
  "object": "seller_rules",
  "saved": false,
  "templates": {
    "new_sellers": {
      "enabled": true,
      "value": 50
    },
    "low_rating": {
      "enabled": true,
      "value": 4.5
    },
    "low_on_time": {
      "enabled": false,
      "value": 95
    },
    "high_disputes": {
      "enabled": true,
      "value": 2
    },
    "above_amount": {
      "enabled": true,
      "value": 1000
    },
    "risk_flagged": {
      "enabled": false,
      "value": 3
    }
  },
  "ask_seller_confirm": {
    "enabled": false,
    "min_amount": 1000,
    "if_not_offered": "proceed"
  },
  "policy_version": null
}
```

## Update your confirmation policy

`PUT /v1/authorize/settings/commerce`

Owner or admin. Every offer your agents sign must publish exactly this policy in `seller_confirmation`; an offer that differs is refused at acceptance.

Auth: an API key, as `Authorization: Bearer <key>`.

### Parameters

| Name | In | Type | Required | Description |
| --- | --- | --- | --- | --- |
| `seller_confirmation` | body | object | no | A seller's confirmation policy, published in every offer it signs and in the counterparty check. |
| `seller_confirmation.offered` | body | enum | yes | Never, when the buyer asks (on orders it covers), or always. One of `never`, `on_request`, `always`. |
| `seller_confirmation.min_amount` | body | number | no | With on_request: orders at or over this amount. |
| `seller_confirmation.items` | body | array of strings | no | With on_request: or orders with one of these SKUs or categories, at any amount. |
| `seller_confirmation.response_time` | body | enum | yes | The stated response time. One of `1h`, `4bh`, `1bd`, `2bd`. |
| `show_approver_name` | body | boolean | no | Show the buyer your approver's name (the role always shows). |
| `show_buyer_record` | body | object | no | Show the buyer's record on your confirmation page. It's always in Details. |
| `show_buyer_record.mode` | body | enum | no | Never (the default), when the buyer is new or rated under below_rating, or always. One of `never`, `new_or_low`, `always`. |
| `show_buyer_record.below_rating` | body | number | no | With new_or_low: the rating under which it shows (default 4). |

### Returns

The settings.

### Errors

- [`parameter_invalid`](https://provenanceauth.com/docs/platform/errors.md#parameter_invalid)
- [`authentication_required`](https://provenanceauth.com/docs/platform/errors.md#authentication_required)
- [`insufficient_role`](https://provenanceauth.com/docs/platform/errors.md#insufficient_role)
- [`rate_limit_exceeded`](https://provenanceauth.com/docs/platform/errors.md#rate_limit_exceeded)

### Request

**curl**

```bash
export PROVENANCE_KEY=prv_test_acct_P9xN2vQ7bT4mW8sYd3cFjLh6gAe1kR5
curl -X PUT "$PROVENANCE_API/v1/authorize/settings/commerce" \
  -H "Authorization: Bearer $PROVENANCE_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "seller_confirmation": {
      "offered": "on_request",
      "min_amount": 500,
      "response_time": "4bh"
    },
    "show_approver_name": false
  }'
curl -s -X PUT "$PROVENANCE_API/v1/authorize/settings/commerce" \
  -H "Authorization: Bearer $PROVENANCE_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "seller_confirmation": {
      "offered": "never",
      "response_time": "1bd"
    }
  }' > /dev/null
```

**Node**

```ts
const data = await (await fetch(`${process.env.PROVENANCE_API}/v1/authorize/settings/commerce`, {
  method: "PUT",
  headers: { Authorization: "Bearer prv_test_acct_P9xN2vQ7bT4mW8sYd3cFjLh6gAe1kR5", "Content-Type": "application/json" },
  body: JSON.stringify({
    "seller_confirmation": {
      "offered": "on_request",
      "min_amount": 500,
      "response_time": "4bh"
    },
    "show_approver_name": false
  }),
})).json();
```

**Python**

```python
import os
import httpx

api = os.environ["PROVENANCE_API"]
data = httpx.put(f"{api}/v1/authorize/settings/commerce", headers={"Authorization": "Bearer prv_test_acct_P9xN2vQ7bT4mW8sYd3cFjLh6gAe1kR5"}, json={
    "seller_confirmation": {
        "offered": "on_request",
        "min_amount": 500,
        "response_time": "4bh"
    },
    "show_approver_name": False
}).json()
```

### Response 200

```json
{
  "object": "commerce_settings",
  "seller_confirmation": {
    "offered": "on_request",
    "min_amount": 500,
    "response_time": "4bh"
  },
  "show_approver_name": false,
  "show_buyer_record": {
    "mode": "never",
    "below_rating": 4
  },
  "approvers_count": 0,
  "confirmation_response_median_s": null,
  "updated_at": "2026-11-07T19:22:53.649Z"
}
```

## Update your seller rules

`PUT /v1/authorize/settings/seller_rules`

Owner or admin. `templates` saves a new version of your Authorize policy: the enabled templates as rules with the fixed ids `rul_default_seller_<template>` first, every other rule after them. `ask_seller_confirm` sets the buyer rule and what happens when a seller doesn't confirm an order.

Auth: an API key, as `Authorization: Bearer <key>`.

### Parameters

| Name | In | Type | Required | Description |
| --- | --- | --- | --- | --- |
| `templates` | body | object | no | Any of new_sellers, low_rating, low_on_time, high_disputes, above_amount: { enabled, value }. |
| `ask_seller_confirm` | body | object \| null | no | The buyer rule. |
| `ask_seller_confirm.enabled` | body | boolean | no | Whether it's on. |
| `ask_seller_confirm.min_amount` | body | number | no | On orders at or over this amount. |
| `ask_seller_confirm.if_not_offered` | body | enum | no | When the seller doesn't confirm the order: buy anyway, ask your person, or don't buy. One of `proceed`, `ask_person`, `deny`. |

### Returns

The seller rules.

### Errors

- [`parameter_invalid`](https://provenanceauth.com/docs/platform/errors.md#parameter_invalid)
- [`authentication_required`](https://provenanceauth.com/docs/platform/errors.md#authentication_required)
- [`insufficient_role`](https://provenanceauth.com/docs/platform/errors.md#insufficient_role)
- [`rate_limit_exceeded`](https://provenanceauth.com/docs/platform/errors.md#rate_limit_exceeded)

### Request

**curl**

```bash
export PROVENANCE_KEY=prv_test_acct_P9xN2vQ7bT4mW8sYd3cFjLh6gAe1kR5
curl -X PUT "$PROVENANCE_API/v1/authorize/settings/seller_rules" \
  -H "Authorization: Bearer $PROVENANCE_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "ask_seller_confirm": {
      "enabled": true,
      "min_amount": 1000,
      "if_not_offered": "ask_person"
    }
  }'
curl -s -X PUT "$PROVENANCE_API/v1/authorize/settings/seller_rules" \
  -H "Authorization: Bearer $PROVENANCE_KEY" \
  -H "Content-Type: application/json" \
  -d '{ "ask_seller_confirm": null }' > /dev/null
```

**Node**

```ts
const data = await (await fetch(`${process.env.PROVENANCE_API}/v1/authorize/settings/seller_rules`, {
  method: "PUT",
  headers: { Authorization: "Bearer prv_test_acct_P9xN2vQ7bT4mW8sYd3cFjLh6gAe1kR5", "Content-Type": "application/json" },
  body: JSON.stringify({
    "ask_seller_confirm": {
      "enabled": true,
      "min_amount": 1000,
      "if_not_offered": "ask_person"
    }
  }),
})).json();
```

**Python**

```python
import os
import httpx

api = os.environ["PROVENANCE_API"]
data = httpx.put(f"{api}/v1/authorize/settings/seller_rules", headers={"Authorization": "Bearer prv_test_acct_P9xN2vQ7bT4mW8sYd3cFjLh6gAe1kR5"}, json={
    "ask_seller_confirm": {
        "enabled": True,
        "min_amount": 1000,
        "if_not_offered": "ask_person"
    }
}).json()
```

### Response 200

```json
{
  "object": "seller_rules",
  "saved": false,
  "templates": {
    "new_sellers": {
      "enabled": true,
      "value": 50
    },
    "low_rating": {
      "enabled": true,
      "value": 4.5
    },
    "low_on_time": {
      "enabled": false,
      "value": 95
    },
    "high_disputes": {
      "enabled": true,
      "value": 2
    },
    "above_amount": {
      "enabled": true,
      "value": 1000
    },
    "risk_flagged": {
      "enabled": false,
      "value": 3
    }
  },
  "ask_seller_confirm": {
    "enabled": true,
    "min_amount": 1000,
    "if_not_offered": "ask_person"
  },
  "policy_version": null
}
```

## List deals

`GET /v1/authorize/deals`

Deals where your account is the buyer, the seller, or either, newest first.

Auth: an API key, as `Authorization: Bearer <key>`.

### Parameters

| Name | In | Type | Required | Description |
| --- | --- | --- | --- | --- |
| `role` | query | enum | no | Which side. Default any. One of `buyer`, `seller`, `any`. |
| `status` | query | array of enums | no | Only deals in these statuses. One value, or several separated by commas. |
| `q` | query | string | no | Search text. Matches when the deal's ID, the offer's ID, either agent's ID or name, the seller's origin, the buyer's subject or the purpose contains it, ignoring case. At most 200 characters. |
| `limit` | query | integer | no | Page size, 1–100 (default 20). Outside the range → 400 parameter_invalid. |
| `cursor` | query | string | no | Opaque; pass a response's `next_cursor` back to get the next page. |

### Returns

A page of deals.

### Errors

- [`parameter_invalid`](https://provenanceauth.com/docs/platform/errors.md#parameter_invalid)
- [`authentication_required`](https://provenanceauth.com/docs/platform/errors.md#authentication_required)
- [`rate_limit_exceeded`](https://provenanceauth.com/docs/platform/errors.md#rate_limit_exceeded)

### Request

**curl**

```bash
export PROVENANCE_KEY=prv_test_acct_P9xN2vQ7bT4mW8sYd3cFjLh6gAe1kR5
curl "$PROVENANCE_API/v1/authorize/deals?role=buyer" \
  -H "Authorization: Bearer $PROVENANCE_KEY"
```

**Node**

```ts
const data = await (await fetch(`${process.env.PROVENANCE_API}/v1/authorize/deals?role=buyer`, {
  headers: { Authorization: "Bearer prv_test_acct_P9xN2vQ7bT4mW8sYd3cFjLh6gAe1kR5" },
})).json();
```

**Python**

```python
import os
import httpx

api = os.environ["PROVENANCE_API"]
data = httpx.get(f"{api}/v1/authorize/deals?role=buyer", headers={"Authorization": "Bearer prv_test_acct_P9xN2vQ7bT4mW8sYd3cFjLh6gAe1kR5"}).json()
```

### Response 200

```json
{
  "object": "list",
  "data": [],
  "has_more": false,
  "next_cursor": null
}
```

## Check who you're paying

`GET /v1/public/counterparties/check`

Before an agent pays another agent: the seller agent, whether its origin's well-known file lists it (`domain_verified`), its key status, its track record as a seller and its confirmation policy beside the measured median response time. Pass `kid` (an offer's key), or `agent_id` and `origin`. No API key needed; 60 a minute per IP.

Auth: none. No API key needed.

### Parameters

| Name | In | Type | Required | Description |
| --- | --- | --- | --- | --- |
| `kid` | query | string | no | The seller key's JWK thumbprint (an offer's `kid`). |
| `agent_id` | query | string | no | The seller agent's ID (with `origin`). |
| `origin` | query | string | no | The origin the seller claims (with `agent_id`). |

### Returns

The counterparty.

### Errors

- [`parameter_invalid`](https://provenanceauth.com/docs/platform/errors.md#parameter_invalid)
- [`rate_limit_exceeded`](https://provenanceauth.com/docs/platform/errors.md#rate_limit_exceeded)

### Request

**curl**

```bash
curl -s -X POST "$PROVENANCE_API/v1/mandate/agents" \
  -H "Authorization: Bearer prv_test_acct_P9xN2vQ7bT4mW8sYd3cFjLh6gAe1kR5" \
  -H "Content-Type: application/json" \
  -d '{ "name": "saltmarsh-reports" }' > step.json
export AGENT_ID=$(jq -r '.id' step.json)
curl "$PROVENANCE_API/v1/public/counterparties/check?agent_id=$AGENT_ID&origin=https%3A%2F%2Fsaltmarsh.example"
```

**Node**

```ts
const step1 = await (await fetch(`${process.env.PROVENANCE_API}/v1/mandate/agents`, {
  method: "POST",
  headers: { Authorization: "Bearer prv_test_acct_P9xN2vQ7bT4mW8sYd3cFjLh6gAe1kR5", "Content-Type": "application/json" },
  body: JSON.stringify({ "name": "saltmarsh-reports" }),
})).json();
const agentId = step1.id;
const data = await (await fetch(`${process.env.PROVENANCE_API}/v1/public/counterparties/check?agent_id=${agentId}&origin=https%3A%2F%2Fsaltmarsh.example`)).json();
```

**Python**

```python
import os
import httpx

api = os.environ["PROVENANCE_API"]
step1 = httpx.post(f"{api}/v1/mandate/agents", headers={"Authorization": "Bearer prv_test_acct_P9xN2vQ7bT4mW8sYd3cFjLh6gAe1kR5"}, json={
    "name": "saltmarsh-reports"
}).json()
agent_id = step1["id"]
data = httpx.get(f"{api}/v1/public/counterparties/check?agent_id={agent_id}&origin=https%3A%2F%2Fsaltmarsh.example").json()
```

### Response 200

```json
{
  "object": "counterparty",
  "agent": {
    "id": "agt_01M6VQDE9V9NJ2VFV4J2CPVPQF",
    "name": "saltmarsh-reports"
  },
  "origin": "https://saltmarsh.example",
  "domain_verified": false,
  "key_status": "unknown",
  "track_record": null
}
```

## Check a seller origin

`POST /v1/authorize/agents/{id}/seller_check`

Fetches `/.well-known/provenance-agent.json` from the agent's `seller_origin` now (https, public addresses only, no redirects, 5 s, 16 KB) and records the result. The file must list the agent and one of its active key ids. A failed check clears `domain_verified` and sends `authorize.agent.seller_check_failed`; the check also runs daily. Once a minute per agent.

Auth: an API key, as `Authorization: Bearer <key>`.

### Parameters

| Name | In | Type | Required | Description |
| --- | --- | --- | --- | --- |
| `id` | path | string | yes | The agent's ID. |

### Returns

The check.

### Errors

- [`parameter_invalid`](https://provenanceauth.com/docs/platform/errors.md#parameter_invalid)
- [`authentication_required`](https://provenanceauth.com/docs/platform/errors.md#authentication_required)
- [`resource_missing`](https://provenanceauth.com/docs/platform/errors.md#resource_missing)
- [`rate_limit_exceeded`](https://provenanceauth.com/docs/platform/errors.md#rate_limit_exceeded)

### Request

**curl**

```bash
export PROVENANCE_KEY=prv_test_acct_P9xN2vQ7bT4mW8sYd3cFjLh6gAe1kR5
curl -s -X POST "$PROVENANCE_API/v1/mandate/agents" \
  -H "Authorization: Bearer $PROVENANCE_KEY" \
  -H "Content-Type: application/json" \
  -d '{ "name": "saltmarsh-reports" }' > step.json
export AGENT_ID=$(jq -r '.id' step.json)
curl -s -X POST "$PROVENANCE_API/v1/identify/agents/$AGENT_ID/signing_keys" \
  -H "Authorization: Bearer $PROVENANCE_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "jwk": {
      "kty": "OKP",
      "crv": "Ed25519",
      "x": "11qYAYKxCrfVS_7TyWQHOg7hcvPapiMlrwIaaPcHURo"
    }
  }' > /dev/null
curl -s -X PATCH "$PROVENANCE_API/v1/mandate/agents/$AGENT_ID" \
  -H "Authorization: Bearer $PROVENANCE_KEY" \
  -H "Content-Type: application/json" \
  -d '{ "selling": true, "seller_origin": "https://saltmarsh.example" }' > /dev/null
curl -X POST "$PROVENANCE_API/v1/authorize/agents/$AGENT_ID/seller_check" \
  -H "Authorization: Bearer $PROVENANCE_KEY"
```

**Node**

```ts
const step1 = await (await fetch(`${process.env.PROVENANCE_API}/v1/mandate/agents`, {
  method: "POST",
  headers: { Authorization: "Bearer prv_test_acct_P9xN2vQ7bT4mW8sYd3cFjLh6gAe1kR5", "Content-Type": "application/json" },
  body: JSON.stringify({ "name": "saltmarsh-reports" }),
})).json();
const agentId = step1.id;
const step2 = await (await fetch(`${process.env.PROVENANCE_API}/v1/identify/agents/${agentId}/signing_keys`, {
  method: "POST",
  headers: { Authorization: "Bearer prv_test_acct_P9xN2vQ7bT4mW8sYd3cFjLh6gAe1kR5", "Content-Type": "application/json" },
  body: JSON.stringify({
    "jwk": {
      "kty": "OKP",
      "crv": "Ed25519",
      "x": "11qYAYKxCrfVS_7TyWQHOg7hcvPapiMlrwIaaPcHURo"
    }
  }),
})).json();
const step3 = await (await fetch(`${process.env.PROVENANCE_API}/v1/mandate/agents/${agentId}`, {
  method: "PATCH",
  headers: { Authorization: "Bearer prv_test_acct_P9xN2vQ7bT4mW8sYd3cFjLh6gAe1kR5", "Content-Type": "application/json" },
  body: JSON.stringify({ "selling": true, "seller_origin": "https://saltmarsh.example" }),
})).json();
const data = await (await fetch(`${process.env.PROVENANCE_API}/v1/authorize/agents/${agentId}/seller_check`, {
  method: "POST",
  headers: { Authorization: "Bearer prv_test_acct_P9xN2vQ7bT4mW8sYd3cFjLh6gAe1kR5" },
})).json();
```

**Python**

```python
import os
import httpx

api = os.environ["PROVENANCE_API"]
step1 = httpx.post(f"{api}/v1/mandate/agents", headers={"Authorization": "Bearer prv_test_acct_P9xN2vQ7bT4mW8sYd3cFjLh6gAe1kR5"}, json={
    "name": "saltmarsh-reports"
}).json()
agent_id = step1["id"]
step2 = httpx.post(f"{api}/v1/identify/agents/{agent_id}/signing_keys", headers={"Authorization": "Bearer prv_test_acct_P9xN2vQ7bT4mW8sYd3cFjLh6gAe1kR5"}, json={
    "jwk": {
        "kty": "OKP",
        "crv": "Ed25519",
        "x": "11qYAYKxCrfVS_7TyWQHOg7hcvPapiMlrwIaaPcHURo"
    }
}).json()
step3 = httpx.patch(f"{api}/v1/mandate/agents/{agent_id}", headers={"Authorization": "Bearer prv_test_acct_P9xN2vQ7bT4mW8sYd3cFjLh6gAe1kR5"}, json={
    "selling": True,
    "seller_origin": "https://saltmarsh.example"
}).json()
data = httpx.post(f"{api}/v1/authorize/agents/{agent_id}/seller_check", headers={"Authorization": "Bearer prv_test_acct_P9xN2vQ7bT4mW8sYd3cFjLh6gAe1kR5"}).json()
```

### Response 200

```json
{
  "object": "seller_check",
  "agent_id": "agt_01M6VQDE9WJR59QA2KGAJEFSFB",
  "origin": "https://saltmarsh.example",
  "status": "unreachable",
  "domain_verified": false,
  "checked_at": "2026-11-07T19:22:53.630Z",
  "well_known_url": "https://saltmarsh.example/.well-known/provenance-agent.json",
  "expected": {
    "agents": [
      {
        "id": "agt_01M6VQDE9WJR59QA2KGAJEFSFB",
        "kids": [
          "kPrK_qmxVWaYVA9wwBF6Iuo3vVzz7TxHCTwXBygrS4k"
        ]
      }
    ]
  }
}
```

## Accept an offer

`POST /v1/authorize/deals`

Accepts a seller agent's signed offer through the ordinary authorize path (`deal.accept`, the seller as the counterparty, the total as the amount): your mandate, budget and policy apply unchanged. Once everyone required has approved, the deal is `accepted` with `intent_token`, which the seller checks offline. The same offer again returns the first deal. Free.

Auth: an API key, as `Authorization: Bearer <key>`.

### Parameters

| Name | In | Type | Required | Description |
| --- | --- | --- | --- | --- |
| `DPoP` | header | string | no | A DPoP proof (RFC 9449) from the grant's holder key, when the grant is holder-bound (`holder_jkt`): an ES256 `dpop+jwt` naming this request (`htm`, `htu`), `iat` within 60 seconds, a fresh `jti`, and `ath`, the SHA-256 of the grant token sent. One per request. See [bind a grant to its holder](https://provenanceauth.com/docs/mandate/guides/bind-a-grant-to-its-holder.md). |
| `offer` | body | string | yes | The seller's signed offer: a compact JWS (`offer+jwt`, EdDSA), at most 8 KB. |
| `agent_session_id` | body | string | yes | Your agent's session. |
| `agent_id` | body | string | no | Your registered agent. Required when the offer has an `aud`. |
| `mandate_token` | body | string | no | A delegation mandate token to accept under. |
| `grant_id` | body | string | no | Or the mandate's ID. A holder-bound grant needs its holder's DPoP proof either way. |
| `run_id` | body | string | no | An agent-team run, stored with the deal. |
| `purpose` | body | string | no | Why the agent is buying, shown in the approval's Details. |
| `require_seller_person` | body | boolean | no | Ask a person at the seller to confirm before the deal is accepted. Refused with `seller_confirmation_not_offered` when the seller's policy doesn't cover this order. |
| `counter_offer_id` | body | string | no | the accepted counter-offer this offer answers. The offer's hash must be the acceptance's `offer_hash` and the deal must be under the counter-offer's grant (`grant_id` or `mandate_token`); otherwise 409 `counter_offer_terms_changed` and no deal. A person's yes on it is the deal's step-up (no second ask, no second confirmation billed); the deal's verify uses the acceptance once. |

### Returns

The first deal for this offer (`replayed`). See [the deal object](#object).

### Errors

- [`parameter_missing`](https://provenanceauth.com/docs/platform/errors.md#parameter_missing)
- [`parameter_invalid`](https://provenanceauth.com/docs/platform/errors.md#parameter_invalid)
- [`offer_invalid`](https://provenanceauth.com/docs/platform/errors.md#offer_invalid)
- [`offer_expired`](https://provenanceauth.com/docs/platform/errors.md#offer_expired)
- [`offer_seller_unknown`](https://provenanceauth.com/docs/platform/errors.md#offer_seller_unknown)
- [`offer_key_revoked`](https://provenanceauth.com/docs/platform/errors.md#offer_key_revoked)
- [`deal_person_required`](https://provenanceauth.com/docs/platform/errors.md#deal_person_required)
- [`seller_confirmation_not_offered`](https://provenanceauth.com/docs/platform/errors.md#seller_confirmation_not_offered)
- [`grant_invalid`](https://provenanceauth.com/docs/platform/errors.md#grant_invalid)
- [`agent_suspended`](https://provenanceauth.com/docs/platform/errors.md#agent_suspended)
- [`authentication_required`](https://provenanceauth.com/docs/platform/errors.md#authentication_required)
- [`insufficient_scope`](https://provenanceauth.com/docs/platform/errors.md#insufficient_scope)
- [`resource_missing`](https://provenanceauth.com/docs/platform/errors.md#resource_missing)
- [`rate_limit_exceeded`](https://provenanceauth.com/docs/platform/errors.md#rate_limit_exceeded)

### Request

**curl**

```bash
export PROVENANCE_KEY=prv_test_acct_P9xN2vQ7bT4mW8sYd3cFjLh6gAe1kR5
curl -X POST "$PROVENANCE_API/v1/authorize/deals" \
  -H "Authorization: Bearer $PROVENANCE_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "offer": "eyJhbGciOiJFZERTQSIsInR5cCI6Im9mZmVyK2p3dCIsImtpZCI6IkJPYzE3bVNNUHl5dEZqWWJnVWVvSFhPbXY5ZGxTSU9ncXhfdVRXMENZakEifQ.eyJpc3MiOiJhZ3RfMDFNNjdQNDhEREs0SFJHRzBCUjQ1N0tRSk4iLCJvZmZlcl9pZCI6Im9mcl9ldV9zdG9yYWdlXzIwMjZxNCIsIml0ZW1zIjpbeyJza3UiOiJycHQtZXUtc3RvcmFnZSIsIm5hbWUiOiJFVSBzdG9yYWdlIG1hcmtldCByZXBvcnQiLCJxdWFudGl0eSI6MSwidW5pdCI6InJlcG9ydCIsInVuaXRfcHJpY2UiOjQwLCJkZXNjcmlwdGlvbiI6IjIwIHBhZ2VzLCBQREYifV0sInRvdGFsIjo0MCwiY3VycmVuY3kiOiJVU0QiLCJkZWxpdmVyeSI6eyJraW5kIjoiZmlsZSIsImZvcm1hdCI6ImFwcGxpY2F0aW9uL3BkZiIsImRlYWRsaW5lIjoiMjAyNi0xMS0wMlQwMDozNTozNS41MDZaIn0sInJlZnVuZF90ZXJtcyI6WyJmdWxsX2lmX2xhdGUiXSwidGVybXMiOnsic3VtbWFyeSI6IlBERiBkZWxpdmVyeS4gQSBmdWxsIHJlZnVuZCBpZiBpdCBhcnJpdmVzIGxhdGUuIiwidXJsIjoiaHR0cHM6Ly9zYWx0bWFyc2guZXhhbXBsZS90ZXJtcyIsImhhc2giOiJiNWJiOWQ4MDE0YTBmOWIxZDYxZTIxZTc5NmQ3OGRjY2RmMTM1MmYyM2NkMzI4MTJmNDg1MGI4NzhhZTQ5NDRjIn0sInNlbGxlcl9jb25maXJtYXRpb24iOnsib2ZmZXJlZCI6Im5ldmVyIiwicmVzcG9uc2VfdGltZSI6IjFiZCJ9LCJraWQiOiJCT2MxN21TTVB5eXRGalliZ1Vlb0hYT212OWRsU0lPZ3F4X3VUVzBDWWpBIiwibm9uY2UiOiJHbUMxMUxWX2RpRldBMHVKUHdvSlB3IiwiaWF0IjoxNzkzNDA2OTM1LCJleHAiOjE3OTM0OTMzMzV9.g9DQ8O-Lvk01T1DN6-hBc7rn1giIryycTGBk6ol0B-B8d0Zfz9oLOfXwOOj0pOFDtZ0cIhwM9pxsoe1fv6UbAQ",
    "agent_session_id": "sess_scout_7",
    "agent_id": "agt_01M67P48EKD7Q0A8ZB4X7S2N9V",
    "purpose": "Market sizing for the Q4 plan"
  }'
```

**Node**

```ts
const data = await (await fetch(`${process.env.PROVENANCE_API}/v1/authorize/deals`, {
  method: "POST",
  headers: { Authorization: "Bearer prv_test_acct_P9xN2vQ7bT4mW8sYd3cFjLh6gAe1kR5", "Content-Type": "application/json" },
  body: JSON.stringify({
    "offer": "eyJhbGciOiJFZERTQSIsInR5cCI6Im9mZmVyK2p3dCIsImtpZCI6IkJPYzE3bVNNUHl5dEZqWWJnVWVvSFhPbXY5ZGxTSU9ncXhfdVRXMENZakEifQ.eyJpc3MiOiJhZ3RfMDFNNjdQNDhEREs0SFJHRzBCUjQ1N0tRSk4iLCJvZmZlcl9pZCI6Im9mcl9ldV9zdG9yYWdlXzIwMjZxNCIsIml0ZW1zIjpbeyJza3UiOiJycHQtZXUtc3RvcmFnZSIsIm5hbWUiOiJFVSBzdG9yYWdlIG1hcmtldCByZXBvcnQiLCJxdWFudGl0eSI6MSwidW5pdCI6InJlcG9ydCIsInVuaXRfcHJpY2UiOjQwLCJkZXNjcmlwdGlvbiI6IjIwIHBhZ2VzLCBQREYifV0sInRvdGFsIjo0MCwiY3VycmVuY3kiOiJVU0QiLCJkZWxpdmVyeSI6eyJraW5kIjoiZmlsZSIsImZvcm1hdCI6ImFwcGxpY2F0aW9uL3BkZiIsImRlYWRsaW5lIjoiMjAyNi0xMS0wMlQwMDozNTozNS41MDZaIn0sInJlZnVuZF90ZXJtcyI6WyJmdWxsX2lmX2xhdGUiXSwidGVybXMiOnsic3VtbWFyeSI6IlBERiBkZWxpdmVyeS4gQSBmdWxsIHJlZnVuZCBpZiBpdCBhcnJpdmVzIGxhdGUuIiwidXJsIjoiaHR0cHM6Ly9zYWx0bWFyc2guZXhhbXBsZS90ZXJtcyIsImhhc2giOiJiNWJiOWQ4MDE0YTBmOWIxZDYxZTIxZTc5NmQ3OGRjY2RmMTM1MmYyM2NkMzI4MTJmNDg1MGI4NzhhZTQ5NDRjIn0sInNlbGxlcl9jb25maXJtYXRpb24iOnsib2ZmZXJlZCI6Im5ldmVyIiwicmVzcG9uc2VfdGltZSI6IjFiZCJ9LCJraWQiOiJCT2MxN21TTVB5eXRGalliZ1Vlb0hYT212OWRsU0lPZ3F4X3VUVzBDWWpBIiwibm9uY2UiOiJHbUMxMUxWX2RpRldBMHVKUHdvSlB3IiwiaWF0IjoxNzkzNDA2OTM1LCJleHAiOjE3OTM0OTMzMzV9.g9DQ8O-Lvk01T1DN6-hBc7rn1giIryycTGBk6ol0B-B8d0Zfz9oLOfXwOOj0pOFDtZ0cIhwM9pxsoe1fv6UbAQ",
    "agent_session_id": "sess_scout_7",
    "agent_id": "agt_01M67P48EKD7Q0A8ZB4X7S2N9V",
    "purpose": "Market sizing for the Q4 plan"
  }),
})).json();
```

**Python**

```python
import os
import httpx

api = os.environ["PROVENANCE_API"]
data = httpx.post(f"{api}/v1/authorize/deals", headers={"Authorization": "Bearer prv_test_acct_P9xN2vQ7bT4mW8sYd3cFjLh6gAe1kR5"}, json={
    "offer": "eyJhbGciOiJFZERTQSIsInR5cCI6Im9mZmVyK2p3dCIsImtpZCI6IkJPYzE3bVNNUHl5dEZqWWJnVWVvSFhPbXY5ZGxTSU9ncXhfdVRXMENZakEifQ.eyJpc3MiOiJhZ3RfMDFNNjdQNDhEREs0SFJHRzBCUjQ1N0tRSk4iLCJvZmZlcl9pZCI6Im9mcl9ldV9zdG9yY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ing for the Q4 plan"
}).json()
```

### Response 200

```json
{
  "object": "deal",
  "id": "deal_01M67P48EVJBZY5CPN6WGF8TB3",
  "status": "accepted",
  "reason": null,
  "role": "buyer",
  "offer_id": "ofr_eu_storage_2026q4",
  "offer_hash": "72f6e1e8623486a35cda7ecdd8415506e4dbd96df7c2f3b6da0b490ad4522aa3",
  "offer": {
    "iss": "agt_01M67P48DDK4HRGG0BR457KQJN",
    "offer_id": "ofr_eu_storage_2026q4",
    "items": [
      {
        "sku": "rpt-eu-storage",
        "name": "EU storage market report",
        "quantity": 1,
        "unit": "report",
        "unit_price": 40,
        "description": "20 pages, PDF"
      }
    ],
    "total": 40,
    "currency": "USD",
    "delivery": {
      "kind": "file",
      "format": "application/pdf",
      "deadline": "2026-11-02T00:35:35.506Z"
    },
    "refund_terms": [
      "full_if_late"
    ],
    "terms": {
      "summary": "PDF delivery. A full refund if it arrives late.",
      "url": "https://saltmarsh.example/terms",
      "hash": "b5bb9d8014a0f9b1d61e21e796d78dccdf1352f23cd32812f4850b878ae4944c"
    },
    "seller_confirmation": {
      "offered": "never",
      "response_time": "1bd"
    },
    "kid": "BOc17mSMPyytFjYbgUeoHXOmv9dlSIOgqx_uTW0CYjA",
    "nonce": "GmC11LV_diFWA0uJPwoJPw",
    "iat": 1793406935,
    "exp": 1793493335
  },
  "seller": {
    "agent_id": "agt_01M67P48DDK4HRGG0BR457KQJN",
    "name": "saltmarsh-reports",
    "origin": "https://saltmarsh.example",
    "domain_verified": true
  },
  "buyer": {
    "agent_id": "agt_01M67P48EHM4K5EDYJTMJZVZDP",
    "agent_name": "scout",
    "subject": "psub_plij7qooukmv7swr6uxg2zbz7e"
  },
  "total": 40,
  "currency": "USD",
  "deadline": "2026-11-02T00:35:35.506Z",
  "confirm_window": 72,
  "offer_expires_at": "2026-11-01T00:35:35.000Z",
  "requires": {
    "buyer_person": false,
    "seller_person": false
  },
  "buyer_approval": null,
  "seller_approval": null,
  "approval": null,
  "grant_id": null,
  "intent_token": "ey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sbGVyIjoiYWd0XzAxTTY3UDQ4RERLNEhSR0cwQlI0NTdLUUpOIn19.rYhqxkyu7H_-n7T3t1u6U0b90eoLAWit5YmWKXdTHe7NrcmTaSpdKpXFt13L6lFg3yGxINcfrqZAfo5rlSQgWw",
  "token_expires_at": "2026-11-01T00:35:35.000Z",
  "jti": "84ea3c19-b1db-4ec8-b781-451563a861fd",
  "run_id": null,
  "purpose": "Market sizing for the Q4 plan",
  "chain": "not_checked",
  "payment": null,
  "delivery": null,
  "confirmed_content_hash": null,
  "cancelled_by": null,
  "timeline": [
    {
      "status": "pending_approval",
      "at": "2026-10-31T00:35:35.515Z",
      "by": "buyer"
    },
    {
      "status": "accepted",
      "at": "2026-10-31T00:35:35.530Z",
      "by": "provenance"
    }
  ],
  "created_at": "2026-10-31T00:35:35.515Z",
  "updated_at": "2026-10-31T00:35:35.530Z",
  "accepted_at": "2026-10-31T00:35:35.529Z",
  "completed_at": null,
  "replayed": true
}
```

## Record a payment reference

`POST /v1/authorize/deals/{id}/payment`

Either side records the rail and an opaque reference (at most 200 characters) once the deal is accepted. Optional; amounts aren't restated. Provenance never moves or holds the money.

Auth: an API key, as `Authorization: Bearer <key>`.

### Parameters

| Name | In | Type | Required | Description |
| --- | --- | --- | --- | --- |
| `id` | path | string | yes | The deal's ID. |
| `rail` | body | string | yes | The rail: x402, acp, ap2, card, bank or your own name ([a-z0-9_.-], at most 40). |
| `reference` | body | string | yes | The rail's reference for the payment. |

### Returns

The deal. See [the deal object](#object).

### Errors

- [`parameter_invalid`](https://provenanceauth.com/docs/platform/errors.md#parameter_invalid)
- [`authentication_required`](https://provenanceauth.com/docs/platform/errors.md#authentication_required)
- [`resource_missing`](https://provenanceauth.com/docs/platform/errors.md#resource_missing)
- [`deal_state_invalid`](https://provenanceauth.com/docs/platform/errors.md#deal_state_invalid)
- [`rate_limit_exceeded`](https://provenanceauth.com/docs/platform/errors.md#rate_limit_exceeded)

### Request

**curl**

```bash
export PROVENANCE_KEY=prv_test_acct_P9xN2vQ7bT4mW8sYd3cFjLh6gAe1kR5
curl -X POST "$PROVENANCE_API/v1/authorize/deals/deal_01M67P48EVJBZY5CPN6WGF8TB3/payment" \
  -H "Authorization: Bearer $PROVENANCE_KEY" \
  -H "Content-Type: application/json" \
  -d '{ "rail": "x402", "reference": "0x9f2c41d0b7e3" }'
```

**Node**

```ts
const data = await (await fetch(`${process.env.PROVENANCE_API}/v1/authorize/deals/deal_01M67P48EVJBZY5CPN6WGF8TB3/payment`, {
  method: "POST",
  headers: { Authorization: "Bearer prv_test_acct_P9xN2vQ7bT4mW8sYd3cFjLh6gAe1kR5", "Content-Type": "application/json" },
  body: JSON.stringify({ "rail": "x402", "reference": "0x9f2c41d0b7e3" }),
})).json();
```

**Python**

```python
import os
import httpx

api = os.environ["PROVENANCE_API"]
data = httpx.post(f"{api}/v1/authorize/deals/deal_01M67P48EVJBZY5CPN6WGF8TB3/payment", headers={"Authorization": "Bearer prv_test_acct_P9xN2vQ7bT4mW8sYd3cFjLh6gAe1kR5"}, json={
    "rail": "x402",
    "reference": "0x9f2c41d0b7e3"
}).json()
```

### Response 200

```json
{
  "object": "deal",
  "id": "deal_01M67P48EVJBZY5CPN6WGF8TB3",
  "status": "accepted",
  "reason": null,
  "role": "buyer",
  "offer_id": "ofr_eu_storage_2026q4",
  "offer_hash": "72f6e1e8623486a35cda7ecdd8415506e4dbd96df7c2f3b6da0b490ad4522aa3",
  "offer": {
    "iss": "agt_01M67P48DDK4HRGG0BR457KQJN",
    "offer_id": "ofr_eu_storage_2026q4",
    "items": [
      {
        "sku": "rpt-eu-storage",
        "name": "EU storage market report",
        "quantity": 1,
        "unit": "report",
        "unit_price": 40,
        "description": "20 pages, PDF"
      }
    ],
    "total": 40,
    "currency": "USD",
    "delivery": {
      "kind": "file",
      "format": "application/pdf",
      "deadline": "2026-11-02T00:35:35.506Z"
    },
    "refund_terms": [
      "full_if_late"
    ],
    "terms": {
      "summary": "PDF delivery. A full refund if it arrives late.",
      "url": "https://saltmarsh.example/terms",
      "hash": "b5bb9d8014a0f9b1d61e21e796d78dccdf1352f23cd32812f4850b878ae4944c"
    },
    "seller_confirmation": {
      "offered": "never",
      "response_time": "1bd"
    },
    "kid": "BOc17mSMPyytFjYbgUeoHXOmv9dlSIOgqx_uTW0CYjA",
    "nonce": "GmC11LV_diFWA0uJPwoJPw",
    "iat": 1793406935,
    "exp": 1793493335
  },
  "seller": {
    "agent_id": "agt_01M67P48DDK4HRGG0BR457KQJN",
    "name": "saltmarsh-reports",
    "origin": "https://saltmarsh.example",
    "domain_verified": true
  },
  "buyer": {
    "agent_id": "agt_01M67P48EHM4K5EDYJTMJZVZDP",
    "agent_name": "scout",
    "subject": "psub_plij7qooukmv7swr6uxg2zbz7e"
  },
  "total": 40,
  "currency": "USD",
  "deadline": "2026-11-02T00:35:35.506Z",
  "confirm_window": 72,
  "offer_expires_at": "2026-11-01T00:35:35.000Z",
  "requires": {
    "buyer_person": false,
    "seller_person": false
  },
  "buyer_approval": null,
  "seller_approval": null,
  "approval": null,
  "grant_id": null,
  "intent_token": "eyJhbGciOiJFUzI1NiIsInR5cCI6IkpXVCIsImtpZCI6IjExM2MyMzdjZDdiMjkyZWIifQ.eyJpc3MiOiJwcm92ZW5hbmNlLWF1dGhvcml6ZSIsImp0aSI6Ijg0ZWEzYzE5LWIxZGItNGVjOC1iNzgxLTQ1MTU2M2E4NjFmZCIsInN1YiI6InBzdWJfcGxpajdxb291a212N3N3cjZ1eGcyemJ6N2UiLCJzZXNzaW9uIjoic2Vzc19zY291dF83IiwiYWN0aW9uX2hhc2giOiJiZjNkN2ExOWE0YWEzOGYzMjEzNThiMGVkOTVkM2Y2Y2Y1N2Q4MDRmNmIyMjhiYzk4NjRmYzhlMzAyZTMyMDM2IiwiaGFyZHdhcmVfYXR0ZXN0ZWQiOmZhbHNlLCJiaW9tZXRyaWNfYm91bmQiOmZhbHNlLCJpc3NfYWNjb3VudCI6IjAwMDAwMDAwLTAwMDAtMDAwMC0wMDAwLTAwMDAwMDAwMDBhOSIsImlzc19jYXJyaWVyIjpudWxsLCJpYXQiOjE3OTM0MDY5MzUsImV4cCI6MTc5MzQ5MzMzNSwicGF5bG9hZF9oYXNoIjoiNzJmNmUxZTg2MjM0ODZhMzVjZGE3ZWNkZDg0MTU1MDZlNGRiZDk2ZGY3YzJmM2I2ZGEwYjQ5MGFkNDUyMmFhMyIsImFnZW50Ijp7ImlkIjoiYWd0XzAxTTY3UDQ4RUhNNEs1RURZSlRNSlpWWkRQIiwibmFtZSI6InNjb3V0IiwiaW50ZWdyYXRpb24iOiJub25lIiwic2RrX3ZlcnNpb24iOm51bGx9LCJhdWQiOiJhZ3RfMDFNNjdQNDhEREs0SFJHRzBCUjQ1N0tRSk4iLCJkZWFsIjp7ImlkIjoiZGVhbF8wMU02N1A0OEVWSkJaWTVDUE42V0dGOFRCMyIsIm9mZmVyX2hhc2giOiI3MmY2ZTFlODYyMzQ4NmEzNWNkYTdlY2RkODQxNTUwNmU0ZGJkOTZkZjdjMmYzYjZkYTBiNDkwYWQ0NTIyYWEzIiwic2VsbGVyIjoiYWd0XzAxTTY3UDQ4RERLNEhSR0cwQlI0NTdLUUpOIn19.rYhqxkyu7H_-n7T3t1u6U0b90eoLAWit5YmWKXdTHe7NrcmTaSpdKpXFt13L6lFg3yGxINcfrqZAfo5rlSQgWw",
  "token_expires_at": "2026-11-01T00:35:35.000Z",
  "jti": "84ea3c19-b1db-4ec8-b781-451563a861fd",
  "run_id": null,
  "purpose": "Market sizing for the Q4 plan",
  "chain": "not_checked",
  "payment": {
    "rail": "x402",
    "reference": "0x9f2c41d0b7e3",
    "recorded_by": "buyer",
    "recorded_at": "2026-10-31T00:35:35.536Z"
  },
  "delivery": null,
  "confirmed_content_hash": null,
  "cancelled_by": null,
  "timeline": [
    {
      "status": "pending_approval",
      "at": "2026-10-31T00:35:35.515Z",
      "by": "buyer"
    },
    {
      "status": "accepted",
      "at": "2026-10-31T00:35:35.530Z",
      "by": "provenance"
    },
    {
      "status": "payment_recorded",
      "at": "2026-10-31T00:35:35.536Z",
      "by": "buyer",
      "detail": "x402"
    }
  ],
  "created_at": "2026-10-31T00:35:35.515Z",
  "updated_at": "2026-10-31T00:35:35.536Z",
  "accepted_at": "2026-10-31T00:35:35.529Z",
  "completed_at": null
}
```

## Record a delivery

`POST /v1/authorize/deals/{id}/delivery`

The seller's key records its signed delivery receipt (`delivery+jwt`, the same key as its offers): the deal, the offer hash and the sha256 of what was delivered. The deal becomes `delivered`; on time when recorded before the deadline. A late delivery after `overdue` is recorded too. Each completed deal counts as one decision for the seller.

Auth: an API key, as `Authorization: Bearer <key>`.

### Parameters

| Name | In | Type | Required | Description |
| --- | --- | --- | --- | --- |
| `id` | path | string | yes | The deal's ID. |
| `receipt` | body | string | yes | The signed delivery receipt (compact JWS), from `signDelivery()`. |

### Returns

The deal. See [the deal object](#object).

### Errors

- [`parameter_invalid`](https://provenanceauth.com/docs/platform/errors.md#parameter_invalid)
- [`delivery_receipt_invalid`](https://provenanceauth.com/docs/platform/errors.md#delivery_receipt_invalid)
- [`usage_limit_reached`](https://provenanceauth.com/docs/platform/errors.md#usage_limit_reached)
- [`authentication_required`](https://provenanceauth.com/docs/platform/errors.md#authentication_required)
- [`resource_missing`](https://provenanceauth.com/docs/platform/errors.md#resource_missing)
- [`deal_state_invalid`](https://provenanceauth.com/docs/platform/errors.md#deal_state_invalid)
- [`rate_limit_exceeded`](https://provenanceauth.com/docs/platform/errors.md#rate_limit_exceeded)

### Request

**curl**

```bash
export PROVENANCE_KEY=prv_test_acct_P9xN2vQ7bT4mW8sYd3cFjLh6gAe1kR5
curl -X POST "$PROVENANCE_API/v1/authorize/deals/deal_01M67P48EVJBZY5CPN6WGF8TB3/delivery" \
  -H "Authorization: Bearer $PROVENANCE_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "receipt": "eyJhbGciOiJFZERTQSIsInR5cCI6ImRlbGl2ZXJ5K2p3dCJ9.eyJkZWFsX2lkIjoiLi4uIn0.c2lnbmF0dXJl"
  }'
```

**Node**

```ts
const data = await (await fetch(`${process.env.PROVENANCE_API}/v1/authorize/deals/deal_01M67P48EVJBZY5CPN6WGF8TB3/delivery`, {
  method: "POST",
  headers: { Authorization: "Bearer prv_test_acct_P9xN2vQ7bT4mW8sYd3cFjLh6gAe1kR5", "Content-Type": "application/json" },
  body: JSON.stringify({
    "receipt": "eyJhbGciOiJFZERTQSIsInR5cCI6ImRlbGl2ZXJ5K2p3dCJ9.eyJkZWFsX2lkIjoiLi4uIn0.c2lnbmF0dXJl"
  }),
})).json();
```

**Python**

```python
import os
import httpx

api = os.environ["PROVENANCE_API"]
data = httpx.post(f"{api}/v1/authorize/deals/deal_01M67P48EVJBZY5CPN6WGF8TB3/delivery", headers={"Authorization": "Bearer prv_test_acct_P9xN2vQ7bT4mW8sYd3cFjLh6gAe1kR5"}, json={
    "receipt": "eyJhbGciOiJFZERTQSIsInR5cCI6ImRlbGl2ZXJ5K2p3dCJ9.eyJkZWFsX2lkIjoiLi4uIn0.c2lnbmF0dXJl"
}).json()
```

### Response 200

```json
{
  "object": "deal",
  "id": "deal_01M67P48EVJBZY5CPN6WGF8TB3",
  "status": "delivered",
  "reason": null,
  "role": "seller",
  "offer_id": "ofr_eu_storage_2026q4",
  "offer_hash": "72f6e1e8623486a35cda7ecdd8415506e4dbd96df7c2f3b6da0b490ad4522aa3",
  "offer": {
    "iss": "agt_01M67P48DDK4HRGG0BR457KQJN",
    "offer_id": "ofr_eu_storage_2026q4",
    "items": [
      {
        "sku": "rpt-eu-storage",
        "name": "EU storage market report",
        "quantity": 1,
        "unit": "report",
        "unit_price": 40,
        "description": "20 pages, PDF"
      }
    ],
    "total": 40,
    "currency": "USD",
    "delivery": {
      "kind": "file",
      "format": "application/pdf",
      "deadline": "2026-11-02T00:35:35.506Z"
    },
    "refund_terms": [
      "full_if_late"
    ],
    "terms": {
      "summary": "PDF delivery. A full refund if it arrives late.",
      "url": "https://saltmarsh.example/terms",
      "hash": "b5bb9d8014a0f9b1d61e21e796d78dccdf1352f23cd32812f4850b878ae4944c"
    },
    "seller_confirmation": {
      "offered": "never",
      "response_time": "1bd"
    },
    "kid": "BOc17mSMPyytFjYbgUeoHXOmv9dlSIOgqx_uTW0CYjA",
    "nonce": "GmC11LV_diFWA0uJPwoJPw",
    "iat": 1793406935,
    "exp": 1793493335
  },
  "seller": {
    "agent_id": "agt_01M67P48DDK4HRGG0BR457KQJN",
    "name": "saltmarsh-reports",
    "origin": "https://saltmarsh.example",
    "domain_verified": true
  },
  "buyer": {
    "agent_id": "agt_01M67P48EHM4K5EDYJTMJZVZDP",
    "agent_name": "scout",
    "subject": "psub_plij7qooukmv7swr6uxg2zbz7e"
  },
  "total": 40,
  "currency": "USD",
  "deadline": "2026-11-02T00:35:35.506Z",
  "confirm_window": 72,
  "offer_expires_at": "2026-11-01T00:35:35.000Z",
  "requires": {
    "buyer_person": false,
    "seller_person": false
  },
  "buyer_approval": null,
  "seller_approval": null,
  "approval": null,
  "jti": "84ea3c19-b1db-4ec8-b781-451563a861fd",
  "run_id": null,
  "purpose": null,
  "chain": "not_checked",
  "payment": {
    "rail": "x402",
    "reference": "0x9f2c41d0b7e3",
    "recorded_by": "buyer",
    "recorded_at": "2026-10-31T00:35:35.536Z"
  },
  "delivery": {
    "content_hash": "2138e20f2c6de32409659c519601a485e21fe056a5e3d6c019f075e4203ce608",
    "content_size": 482113,
    "parts": null,
    "delivered_at": "2026-10-31T00:35:35.542Z",
    "on_time": true
  },
  "confirmed_content_hash": null,
  "cancelled_by": null,
  "timeline": [
    {
      "status": "pending_approval",
      "at": "2026-10-31T00:35:35.515Z",
      "by": "buyer"
    },
    {
      "status": "accepted",
      "at": "2026-10-31T00:35:35.530Z",
      "by": "provenance"
    },
    {
      "status": "payment_recorded",
      "at": "2026-10-31T00:35:35.536Z",
      "by": "buyer",
      "detail": "x402"
    },
    {
      "status": "delivered",
      "at": "2026-10-31T00:35:35.542Z",
      "by": "seller"
    }
  ],
  "created_at": "2026-10-31T00:35:35.515Z",
  "updated_at": "2026-10-31T00:35:35.542Z",
  "accepted_at": "2026-10-31T00:35:35.529Z",
  "completed_at": null
}
```

## Confirm a delivery

`POST /v1/authorize/deals/{id}/confirm`

The buyer sends the sha256 of what it received. A match completes the deal; anything else is `delivery_mismatch`. A buyer that stays silent for the offer's confirm window (72 hours by default) leaves the deal `completed_unconfirmed`.

Auth: an API key, as `Authorization: Bearer <key>`.

### Parameters

| Name | In | Type | Required | Description |
| --- | --- | --- | --- | --- |
| `id` | path | string | yes | The deal's ID. |
| `content_hash` | body | string | yes | The sha256 (hex) of what you received. |

### Returns

The deal. See [the deal object](#object).

### Errors

- [`parameter_invalid`](https://provenanceauth.com/docs/platform/errors.md#parameter_invalid)
- [`authentication_required`](https://provenanceauth.com/docs/platform/errors.md#authentication_required)
- [`resource_missing`](https://provenanceauth.com/docs/platform/errors.md#resource_missing)
- [`deal_state_invalid`](https://provenanceauth.com/docs/platform/errors.md#deal_state_invalid)
- [`rate_limit_exceeded`](https://provenanceauth.com/docs/platform/errors.md#rate_limit_exceeded)

### Request

**curl**

```bash
export PROVENANCE_KEY=prv_test_acct_P9xN2vQ7bT4mW8sYd3cFjLh6gAe1kR5
curl -X POST "$PROVENANCE_API/v1/authorize/deals/deal_01M67P48EVJBZY5CPN6WGF8TB3/confirm" \
  -H "Authorization: Bearer $PROVENANCE_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "content_hash": "2138e20f2c6de32409659c519601a485e21fe056a5e3d6c019f075e4203ce608"
  }'
```

**Node**

```ts
const data = await (await fetch(`${process.env.PROVENANCE_API}/v1/authorize/deals/deal_01M67P48EVJBZY5CPN6WGF8TB3/confirm`, {
  method: "POST",
  headers: { Authorization: "Bearer prv_test_acct_P9xN2vQ7bT4mW8sYd3cFjLh6gAe1kR5", "Content-Type": "application/json" },
  body: JSON.stringify({
    "content_hash": "2138e20f2c6de32409659c519601a485e21fe056a5e3d6c019f075e4203ce608"
  }),
})).json();
```

**Python**

```python
import os
import httpx

api = os.environ["PROVENANCE_API"]
data = httpx.post(f"{api}/v1/authorize/deals/deal_01M67P48EVJBZY5CPN6WGF8TB3/confirm", headers={"Authorization": "Bearer prv_test_acct_P9xN2vQ7bT4mW8sYd3cFjLh6gAe1kR5"}, json={
    "content_hash": "2138e20f2c6de32409659c519601a485e21fe056a5e3d6c019f075e4203ce608"
}).json()
```

### Response 200

```json
{
  "object": "deal",
  "id": "deal_01M67P48EVJBZY5CPN6WGF8TB3",
  "status": "completed",
  "reason": null,
  "role": "buyer",
  "offer_id": "ofr_eu_storage_2026q4",
  "offer_hash": "72f6e1e8623486a35cda7ecdd8415506e4dbd96df7c2f3b6da0b490ad4522aa3",
  "offer": {
    "iss": "agt_01M67P48DDK4HRGG0BR457KQJN",
    "offer_id": "ofr_eu_storage_2026q4",
    "items": [
      {
        "sku": "rpt-eu-storage",
        "name": "EU storage market report",
        "quantity": 1,
        "unit": "report",
        "unit_price": 40,
        "description": "20 pages, PDF"
      }
    ],
    "total": 40,
    "currency": "USD",
    "delivery": {
      "kind": "file",
      "format": "application/pdf",
      "deadline": "2026-11-02T00:35:35.506Z"
    },
    "refund_terms": [
      "full_if_late"
    ],
    "terms": {
      "summary": "PDF delivery. A full refund if it arrives late.",
      "url": "https://saltmarsh.example/terms",
      "hash": "b5bb9d8014a0f9b1d61e21e796d78dccdf1352f23cd32812f4850b878ae4944c"
    },
    "seller_confirmation": {
      "offered": "never",
      "response_time": "1bd"
    },
    "kid": "BOc17mSMPyytFjYbgUeoHXOmv9dlSIOgqx_uTW0CYjA",
    "nonce": "GmC11LV_diFWA0uJPwoJPw",
    "iat": 1793406935,
    "exp": 1793493335
  },
  "seller": {
    "agent_id": "agt_01M67P48DDK4HRGG0BR457KQJN",
    "name": "saltmarsh-reports",
    "origin": "https://saltmarsh.example",
    "domain_verified": true
  },
  "buyer": {
    "agent_id": "agt_01M67P48EHM4K5EDYJTMJZVZDP",
    "agent_name": "scout",
    "subject": "psub_plij7qooukmv7swr6uxg2zbz7e"
  },
  "total": 40,
  "currency": "USD",
  "deadline": "2026-11-02T00:35:35.506Z",
  "confirm_window": 72,
  "offer_expires_at": "2026-11-01T00:35:35.000Z",
  "requires": {
    "buyer_person": false,
    "seller_person": false
  },
  "buyer_approval": null,
  "seller_approval": null,
  "approval": null,
  "grant_id": null,
  "intent_token": "eyJhbGciOiJFUzI1NiIsInR5cCI6IkpXVCIsImtpZCI6IjExM2MyMzdjZDdiMjkyZWIifQ.eyJpc3MiOiJwcm92ZW5hbmNlLWF1dGhvcml6ZSIsImp0aSI6Ijg0ZWEzYzE5LWIxZGItNGVjOC1iNzgxLTQ1MTU2M2E4NjFmZCIsInN1YiI6InBzdWJfcGxpajdxb291a212N3N3cjZ1eGcyemJ6N2UiLCJzZXNzaW9uIjoic2Vzc19zY291dF83IiwiYWN0aW9uX2hhc2giOiJiZjNkN2ExOWE0YWEzOGYzMjEzNThiMGVkOTVkM2Y2Y2Y1N2Q4MDRmNmIyMjhiYzk4NjRmYzhlMzAyZTMyMDM2IiwiaGFyZHdhcmVfYXR0ZXN0ZWQiOmZhbHNlLCJiaW9tZXRyaWNfYm91bmQiOmZhbHNlLCJpc3NfYWNjb3VudCI6IjAwMDAwMDAwLTAwMDAtMDAwMC0wMDAwLTAwMDAwMDAwMDBhOSIsImlzc19jYXJyaWVyIjpudWxsLCJpYXQiOjE3OTM0MDY5MzUsImV4cCI6MTc5MzQ5MzMzNSwicGF5bG9hZF9oYXNoIjoiNzJmNmUxZTg2MjM0ODZhMzVjZGE3ZWNkZDg0MTU1MDZlNGRiZDk2ZGY3YzJmM2I2ZGEwYjQ5MGFkNDUyMmFhMyIsImFnZW50Ijp7ImlkIjoiYWd0XzAxTTY3UDQ4RUhNNEs1RURZSlRNSlpWWkRQIiwibmFtZSI6InNjb3V0IiwiaW50ZWdyYXRpb24iOiJub25lIiwic2RrX3ZlcnNpb24iOm51bGx9LCJhdWQiOiJhZ3RfMDFNNjdQNDhEREs0SFJHRzBCUjQ1N0tRSk4iLCJkZWFsIjp7ImlkIjoiZGVhbF8wMU02N1A0OEVWSkJaWTVDUE42V0dGOFRCMyIsIm9mZmVyX2hhc2giOiI3MmY2ZTFlODYyMzQ4NmEzNWNkYTdlY2RkODQxNTUwNmU0ZGJkOTZkZjdjMmYzYjZkYTBiNDkwYWQ0NTIyYWEzIiwic2VsbGVyIjoiYWd0XzAxTTY3UDQ4RERLNEhSR0cwQlI0NTdLUUpOIn19.rYhqxkyu7H_-n7T3t1u6U0b90eoLAWit5YmWKXdTHe7NrcmTaSpdKpXFt13L6lFg3yGxINcfrqZAfo5rlSQgWw",
  "token_expires_at": "2026-11-01T00:35:35.000Z",
  "jti": "84ea3c19-b1db-4ec8-b781-451563a861fd",
  "run_id": null,
  "purpose": "Market sizing for the Q4 plan",
  "chain": "not_checked",
  "payment": {
    "rail": "x402",
    "reference": "0x9f2c41d0b7e3",
    "recorded_by": "buyer",
    "recorded_at": "2026-10-31T00:35:35.536Z"
  },
  "delivery": {
    "content_hash": "2138e20f2c6de32409659c519601a485e21fe056a5e3d6c019f075e4203ce608",
    "content_size": 482113,
    "parts": null,
    "delivered_at": "2026-10-31T00:35:35.542Z",
    "on_time": true
  },
  "confirmed_content_hash": "2138e20f2c6de32409659c519601a485e21fe056a5e3d6c019f075e4203ce608",
  "cancelled_by": null,
  "timeline": [
    {
      "status": "pending_approval",
      "at": "2026-10-31T00:35:35.515Z",
      "by": "buyer"
    },
    {
      "status": "accepted",
      "at": "2026-10-31T00:35:35.530Z",
      "by": "provenance"
    },
    {
      "status": "payment_recorded",
      "at": "2026-10-31T00:35:35.536Z",
      "by": "buyer",
      "detail": "x402"
    },
    {
      "status": "delivered",
      "at": "2026-10-31T00:35:35.542Z",
      "by": "seller"
    },
    {
      "status": "completed",
      "at": "2026-10-31T00:35:35.545Z",
      "by": "buyer"
    }
  ],
  "created_at": "2026-10-31T00:35:35.515Z",
  "updated_at": "2026-10-31T00:35:35.545Z",
  "accepted_at": "2026-10-31T00:35:35.529Z",
  "completed_at": "2026-10-31T00:35:35.545Z"
}
```

## Cancel a deal

`POST /v1/authorize/deals/{id}/cancel`

Before delivery. The seller may cancel any time before delivery; the buyer before acceptance, or after it when the offer's refund terms include `full_before_delivery`. Refunds, when due, happen on the rail.

Auth: an API key, as `Authorization: Bearer <key>`.

### Parameters

| Name | In | Type | Required | Description |
| --- | --- | --- | --- | --- |
| `id` | path | string | yes | The deal's ID. |

### Returns

The deal. See [the deal object](#object).

### Errors

- [`authentication_required`](https://provenanceauth.com/docs/platform/errors.md#authentication_required)
- [`resource_missing`](https://provenanceauth.com/docs/platform/errors.md#resource_missing)
- [`deal_state_invalid`](https://provenanceauth.com/docs/platform/errors.md#deal_state_invalid)
- [`rate_limit_exceeded`](https://provenanceauth.com/docs/platform/errors.md#rate_limit_exceeded)

### Request

**curl**

```bash
export PROVENANCE_KEY=prv_test_acct_P9xN2vQ7bT4mW8sYd3cFjLh6gAe1kR5
curl -X POST "$PROVENANCE_API/v1/authorize/deals/deal_01M67P48EVJBZY5CPN6WGF8TB3/cancel" \
  -H "Authorization: Bearer $PROVENANCE_KEY"
```

**Node**

```ts
const data = await (await fetch(`${process.env.PROVENANCE_API}/v1/authorize/deals/deal_01M67P48EVJBZY5CPN6WGF8TB3/cancel`, {
  method: "POST",
  headers: { Authorization: "Bearer prv_test_acct_P9xN2vQ7bT4mW8sYd3cFjLh6gAe1kR5" },
})).json();
```

**Python**

```python
import os
import httpx

api = os.environ["PROVENANCE_API"]
data = httpx.post(f"{api}/v1/authorize/deals/deal_01M67P48EVJBZY5CPN6WGF8TB3/cancel", headers={"Authorization": "Bearer prv_test_acct_P9xN2vQ7bT4mW8sYd3cFjLh6gAe1kR5"}).json()
```

### Response 200

```json
{
  "object": "deal",
  "id": "deal_01M67P48G7E2FTJTBPPPDWK5X5",
  "status": "cancelled",
  "reason": null,
  "role": "buyer",
  "offer_id": "ofr_eu_storage_2026q4_b",
  "offer_hash": "86b3d9701a0459afd7ae0f8ed69f701d4a544078488649d34b7b3c0550d1932b",
  "offer": {
    "iss": "agt_01M67P48DDK4HRGG0BR457KQJN",
    "offer_id": "ofr_eu_storage_2026q4_b",
    "items": [
      {
        "sku": "rpt",
        "name": "Report",
        "quantity": 1,
        "unit_price": 40
      }
    ],
    "total": 40,
    "currency": "USD",
    "delivery": {
      "kind": "file",
      "deadline": "2026-11-02T00:35:35.556Z"
    },
    "refund_terms": [
      "full_before_delivery"
    ],
    "seller_confirmation": {
      "offered": "never",
      "response_time": "1bd"
    },
    "kid": "BOc17mSMPyytFjYbgUeoHXOmv9dlSIOgqx_uTW0CYjA",
    "nonce": "ojNS2B4q45bM-FxssQ3xVQ",
    "iat": 1793406935,
    "exp": 1793493335
  },
  "seller": {
    "agent_id": "agt_01M67P48DDK4HRGG0BR457KQJN",
    "name": "saltmarsh-reports",
    "origin": "https://saltmarsh.example",
    "domain_verified": true
  },
  "buyer": {
    "agent_id": null,
    "agent_name": null,
    "subject": "psub_plij7qooukmv7swr6uxg2zbz7e"
  },
  "total": 40,
  "currency": "USD",
  "deadline": "2026-11-02T00:35:35.556Z",
  "confirm_window": 72,
  "offer_expires_at": "2026-11-01T00:35:35.000Z",
  "requires": {
    "buyer_person": false,
    "seller_person": false
  },
  "buyer_approval": null,
  "seller_approval": null,
  "approval": null,
  "grant_id": null,
  "intent_token": "eyJhbGciOiJFUzI1NiIsInR5cCI6IkpXVCIsImtpZCI6IjExM2MyMzdjZDdiMjkyZWIifQ.eyJpc3MiOiJwcm92ZW5hbmNlLWF1dGhvcml6ZSIsImp0aSI6IjA4NTNhMjRjLWNiYjYtNDU4OS1hOGFjLTM4MmQzNTkyNTdmNSIsInN1YiI6InBzdWJfcGxpajdxb291a212N3N3cjZ1eGcyemJ6N2UiLCJzZXNzaW9uIjoic2Vzc19zY291dF83IiwiYWN0aW9uX2hhc2giOiIyMDY0NDQ4NmQzM2EwOGMwNDkzZThkNWEyMjNjY2IwOWJiYzc3ZGRlNmEzNmJmNGIxN2U5NzAyOWZkZTdhODYwIiwiaGFyZHdhcmVfYXR0ZXN0ZWQiOmZhbHNlLCJiaW9tZXRyaWNfYm91bmQiOmZhbHNlLCJpc3NfYWNjb3VudCI6IjAwMDAwMDAwLTAwMDAtMDAwMC0wMDAwLTAwMDAwMDAwMDBhOSIsImlzc19jYXJyaWVyIjpudWxsLCJpYXQiOjE3OTM0MDY5MzUsImV4cCI6MTc5MzQ5MzMzNSwicGF5bG9hZF9oYXNoIjoiODZiM2Q5NzAxYTA0NTlhZmQ3YWUwZjhlZDY5ZjcwMWQ0YTU0NDA3ODQ4ODY0OWQzNGI3YjNjMDU1MGQxOTMyYiIsImF1ZCI6ImFndF8wMU02N1A0OERESzRIUkdHMEJSNDU3S1FKTiIsImRlYWwiOnsiaWQiOiJkZWFsXzAxTTY3UDQ4RzdFMkZUSlRCUFBQRFdLNVg1Iiwib2ZmZXJfaGFzaCI6Ijg2YjNkOTcwMWEwNDU5YWZkN2FlMGY4ZWQ2OWY3MDFkNGE1NDQwNzg0ODg2NDlkMzRiN2IzYzA1NTBkMTkzMmIiLCJzZWxsZXIiOiJhZ3RfMDFNNjdQNDhEREs0SFJHRzBCUjQ1N0tRSk4ifX0.MnJ2a3zkf74vEUWUFLMMV0zVCesb9iIaZux3879mcekIsMIkGXekRBJJVXT819J9OKosa1klWns_uKRxxRHUjg",
  "token_expires_at": "2026-11-01T00:35:35.000Z",
  "jti": "0853a24c-cbb6-4589-a8ac-382d359257f5",
  "run_id": null,
  "purpose": null,
  "chain": "not_checked",
  "payment": null,
  "delivery": null,
  "confirmed_content_hash": null,
  "cancelled_by": "buyer",
  "timeline": [
    {
      "status": "pending_approval",
      "at": "2026-10-31T00:35:35.559Z",
      "by": "buyer"
    },
    {
      "status": "accepted",
      "at": "2026-10-31T00:35:35.563Z",
      "by": "provenance"
    },
    {
      "status": "cancelled",
      "at": "2026-10-31T00:35:35.565Z",
      "by": "buyer"
    }
  ],
  "created_at": "2026-10-31T00:35:35.559Z",
  "updated_at": "2026-10-31T00:35:35.565Z",
  "accepted_at": "2026-10-31T00:35:35.563Z",
  "completed_at": null
}
```

## Rate a deal

`POST /v1/authorize/deals/{id}/rating`

After a deal completes, the buyer rates the seller and the seller rates the buyer, 1 to 5 stars, once per deal. No written reviews. A rating shows once there are 20 ratings from 5 companies.

Auth: an API key, as `Authorization: Bearer <key>`.

### Parameters

| Name | In | Type | Required | Description |
| --- | --- | --- | --- | --- |
| `id` | path | string | yes | The deal's ID. |
| `stars` | body | integer | yes | One to five stars. |

### Returns

The rating.

### Errors

- [`parameter_invalid`](https://provenanceauth.com/docs/platform/errors.md#parameter_invalid)
- [`authentication_required`](https://provenanceauth.com/docs/platform/errors.md#authentication_required)
- [`resource_missing`](https://provenanceauth.com/docs/platform/errors.md#resource_missing)
- [`deal_not_rateable`](https://provenanceauth.com/docs/platform/errors.md#deal_not_rateable)
- [`deal_already_rated`](https://provenanceauth.com/docs/platform/errors.md#deal_already_rated)
- [`rate_limit_exceeded`](https://provenanceauth.com/docs/platform/errors.md#rate_limit_exceeded)

### Request

**curl**

```bash
export PROVENANCE_KEY=prv_test_acct_P9xN2vQ7bT4mW8sYd3cFjLh6gAe1kR5
curl -X POST "$PROVENANCE_API/v1/authorize/deals/deal_01M67P48EVJBZY5CPN6WGF8TB3/rating" \
  -H "Authorization: Bearer $PROVENANCE_KEY" \
  -H "Content-Type: application/json" \
  -d '{ "stars": 5 }'
```

**Node**

```ts
const data = await (await fetch(`${process.env.PROVENANCE_API}/v1/authorize/deals/deal_01M67P48EVJBZY5CPN6WGF8TB3/rating`, {
  method: "POST",
  headers: { Authorization: "Bearer prv_test_acct_P9xN2vQ7bT4mW8sYd3cFjLh6gAe1kR5", "Content-Type": "application/json" },
  body: JSON.stringify({ "stars": 5 }),
})).json();
```

**Python**

```python
import os
import httpx

api = os.environ["PROVENANCE_API"]
data = httpx.post(f"{api}/v1/authorize/deals/deal_01M67P48EVJBZY5CPN6WGF8TB3/rating", headers={"Authorization": "Bearer prv_test_acct_P9xN2vQ7bT4mW8sYd3cFjLh6gAe1kR5"}, json={
    "stars": 5
}).json()
```

### Response 201

```json
{
  "object": "deal_rating",
  "deal_id": "deal_01M67P48EVJBZY5CPN6WGF8TB3",
  "side": "buyer",
  "stars": 5,
  "created_at": "2026-10-31T00:35:35.549Z"
}
```
