# Approval contexts

How a person decided, the same on every product. Embedded in each result that names the decision, and read alone here.

Related guide: [Approval context](https://provenanceauth.com/docs/concepts/approval-context.md)

## Endpoints

- `GET /v1/approval_contexts/{id}`: [Retrieve an approval context](#get-v1-approval-contexts-id)

## The approval context object

### Attributes

| Name | Type | Required | Description |
| --- | --- | --- | --- |
| `object` | enum | yes | The type of object. One of `approval_context`. |
| `id` | string | yes | Unique identifier for the object (`apc_…`). |
| `subject` | object | yes | What the person decided. |
| `subject.type` | enum | yes | The decided object's type: a cart approval, a step-up approval, a grant, an intent token the person approved with the device's passkey when it was minted, a delegation proposal or a captured item. One of `checkout_approval`, `mandate_approval`, `mandate_grant`, `intent_token`, `delegation_proposal`, `capture_item`. |
| `subject.id` | string | yes | Its id (an intent token is its `jti`; a captured item is `capr_…:<index>`). |
| `decision` | enum | yes | The person's own answer; `captured` for a capture. One of `approved`, `declined`, `captured`. |
| `decided_at` | timestamp | yes | When the person decided. |
| `method` | object | yes | How the person decided. |
| `method.kind` | enum | yes | A passkey, the Provenance app's device key, the keypad on a confirmation call, a confirmation given outside Provenance, a signed-in console member, or a browser page with no passkey (a decline, a capture page). One of `passkey`, `device_key`, `voice_keypad`, `external`, `console_session`, `browser_session`. |
| `method.authenticator` | enum | yes | With a passkey: where it lives, as the browser reported when it was created; null otherwise or when unknown. One of `platform_passkey`, `cross_device_passkey`, `security_key`. |
| `method.user_verified` | boolean | yes | True when the assertion's user-verification flag was set (face, fingerprint or the screen lock). |
| `method.step_up` | object \| null | yes | What confirmed the customer contact for a new passkey under `step_up_contact`, when it applied. |
| `method.step_up.method` | enum | no | `contact_code`: a 6-digit code sent to the customer contact matched. `link_contact`: the person opened the link from the email or text sent to that same contact, so no code was sent. One of `contact_code`, `link_contact`. |
| `method.step_up.channel` | enum | no | Where the code went, or which message carried the link. One of `sms`, `email`. |
| `method.step_up.verified_at` | timestamp | no | When the code matched, or when the passkey approved through that link. |
| `passkey` | object \| null | yes | The passkey that decided; null for any other method. |
| `passkey.status` | enum | no | `new` when it was younger than the store's minimum age or set up during the approval. One of `new`, `existing`. |
| `passkey.age` | object | no | Its age at the decision: whole days, and the minutes past them. |
| `passkey.age.days` | integer | no | Whole days. |
| `passkey.age.minutes` | integer | no | Minutes past the whole days. |
| `passkey.created_during_approval` | boolean | no | Set up on this approval's page. |
| `passkey.synced` | boolean \| null | no | A synced (backed-up) passkey; null when the authenticator didn't say. |
| `passkey.provider` | string \| null | no | The provider its AAGUID names (the authenticator's own claim); null when unknown. |
| `passkey.provider_attested` | enum | no | Always false: the provider is the authenticator's own claim. One of `false`. |
| `device` | object \| null | yes | The device the person decided on, as it reported itself (or, with the app's device key, as it enrolled). |
| `device.os` | string \| null | no | `ios`, `ipados`, `android`, `macos`, `windows`, `linux` or `other`. |
| `device.os_version` | string \| null | no | The OS version, for phones (desktop browsers freeze theirs). |
| `device.browser` | string \| null | no | `safari`, `chrome`, `edge`, `firefox`, `samsung` or `other`; null in an app. |
| `device.source` | enum | no | Where the device facts came from. One of `user_agent`, `app_attestation`. |
| `device.verified` | boolean | no | True only when the server verified the device's attestation. |
| `device.time_zone` | object \| null | no | The device's time zone, as reported (never verified). |
| `device.time_zone.name` | string | no | IANA name (`America/Los_Angeles`). |
| `device.time_zone.utc_offset_minutes` | integer | no | Its offset at the decision. |
| `device.time_zone.source` | enum | no | Who reported it. One of `browser`, `app`. |
| `device.time_zone.verified` | enum | no | Always false. One of `false`. |
| `device.locale` | string \| null | no | The language tag (`en-US`). |
| `network` | object \| null | yes | The connection the decision came from: a provider's estimate of its place, and its flags. |
| `network.country` | string \| null | no | ISO 3166-1 alpha-2. |
| `network.region` | string \| null | no | ISO 3166-2 (`US-OR`). |
| `network.city` | string \| null | no | The city, only while the network city switch is on. |
| `network.city_status` | enum | no | Whether the city switch is on. One of `enabled`, `not_enabled`. |
| `network.flags` | object | no | What the published lists and the IP lookup say about the network. |
| `network.flags.vpn` | boolean | no | A VPN service. |
| `network.flags.proxy` | boolean | no | A proxy. |
| `network.flags.hosting_provider` | boolean | no | A cloud or hosting provider's range. |
| `network.flags.tor` | boolean | no | A Tor exit. |
| `network.flags.private_relay` | boolean | no | iCloud Private Relay (a privacy feature, never counted as a VPN). |
| `network.asn` | integer \| null | no | The network's AS number, from the IP lookup provider; null without one. |
| `network.source` | enum | no | Where the place and flags came from. One of `published_lists`, `ip_intel`. |
| `network.ip` | string \| null | no | The address, only while your IP sharing switch is on and the sealed copy is kept; null otherwise. |
| `location_match` | enum | no | A cart approval's only: whether where the person approved from matches the billing address the store sent. The same value the `approval.location` rule fact reads: `matches_billing` needs the network region (or city) to agree with nothing contradicting it, a time-zone match alone is never a match; `differs` when a known comparison differs; `unavailable` with its reason in `unavailable.location_match` (no IP lookup, no time zone); `no_billing` when the store sent no address. The distance and the per-field comparisons stay rule facts and are never returned. Absent on other approvals. One of `matches_billing`, `differs`, `unavailable`, `no_billing`. |
| `location_match_basis` | array of enums | no | With `location_match`: the inputs that agreed (`matches_billing`) or disagreed (`differs`); empty otherwise. `time_zone_network`: the device's time zone is in another country than the network. |
| `browser_details` | object | yes | The 3-D Secure browser fields the approval page or embed reported, with the request's User-Agent and Accept headers; null for a decision outside a browser page (the app, a keypad, a console member) or recorded before they were collected. |
| `browser_details.screen_width` | integer \| null | yes | The screen's width in CSS pixels (`screen.width`). |
| `browser_details.screen_height` | integer \| null | yes | The screen's height in CSS pixels (`screen.height`). |
| `browser_details.color_depth` | enum | yes | Bits per pixel (`screen.colorDepth`). One of `1`, `4`, `8`, `15`, `16`, `24`, `30`, `32`, `48`. |
| `browser_details.language` | string \| null | yes | The browser's language (`navigator.language`). |
| `browser_details.java_enabled` | boolean \| null | yes | Whether Java is enabled (`navigator.javaEnabled()`). |
| `browser_details.javascript_enabled` | boolean \| null | yes | Whether JavaScript ran (true when the page sent the block). |
| `browser_details.utc_offset_minutes` | integer \| null | yes | Local time minus UTC, in minutes. |
| `browser_details.user_agent` | string \| null | yes | The request's `User-Agent` header (at most 2,048 characters). |
| `browser_details.accept_header` | string \| null | yes | The request's `Accept` header (at most 2,048 characters). |
| `browser_details.source` | enum | yes | Where the fields came from. One of `browser`. |
| `browser_details.verified` | enum | yes | Always false: as the browser reported them. One of `false`. |
| `billing` | object | yes | A cart approval's context only: the full billing address you sent, to your own key and console (never on a webhook); null otherwise. |
| `billing.line1` | string \| null | yes | The street line. |
| `billing.line2` | string \| null | yes | The second line. |
| `billing.city` | string \| null | yes | The city. |
| `billing.region` | string \| null | yes | ISO 3166-2 (`US-OR`) where the region table maps it (US, Canada, Australia); else as you sent it. |
| `billing.postal_code` | string \| null | yes | The postal code as you sent it. |
| `billing.country` | string | yes | ISO 3166-1 alpha-2. |
| `billing.source` | enum | yes | Always `merchant`: your store attested it. One of `merchant`. |
| `person` | object | yes | Who decided, as far as Provenance can say without identifying them. |
| `person.pseudonym` | string \| null | no | A per-store pseudonym for the passkey, on cart approvals. |
| `person.link` | enum | no | Over a grant's limit: whether the passkey is the grant's own person's. One of `same_person`, `unlinked`, `not_applicable`. |
| `external` | object \| null | yes | With `method.kind: external`: the confirmation given outside Provenance. |
| `external.kind` | enum | no | The kind of outside confirmation. One of `ap2_user_mandate`, `spc`, `platform`. |
| `external.issuer` | string \| null | no | Who issued it. |
| `external.evidence_hash` | string \| null | no | The hash of the evidence verified. |
| `unavailable` | object | yes | Each fact that is null and why (`not_collected`, `no_ip`, `ip_intel_not_configured`, `ip_intel_failed`, `network_relayed`, `network_vpn`, `network_hosting`, `network_tor`), keyed by field (`device.time_zone`, `network.country`). |

### Example

```json
{
  "object": "approval_context",
  "id": "apc_01JD5HT9QK3M8V2XR7N4B6WZTC",
  "subject": {
    "type": "checkout_approval",
    "id": "coap_01JD5HT2QZ6Y1K9F3R8M4V7NXB"
  },
  "decision": "approved",
  "decided_at": "2026-11-17T09:06:12.000Z",
  "method": {
    "kind": "passkey",
    "authenticator": "platform_passkey",
    "user_verified": true,
    "step_up": null
  },
  "passkey": {
    "status": "existing",
    "age": {
      "days": 41,
      "minutes": 312
    },
    "created_during_approval": false,
    "synced": true,
    "provider": "iCloud Keychain",
    "provider_attested": false
  },
  "device": {
    "os": "ios",
    "os_version": "26.1",
    "browser": "safari",
    "source": "user_agent",
    "verified": false,
    "time_zone": {
      "name": "America/Los_Angeles",
      "utc_offset_minutes": -480,
      "source": "browser",
      "verified": false
    },
    "locale": "en-US"
  },
  "network": {
    "country": "US",
    "region": "US-OR",
    "city": null,
    "city_status": "not_enabled",
    "flags": {
      "vpn": false,
      "proxy": false,
      "hosting_provider": false,
      "tor": false,
      "private_relay": false
    },
    "source": "ip_intel",
    "ip": null
  },
  "location_match": "matches_billing",
  "location_match_basis": [
    "network_region",
    "time_zone"
  ],
  "browser_details": null,
  "billing": {
    "line1": "18 Harrow Lane",
    "line2": null,
    "city": "Portland",
    "region": "US-OR",
    "postal_code": "97205",
    "country": "US",
    "source": "merchant"
  },
  "person": {
    "pseudonym": "hum_6f1c2a9e0b7d4c3a8e5f",
    "link": "not_applicable"
  },
  "external": null,
  "unavailable": {}
}
```

## Retrieve an approval context

`GET /v1/approval_contexts/{id}`

How a person decided one cart approval, step-up approval, grant or captured item: the object that result embeds. The key needs the decided object's product scope; the IP shows only while your IP sharing switch keeps it.

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

### Parameters

| Name | In | Type | Required | Description |
| --- | --- | --- | --- | --- |
| `id` | path | string | yes | The approval context's ID (`apc_…`), from the `approval_context.id` of the result that named the decision. |

### Returns

The approval context. See [the approval context 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_acct_P9xN2vQ7bT4mW8sYd3cFjLh6gAe1kR5
curl "$PROVENANCE_API/v1/approval_contexts/apc_01JD5HT9QK3M8V2XR7N4B6WZTC" \
  -H "Authorization: Bearer $PROVENANCE_KEY"
```

**Node**

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

### Response 200

```json
{
  "object": "approval_context",
  "id": "apc_01JD5HT9QK3M8V2XR7N4B6WZTC",
  "subject": {
    "type": "checkout_approval",
    "id": "coap_01JD5HT2QZ6Y1K9F3R8M4V7NXB"
  },
  "decision": "approved",
  "decided_at": "2026-11-17T09:06:12.000Z",
  "method": {
    "kind": "passkey",
    "authenticator": "platform_passkey",
    "user_verified": true,
    "step_up": null
  },
  "passkey": {
    "status": "existing",
    "age": {
      "days": 41,
      "minutes": 312
    },
    "created_during_approval": false,
    "synced": true,
    "provider": "iCloud Keychain",
    "provider_attested": false
  },
  "device": {
    "os": "ios",
    "os_version": "26.1",
    "browser": "safari",
    "source": "user_agent",
    "verified": false,
    "time_zone": {
      "name": "America/Los_Angeles",
      "utc_offset_minutes": -480,
      "source": "browser",
      "verified": false
    },
    "locale": "en-US"
  },
  "network": {
    "country": "US",
    "region": "US-OR",
    "city": null,
    "city_status": "not_enabled",
    "flags": {
      "vpn": false,
      "proxy": false,
      "hosting_provider": false,
      "tor": false,
      "private_relay": false
    },
    "source": "ip_intel",
    "ip": null
  },
  "location_match": "matches_billing",
  "location_match_basis": [
    "network_region",
    "time_zone"
  ],
  "browser_details": null,
  "billing": {
    "line1": "18 Harrow Lane",
    "line2": null,
    "city": "Portland",
    "region": "US-OR",
    "postal_code": "97205",
    "country": "US",
    "source": "merchant"
  },
  "person": {
    "pseudonym": "hum_6f1c2a9e0b7d4c3a8e5f",
    "link": "not_applicable"
  },
  "external": null,
  "unavailable": {}
}
```
