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

# The spend intent object

> Ask a business to approve one agent purchase, then claim the card for checkout.

```json The spend intent object theme={null}
{
  "id": "spi_4Rk8Lm2Qx7Vn3P",
  "object": "spend_intent",
  "account_id": "mer_7Hk2Pq9Lm4Xw1R",
  "agent_id": "agt_3Wd9Kp2Lm7Xq4R",
  "livemode": false,
  "version": 2,
  "action": "payment",
  "card_id": "spcard_9Tb4Nx2Kq8Lm5W",
  "purpose": "Printer paper for the front office",
  "seller": {
    "name": "Example Supplies",
    "checkout_url": "https://shop.example.com/checkout"
  },
  "amount": 6000,
  "currency": "usd",
  "billing_details": {
    "name": "Ops Owner",
    "address": {
      "line1": "1 Main St",
      "city": "Austin",
      "postal_code": "78701",
      "country": "US"
    }
  },
  "reference": "task-184",
  "status": "approved",
  "allowed_hosts": ["payments.shop.example.com"],
  "approval_url": "https://dashboard.ionicfi.com/spend/approve/spi_4Rk8Lm2Qx7Vn3P",
  "return_url": null,
  "created": 1793782800,
  "approval_expires_at": 1793869200,
  "approved_at": 1793783100,
  "claimed_at": null,
  "canceled_at": null,
  "claim_expires_at": 1793783400,
  "credential_expires_at": null,
  "claim_replay_available": false,
  "credential_exposure": "none",
  "claim_within_seconds": 300,
  "approvals": [
    {
      "authority": "owner",
      "status": "approved",
      "over_limit": false,
      "decided_at": 1793783100
    }
  ],
  "limit_breaches": [],
  "blocked_at": null
}
```

A spend intent (`spi_…`) asks a business to approve one purchase on one of its
cards. Your agent creates it, a business owner approves or declines it at
`approval_url`, and your browser worker then claims the card details and
enters them at the seller's checkout.

For the full flow, see
[Build browser purchases with Spend](https://docs.ionicfi.com/guides/spend-platform-integration.md).

## Attributes

**id** `string`

Unique identifier for the spend intent (`spi_…`).

**account\_id** `string`

The business whose card is used.

**agent\_id** `string`

The agent that created the request. Only this agent can read, claim, or cancel it.

**livemode** `boolean`

`true` in live mode, `false` in test mode.

**version** `integer`

Increases each time the spend intent changes.

**action** `enum`

What the card is for. Use `payment`.

**card\_id** `string`

The card the agent asked to use (`spcard_…`).

**purpose** `string`

What the agent is buying, shown to the owner during approval.

**seller** `object`

The seller's `name` and `checkout_url`, shown to the owner during approval.

**amount** `integer`

The purchase amount in the smallest currency unit. `6000` is \$60.00.

**currency** `string`

Three-letter ISO currency code, in lowercase.

**billing\_details** `object`

The `name`, optional `email`, and `address` to enter at checkout.

**reference** `string | null`

Your own identifier for the task. It isn't unique, so don't use it to prevent duplicates.

**status** `enum`

Where the request is in approval and card delivery.

| Status | Meaning |
| - | - |
| `pending_approval` | Waiting for every required approval. |
| `approved` | Approved. Claim before `claim_expires_at`. |
| `declined` | An approver declined. |
| `blocked` | A blocking spending limit ended the request. No one can approve it. |
| `claimed` | Card details were delivered to your worker. This doesn't mean the purchase succeeded. |
| `expired` | A deadline passed before the next step. |
| `canceled` | Canceled. No more card details are delivered. |
| `issuance_unknown` | Ionic can't confirm whether card details were delivered. Stop the purchase and don't create a replacement automatically. |

**allowed\_hosts** `array of strings`

The exact hosts where card details can be entered, approved by the owner. Redirects don't add hosts.

**approval\_url** `string | null`

The Ionic page where an owner reviews and decides the request. Send the owner here.

**return\_url** `string | null`

Where the owner returns after deciding, for a platform's agent. Retrieve the
spend intent to confirm the decision; the redirect alone doesn't confirm it.

**created** `timestamp`

When the request was created, in Unix seconds.

**approval\_expires\_at** `timestamp`

When a pending request expires if it isn't approved.

**approved\_at** `timestamp | null`

When the final approval was given.

**claimed\_at** `timestamp | null`

When card details were first delivered.

**canceled\_at** `timestamp | null`

When the request was canceled.

**claim\_expires\_at** `timestamp | null`

The deadline to claim: `approved_at` plus `claim_within_seconds`. `null` before approval.

**credential\_expires\_at** `timestamp | null`

When the delivered card details stop working. Retrying a claim doesn't extend it.

**claim\_replay\_available** `boolean`

Whether retrying the claim with its original `Idempotency-Key` can still return the card details.

**credential\_exposure** `enum`

Whether card details may have left Ionic: `none`, `possible`, or `issued`.

**claim\_within\_seconds** `integer`

Seconds after approval to claim. Defaults to `300`, which is also the maximum.

**approvals** `array of objects`

Each approval the request needs, in the order they happen. Each has `authority`
(`owner`, `platform`, or `business`), `status`, `over_limit`, and
`decided_at`. The card owner decides last. Empty on a blocked request.

**limit\_breaches** `array of objects`

Spending limits the request exceeds. Empty when it is within every limit.
A breach with `on_breach: "block"` ends the request as `blocked`.

**blocked\_at** `timestamp | null`

When a blocking limit ended the request, at creation or at final approval.


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