---
title: "codespar shop"
description: "Shop (delegated purchases): propose one, read where it stands, list a person's masked cards"
---

Shop (delegated purchases): propose one, read where it stands, list a person's masked cards

5 commands in `@codespar/cli 0.22.5`.

Each one prints what its operation answered. [What a command prints](/docs/cli/reference#what-a-command-prints) has the rule, and [Configuration](/docs/cli/config#what-a-script-gets-when-a-command-fails) has the exit codes and the shape of a failure.

### `codespar shop create-purchases`

Propose a purchase at a supported store (never an order)

```bash
codespar shop create-purchases --input-file body.json
```

```json title="body.json"
{
  "agent_id": "agt_0000000000000000",
  "merchant": "string",
  "items": [
    {
      "sku_id": "sku_0000000000000000",
      "quantity": 0
    }
  ],
  "offer_id": "offer_0000000000000000",
  "quantity": 0,
  "payment_method": "card",
  "idempotency_key": "string"
}
```

| option | what it does |
|---|---|
| `-q, --query <key=value>` | Query parameter (repeatable) (default: []) |
| `--timeout <ms>` | Per-request timeout in milliseconds |
| `-i, --input <json>` | Request body as a JSON string |
| `-f, --input-file <path>` | Request body from a JSON file |

`POST /v1/shop/agent/purchases` · [parameters, responses and refusals](/docs/api/reference/shop#post-v1shopagentpurchases)

### `codespar shop get-purchases`

Where a purchase stands

```bash
codespar shop get-purchases prp_0000000000000000
```

| argument | what it is |
|---|---|
| `<id>` | The purchase proposal id (`prp_...`), from `POST /v1/shop/agent/purchases`. |

| option | what it does |
|---|---|
| `-q, --query <key=value>` | Query parameter (repeatable) (default: []) |
| `--timeout <ms>` | Per-request timeout in milliseconds |

`GET /v1/shop/agent/purchases/{id}` · [parameters, responses and refusals](/docs/api/reference/shop#get-v1shopagentpurchasesid)

### `codespar shop create-research`

Research a pedido aberto: offers compared, one recommendation

```bash
codespar shop create-research --input '{"query":"string","criteria":{"priority":"total","max_total_minor":1,"sources":["registry"],"limit":1000}}'
```

| option | what it does |
|---|---|
| `-q, --query <key=value>` | Query parameter (repeatable) (default: []) |
| `--timeout <ms>` | Per-request timeout in milliseconds |
| `-i, --input <json>` | Request body as a JSON string |
| `-f, --input-file <path>` | Request body from a JSON file |

`POST /v1/shop/agent/research` · [parameters, responses and refusals](/docs/api/reference/shop#post-v1shopagentresearch)

### `codespar shop get-research`

Read a research back

```bash
codespar shop get-research srr_0000000000000000
```

| argument | what it is |
|---|---|
| `<id>` | The research id (`srr_...`), from `POST /v1/shop/agent/research`. |

| option | what it does |
|---|---|
| `-q, --query <key=value>` | Query parameter (repeatable) (default: []) |
| `--timeout <ms>` | Per-request timeout in milliseconds |

`GET /v1/shop/agent/research/{id}` · [parameters, responses and refusals](/docs/api/reference/shop#get-v1shopagentresearchid)

### `codespar shop instruments`

The calling person's cards, masked

```bash
codespar shop instruments
```

| option | what it does |
|---|---|
| `-q, --query <key=value>` | Query parameter (repeatable) (default: []) |
| `--timeout <ms>` | Per-request timeout in milliseconds |

`GET /v1/shop/agent/instruments` · [parameters, responses and refusals](/docs/api/reference/shop#get-v1shopagentinstruments)
