> ## 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 setup session object

> Send a business owner to a hosted page to add a card for agent purchases.

```json The setup session object theme={null}
{
  "id": "sps_6Pq3Lm8Kx2Vn7R",
  "object": "spend.setup_session",
  "account_id": "mer_7Hk2Pq9Lm4Xw1R",
  "livemode": false,
  "status": "completed",
  "url": null,
  "card_id": "spcard_9Tb4Nx2Kq8Lm5W",
  "created": 1793782800,
  "expires_at": 1793784600
}
```

A setup session (`sps_…`) is a hosted Ionic page where a business owner adds a
card for agent purchases. Your server creates it, sends the owner to `url`,
and retrieves the session to confirm the card was saved.

Saving a card doesn't give any agent access to it. The owner grants access to
an agent separately. See [Manage cards and agent purchases](https://docs.ionicfi.com/guides/spend-card-access.md).

## Attributes

**id** `string`

Unique identifier for the setup session (`sps_…`).

**account\_id** `string`

The business the card is added to.

**livemode** `boolean`

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

**status** `enum`

`pending`, `completed`, `expired`, or `canceled`. Setup is done only when
`status` is `completed` and `card_id` is set.

**url** `string | null`

The hosted page to send the owner to, returned only while the session is
`pending`. A retry or read of a pending session can return a new link;
earlier links keep working until the session ends. `null` once the session
is `completed`, `expired`, or `canceled`.

**card\_id** `string | null`

The saved card (`spcard_…`), once setup completes.

**created** `timestamp`

When the session was created, in Unix seconds.

**expires\_at** `timestamp`

When the session expires, 30 minutes after creation. Issuing a new link doesn't
extend it.


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