# Card commands

URL: /code/cli/card · Id: `page:code/cli/card`

> Every Card Verb as a CLI command, with its inputs, result, refusals and an example.

Reference for [Card](/business/nouns/card).

| Noun | System | Run by |
| --- | --- | --- |
| [Card](/business/nouns/card) | [Spend management](/systems/spend) | [Finance Lead](/agents/finance/finance-lead) |

### Card.get
Returns one Card by id. [Verb page](/business/nouns/card/get?interface=cli).

```text
npx startup-builder do Card.get --json '<input>' [--try]
```

Reads only: it emits no Event.

**Inputs**

| Input | Type | Required | Description |
| --- | --- | --- | --- |
| `id` | `string` | Yes | The id of the Card. |
| `at` | `string` | No | A time or Version name: the record as it stood then. Unset: as it stands now. |

**Returns**

| Output | Type | Required | Description |
| --- | --- | --- | --- |
| `card` | [Card](/business/nouns/card) | Yes | The Card. |

**Refuses when**

| Check | Error | Fix | Then call |
| --- | --- | --- | --- |
| The key is valid, but its scopes do not allow this operation. | [`forbidden`](/code/api/errors/forbidden) | Use a key whose scopes cover the operation, or ask an owner of the namespace to grant them. | None. |

**Example**

```bash
npx startup-builder do Card.get --json '{"id":"card_YkjOnjSexq"}'
```

### Card.list
Returns Cards, newest first, one page at a time. [Verb page](/business/nouns/card/list?interface=cli).

```text
npx startup-builder do Card.list --json '<input>' [--try]
```

Reads only: it emits no Event.

**Inputs**

| Input | Type | Required | Description |
| --- | --- | --- | --- |
| `limit` | `integer` | No | At most this many records, up to 100. The default is 20. |
| `after` | `string` | No | The cursor from the previous page. |
| `where` | `string` | No | A filter over the properties, such as `paidAt = null and total.amount > 500`. |
| `sort` | `string` | No | Properties to sort by, comma-separated; a leading minus sorts descending. |
| `total` | `boolean` | No | True adds the match count as `meta.total`, exact up to 10,000 matches and estimated above. |
| `facets` | `string` | No | Properties to count by value, comma-separated, returned as `meta.facets`. |
| `fields` | `string` | No | Properties to return on each record, comma-separated; `$id` and `$type` always return. |
| `include` | `string` | No | Related records to embed in place of their URLs, comma-separated. |
| `depth` | `integer` | No | How many levels of related records to embed. The default is 1. |
| `q` | `string` | No | Words to match across the text properties, ranked by relevance. |
| `match` | `string` | No | Ranks the search by `words`, or `meaning`; words is the default. |

**Returns**

| Output | Type | Required | Description |
| --- | --- | --- | --- |
| `cards` | list of [Card](/business/nouns/card) | Yes | One page of Cards. |

**Refuses when**

| Check | Error | Fix | Then call |
| --- | --- | --- | --- |
| The key is valid, but its scopes do not allow this operation. | [`forbidden`](/code/api/errors/forbidden) | Use a key whose scopes cover the operation, or ask an owner of the namespace to grant them. | None. |

**Example**

```bash
npx startup-builder do Card.list --json '{"limit":20}'
```

### Card.issue
Issue creates a Card under a Mandate once the Mandate check passes, with explicit limits on every interval. [Verb page](/business/nouns/card/issue?interface=cli).

```text
npx startup-builder do Card.issue --json '<input>' [--try | --send | --do]
```

Emits [`Card.issued`](/business/events/Card.issued).

**Inputs**

| Input | Type | Required | Description |
| --- | --- | --- | --- |
| `mandate` | [Mandate](/business/nouns/mandate) | Yes | The Mandate the Card spends under. |
| `form` | `string` | Yes | Which kind of Card to issue. |
| `task` | [Task](/business/nouns/task) | No | For a `singleUse` Card: the Task it pays for. |
| `merchant` | `string` | No | For a `merchant` Card: the one merchant it may pay. |

**Returns**

| Output | Type | Required | Description |
| --- | --- | --- | --- |
| `card` | [Card](/business/nouns/card) | Yes | The active Card, with its last four digits and limits. |

**Refuses when**

| Check | Error | Fix | Then call |
| --- | --- | --- | --- |
| The key is valid, but its scopes do not allow this operation. | [`forbidden`](/code/api/errors/forbidden) | Use a key whose scopes cover the operation, or ask an owner of the namespace to grant them. | None. |
| The card program of the Startup’s owner of record awaits its grant, so no Card can be issued. | [`card-program-pending`](/code/api/errors/card-program-pending) | Call again once the program is granted; nothing on the Startup’s side changes. | None. |
| `card-program-pending` while the card program of the Startup’s owner of record awaits its grant | [`card-program-pending`](/code/api/errors/card-program-pending) | Clear what the check names, then call it again. | None. |

**Example**

```bash
npx startup-builder do Card.issue --json '{"mandate":"mandate_mKKPrmFQYD","form":"singleUse"}'
```