# Exchanges

The shared exchange record: one signed, append-only log of an agent-to-agent exchange, from the brief to the close, that both parties read in their own view and verify.

Related guide: [Counter-offers](https://provenanceauth.com/docs/mandate/guides/counter-offers.md)

## Endpoints

- `GET /v1/authorize/exchanges/{id}`: [Read an exchange](#get-v1-authorize-exchanges-id)
- `GET /v1/public/exchanges/{id}`: [Read an exchange with your website key](#get-v1-public-exchanges-id)
- `GET /v1/authorize/exchanges`: [List exchanges](#get-v1-authorize-exchanges)
- `GET /v1/authorize/exchanges/{id}/entries`: [List an exchange's entries](#get-v1-authorize-exchanges-id-entries)
- `POST /v1/authorize/exchanges/{id}/export`: [Export an exchange's signed bundle](#post-v1-authorize-exchanges-id-export)
- `GET /v1/public/exchanges/{id}/export`: [Export an exchange with your website key](#get-v1-public-exchanges-id-export)

## The exchange object

### Attributes

| Name | Type | Required | Description |
| --- | --- | --- | --- |
| `id` | string | no | The exchange (`xch_…`). |
| `object` | enum | no | Always `exchange`. One of `exchange`. |
| `role` | enum | no | Your role. One of `requester`, `responder`. |
| `side` | enum | no | Your side, in the counter-offer API's words. One of `asking`, `offering`. |
| `status` | enum | no | `joined`: this half met the other customer's half on a signed offer; read `merged_into`. One of `open`, `closed`, `joined`. |
| `outcome` | string \| null | no | How it closed (completed, withdrawn, expired, declined, cancelled). |
| `parties` | object | no | Each role: `customer` (a Provenance account) and, for an outside agent, its ids. Never the other account's id. |
| `brief_id` | string \| null | no | Your own brief; the other side's stays private. |
| `merged_into` | string \| null | no | The exchange this half joined. |
| `head` | object | no | The chain's head: `seq`, `head_hash` and `jws`, our `exchange-head+jwt` (ES256, `/.well-known/jwks.json`). |
| `head.seq` | integer | no | Entries so far. |
| `head.head_hash` | string | no | The last entry's hash. |
| `head.jws` | string \| null | no | Our signature over the head. |
| `verify` | object | no | On a read of one exchange: the chain recomputed (each `entry_hash` and `prev`). |
| `verify.ok` | boolean | no | Whether it verified. |
| `verify.problem` | string | no | Where it didn't. |
| `created_at` | timestamp | no | When it opened. |
| `updated_at` | timestamp | no | The last entry. |

### Example

```json
{
  "id": "xch_01M8GDJVW562GCQVBRBS8TCAAZ",
  "object": "exchange",
  "role": "responder",
  "side": "offering",
  "status": "open",
  "outcome": null,
  "parties": {
    "requester": {
      "customer": false,
      "name": "Flights"
    },
    "responder": {
      "customer": true,
      "you": true,
      "agent_id": "agt_01M8GDJVW4SVRT8A810R0CG8MK"
    }
  },
  "brief_id": "brf_01M8GDJVW4RCVHXKV51Y2E7RC6",
  "merged_into": null,
  "head": {
    "seq": 3,
    "head_hash": "eca47078f89429cbb965088065dd864057215126916f2c31d917189148910eaf",
    "jws": "eyJhbGciOiJFUzI1NiIsInR5cCI6ImV4Y2hhbmdlLWhlYWQrand0Iiwia2lkIjoiMjRkYzdjYjBjZWIwMmM4NiJ9.eyJpc3MiOiJwcm92ZW5hbmNlLWF1dGhvcml6ZSIsInhjaCI6InhjaF8wMU04R0RKVlc1NjJHQ1FWQlJCUzhUQ0FBWiIsInNlcSI6MywiaGVhZF9oYXNoIjoiZWNhNDcwNzhmODk0MjljYmI5NjUwODgwNjVkZDg2NDA1NzIxNTEyNjkxNmYyYzMxZDkxNzE4OTE0ODkxMGVhZiIsImF0IjoxNzk1ODQ3NDUwLCJwYXJ0aWVzIjp7InJlcXVlc3Rlcl9hY2NvdW50X2hhc2giOm51bGwsInJlc3BvbmRlcl9hY2NvdW50X2hhc2giOiI4OWU5Y2I3M2JmYWNlNzY3YmZmNDFkODM2ZTdmN2FlZGNiYWIzMzlmNDkxOTMyZGE5ODNhMDM3ZmQzMDk5NTlmIiwicmVzcG9uZGVyIjp7ImFnZW50X2lkIjoiYWd0XzAxTThHREpWVzRTVlJUOEE4MTBSMENHOE1LIn0sInJlcXVlc3RlciI6eyJuYW1lIjoiRmxpZ2h0cyJ9fX0.Uh6pCQ4lfOGJBGmwRKEfXP9h2HdDJMTEXTqALUylzvw-MsyPAabD1HY5aqyBgLsCuXJ_4ZFP_LsZUhqCbzBDUQ"
  },
  "created_at": "2026-11-28T06:30:50.501Z",
  "updated_at": "2026-11-28T06:30:50.503Z",
  "verify": {
    "ok": true
  }
}
```

## Events

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

- `authorize.exchange.opened`
- `authorize.exchange.entry_added`
- `authorize.exchange.closed`

## Read an exchange

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

One exchange in your view, with the signed head and the chain recomputed (`verify`). An exchange you aren't a party to reads 404, the same as one that doesn't exist.

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

### Parameters

| Name | In | Type | Required | Description |
| --- | --- | --- | --- | --- |
| `id` | path | string | yes | The exchange (`xch_…`). |

### Returns

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

### Errors

- [`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": "Kestrel Air booking agent" }' > step.json
export AGENT_ID=$(jq -r '.id' step.json)
curl -s -X POST "$PROVENANCE_API/v1/authorize/briefs" \
  -H "Authorization: Bearer $PROVENANCE_KEY" \
  -H "Idempotency-Key: offer-sample-exchange" \
  -H "Content-Type: application/json" \
  -d "{
    \"side\": \"offering\",
    \"agent_id\": \"$AGENT_ID\",
    \"wants\": {
      \"items\": [
        {
          \"name\": \"Seat LIS-JFK\",
          \"sku\": \"TP209-0905\",
          \"category\": \"flight\",
          \"quantity\": 1
        }
      ],
      \"max_total\": 612,
      \"currency\": \"USD\",
      \"dates\": {
        \"start\": \"2027-03-12T09:05:00Z\"
      }
    },
    \"standard\": {
      \"items\": [
        {
          \"name\": \"Seat LIS-JFK\",
          \"sku\": \"TP209-0905\",
          \"category\": \"flight\",
          \"quantity\": 1
        }
      ],
      \"total\": 650,
      \"currency\": \"USD\",
      \"dates\": {
        \"start\": \"2027-03-12T09:05:00Z\"
      }
    },
    \"requester\": {
      \"name\": \"Flights\"
    }
  }" > step.json
export BRIEF_ID=$(jq -r '.id' step.json)
curl -s -X POST "$PROVENANCE_API/v1/authorize/counter_offers" \
  -H "Authorization: Bearer $PROVENANCE_KEY" \
  -H "Content-Type: application/json" \
  -d "{
    \"brief_id\": \"$BRIEF_ID\",
    \"channel\": \"a2a\",
    \"options\": [
      {
        \"label\": \"9:05 at list\",
        \"offer\": {
          \"items\": [
            {
              \"name\": \"Seat LIS-JFK\",
              \"sku\": \"TP209-0905\",
              \"category\": \"flight\",
              \"quantity\": 1
            }
          ],
          \"total\": 650,
          \"currency\": \"USD\",
          \"dates\": {
            \"start\": \"2027-03-12T09:05:00Z\"
          },
          \"expires_at\": \"2027-03-01T00:00:00Z\"
        }
      }
    ]
  }" > step.json
export COUNTER_OFFER_ID=$(jq -r '.id' step.json)
curl -s "$PROVENANCE_API/v1/authorize/counter_offers/$COUNTER_OFFER_ID" \
  -H "Authorization: Bearer $PROVENANCE_KEY" > step.json
export EXCHANGE_ID=$(jq -r '.exchange_id' step.json)
curl "$PROVENANCE_API/v1/authorize/exchanges/$EXCHANGE_ID" \
  -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": "Kestrel Air booking agent" }),
})).json();
const agentId = step1.id;
const step2 = await (await fetch(`${process.env.PROVENANCE_API}/v1/authorize/briefs`, {
  method: "POST",
  headers: { Authorization: "Bearer prv_test_acct_P9xN2vQ7bT4mW8sYd3cFjLh6gAe1kR5", "Content-Type": "application/json", "Idempotency-Key": "offer-sample-exchange" },
  body: JSON.stringify({
    "side": "offering",
    "agent_id": agentId,
    "wants": {
      "items": [
        {
          "name": "Seat LIS-JFK",
          "sku": "TP209-0905",
          "category": "flight",
          "quantity": 1
        }
      ],
      "max_total": 612,
      "currency": "USD",
      "dates": {
        "start": "2027-03-12T09:05:00Z"
      }
    },
    "standard": {
      "items": [
        {
          "name": "Seat LIS-JFK",
          "sku": "TP209-0905",
          "category": "flight",
          "quantity": 1
        }
      ],
      "total": 650,
      "currency": "USD",
      "dates": {
        "start": "2027-03-12T09:05:00Z"
      }
    },
    "requester": {
      "name": "Flights"
    }
  }),
})).json();
const briefId = step2.id;
const step3 = await (await fetch(`${process.env.PROVENANCE_API}/v1/authorize/counter_offers`, {
  method: "POST",
  headers: { Authorization: "Bearer prv_test_acct_P9xN2vQ7bT4mW8sYd3cFjLh6gAe1kR5", "Content-Type": "application/json" },
  body: JSON.stringify({
    "brief_id": briefId,
    "channel": "a2a",
    "options": [
      {
        "label": "9:05 at list",
        "offer": {
          "items": [
            {
              "name": "Seat LIS-JFK",
              "sku": "TP209-0905",
              "category": "flight",
              "quantity": 1
            }
          ],
          "total": 650,
          "currency": "USD",
          "dates": {
            "start": "2027-03-12T09:05:00Z"
          },
          "expires_at": "2027-03-01T00:00:00Z"
        }
      }
    ]
  }),
})).json();
const counterOfferId = step3.id;
const step4 = await (await fetch(`${process.env.PROVENANCE_API}/v1/authorize/counter_offers/${counterOfferId}`, {
  headers: { Authorization: "Bearer prv_test_acct_P9xN2vQ7bT4mW8sYd3cFjLh6gAe1kR5" },
})).json();
const exchangeId = step4.exchange_id;
const data = await (await fetch(`${process.env.PROVENANCE_API}/v1/authorize/exchanges/${exchangeId}`, {
  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": "Kestrel Air booking agent"
}).json()
agent_id = step1["id"]
step2 = httpx.post(f"{api}/v1/authorize/briefs", headers={"Authorization": "Bearer prv_test_acct_P9xN2vQ7bT4mW8sYd3cFjLh6gAe1kR5", "Idempotency-Key": "offer-sample-exchange"}, json={
    "side": "offering",
    "agent_id": agent_id,
    "wants": {
        "items": [
            {
                "name": "Seat LIS-JFK",
                "sku": "TP209-0905",
                "category": "flight",
                "quantity": 1
            }
        ],
        "max_total": 612,
        "currency": "USD",
        "dates": {
            "start": "2027-03-12T09:05:00Z"
        }
    },
    "standard": {
        "items": [
            {
                "name": "Seat LIS-JFK",
                "sku": "TP209-0905",
                "category": "flight",
                "quantity": 1
            }
        ],
        "total": 650,
        "currency": "USD",
        "dates": {
            "start": "2027-03-12T09:05:00Z"
        }
    },
    "requester": {
        "name": "Flights"
    }
}).json()
brief_id = step2["id"]
step3 = httpx.post(f"{api}/v1/authorize/counter_offers", headers={"Authorization": "Bearer prv_test_acct_P9xN2vQ7bT4mW8sYd3cFjLh6gAe1kR5"}, json={
    "brief_id": brief_id,
    "channel": "a2a",
    "options": [
        {
            "label": "9:05 at list",
            "offer": {
                "items": [
                    {
                        "name": "Seat LIS-JFK",
                        "sku": "TP209-0905",
                        "category": "flight",
                        "quantity": 1
                    }
                ],
                "total": 650,
                "currency": "USD",
                "dates": {
                    "start": "2027-03-12T09:05:00Z"
                },
                "expires_at": "2027-03-01T00:00:00Z"
            }
        }
    ]
}).json()
counter_offer_id = step3["id"]
step4 = httpx.get(f"{api}/v1/authorize/counter_offers/{counter_offer_id}", headers={"Authorization": "Bearer prv_test_acct_P9xN2vQ7bT4mW8sYd3cFjLh6gAe1kR5"}).json()
exchange_id = step4["exchange_id"]
data = httpx.get(f"{api}/v1/authorize/exchanges/{exchange_id}", headers={"Authorization": "Bearer prv_test_acct_P9xN2vQ7bT4mW8sYd3cFjLh6gAe1kR5"}).json()
```

### Response 200

```json
{
  "id": "xch_01M8GDJVW562GCQVBRBS8TCAAZ",
  "object": "exchange",
  "role": "responder",
  "side": "offering",
  "status": "open",
  "outcome": null,
  "parties": {
    "requester": {
      "customer": false,
      "name": "Flights"
    },
    "responder": {
      "customer": true,
      "you": true,
      "agent_id": "agt_01M8GDJVW4SVRT8A810R0CG8MK"
    }
  },
  "brief_id": "brf_01M8GDJVW4RCVHXKV51Y2E7RC6",
  "merged_into": null,
  "head": {
    "seq": 3,
    "head_hash": "eca47078f89429cbb965088065dd864057215126916f2c31d917189148910eaf",
    "jws": "eyJhbGciOiJFUzI1NiIsInR5cCI6ImV4Y2hhbmdlLWhlYWQrand0Iiwia2lkIjoiMjRkYzdjYjBjZWIwMmM4NiJ9.eyJpc3MiOiJwcm92ZW5hbmNlLWF1dGhvcml6ZSIsInhjaCI6InhjaF8wMU04R0RKVlc1NjJHQ1FWQlJCUzhUQ0FBWiIsInNlcSI6MywiaGVhZF9oYXNoIjoiZWNhNDcwNzhmODk0MjljYmI5NjUwODgwNjVkZDg2NDA1NzIxNTEyNjkxNmYyYzMxZDkxNzE4OTE0ODkxMGVhZiIsImF0IjoxNzk1ODQ3NDUwLCJwYXJ0aWVzIjp7InJlcXVlc3Rlcl9hY2NvdW50X2hhc2giOm51bGwsInJlc3BvbmRlcl9hY2NvdW50X2hhc2giOiI4OWU5Y2I3M2JmYWNlNzY3YmZmNDFkODM2ZTdmN2FlZGNiYWIzMzlmNDkxOTMyZGE5ODNhMDM3ZmQzMDk5NTlmIiwicmVzcG9uZGVyIjp7ImFnZW50X2lkIjoiYWd0XzAxTThHREpWVzRTVlJUOEE4MTBSMENHOE1LIn0sInJlcXVlc3RlciI6eyJuYW1lIjoiRmxpZ2h0cyJ9fX0.Uh6pCQ4lfOGJBGmwRKEfXP9h2HdDJMTEXTqALUylzvw-MsyPAabD1HY5aqyBgLsCuXJ_4ZFP_LsZUhqCbzBDUQ"
  },
  "created_at": "2026-11-28T06:30:50.501Z",
  "updated_at": "2026-11-28T06:30:50.503Z",
  "verify": {
    "ok": true
  }
}
```

## Read an exchange with your website key

`GET /v1/public/exchanges/{id}`

For a party with no account: sign the request (RFC 9421) with a key from the key file on your own domain, covering `@method`, `@authority` and `@path`, with a nonce. You read the shared view of an exchange your origin is a party to, never a private part or a note. Anything else reads 404.

Auth: none. No API key needed.

### Parameters

| Name | In | Type | Required | Description |
| --- | --- | --- | --- | --- |
| `id` | path | string | yes | The exchange (`xch_…`), from the A2A offers extension or the MCP `_meta` key `com.provenanceauth/exchange`. |
| `Signature` | header | string | yes | The RFC 9421 signature. |
| `Signature-Input` | header | string | yes | The covered components, `created`, `expires`, `keyid` and `nonce`. |
| `Signature-Agent` | header | string | yes | Your origin's key directory. |

### Returns

The shared view.

### Errors

- [`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
curl "$PROVENANCE_API/v1/public/exchanges/xch_01M8GDJVW562GCQVBRBS8TCAAZ"
```

**Node**

```ts
const data = await (await fetch(`${process.env.PROVENANCE_API}/v1/public/exchanges/xch_01M8GDJVW562GCQVBRBS8TCAAZ`)).json();
```

**Python**

```python
import os
import httpx

api = os.environ["PROVENANCE_API"]
data = httpx.get(f"{api}/v1/public/exchanges/xch_01M8GDJVW562GCQVBRBS8TCAAZ").json()
```

### Response 200

```json
{
  "id": "xch_01M8GDJVW562GCQVBRBS8TCAAZ",
  "object": "exchange",
  "view": "shared",
  "role": "responder",
  "side": "offering",
  "status": "open",
  "outcome": null,
  "parties": {
    "requester": {
      "customer": true
    },
    "responder": {
      "customer": false,
      "origin": "https://shop.example",
      "name": "Outside Shop"
    }
  },
  "merged_into": null,
  "head": {
    "seq": 1,
    "head_hash": "5f0c1b7e9d2a4c6e8f0a2b4c6d8e0f1a3b5c7d9e1f3a5b7c9d1e3f5a7b9c1d3e",
    "jws": null
  },
  "entries": [
    {
      "seq": 1,
      "kind": "counter_offer",
      "entry": {
        "seq": 1,
        "kind": "counter_offer"
      },
      "entry_hash": "5f0c1b7e9d2a4c6e8f0a2b4c6d8e0f1a3b5c7d9e1f3a5b7c9d1e3f5a7b9c1d3e"
    }
  ],
  "verify": {
    "ok": true
  },
  "created_at": "2026-11-28T10:00:00.000Z",
  "updated_at": "2026-11-28T10:00:00.000Z"
}
```

## List exchanges

`GET /v1/authorize/exchanges`

The exchange records your account is a party to, newest first, each in your view.

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

### Parameters

| Name | In | Type | Required | Description |
| --- | --- | --- | --- | --- |
| `brief_id` | query | string | no | Only exchanges of this brief (yours). |
| `status` | query | enum | no | Only this state. One of `open`, `closed`, `joined`. |
| `limit` | query | integer | no | At most this many (default 50). |

### Returns

The exchanges.

### 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
export PROVENANCE_KEY=prv_test_acct_P9xN2vQ7bT4mW8sYd3cFjLh6gAe1kR5
curl "$PROVENANCE_API/v1/authorize/exchanges" \
  -H "Authorization: Bearer $PROVENANCE_KEY"
```

**Node**

```ts
const data = await (await fetch(`${process.env.PROVENANCE_API}/v1/authorize/exchanges`, {
  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/exchanges", headers={"Authorization": "Bearer prv_test_acct_P9xN2vQ7bT4mW8sYd3cFjLh6gAe1kR5"}).json()
```

### Response 200

```json
{
  "object": "list",
  "data": [
    {
      "id": "xch_01M8GDJVVTNQ9MA42ABVX2MN36",
      "object": "exchange",
      "role": "responder",
      "side": "offering",
      "status": "open",
      "outcome": null,
      "parties": {
        "requester": {
          "customer": false,
          "name": "Flights"
        },
        "responder": {
          "customer": true,
          "you": true,
          "agent_id": "agt_01M8GDJVVQFY23QS2DBGP60BN4"
        }
      },
      "brief_id": "brf_01M8GDJVVSXFE77XD64JGHN1CJ",
      "merged_into": null,
      "head": {
        "seq": 3,
        "head_hash": "11dfe9fa2340be1308d7b5f0a7a3dc867c40bb9a783453dc8fcc21397ddec26f",
        "jws": "eyJhbGciOiJFUzI1NiIsInR5cCI6ImV4Y2hhbmdlLWhlYWQrand0Iiwia2lkIjoiMjRkYzdjYjBjZWIwMmM4NiJ9.eyJpc3MiOiJwcm92ZW5hbmNlLWF1dGhvcml6ZSIsInhjaCI6InhjaF8wMU04R0RKVlZUTlE5TUE0MkFCVlgyTU4zNiIsInNlcSI6MywiaGVhZF9oYXNoIjoiMTFkZmU5ZmEyMzQwYmUxMzA4ZDdiNWYwYTdhM2RjODY3YzQwYmI5YTc4MzQ1M2RjOGZjYzIxMzk3ZGRlYzI2ZiIsImF0IjoxNzk1ODQ3NDUwLCJwYXJ0aWVzIjp7InJlcXVlc3Rlcl9hY2NvdW50X2hhc2giOm51bGwsInJlc3BvbmRlcl9hY2NvdW50X2hhc2giOiI4OWU5Y2I3M2JmYWNlNzY3YmZmNDFkODM2ZTdmN2FlZGNiYWIzMzlmNDkxOTMyZGE5ODNhMDM3ZmQzMDk5NTlmIiwicmVzcG9uZGVyIjp7ImFnZW50X2lkIjoiYWd0XzAxTThHREpWVlFGWTIzUVMyREJHUDYwQk40In0sInJlcXVlc3RlciI6eyJuYW1lIjoiRmxpZ2h0cyJ9fX0.pS2Z2TsdW-pFlYjqkizTTxXh_VL4XpCct4P9mDtAEE-DOP8XrnkcViJOUPrMGt86zCBo-wC888qNiJX5c2uYsg"
      },
      "created_at": "2026-11-28T06:30:50.490Z",
      "updated_at": "2026-11-28T06:30:50.493Z"
    }
  ],
  "has_more": false
}
```

## List an exchange's entries

`GET /v1/authorize/exchanges/{id}/entries`

The entries in order, in your view: each canonical entry and its hash, and your own private part. The other side's private part is only a salted commitment, so you verify the whole chain without seeing it.

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

### Parameters

| Name | In | Type | Required | Description |
| --- | --- | --- | --- | --- |
| `id` | path | string | yes | The exchange (`xch_…`). |
| `since_seq` | query | integer | no | Only entries after this one. |
| `limit` | query | integer | no | At most this many (default 100). |
| `cursor` | query | string | no | `next_cursor` from the previous page. |

### Returns

The entries.

### Errors

- [`parameter_invalid`](https://provenanceauth.com/docs/platform/errors.md#parameter_invalid)
- [`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": "Kestrel Air booking agent" }' > step.json
export AGENT_ID=$(jq -r '.id' step.json)
curl -s -X POST "$PROVENANCE_API/v1/authorize/briefs" \
  -H "Authorization: Bearer $PROVENANCE_KEY" \
  -H "Idempotency-Key: offer-sample-entries" \
  -H "Content-Type: application/json" \
  -d "{
    \"side\": \"offering\",
    \"agent_id\": \"$AGENT_ID\",
    \"wants\": {
      \"items\": [
        {
          \"name\": \"Seat LIS-JFK\",
          \"sku\": \"TP209-0905\",
          \"category\": \"flight\",
          \"quantity\": 1
        }
      ],
      \"max_total\": 612,
      \"currency\": \"USD\",
      \"dates\": {
        \"start\": \"2027-03-12T09:05:00Z\"
      }
    },
    \"standard\": {
      \"items\": [
        {
          \"name\": \"Seat LIS-JFK\",
          \"sku\": \"TP209-0905\",
          \"category\": \"flight\",
          \"quantity\": 1
        }
      ],
      \"total\": 650,
      \"currency\": \"USD\",
      \"dates\": {
        \"start\": \"2027-03-12T09:05:00Z\"
      }
    },
    \"requester\": {
      \"name\": \"Flights\"
    }
  }" > step.json
export BRIEF_ID=$(jq -r '.id' step.json)
curl -s -X POST "$PROVENANCE_API/v1/authorize/counter_offers" \
  -H "Authorization: Bearer $PROVENANCE_KEY" \
  -H "Content-Type: application/json" \
  -d "{
    \"brief_id\": \"$BRIEF_ID\",
    \"channel\": \"a2a\",
    \"options\": [
      {
        \"label\": \"9:05 at list\",
        \"offer\": {
          \"items\": [
            {
              \"name\": \"Seat LIS-JFK\",
              \"sku\": \"TP209-0905\",
              \"category\": \"flight\",
              \"quantity\": 1
            }
          ],
          \"total\": 650,
          \"currency\": \"USD\",
          \"dates\": {
            \"start\": \"2027-03-12T09:05:00Z\"
          },
          \"expires_at\": \"2027-03-01T00:00:00Z\"
        }
      }
    ]
  }" > step.json
export COUNTER_OFFER_ID=$(jq -r '.id' step.json)
curl -s "$PROVENANCE_API/v1/authorize/counter_offers/$COUNTER_OFFER_ID" \
  -H "Authorization: Bearer $PROVENANCE_KEY" > step.json
export EXCHANGE_ID=$(jq -r '.exchange_id' step.json)
curl "$PROVENANCE_API/v1/authorize/exchanges/$EXCHANGE_ID/entries" \
  -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": "Kestrel Air booking agent" }),
})).json();
const agentId = step1.id;
const step2 = await (await fetch(`${process.env.PROVENANCE_API}/v1/authorize/briefs`, {
  method: "POST",
  headers: { Authorization: "Bearer prv_test_acct_P9xN2vQ7bT4mW8sYd3cFjLh6gAe1kR5", "Content-Type": "application/json", "Idempotency-Key": "offer-sample-entries" },
  body: JSON.stringify({
    "side": "offering",
    "agent_id": agentId,
    "wants": {
      "items": [
        {
          "name": "Seat LIS-JFK",
          "sku": "TP209-0905",
          "category": "flight",
          "quantity": 1
        }
      ],
      "max_total": 612,
      "currency": "USD",
      "dates": {
        "start": "2027-03-12T09:05:00Z"
      }
    },
    "standard": {
      "items": [
        {
          "name": "Seat LIS-JFK",
          "sku": "TP209-0905",
          "category": "flight",
          "quantity": 1
        }
      ],
      "total": 650,
      "currency": "USD",
      "dates": {
        "start": "2027-03-12T09:05:00Z"
      }
    },
    "requester": {
      "name": "Flights"
    }
  }),
})).json();
const briefId = step2.id;
const step3 = await (await fetch(`${process.env.PROVENANCE_API}/v1/authorize/counter_offers`, {
  method: "POST",
  headers: { Authorization: "Bearer prv_test_acct_P9xN2vQ7bT4mW8sYd3cFjLh6gAe1kR5", "Content-Type": "application/json" },
  body: JSON.stringify({
    "brief_id": briefId,
    "channel": "a2a",
    "options": [
      {
        "label": "9:05 at list",
        "offer": {
          "items": [
            {
              "name": "Seat LIS-JFK",
              "sku": "TP209-0905",
              "category": "flight",
              "quantity": 1
            }
          ],
          "total": 650,
          "currency": "USD",
          "dates": {
            "start": "2027-03-12T09:05:00Z"
          },
          "expires_at": "2027-03-01T00:00:00Z"
        }
      }
    ]
  }),
})).json();
const counterOfferId = step3.id;
const step4 = await (await fetch(`${process.env.PROVENANCE_API}/v1/authorize/counter_offers/${counterOfferId}`, {
  headers: { Authorization: "Bearer prv_test_acct_P9xN2vQ7bT4mW8sYd3cFjLh6gAe1kR5" },
})).json();
const exchangeId = step4.exchange_id;
const data = await (await fetch(`${process.env.PROVENANCE_API}/v1/authorize/exchanges/${exchangeId}/entries`, {
  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": "Kestrel Air booking agent"
}).json()
agent_id = step1["id"]
step2 = httpx.post(f"{api}/v1/authorize/briefs", headers={"Authorization": "Bearer prv_test_acct_P9xN2vQ7bT4mW8sYd3cFjLh6gAe1kR5", "Idempotency-Key": "offer-sample-entries"}, json={
    "side": "offering",
    "agent_id": agent_id,
    "wants": {
        "items": [
            {
                "name": "Seat LIS-JFK",
                "sku": "TP209-0905",
                "category": "flight",
                "quantity": 1
            }
        ],
        "max_total": 612,
        "currency": "USD",
        "dates": {
            "start": "2027-03-12T09:05:00Z"
        }
    },
    "standard": {
        "items": [
            {
                "name": "Seat LIS-JFK",
                "sku": "TP209-0905",
                "category": "flight",
                "quantity": 1
            }
        ],
        "total": 650,
        "currency": "USD",
        "dates": {
            "start": "2027-03-12T09:05:00Z"
        }
    },
    "requester": {
        "name": "Flights"
    }
}).json()
brief_id = step2["id"]
step3 = httpx.post(f"{api}/v1/authorize/counter_offers", headers={"Authorization": "Bearer prv_test_acct_P9xN2vQ7bT4mW8sYd3cFjLh6gAe1kR5"}, json={
    "brief_id": brief_id,
    "channel": "a2a",
    "options": [
        {
            "label": "9:05 at list",
            "offer": {
                "items": [
                    {
                        "name": "Seat LIS-JFK",
                        "sku": "TP209-0905",
                        "category": "flight",
                        "quantity": 1
                    }
                ],
                "total": 650,
                "currency": "USD",
                "dates": {
                    "start": "2027-03-12T09:05:00Z"
                },
                "expires_at": "2027-03-01T00:00:00Z"
            }
        }
    ]
}).json()
counter_offer_id = step3["id"]
step4 = httpx.get(f"{api}/v1/authorize/counter_offers/{counter_offer_id}", headers={"Authorization": "Bearer prv_test_acct_P9xN2vQ7bT4mW8sYd3cFjLh6gAe1kR5"}).json()
exchange_id = step4["exchange_id"]
data = httpx.get(f"{api}/v1/authorize/exchanges/{exchange_id}/entries", headers={"Authorization": "Bearer prv_test_acct_P9xN2vQ7bT4mW8sYd3cFjLh6gAe1kR5"}).json()
```

### Response 200

```json
{
  "object": "list",
  "exchange_id": "xch_01M8GDJVWC2M6RVTYVY22X0N3N",
  "role": "responder",
  "data": [
    {
      "seq": 1,
      "kind": "request_recorded",
      "entry": {
        "xch": "xch_01M8GDJVWC2M6RVTYVY22X0N3N",
        "seq": 1,
        "at": "2026-11-28T06:30:50.508Z",
        "kind": "request_recorded",
        "role": "responder",
        "actor": {
          "kind": "agent",
          "id_or_subject": "agt_01M8GDJVWBTH919Q2YBCDH2ZPB"
        },
        "shared": {
          "wants": {
            "items": [
              {
                "name": "Seat LIS-JFK",
                "sku": "TP209-0905",
                "category": "flight",
                "quantity": 1
              }
            ],
            "max_total": 612,
            "currency": "USD",
            "dates": {
              "start": "2027-03-12T09:05:00Z"
            }
          },
          "brief_hash": "7e948c2977e3bcbb3c7a372a3560c74a20dd48eda753f07a5199365018c90287"
        },
        "commitments": {
          "responder": "76f603e7a30df4d968aa0075c35b1d2b6c31656d7c86442c46344cef2e783263"
        },
        "refs": {
          "brief_hash": "7e948c2977e3bcbb3c7a372a3560c74a20dd48eda753f07a5199365018c90287"
        },
        "prev": "0000000000000000000000000000000000000000000000000000000000000000"
      },
      "entry_hash": "bf02de6875a08f0c0c252b0ee68afb519e50f7af22ceef4972ce13fe4325e586",
      "private": {
        "salt": "643dede327174c17eb1ba72afcd631ee4c3b044dea1c25140925c812a4401174",
        "private": {
          "standard": {
            "items": [
              {
                "name": "Seat LIS-JFK",
                "sku": "TP209-0905",
                "category": "flight",
                "quantity": 1
              }
            ],
            "max_total": 650,
            "currency": "USD",
            "dates": {
              "start": "2027-03-12T09:05:00Z"
            }
          }
        }
      }
    },
    {
      "seq": 2,
      "kind": "offer",
      "entry": {
        "xch": "xch_01M8GDJVWC2M6RVTYVY22X0N3N",
        "seq": 2,
        "at": "2026-11-28T06:30:50.509Z",
        "kind": "offer",
        "role": "responder",
        "actor": {
          "kind": "agent",
          "id_or_subject": "agt_01M8GDJVWBTH919Q2YBCDH2ZPB"
        },
        "shared": {
          "option": 0,
          "offer_hash": "c67b354508443ca58b8c567da1841332dcb2aad0a4a0657cb6466c9d2365903f",
          "offer": {
            "items": [
              {
                "name": "Seat LIS-JFK",
                "sku": "TP209-0905",
                "category": "flight",
                "quantity": 1
              }
            ],
            "total": 650,
            "currency": "USD",
            "dates": {
              "start": "2027-03-12T09:05:00Z"
            },
            "expires_at": "2027-03-01T00:00:00Z"
          },
          "signed": false
        },
        "commitments": {
          "responder": "209901901aa1cea1aad619a4b2b15bc4bb9138c06b553aa397c53bcf5a69bea9"
        },
        "refs": {
          "offer_hash": "c67b354508443ca58b8c567da1841332dcb2aad0a4a0657cb6466c9d2365903f",
          "counter_offer_id": "cof_01M8GDJVWD10C92PTM2HCS5926"
        },
        "prev": "bf02de6875a08f0c0c252b0ee68afb519e50f7af22ceef4972ce13fe4325e586"
      },
      "entry_hash": "12c93888cd7dbd7d015f831d8c5a3ef9e588f1334d349e9070ee5326590ce10b",
      "private": {
        "salt": "1f90aa496740edb4b10d1af787621ed785eba5f15952d5c41dcce3ef608bcff6",
        "private": {
          "result": "within_authority",
          "reason": null,
          "concession": []
        }
      }
    },
    {
      "seq": 3,
      "kind": "offer_cleared",
      "entry": {
        "xch": "xch_01M8GDJVWC2M6RVTYVY22X0N3N",
        "seq": 3,
        "at": "2026-11-28T06:30:50.509Z",
        "kind": "offer_cleared",
        "role": "responder",
        "actor": {
          "kind": "server",
          "id_or_subject": null
        },
        "shared": {
          "offer_hash": "c67b354508443ca58b8c567da1841332dcb2aad0a4a0657cb6466c9d2365903f",
          "cleared_by": "rules"
        },
        "commitments": {},
        "refs": {
          "offer_hash": "c67b354508443ca58b8c567da1841332dcb2aad0a4a0657cb6466c9d2365903f",
          "counter_offer_id": "cof_01M8GDJVWD10C92PTM2HCS5926"
        },
        "prev": "12c93888cd7dbd7d015f831d8c5a3ef9e588f1334d349e9070ee5326590ce10b"
      },
      "entry_hash": "657db01d1e231ad67f284ab2d0a1fee0a3b409474ff9ae763455c4c9b058f0b9"
    }
  ],
  "head": {
    "seq": 3,
    "head_hash": "657db01d1e231ad67f284ab2d0a1fee0a3b409474ff9ae763455c4c9b058f0b9",
    "jws": "eyJhbGciOiJFUzI1NiIsInR5cCI6ImV4Y2hhbmdlLWhlYWQrand0Iiwia2lkIjoiMjRkYzdjYjBjZWIwMmM4NiJ9.eyJpc3MiOiJwcm92ZW5hbmNlLWF1dGhvcml6ZSIsInhjaCI6InhjaF8wMU04R0RKVldDMk02UlZUWVZZMjJYME4zTiIsInNlcSI6MywiaGVhZF9oYXNoIjoiNjU3ZGIwMWQxZTIzMWFkNjdmMjg0YWIyZDBhMWZlZTBhM2I0MDk0NzRmZjlhZTc2MzQ1NWM0YzliMDU4ZjBiOSIsImF0IjoxNzk1ODQ3NDUwLCJwYXJ0aWVzIjp7InJlcXVlc3Rlcl9hY2NvdW50X2hhc2giOm51bGwsInJlc3BvbmRlcl9hY2NvdW50X2hhc2giOiI4OWU5Y2I3M2JmYWNlNzY3YmZmNDFkODM2ZTdmN2FlZGNiYWIzMzlmNDkxOTMyZGE5ODNhMDM3ZmQzMDk5NTlmIiwicmVzcG9uZGVyIjp7ImFnZW50X2lkIjoiYWd0XzAxTThHREpWV0JUSDkxOVEyWUJDREgyWlBCIn0sInJlcXVlc3RlciI6eyJuYW1lIjoiRmxpZ2h0cyJ9fX0.ubTkG5_6CKQVPpUKgQ3zKdnGRgWef940-EQxYHc1pvb7Z14L4jqTJDJRWO5lDe0vZU9e-zxamXqntWrw5U_udA"
  },
  "has_more": false
}
```

## Export an exchange's signed bundle

`POST /v1/authorize/exchanges/{id}/export`

The signed bundle of an exchange's shared view for a dispute or an audit: entries, the signed head, the published keys, the chain check and the offline verifier. `reveal` with your own side adds your private parts and their salts. 10 an hour per account; not a party reads 404.

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

### Parameters

| Name | In | Type | Required | Description |
| --- | --- | --- | --- | --- |
| `id` | path | string | yes | The exchange (`xch_…`). |
| `reveal` | body | array of enums | no | Your own side (your role in the exchange), to include your private parts with their salts. Naming the other side is 400. |

### Returns

The bundle.

### Errors

- [`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/exchanges/$EXCHANGE_ID/export" \
  -H "Authorization: Bearer $PROVENANCE_KEY"
```

**Node**

```ts
const data = await (await fetch(`${process.env.PROVENANCE_API}/v1/authorize/exchanges/${exchangeId}/export`, {
  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/exchanges/{exchange_id}/export", headers={"Authorization": "Bearer prv_test_acct_P9xN2vQ7bT4mW8sYd3cFjLh6gAe1kR5"}).json()
```

### Response 200

```json
{
  "object": "exchange_bundle",
  "format": "signed_bundle",
  "exchange_id": "xch_01M8GDJVW562GCQVBRBS8TCAAZ",
  "view": "shared",
  "role": "responder",
  "entries": [
    {
      "seq": 1,
      "kind": "counter_offer",
      "entry": {
        "seq": 1,
        "kind": "counter_offer",
        "prev": "0000000000000000000000000000000000000000000000000000000000000000"
      },
      "entry_hash": "5f0c1b7e9d2a4c6e8f0a2b4c6d8e0f1a3b5c7d9e1f3a5b7c9d1e3f5a7b9c1d3e"
    }
  ],
  "head": {
    "seq": 1,
    "head_hash": "5f0c1b7e9d2a4c6e8f0a2b4c6d8e0f1a3b5c7d9e1f3a5b7c9d1e3f5a7b9c1d3e",
    "jws": "eyJhbGciOiJFUzI1NiIsInR5cCI6ImV4Y2hhbmdlLWhlYWQrand0In0.eyJ4Y2giOiJ4Y2hfMDEifQ.c2lnbmF0dXJl",
    "typ": "exchange-head+jwt"
  },
  "keys": {
    "keys": [
      {
        "kty": "EC",
        "crv": "P-256",
        "kid": "4c1f9a2e7b3d5c8a",
        "x": "f83OJ3D2xF1Bg8vub9tLe1gHMzV76e8Tus9uPHvRVEU",
        "y": "x_FEzRu9m36HLN_tue659LNpXW6pCyStikYjKIWI5a0"
      }
    ]
  },
  "verify": {
    "ok": true
  },
  "built_at": "2026-11-28T10:00:00.000Z"
}
```

## Export an exchange with your website key

`GET /v1/public/exchanges/{id}/export`

For a party with no Provenance account, signed the same way as reading it: the signed bundle of the shared view (every entry, the signed head, the keys that sign heads and the chain check), never a private part or a note. 10 an hour per key. Anything else, a missing or wrong signature included, reads 404.

Auth: none. No API key needed.

### Parameters

| Name | In | Type | Required | Description |
| --- | --- | --- | --- | --- |
| `id` | path | string | yes | The exchange (`xch_…`). |
| `Signature` | header | string | yes | The RFC 9421 signature. |
| `Signature-Input` | header | string | yes | The covered components, `created`, `expires`, `keyid` and `nonce`. |
| `Signature-Agent` | header | string | yes | Your origin's key directory. |

### Returns

The bundle.

### Errors

- [`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
curl "$PROVENANCE_API/v1/public/exchanges/xch_01M8GDJVW562GCQVBRBS8TCAAZ/export"
```

**Node**

```ts
const data = await (await fetch(`${process.env.PROVENANCE_API}/v1/public/exchanges/xch_01M8GDJVW562GCQVBRBS8TCAAZ/export`)).json();
```

**Python**

```python
import os
import httpx

api = os.environ["PROVENANCE_API"]
data = httpx.get(f"{api}/v1/public/exchanges/xch_01M8GDJVW562GCQVBRBS8TCAAZ/export").json()
```

### Response 200

```json
{
  "object": "exchange_bundle",
  "format": "signed_bundle",
  "exchange_id": "xch_01M8GDJVW562GCQVBRBS8TCAAZ",
  "view": "shared",
  "role": "responder",
  "entries": [],
  "head": {
    "seq": 0,
    "head_hash": "0000000000000000000000000000000000000000000000000000000000000000",
    "jws": null,
    "typ": "exchange-head+jwt"
  },
  "keys": {
    "keys": []
  },
  "verify": {
    "ok": true
  },
  "built_at": "2026-11-28T10:00:00.000Z"
}
```
