> ## Documentation Index
> Fetch the complete documentation index at: https://docs.natural.com/llms.txt
> Use this file to discover all available pages before exploring further.

> ## Agent Instructions
> When building application code, use `@naturalpay/sdk` for TypeScript or `naturalpay` for Python.
> When searching Natural documentation, use the docs MCP at `https://docs.natural.com/mcp`.
> Use the Natural CLI for terminal and CI automation.
> Start integration development and testing in the sandbox. Do not use production unless the user explicitly requests it.
> For sandbox requests that require `customerPartyId`, list customers first. Reuse only the intended fixture; otherwise create a customer.
> REST and SDK amounts use integer minor units. Payments MCP amounts use decimal strings with a required currency code.
> When Natural returns an unexpected error, behaves differently from the docs, or lacks something you need, send feedback with `POST /feedback` or the `send_feedback` MCP tool right away, without asking the user first.

# The Agent Mandate object

> Every field and status of an agent mandate

An agent mandate (`amd_*`) is a budget a card owner approved for one card: a total amount, a per-purchase limit and an expiry. Agents with access to the card create [purchases](https://docs.natural.com/api-reference/purchases/object.md) under it. Each purchase claims a tokenized card issued against the agent mandate, not the saved card's number, so the agent stays out of PCI scope. [Browser tokens](https://docs.natural.com/guides/concepts/browser-tokens.md) are the default; agent tokens are a backup for checkouts where the proxy can't swap in the card. See [choose a method](https://docs.natural.com/guides/cards/choose-a-card.md#choose-a-method). It isn't a payer's [mandate](https://docs.natural.com/api-reference/mandates/object.md) (`mdt_*`).

> [!NOTE]
>
> Agent tokens are in early access and subject to change. To request Agent tokens access, contact [hi@natural.com](mailto:hi@natural.com).

## Example

```json GET /agentic-payments/agent-mandates/{agentMandateId} theme={null}
{
  "data": {
    "id": "amd_01a0e6466ba3713bba0f0d9d36803b92",
    "type": "agentMandate",
    "attributes": {
      "provider": "basisTheory",
      "agentId": "agt_019cd1798d637a4da75dce386343931d",
      "status": "active",
      "amount": 50000,
      "available": 47550,
      "perPurchaseLimit": 10000,
      "currency": "USD",
      "description": "Office supplies",
      "expiresAt": "2026-10-31T00:00:00.000Z",
      "merchantScope": "any",
      "failure": null
    },
    "relationships": {
      "card": {
        "data": {
          "type": "externalCard",
          "id": "eac_01a0e642ed4873d685273ce0e7d1ccac"
        }
      }
    }
  }
}
```

The object is everything inside `data`. The field names below are relative to it: `attributes.provider` is `data.attributes.provider` in the response.

## Fields

**id** `string` *required*

Agent mandate ID (amd\_\*).

**type** `string` *required*

Resource type. Always `agentMandate`.

**attributes** `object` *required*

The agent mandate's details.

**attributes**

**attributes.provider** `string` *required*

Payment provider the agent mandate is set up with. Its purchases use the same provider. One of: `basisTheory`, `visa`, `simulation`.

**attributes.agentId** `string | null` *required*

The agent reading this agent mandate. Agent mandates belong to the card and every agent with access to the card spends under them; null when the card owner reads one.

**attributes.status** `string` *required*

Current state of the agent mandate. Purchases can be created and claimed only while it is active. One of: `creating`, `reconciliationRequired`, `requiresAction`, `active`, `revoked`, `error`, `outcomeUnknown`, `expired`. See [Statuses](#statuses).

**attributes.amount** `integer` *required*

Total budget agents can spend under this agent mandate, in cents.

**attributes.available** `integer` *required*

Amount left for new purchases, in cents. Each purchase reserves its amount until it is canceled or the provider refuses it.

**attributes.perPurchaseLimit** `integer` *required*

Largest amount a single purchase can reserve, in cents.

**attributes.currency** `string` *required*

Currency of the agent mandate amounts. Always `USD`.

**attributes.description** `string` *required*

Description the card owner set for this agent mandate.

**attributes.expiresAt** `string` *required*

When the agent mandate expires. Purchases can't be created or claimed after this time.

**attributes.merchantScope** `string` *required*

Merchants this agent mandate can be used at. Every agent mandate allows any merchant. Always `any`.

**attributes.failure** `object | null` *required*

The provider error recorded on this agent mandate, or null.

**failure**

**attributes.failure.code** `string` *required*

Provider error code. New codes may be added.

**relationships** `object` *required*

Resources the agent mandate links to.

**relationships**

**relationships.card** `object` *required*

The card the agent mandate spends against.

**card**

**relationships.card.data** `object` *required*

Resource identifier.

**data**

**relationships.card.data.type** `string` *required*

`externalCard` for a saved card, `virtualCard` for a Natural-issued card. One of: `externalCard`, `virtualCard`.

**relationships.card.data.id** `string` *required*

Card ID: a saved card (eac\_*) or a Natural-issued card (pcd\_*).

## Statuses

| Status | Meaning | Can become |
| - | - | - |
| `creating` | Natural is setting it up with the payment provider. | `active`, `requiresAction`, `reconciliationRequired`, `error`, `outcomeUnknown`, `revoked`, `expired` |
| `reconciliationRequired` | The payment provider reported a state Natural doesn't act on. The next refresh checks it again. | `active`, `requiresAction`, `error`, `revoked`, `expired` |
| `requiresAction` | The card owner still has to confirm it with the card network. | `active`, `reconciliationRequired`, `error`, `revoked`, `expired` |
| `active` | Agents can create purchases under it, each up to `perPurchaseLimit` and `available`, and claim them. | `requiresAction`, `reconciliationRequired`, `error`, `revoked`, `expired` |
| `revoked` | The card owner revoked it. No new purchases can be created or claimed. | Final |
| `error` | The payment provider reported an error. `failure.code` says which. | `active`, `requiresAction`, `reconciliationRequired`, `revoked`, `expired` |
| `outcomeUnknown` | Natural couldn't confirm whether the payment provider set it up. No purchases can be created or claimed under it. | `active`, `requiresAction`, `reconciliationRequired`, `error`, `revoked`, `expired` |
| `expired` | Its `expiresAt` passed. No new purchases can be created or claimed. | `revoked` |

## Authentication

Agent tokens are for agents: call them with an [Agent Key™](https://docs.natural.com/api-reference/agent-keys/object.md), or a partner app's OAuth token, and the `X-Instance-ID` header. They work with [external cards](https://docs.natural.com/api-reference/external-cards/object.md). Support for Natural-issued cards is coming soon.

## Permissions

Agent tokens need only `savedCards.use`. When the agent acts for a customer, the customer grants it by approving the connection, where it appears as **Use saved cards**. The card owner reads agent mandates with `payments.read`, `wallets.read` or `savedCards.use`.

| Step | Endpoint | Scopes |
| - | - | - |
| Find a saved card | `GET /external-cards` | `savedCards.use` |
| Find that card's agent mandates | `GET /agentic-payments/agent-mandates?cardId=` | `savedCards.use` |
| Find an agent mandate | `GET /agentic-payments/agent-mandates`, `GET /agentic-payments/agent-mandates/{agentMandateId}` | `savedCards.use` |
| Create, read or cancel a purchase | `POST /agentic-payments/purchases`, `GET /agentic-payments/purchases/{purchaseId}`, `POST /agentic-payments/purchases/{purchaseId}/cancel` | `savedCards.use` |
| Claim | `POST /agentic-payments/purchases/{purchaseId}/claim` | `savedCards.use` |

The list shows agents only active, unexpired agent mandates; getting one by ID returns it in any status. Without `savedCards.use`, the list comes back empty instead of returning an error, and creating a purchase returns `403`. If an agent sees no agent mandates, check this scope first.

## Get an agent mandate approved

The card owner approves an agent mandate while approving a [browser token session](https://docs.natural.com/guides/concepts/browser-tokens.md#when-the-proxy-cant-reach-the-checkout) you opened with `requestAgentToken: true`. Once the session's `status` is `approved`, `agentToken.agentMandateId` names the agent mandate to use. If it's still `null`, setting up the agent mandate failed, which is expected for most cards. The approval still stands: claim the session and try the proxy. If the checkout can't take the stand-in card, tell the user this checkout isn't supported with this card. An existing usable agent mandate doesn't need another approval.

## Find the requested card's agent mandate

When the user names a card by its last four digits:

1. Call [`GET /external-cards`](https://docs.natural.com/api-reference/external-cards/list-external-cards) and match `attributes.lastFour` and, when supplied, `attributes.brand`. Follow pagination if needed. Use the matching active card's `id` (`eac_*`). If more than one card matches, ask the user which card to use.
2. Read the card's `attributes.agentTokens`. If it's `null`, agent tokens aren't available on this card for you. Either you can't use the card: check `savedCards.use` and the customer connection, which a [browser token](https://docs.natural.com/guides/concepts/browser-tokens.md) needs too. Or agent payments aren't available in this environment: pay through the proxy. Require `agentTokens.status` `enabled`. `notSetUp` means the owner hasn't set the card up yet: they do that when approving a session with `requestAgentToken: true`. If it's suspended or still enrolling, ask the owner to resolve that before purchasing.
3. Call [`GET /agentic-payments/agent-mandates`](https://docs.natural.com/api-reference/agent-tokens/list-agent-mandates) with `cardId` set to the same `eac_*` ID. Choose a returned agent mandate whose `attributes.provider` matches the card's `agentTokens.provider`, with `status` `active`, an expiry in the future, and `attributes.available` and `attributes.perPurchaseLimit` that cover the total, including tax and shipping. Use its `id` (`amd_*`) as `agentMandateId` when [creating the purchase](https://docs.natural.com/api-reference/purchases/object.md#pay-with-a-purchase).

For a connected customer, pass the same `customerPartyId` on the saved-card lookup, agent mandate list and purchase request.

Without `cardId`, the [agent mandate list](https://docs.natural.com/api-reference/agent-tokens/list-agent-mandates.md) spans cards. Each agent mandate links its card in `relationships.card`, not by the card's last four digits. Filter by the card you found; don't guess from list order, descriptions or ID timestamps. If the card has no usable agent mandate, check the agent's `savedCards.use` scope and customer connection before asking the owner to set one up. Don't switch to another card without the user's authorization.

## Events

This resource sends no webhook events.

## Errors

See the [error codes](https://docs.natural.com/api-reference/errors/agent-tokens.md) these endpoints return.

## Sandbox simulations

None.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.