Skip to main content
Command reference

codespar wallets

Wallets: balances, ledger, funding sources, execute, transfer, custody

6 min read
View MarkdownEdit on GitHub

Wallets: balances, ledger, funding sources, execute, transfer, custody

15 commands in @codespar/cli 0.16.0.

Each one prints what its operation answered. What a command prints has the rule, and Configuration has the exit codes and the shape of a failure.

codespar wallets list

List wallets in the caller's project. Optional filters: status, agent_id.

codespar wallets list
optionwhat it does
-q, --query <key=value>Query parameter (repeatable) (default: [])
--timeout <ms>Per-request timeout in milliseconds

GET /v1/wallets · parameters, responses and refusals

codespar wallets create

Create a per-agent wallet. Seeds a zero-balance row in the requested currency.

codespar wallets create --input '{"display_name":"Example","currency":"BRL","agent_id":"agt_0000000000000000","metadata":{}}'
optionwhat 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/wallets · parameters, responses and refusals

codespar wallets get

Fetch a wallet plus its per-currency balances. Cross-tenant ids return 404.

codespar wallets get obj_0000000000000000
argumentwhat it is
<id>String.
optionwhat it does
-q, --query <key=value>Query parameter (repeatable) (default: [])
--timeout <ms>Per-request timeout in milliseconds

GET /v1/wallets/{id} · parameters, responses and refusals

codespar wallets list-ledger

Paginated ledger view, newest first. Cursor via before_id. Optional kind filter.

codespar wallets list-ledger obj_0000000000000000
argumentwhat it is
<id>String.
optionwhat it does
-q, --query <key=value>Query parameter (repeatable) (default: [])
--timeout <ms>Per-request timeout in milliseconds

GET /v1/wallets/{id}/ledger · parameters, responses and refusals

codespar wallets create-ledger

Post a ledger entry. Admin role. Idempotent on (wallet_id, attempt_id, kind) and (wallet_id, kind, external_ref). Returns 200 with the prior row on retry, 201 on fresh insert. kind=fund is accepted only in a test project; in a live project it is refused with 409 fund_requires_test_project and nothing is written, because a live wallet is credited only by a real Pix, TED or provider receipt.

codespar wallets create-ledger obj_0000000000000000 --input '{"wallet_id":"wlt_0000000000000000","org_id":"org_0000000000000000","currency":"BRL","amount_minor":"1000","kind":"fund","metadata":{}}'
argumentwhat it is
<id>String.
optionwhat 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/wallets/{id}/ledger · parameters, responses and refusals

codespar wallets list-funding-sources

List funding-source bindings for this wallet.

codespar wallets list-funding-sources obj_0000000000000000
argumentwhat it is
<id>String.
optionwhat it does
-q, --query <key=value>Query parameter (repeatable) (default: [])
--timeout <ms>Per-request timeout in milliseconds

GET /v1/wallets/{id}/funding-sources · parameters, responses and refusals

codespar wallets create-funding-sources

Bind a connected_accounts row as a funding rail for this wallet. Admin role. The funding bridge converts the connection's webhook events into kind=fund ledger entries.

codespar wallets create-funding-sources obj_0000000000000000 --input '{"connection_id":"conn_0000000000000000","currency":"BRL","metadata":{}}'
argumentwhat it is
<id>String.
optionwhat 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/wallets/{id}/funding-sources · parameters, responses and refusals

codespar wallets delete-funding-sources

Unbind a funding source. Admin role.

codespar wallets delete-funding-sources obj_0000000000000000 conn_0000000000000000 BRL
argumentwhat it is
<id>String.
<connection_id>String.
<currency>One of BRL, USD, MXN, COP, ARS, USDC, BRLA.
optionwhat it does
-q, --query <key=value>Query parameter (repeatable) (default: [])
--timeout <ms>Per-request timeout in milliseconds

DELETE /v1/wallets/{id}/funding-sources/{connection_id}/{currency} · parameters, responses and refusals

codespar wallets execute

Drive the F2.M4 gateway lifecycle: policy → mandate → wallet hold → route → execute → wallet settle → audit. Admin role. HTTP status mirrors the GatewayPaymentResult.status (200 completed, 402 requires-approval, 403 denied, 422 failed).

codespar wallets execute obj_0000000000000000 --input-file body.json
body.json
{
  "amount": 1000,
  "currency": "BRL",
  "target_currency": "USD",
  "preferred_method": "string",
  "recipient": "string",
  "description": "string",
  "mandate_id": "mandate_0000000000000000",
  "purpose": "string",
  "attempt_id": "attempt_0000000000000000",
  "metadata": {}
}
argumentwhat it is
<id>String.
optionwhat 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/wallets/{id}/execute · parameters, responses and refusals

codespar wallets list-recon-anomalies

List reconciliation anomalies the engine has flagged. Default status filter is open.

codespar wallets list-recon-anomalies obj_0000000000000000
argumentwhat it is
<id>String.
optionwhat it does
-q, --query <key=value>Query parameter (repeatable) (default: [])
--timeout <ms>Per-request timeout in milliseconds

GET /v1/wallets/{id}/recon-anomalies · parameters, responses and refusals

codespar wallets create-recon-anomalies

Operator marks an open anomaly as resolved or dismissed. Admin role. Idempotent on the partial unique covering open rows.

codespar wallets create-recon-anomalies obj_0000000000000000 string --input '{"status":"resolved","note":"string"}'
argumentwhat it is
<id>String.
<aid>String.
optionwhat 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/wallets/{id}/recon-anomalies/{aid} · parameters, responses and refusals

codespar wallets receive

How to put money into a wallet, per rail

codespar wallets receive obj_0000000000000000
argumentwhat it is
<id>The wallet id.
optionwhat it does
-q, --query <key=value>Query parameter (repeatable) (default: [])
--timeout <ms>Per-request timeout in milliseconds

GET /v1/wallets/{id}/receive · parameters, responses and refusals

codespar wallets custody

What the ledger attributed against what the address actually holds

codespar wallets custody obj_0000000000000000
argumentwhat it is
<id>The wallet id.
optionwhat it does
-q, --query <key=value>Query parameter (repeatable) (default: [])
--timeout <ms>Per-request timeout in milliseconds

GET /v1/wallets/{id}/custody · parameters, responses and refusals

codespar wallets transfer

Withdraw from a consumer wallet under the consumer's signed mandate

codespar wallets transfer obj_0000000000000000 --input-file body.json
body.json
{
  "currency": "BRL",
  "to_address": "string",
  "amount_minor": 1000,
  "idempotency_key": "string",
  "signature": "string",
  "agent_id": "agt_0000000000000000",
  "purpose": "string"
}
argumentwhat it is
<id>The wallet id. Must be consumer-scoped.
optionwhat 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/wallets/{id}/transfer · parameters, responses and refusals

codespar wallets statement-import

Hand the reconciler a bank statement

codespar wallets statement-import obj_0000000000000000 --input-file body.json
body.json
{
  "source": "string",
  "entries": [
    {
      "provider_event_id": "providerevent_0000000000000000",
      "amount_minor": 1000,
      "currency": "BRL",
      "occurred_at": "2026-01-15T12:00:00.000Z",
      "memo": "string"
    }
  ]
}
argumentwhat it is
<id>The wallet whose ledger these lines will be matched against.
optionwhat 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/wallets/{id}/statement-import · parameters, responses and refusals

codespar wallets | CodeSpar