Skip to main content
Command reference

codespar payment-links

Payment links: the shareable URL an agent pays over x402/USDC and a person pays via Pix; list, create, read, change, remove, payments, stats

2 min read
View MarkdownEdit on GitHub

Payment links: the shareable URL an agent pays over x402/USDC and a person pays via Pix; list, create, read, change, remove, payments, stats

7 commands in @codespar/cli 0.20.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.

List the payment links in this project

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

GET /v1/payment-links · parameters, responses and refusals

Create a multi-rail payment link

codespar payment-links create --input-file body.json
body.json
{
  "slug": "example",
  "title": "Example",
  "description": "string",
  "accepts": [
    {
      "rail": "x402",
      "amount": "1000",
      "currency": "USDC",
      "pay_to": {
        "kind": "byo",
        "address": "string",
        "consumer_id": "csm_0000000000000000"
      }
    }
  ],
  "one_time": true,
  "max_uses": 1,
  "expires_at": "2026-01-15T12:00:00.000Z",
  "redirect_url": "https://example.com/hook",
  "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/payment-links · parameters, responses and refusals

Collect totals for this project's payment links

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

GET /v1/payment-links/stats · parameters, responses and refusals

The payments one payment link received

codespar payment-links payments 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/payment-links/{id}/payments · parameters, responses and refusals

Read one payment link

codespar payment-links 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/payment-links/{id} · parameters, responses and refusals

Delete a payment link

codespar payment-links delete 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

DELETE /v1/payment-links/{id} · parameters, responses and refusals

Update a payment link's title, copy, expiry, redirect or active flag

codespar payment-links update obj_0000000000000000 --input '{"title":"Example","description":"string","active":true,"expires_at":"2026-01-15T12:00:00.000Z","redirect_url":"https://example.com/hook"}'
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

PATCH /v1/payment-links/{id} · parameters, responses and refusals

codespar payment-links | CodeSpar