# Store integrations

Your shops on hosted store platforms (Shopify first): connect a shop, and its orders run through your checkout rules; an order a rule names is held until the buyer approves.

Related guide: [Hold Shopify orders](https://provenanceauth.com/docs/authorize/guides/shopify.md)

## Endpoints

- `POST /v1/authorize/store_connections/{id}/default_rule`: [Add the store default rule](#post-v1-authorize-store-connections-id-default-rule)
- `GET /v1/authorize/store_connections/{id}`: [Retrieve a store connection](#get-v1-authorize-store-connections-id)
- `GET /v1/authorize/store_orders/{id}`: [Retrieve a store order](#get-v1-authorize-store-orders-id)
- `PATCH /v1/authorize/store_connections/{id}`: [Update a store connection](#patch-v1-authorize-store-connections-id)
- `GET /v1/authorize/store_connections`: [List store connections](#get-v1-authorize-store-connections)
- `GET /v1/authorize/store_orders`: [List store orders](#get-v1-authorize-store-orders)
- `GET /v1/authorize/store_agent_channels`: [List agent sales channels](#get-v1-authorize-store-agent-channels)
- `DELETE /v1/authorize/store_connections/{id}`: [Disconnect a store](#delete-v1-authorize-store-connections-id)
- `POST /v1/authorize/store_orders/{id}/release`: [Release a held order](#post-v1-authorize-store-orders-id-release)
- `POST /v1/authorize/store_orders/{id}/outcome`: [Report a store order's outcome](#post-v1-authorize-store-orders-id-outcome)
- `POST /v1/authorize/store_orders/{id}/cancel`: [Cancel and refund a held order](#post-v1-authorize-store-orders-id-cancel)

## The store order object

### Attributes

| Name | Type | Required | Description |
| --- | --- | --- | --- |
| `id` | string | yes | Unique identifier for the object (`sto_`). |
| `object` | enum | yes | The type of object. One of `store_order`. |
| `store_connection_id` | string | yes | The shop the order came from. |
| `platform_order_id` | string | yes | The platform's order ID. |
| `order_name` | string \| null | no | The platform's name for the order, for example `#1002`. |
| `state` | enum | yes | `not_challenged`: no rule challenged it, and the order goes on as the platform handles it. `challenged`: held while the buyer decides. `held`: held for you (a Hold for review rule, a decline, an expiry, or no contact). `released`: the hold was lifted. `cancelled`: cancelled and refunded. One of `checked`, `challenged`, `held`, `released`, `cancelled`, `not_challenged`. |
| `reason` | string \| null | no | Why the order is in its state, from the [reason codes](https://provenanceauth.com/docs/platform/reason-codes.md): for example `store_no_rule`, `policy_rule`, `store_buyer_approved`, `store_buyer_declined`, `store_hold_rule`. |
| `rule_id` | string \| null | no | The checkout rule that asked or held. |
| `checkout_approval_id` | string \| null | no | The cart approval sent to the buyer. |
| `approval_status` | string \| null | no | The cart approval's status as last heard: `pending`, `approved`, `denied`, `expired` or `in_review`. |
| `held` | boolean | yes | Whether Provenance's fulfillment hold is on the order now. |
| `risk` | enum | no | The risk level last written to the platform's order page. One of `pending`, `low`, `high`. |
| `payment_signals` | object \| any \| null | no | The payment signals the order carried; null until a platform carries an agent credential we can read (Shopify carries none yet). |
| `payment_signals.shared_payment_token` | boolean | no | You named a shared payment token (`payment.shared_payment_token`), checked or not. |
| `payment_signals.checked` | boolean | no | The token was read on your Stripe account and matched its mode. |
| `payment_signals.unchecked_reason` | enum | no | Why a named token wasn't checked: no active Stripe connection, the key lacks the shared payment token read, Stripe doesn't know the token, a token of the other mode, or Stripe didn't answer in time. One of `no_connection`, `permission_missing`, `not_found`, `mode_mismatch`, `unavailable`. |
| `payment_signals.agent_profile` | string \| null | no | The agent's Stripe profile (`network_business_profile`), when the token was checked. |
| `payment_signals.usage_limit` | object \| null | no | The token's usage limit, when the token was checked. |
| `payment_signals.usage_limit.max_amount` | integer | no | The most it can pay, in minor units. |
| `payment_signals.usage_limit.currency` | string | no | Lowercase ISO 4217. |
| `payment_signals.credential_type` | enum | no | The credential type you reported from your own token resolve. One of `agentic_token`, `dpan`, `fpan`. |
| `payment_signals.network_token` | boolean \| null | no | Whether the PaymentIntent's latest charge used a network token (null when not read). A network token alone never makes an agent order. |
| `payment_signals.risk` | object | no | Stripe's risk scores for the token, when it was checked, on the scale Stripe's shared payment token reference gives. |
| `payment_signals.risk.bot` | number | no | Stripe bot score. |
| `payment_signals.risk.card_testing` | number | no | Stripe card testing score. |
| `payment_signals.risk.stolen_card` | number | no | Stripe stolen card score. |
| `payment_signals.risk.fraudulent_dispute` | number | no | Stripe fraud dispute score. |
| `payment_signals.risk.card_issuer_decline` | number | no | Stripe bank decline score. |
| `created_at` | timestamp | yes | When the order arrived. |
| `updated_at` | timestamp | yes | When the order's state last changed. |
| `ending` | object \| any \| null | no | How the order ended, worked out. On `GET` and the list; null while nothing is known yet. |
| `ending.outcome` | enum | no | `chargeback`: a dispute matched to the order. `fraud`: a fraud report on the order's token or agent. `refund_abuse`: refunds repeat for the same shopper or agent. `refunded`: a refund that does not repeat. `customer_denied`: the shopper declined. `store_rejected`: your review or your staff refused it. `legitimate`: reported so, or 14 days passed with no dispute or refund. One of `chargeback`, `fraud`, `refund_abuse`, `refunded`, `customer_denied`, `store_rejected`, `legitimate`. |
| `ending.source` | enum | no | Where it came from: `reported` is an outcome you reported; `quiet_period` is an order that went ahead on a connection that reports disputes and heard nothing for 14 days. One of `reported`, `chargeback`, `network_report`, `approval_denied`, `staff_cancel`, `refund`, `quiet_period`. |
| `ending.at` | timestamp | no | When it ended this way: the report, the dispute, the refund, the decline, or the end of the 14 days. |

### Example

```json
{
  "object": "store_order",
  "id": "sto_01M7V7QYS7FQ9HETWF1HF5SM2H",
  "store_connection_id": "stc_01M7V7QYRYH5TA9E3H2GV0VT1Y",
  "platform_order_id": "5512345678901",
  "order_name": "#1002",
  "state": "challenged",
  "reason": "policy_rule",
  "rule_id": "rul_01M7V7QYS373XHYJSGGCQ4M2RJ",
  "checkout_approval_id": "coap_01M7V7QYS8H2SM4X31ME688ZWN",
  "approval_status": "pending",
  "held": true,
  "risk": "pending",
  "created_at": "2026-11-19T16:24:42.791Z",
  "updated_at": "2026-11-19T16:24:42.794Z"
}
```

## Add the store default rule

`POST /v1/authorize/store_connections/{id}/default_rule`

Adds Orders from AI agents (`store.agent_order` is true → ask the buyer) at the top of your checkout rules, as a new version; the previous version stays in the history. Nothing changes when a rule on `store.agent_order` is already there. Needs Manage policies.

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

### Parameters

| Name | In | Type | Required | Description |
| --- | --- | --- | --- | --- |
| `id` | path | string | yes | The connection's ID (`stc_`). |

### Returns

What happened.

### Errors

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

### Request

**curl**

```bash
export PROVENANCE_KEY=prv_test_ent_E7nT2vQ9bW4mK8sYd3cFjLh6gAe1pR5x
curl -X POST "$PROVENANCE_API/v1/authorize/store_connections/stc_01M7V7QYRYH5TA9E3H2GV0VT1Y/default_rule" \
  -H "Authorization: Bearer $PROVENANCE_KEY"
```

**Node**

```ts
const data = await (await fetch(`${process.env.PROVENANCE_API}/v1/authorize/store_connections/stc_01M7V7QYRYH5TA9E3H2GV0VT1Y/default_rule`, {
  method: "POST",
  headers: { Authorization: "Bearer prv_test_ent_E7nT2vQ9bW4mK8sYd3cFjLh6gAe1pR5x" },
})).json();
```

**Python**

```python
import os
import httpx

api = os.environ["PROVENANCE_API"]
data = httpx.post(f"{api}/v1/authorize/store_connections/stc_01M7V7QYRYH5TA9E3H2GV0VT1Y/default_rule", headers={"Authorization": "Bearer prv_test_ent_E7nT2vQ9bW4mK8sYd3cFjLh6gAe1pR5x"}).json()
```

### Response 200

```json
{
  "object": "store_default_rule",
  "result": "published",
  "rule_id": "rul_01M7V7QYS373XHYJSGGCQ4M2RJ",
  "policy_version": 4
}
```

## Retrieve a store connection

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

Returns one shop, with whether your checkout rules have a rule on `store.agent_order` (`default_rule`).

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

### Parameters

| Name | In | Type | Required | Description |
| --- | --- | --- | --- | --- |
| `id` | path | string | yes | The connection's ID (`stc_`). |

### Returns

The connection.

### Errors

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

### Request

**curl**

```bash
export PROVENANCE_KEY=prv_test_ent_E7nT2vQ9bW4mK8sYd3cFjLh6gAe1pR5x
curl "$PROVENANCE_API/v1/authorize/store_connections/stc_01M7V7QYRYH5TA9E3H2GV0VT1Y" \
  -H "Authorization: Bearer $PROVENANCE_KEY"
```

**Node**

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

**Python**

```python
import os
import httpx

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

### Response 200

```json
{
  "object": "store_connection",
  "id": "stc_01M7V7QYRYH5TA9E3H2GV0VT1Y",
  "platform": "shopify",
  "shop_domain": "saltmarsh-goods.myshopify.com",
  "shop_name": null,
  "status": "active",
  "scopes": [
    "read_orders",
    "write_orders",
    "write_merchant_managed_fulfillment_orders"
  ],
  "billing_source": "shopify",
  "settings": {
    "auto_cancel_on_decline": false,
    "agent_channels": [
      "8765309"
    ],
    "storefront_check": true,
    "storefront_category": "security",
    "field_timing": false
  },
  "installed_at": "2026-11-19T16:02:11.204Z",
  "uninstalled_at": null,
  "created_at": "2026-11-19T16:01:40.118Z",
  "updated_at": "2026-11-19T16:20:03.552Z",
  "default_rule": "present",
  "storefront": {
    "script_url": "https://api.provenanceauth.com/v1/identify/storefront.js?shop=saltmarsh-goods.myshopify.com",
    "theme_editor_url": "https://saltmarsh-goods.myshopify.com/admin/themes/current/editor?context=apps&activateAppId=4c2d9a7e4b1f3a5c6e8d0b2f4a6c8e1d%2Fstorefront-check",
    "traffic": {
      "window": "7d",
      "humans": 412,
      "signed_agents": 9,
      "unsigned_agents": 31,
      "automated_browsers": 17,
      "unknown": 6
    }
  }
}
```

## Retrieve a store order

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

Returns one order from a connected shop: its state, why, and the cart approval sent to the buyer.

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

### Parameters

| Name | In | Type | Required | Description |
| --- | --- | --- | --- | --- |
| `id` | path | string | yes | The store order's ID (`sto_`). |

### Returns

The order. See [the store order object](#object).

### Errors

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

### Request

**curl**

```bash
export PROVENANCE_KEY=prv_test_ent_E7nT2vQ9bW4mK8sYd3cFjLh6gAe1pR5x
curl "$PROVENANCE_API/v1/authorize/store_orders/sto_01M7V7QYS7FQ9HETWF1HF5SM2H" \
  -H "Authorization: Bearer $PROVENANCE_KEY"
```

**Node**

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

**Python**

```python
import os
import httpx

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

### Response 200

```json
{
  "object": "store_order",
  "id": "sto_01M7V7QYS7FQ9HETWF1HF5SM2H",
  "store_connection_id": "stc_01M7V7QYRYH5TA9E3H2GV0VT1Y",
  "platform_order_id": "5512345678901",
  "order_name": "#1002",
  "state": "challenged",
  "reason": "policy_rule",
  "rule_id": "rul_01M7V7QYS373XHYJSGGCQ4M2RJ",
  "checkout_approval_id": "coap_01M7V7QYS8H2SM4X31ME688ZWN",
  "approval_status": "pending",
  "held": true,
  "risk": "pending",
  "created_at": "2026-11-19T16:24:42.791Z",
  "updated_at": "2026-11-19T16:24:42.794Z"
}
```

## Update a store connection

`PATCH /v1/authorize/store_connections/{id}`

Changes a shop's settings: Cancel automatically on decline, your own agent sales channels, and the storefront check (on or off, its consent category, and field timing). Needs Manage policies and a fresh second-factor check from the console, or an `authorize` key.

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

### Parameters

| Name | In | Type | Required | Description |
| --- | --- | --- | --- | --- |
| `id` | path | string | yes | The connection's ID (`stc_`). |
| `auto_cancel_on_decline` | body | boolean | no | Cancel and refund an order at once when the buyer declines. |
| `agent_channels` | body | array of strings | no | Your agent sales channels (a Shopify app ID, publication ID or source name). Replaces the list. |
| `storefront_check` | body | boolean | no | Run the storefront check on the shop's pages. |
| `storefront_category` | body | enum | no | The consent category the check declares (`analytics` waits for the visitor's consent). One of `security`, `analytics`. |
| `field_timing` | body | boolean | no | Field timing on the cart page (always declared as analytics). |
| `chargeback_response` | body | object | no | Chargeback responses on Shopify Payments. |
| `chargeback_response.mode` | body | enum | no | `auto` (default) or `review`. One of `auto`, `review`. |
| `chargeback_response.reasons` | body | enum | no | `fraud` (default) or `fraud_and_consumer`. One of `fraud`, `fraud_and_consumer`. |

### Returns

The connection.

### Errors

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

### Request

**curl**

```bash
export PROVENANCE_KEY=prv_test_ent_E7nT2vQ9bW4mK8sYd3cFjLh6gAe1pR5x
curl -X PATCH "$PROVENANCE_API/v1/authorize/store_connections/stc_01M7V7QYRYH5TA9E3H2GV0VT1Y" \
  -H "Authorization: Bearer $PROVENANCE_KEY" \
  -H "Content-Type: application/json" \
  -d '{ "agent_channels": ["8765309"], "field_timing": true }'
```

**Node**

```ts
const data = await (await fetch(`${process.env.PROVENANCE_API}/v1/authorize/store_connections/stc_01M7V7QYRYH5TA9E3H2GV0VT1Y`, {
  method: "PATCH",
  headers: { Authorization: "Bearer prv_test_ent_E7nT2vQ9bW4mK8sYd3cFjLh6gAe1pR5x", "Content-Type": "application/json" },
  body: JSON.stringify({ "agent_channels": ["8765309"], "field_timing": true }),
})).json();
```

**Python**

```python
import os
import httpx

api = os.environ["PROVENANCE_API"]
data = httpx.patch(f"{api}/v1/authorize/store_connections/stc_01M7V7QYRYH5TA9E3H2GV0VT1Y", headers={"Authorization": "Bearer prv_test_ent_E7nT2vQ9bW4mK8sYd3cFjLh6gAe1pR5x"}, json={
    "agent_channels": [
        "8765309"
    ],
    "field_timing": True
}).json()
```

### Response 200

```json
{
  "object": "store_connection",
  "id": "stc_01M7V7QYRYH5TA9E3H2GV0VT1Y",
  "platform": "shopify",
  "shop_domain": "saltmarsh-goods.myshopify.com",
  "shop_name": null,
  "status": "active",
  "scopes": [
    "read_orders",
    "write_orders",
    "write_merchant_managed_fulfillment_orders"
  ],
  "billing_source": "shopify",
  "settings": {
    "auto_cancel_on_decline": false,
    "agent_channels": [
      "8765309"
    ],
    "storefront_check": true,
    "storefront_category": "security",
    "field_timing": true
  },
  "installed_at": "2026-11-19T16:02:11.204Z",
  "uninstalled_at": null,
  "created_at": "2026-11-19T16:01:40.118Z",
  "updated_at": "2026-11-19T16:20:03.552Z"
}
```

## List store connections

`GET /v1/authorize/store_connections`

Lists the shops connected to your account, oldest first. Free.

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

### Parameters

No parameters.

### Returns

The account's shops.

### Errors

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

### Request

**curl**

```bash
export PROVENANCE_KEY=prv_test_ent_E7nT2vQ9bW4mK8sYd3cFjLh6gAe1pR5x
curl "$PROVENANCE_API/v1/authorize/store_connections" \
  -H "Authorization: Bearer $PROVENANCE_KEY"
```

**Node**

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

**Python**

```python
import os
import httpx

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

### Response 200

```json
{
  "object": "list",
  "data": [
    {
      "object": "store_connection",
      "id": "stc_01M7V7QYRYH5TA9E3H2GV0VT1Y",
      "platform": "shopify",
      "shop_domain": "saltmarsh-goods.myshopify.com",
      "shop_name": null,
      "status": "active",
      "scopes": [
        "read_orders",
        "write_orders",
        "write_merchant_managed_fulfillment_orders"
      ],
      "billing_source": "shopify",
      "settings": {
        "auto_cancel_on_decline": false,
        "agent_channels": [
          "8765309"
        ],
        "storefront_check": true,
        "storefront_category": "security",
        "field_timing": false
      },
      "installed_at": "2026-11-19T16:02:11.204Z",
      "uninstalled_at": null,
      "created_at": "2026-11-19T16:01:40.118Z",
      "updated_at": "2026-11-19T16:20:03.552Z"
    }
  ],
  "has_more": false,
  "next_cursor": null,
  "available_platforms": [
    "shopify"
  ]
}
```

## List store orders

`GET /v1/authorize/store_orders`

Lists the orders your checkout rules checked from your connected shops, newest first. Free.

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

### Parameters

| Name | In | Type | Required | Description |
| --- | --- | --- | --- | --- |
| `state` | query | enum | no | Only orders in this state: `challenged` for orders waiting on the buyer, `held` for orders waiting on you. One of `checked`, `challenged`, `held`, `released`, `cancelled`, `not_challenged`. |
| `store_connection_id` | query | string | no | Only orders from this shop. |
| `q` | query | string | no | Only orders whose ID, name (`#1001`) or platform order ID contains this text, in any case. |
| `created_gte` | query | timestamp | no | Only orders that arrived at or after this time. |
| `created_lte` | query | timestamp | no | Only orders that arrived at or before this time. |
| `sort` | query | enum | no | The order of the list: `created`, with `-` in front for descending. Newest first when omitted. A `next_cursor` carries its order; pass it back with the same `sort`. One of `created`, `-created`. |
| `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 orders.

### Errors

- [`authentication_required`](https://provenanceauth.com/docs/platform/errors.md#authentication_required)
- [`insufficient_scope`](https://provenanceauth.com/docs/platform/errors.md#insufficient_scope)
- [`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_ent_E7nT2vQ9bW4mK8sYd3cFjLh6gAe1pR5x
curl "$PROVENANCE_API/v1/authorize/store_orders?state=challenged" \
  -H "Authorization: Bearer $PROVENANCE_KEY"
```

**Node**

```ts
const data = await (await fetch(`${process.env.PROVENANCE_API}/v1/authorize/store_orders?state=challenged`, {
  headers: { Authorization: "Bearer prv_test_ent_E7nT2vQ9bW4mK8sYd3cFjLh6gAe1pR5x" },
})).json();
```

**Python**

```python
import os
import httpx

api = os.environ["PROVENANCE_API"]
data = httpx.get(f"{api}/v1/authorize/store_orders?state=challenged", headers={"Authorization": "Bearer prv_test_ent_E7nT2vQ9bW4mK8sYd3cFjLh6gAe1pR5x"}).json()
```

### Response 200

```json
{
  "object": "list",
  "data": [
    {
      "object": "store_order",
      "id": "sto_01M7V7QYS7FQ9HETWF1HF5SM2H",
      "store_connection_id": "stc_01M7V7QYRYH5TA9E3H2GV0VT1Y",
      "platform_order_id": "5512345678901",
      "order_name": "#1002",
      "state": "challenged",
      "reason": "policy_rule",
      "rule_id": "rul_01M7V7QYS373XHYJSGGCQ4M2RJ",
      "checkout_approval_id": "coap_01M7V7QYS8H2SM4X31ME688ZWN",
      "approval_status": "pending",
      "held": true,
      "risk": "pending",
      "created_at": "2026-11-19T16:24:42.791Z",
      "updated_at": "2026-11-19T16:24:42.794Z"
    }
  ],
  "has_more": false,
  "next_cursor": null
}
```

## List agent sales channels

`GET /v1/authorize/store_agent_channels`

The agent sales channels Provenance maintains: an order through one counts as sold through an agent channel (`store.agent_channel`). `version` rises with each change. With `store_connection_id`, also that shop's own channels (`yours`) and the channels its last 90 days of orders carried that neither list names (`seen`).

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

### Parameters

| Name | In | Type | Required | Description |
| --- | --- | --- | --- | --- |
| `store_connection_id` | query | string | no | One of your shops (`stc_`), to add its own channels and the channels its orders carried. |

### Returns

The list, and the shop's channels when asked.

### Errors

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

### Request

**curl**

```bash
export PROVENANCE_KEY=prv_test_ent_E7nT2vQ9bW4mK8sYd3cFjLh6gAe1pR5x
curl "$PROVENANCE_API/v1/authorize/store_agent_channels" \
  -H "Authorization: Bearer $PROVENANCE_KEY"
```

**Node**

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

**Python**

```python
import os
import httpx

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

### Response 200

```json
{
  "object": "store_agent_channels",
  "version": 0,
  "data": []
}
```

## Disconnect a store

`DELETE /v1/authorize/store_connections/{id}`

Disconnects a shop: its access and order records are deleted, and its webhooks change nothing from then on. Holds already on its orders stay in Shopify for you to release there. To remove the app from the shop, uninstall it in Shopify.

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

### Parameters

| Name | In | Type | Required | Description |
| --- | --- | --- | --- | --- |
| `id` | path | string | yes | The connection's ID (`stc_`). |

### Returns

Deleted.

### Errors

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

### Request

**curl**

```bash
export PROVENANCE_KEY=prv_test_ent_E7nT2vQ9bW4mK8sYd3cFjLh6gAe1pR5x
curl -X DELETE "$PROVENANCE_API/v1/authorize/store_connections/stc_01M7V7QYRYH5TA9E3H2GV0VT1Y" \
  -H "Authorization: Bearer $PROVENANCE_KEY"
```

**Node**

```ts
const data = await (await fetch(`${process.env.PROVENANCE_API}/v1/authorize/store_connections/stc_01M7V7QYRYH5TA9E3H2GV0VT1Y`, {
  method: "DELETE",
  headers: { Authorization: "Bearer prv_test_ent_E7nT2vQ9bW4mK8sYd3cFjLh6gAe1pR5x" },
})).json();
```

**Python**

```python
import os
import httpx

api = os.environ["PROVENANCE_API"]
data = httpx.delete(f"{api}/v1/authorize/store_connections/stc_01M7V7QYRYH5TA9E3H2GV0VT1Y", headers={"Authorization": "Bearer prv_test_ent_E7nT2vQ9bW4mK8sYd3cFjLh6gAe1pR5x"}).json()
```

### Response 200

```json
{
  "id": "stc_01M7V7QYRYH5TA9E3H2GV0VT1Y",
  "object": "store_connection",
  "deleted": true
}
```

## Release a held order

`POST /v1/authorize/store_orders/{id}/release`

Lifts Provenance's fulfillment hold on an order (held for review, declined, expired or waiting on the buyer), so it ships as usual. The same as releasing it in the Shopify admin.

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

### Parameters

| Name | In | Type | Required | Description |
| --- | --- | --- | --- | --- |
| `id` | path | string | yes | The store order's ID (`sto_`). |

### Returns

The order, released. See [the store order object](#object).

### Errors

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

### Request

**curl**

```bash
export PROVENANCE_KEY=prv_test_ent_E7nT2vQ9bW4mK8sYd3cFjLh6gAe1pR5x
curl -X POST "$PROVENANCE_API/v1/authorize/store_orders/sto_01M7V7QYS7FQ9HETWF1HF5SM2H/release" \
  -H "Authorization: Bearer $PROVENANCE_KEY"
```

**Node**

```ts
const data = await (await fetch(`${process.env.PROVENANCE_API}/v1/authorize/store_orders/sto_01M7V7QYS7FQ9HETWF1HF5SM2H/release`, {
  method: "POST",
  headers: { Authorization: "Bearer prv_test_ent_E7nT2vQ9bW4mK8sYd3cFjLh6gAe1pR5x" },
})).json();
```

**Python**

```python
import os
import httpx

api = os.environ["PROVENANCE_API"]
data = httpx.post(f"{api}/v1/authorize/store_orders/sto_01M7V7QYS7FQ9HETWF1HF5SM2H/release", headers={"Authorization": "Bearer prv_test_ent_E7nT2vQ9bW4mK8sYd3cFjLh6gAe1pR5x"}).json()
```

### Response 200

```json
{
  "object": "store_order",
  "id": "sto_01M7V7QYS7FQ9HETWF1HF5SM2H",
  "store_connection_id": "stc_01M7V7QYRYH5TA9E3H2GV0VT1Y",
  "platform_order_id": "5512345678901",
  "order_name": "#1002",
  "state": "released",
  "reason": "store_released_by_staff",
  "rule_id": "rul_01M7V7QYS373XHYJSGGCQ4M2RJ",
  "checkout_approval_id": "coap_01M7V7QYS8H2SM4X31ME688ZWN",
  "approval_status": "pending",
  "held": false,
  "risk": "pending",
  "created_at": "2026-11-19T16:24:42.791Z",
  "updated_at": "2026-11-19T16:24:42.794Z"
}
```

## Report a store order's outcome

`POST /v1/authorize/store_orders/{id}/outcome`

Records what happened to a store order after its decision: a chargeback, fraud, refund abuse, or that it was legitimate. Rule suggestions learn from these labels. The latest report wins; every report is kept. Free. Needs the `authorize` scope or Manage policies; another account's order is `404`. See [rule suggestions](https://provenanceauth.com/docs/authorize/guides/rule-suggestions.md).

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

### Parameters

| Name | In | Type | Required | Description |
| --- | --- | --- | --- | --- |
| `id` | path | string | yes | The store order's ID (`sto_`). |
| `outcome` | body | enum | yes | What happened to the order. One of `chargeback`, `fraud`, `refund_abuse`, `legitimate`. |
| `note` | body | string | no | A note for your team. Leave out customer details. |

### Returns

The recorded outcome.

### Errors

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

### Request

**curl**

```bash
export PROVENANCE_KEY=prv_test_ent_E7nT2vQ9bW4mK8sYd3cFjLh6gAe1pR5x
curl -X POST "$PROVENANCE_API/v1/authorize/store_orders/sto_01M7V7QYS7FQ9HETWF1HF5SM2H/outcome" \
  -H "Authorization: Bearer $PROVENANCE_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "outcome": "legitimate",
    "note": "Customer confirmed the order by phone"
  }'
```

**Node**

```ts
const data = await (await fetch(`${process.env.PROVENANCE_API}/v1/authorize/store_orders/sto_01M7V7QYS7FQ9HETWF1HF5SM2H/outcome`, {
  method: "POST",
  headers: { Authorization: "Bearer prv_test_ent_E7nT2vQ9bW4mK8sYd3cFjLh6gAe1pR5x", "Content-Type": "application/json" },
  body: JSON.stringify({
    "outcome": "legitimate",
    "note": "Customer confirmed the order by phone"
  }),
})).json();
```

**Python**

```python
import os
import httpx

api = os.environ["PROVENANCE_API"]
data = httpx.post(f"{api}/v1/authorize/store_orders/sto_01M7V7QYS7FQ9HETWF1HF5SM2H/outcome", headers={"Authorization": "Bearer prv_test_ent_E7nT2vQ9bW4mK8sYd3cFjLh6gAe1pR5x"}, json={
    "outcome": "legitimate",
    "note": "Customer confirmed the order by phone"
}).json()
```

### Response 201

```json
{
  "object": "order_outcome",
  "id": "oot_01M81CRZ6H0M71QNV04T2Z64QM",
  "assessment_id": null,
  "store_order_id": "sto_01M7V7QYS7FQ9HETWF1HF5SM2H",
  "outcome": "legitimate",
  "kind": "clean",
  "source": "api",
  "note": "Customer confirmed the order by phone",
  "reported_at": "2026-11-22T10:28:05.457Z"
}
```

## Cancel and refund a held order

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

Cancels a held order in the shop, refunds it, restocks its items and tells the buyer. A store that captures payment by hand voids the authorization instead. Shopify runs the cancel as a job.

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

### Parameters

| Name | In | Type | Required | Description |
| --- | --- | --- | --- | --- |
| `id` | path | string | yes | The store order's ID (`sto_`). |

### Returns

The order, cancelled. See [the store order object](#object).

### Errors

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

### Request

**curl**

```bash
export PROVENANCE_KEY=prv_test_ent_E7nT2vQ9bW4mK8sYd3cFjLh6gAe1pR5x
curl -X POST "$PROVENANCE_API/v1/authorize/store_orders/sto_01M7V7QYS7FQ9HETWF1HF5SM2H/cancel" \
  -H "Authorization: Bearer $PROVENANCE_KEY"
```

**Node**

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

**Python**

```python
import os
import httpx

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

### Response 200

```json
{
  "object": "store_order",
  "id": "sto_01M7V7QYS7FQ9HETWF1HF5SM2H",
  "store_connection_id": "stc_01M7V7QYRYH5TA9E3H2GV0VT1Y",
  "platform_order_id": "5512345678901",
  "order_name": "#1002",
  "state": "cancelled",
  "reason": "store_cancelled_by_staff",
  "rule_id": "rul_01M7V7QYS373XHYJSGGCQ4M2RJ",
  "checkout_approval_id": "coap_01M7V7QYS8H2SM4X31ME688ZWN",
  "approval_status": "denied",
  "held": false,
  "risk": "high",
  "created_at": "2026-11-19T16:24:42.791Z",
  "updated_at": "2026-11-19T16:24:42.794Z"
}
```
