---
title: "codespar test"
description: "Sandbox money (test keys only): credit a consumer directly, or mint a Pix charge and settle it"
---

Sandbox money (test keys only): credit a consumer directly, or mint a Pix charge and settle it

4 commands in `@codespar/cli 0.16.0`.

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 test charges-pay`

Pay a charge in the sandbox

```bash
codespar test charges-pay charge_0000000000000000 --input '{"amount_minor":1000}'
```

| argument | what it is |
|---|---|
| `<chargeId>` | 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/test/charges/{chargeId}/pay` · [parameters, responses and refusals](/docs/api/reference/test#post-v1testchargeschargeidpay)

### `codespar test fund`

Credit a consumer in the sandbox

```bash
codespar test fund --input '{"consumer_id":"csm_0000000000000000","amount_minor":1000,"account":"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/test/fund` · [parameters, responses and refusals](/docs/api/reference/test#post-v1testfund)

### `codespar test pix-in`

Mint a sandbox Pix charge to fund a consumer

```bash
codespar test pix-in --input '{"consumer_id":"csm_0000000000000000","amount_minor":1000,"description":"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/test/pix-in` · [parameters, responses and refusals](/docs/api/reference/test#post-v1testpix-in)

### `codespar test settle-pix-in`

Settle a sandbox Pix charge and credit the consumer

```bash
codespar test settle-pix-in --input '{"consumer_id":"csm_0000000000000000","amount_minor":1000,"transaction_id":"transaction_0000000000000000"}'
```

| 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/test/settle-pix-in` · [parameters, responses and refusals](/docs/api/reference/test#post-v1testsettle-pix-in)
