Skip to main content
Command reference

codespar consumer-payments

Consumer payments: execute a payment on a consumer's behalf, with the audit chain (execute-stream returns SSE)

1 min read
View MarkdownEdit on GitHub

Consumer payments: execute a payment on a consumer's behalf, with the audit chain (execute-stream returns SSE)

2 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 consumer-payments execute

Spend by presenting the signed mandate

codespar consumer-payments execute --input-file body.json
body.json
{
  "signature": "string",
  "amount_minor": 1000,
  "purpose": "string",
  "agent_id": "agt_0000000000000000",
  "payee": "string",
  "attempt_id": "attempt_0000000000000000",
  "ted": {
    "bank": "string",
    "branch": "string",
    "account": "string",
    "tax_id": "tax_0000000000000000",
    "name": "Example",
    "account_type": "CC",
    "person_type": "F",
    "client_finality": "string"
  },
  "quote": {
    "seller": "string",
    "resource": "string",
    "price_minor": 1,
    "payee": "string",
    "session_id": "ses_0000000000000000",
    "at": "2026-01-15T12:00:00.000Z"
  },
  "actor": {
    "type": "agent",
    "id": "paymentactor_0000000000000000",
    "on_behalf_of": "string"
  },
  "approval": {
    "items_hash": "string",
    "batch_hash": "string"
  },
  "session_id": "ses_0000000000000000"
}
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/consumer-payments/execute · parameters, responses and refusals

codespar consumer-payments execute-stream

Spend by presenting the mandate, with the steps streamed

codespar consumer-payments execute-stream --input-file body.json
body.json
{
  "signature": "string",
  "amount_minor": 1000,
  "purpose": "string",
  "agent_id": "agt_0000000000000000",
  "payee": "string",
  "attempt_id": "attempt_0000000000000000",
  "ted": {
    "bank": "string",
    "branch": "string",
    "account": "string",
    "tax_id": "tax_0000000000000000",
    "name": "Example",
    "account_type": "CC",
    "person_type": "F",
    "client_finality": "string"
  },
  "quote": {
    "seller": "string",
    "resource": "string",
    "price_minor": 1,
    "payee": "string",
    "session_id": "ses_0000000000000000",
    "at": "2026-01-15T12:00:00.000Z"
  },
  "actor": {
    "type": "agent",
    "id": "paymentactor_0000000000000000",
    "on_behalf_of": "string"
  },
  "approval": {
    "items_hash": "string",
    "batch_hash": "string"
  },
  "session_id": "ses_0000000000000000"
}
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/consumer-payments/execute-stream · parameters, responses and refusals

codespar consumer-payments | CodeSpar