Skip to main content
Command reference

codespar collect

Collect: links (draft, publish, pause, archive, stats), attempts and their WhatsApp material, payments and late-payment decisions, receivers, recurring offers and their adhesions, the Test payer butto

9 min read
View MarkdownEdit on GitHub

Collect: links (draft, publish, pause, archive, stats), attempts and their WhatsApp material, payments and late-payment decisions, receivers, recurring offers and their adhesions, the Test payer button

29 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 this project's Collect links

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

GET /v1/collect/links · parameters, responses and refusals

Create a Collect link with its first draft

codespar collect create-links --input-file body.json
body.json
{
  "consumer_id": "csm_0000000000000000",
  "valid_until": "2026-01-15T12:00:00.000Z",
  "billing": "one_time",
  "version": {
    "title": "Example",
    "description": "string",
    "success_message": "string",
    "items": [
      {
        "name": "Example",
        "quantity": 0,
        "unit_amount_minor": 1000
      }
    ],
    "brand": {
      "logo_url": "https://example.com/hook",
      "color": "string",
      "text_color": "string",
      "texts": {
        "header": "string",
        "footer": "string"
      }
    },
    "surfaces": [
      "page"
    ],
    "due_in_days": 0,
    "payer_fields": {
      "contact": "optional",
      "external_reference": "off"
    },
    "usdc_price": "string"
  },
  "payer": {
    "name": "Example",
    "contact": "string",
    "external_reference": "string",
    "document": "string",
    "address": {
      "publicArea": "string",
      "number": "string",
      "neighborhood": "string",
      "city": "string",
      "state": "string",
      "postalCode": "string"
    }
  },
  "reference": "string",
  "reference_version": "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/collect/links · parameters, responses and refusals

codespar collect list-receivers-default

The project's default receiver for links that name none

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

GET /v1/collect/receivers/default · parameters, responses and refusals

codespar collect set-receivers-default

Configure (or clear) the project's default receiver

codespar collect set-receivers-default --input '{"consumer_id":"csm_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

PUT /v1/collect/receivers/default · parameters, responses and refusals

codespar collect receivers

The consumers that could receive a Collect charge in this project

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

GET /v1/collect/receivers · parameters, responses and refusals

The project's Collect numbers over the last 30 days

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

GET /v1/collect/links/stats · parameters, responses and refusals

Read a Collect link

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

GET /v1/collect/links/{linkId} · parameters, responses and refusals

Change a draft link's validity or receiving consumer

codespar collect update-links link_0000000000000000 --input '{"valid_until":"2026-01-15T12:00:00.000Z","consumer_id":"csm_0000000000000000"}'
argumentwhat it is
<linkId>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/collect/links/{linkId} · parameters, responses and refusals

Replace the draft of a Collect link

codespar collect links-draft link_0000000000000000 --input-file body.json
body.json
{
  "title": "Example",
  "description": "string",
  "success_message": "string",
  "items": [
    {
      "name": "Example",
      "quantity": 0,
      "unit_amount_minor": 1000
    }
  ],
  "brand": {
    "logo_url": "https://example.com/hook",
    "color": "string",
    "text_color": "string",
    "texts": {
      "header": "string",
      "footer": "string"
    }
  },
  "surfaces": [
    "page"
  ],
  "due_in_days": 0,
  "payer_fields": {
    "contact": "optional",
    "external_reference": "off"
  },
  "usdc_price": "string"
}
argumentwhat it is
<linkId>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

PUT /v1/collect/links/{linkId}/draft · parameters, responses and refusals

Publish a Collect link

codespar collect links-publish link_0000000000000000 --input '{"confirm_usdc_price":"string"}'
argumentwhat it is
<linkId>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/collect/links/{linkId}/publish · parameters, responses and refusals

Pause a Collect link

codespar collect links-pause link_0000000000000000
argumentwhat it is
<linkId>String.
optionwhat it does
-q, --query <key=value>Query parameter (repeatable) (default: [])
--timeout <ms>Per-request timeout in milliseconds

POST /v1/collect/links/{linkId}/pause · parameters, responses and refusals

Resume a paused Collect link

codespar collect links-resume link_0000000000000000
argumentwhat it is
<linkId>String.
optionwhat it does
-q, --query <key=value>Query parameter (repeatable) (default: [])
--timeout <ms>Per-request timeout in milliseconds

POST /v1/collect/links/{linkId}/resume · parameters, responses and refusals

List a Collect link's attempts

codespar collect list-links-attempts link_0000000000000000
argumentwhat it is
<linkId>String.
optionwhat it does
-q, --query <key=value>Query parameter (repeatable) (default: [])
--timeout <ms>Per-request timeout in milliseconds

GET /v1/collect/links/{linkId}/attempts · parameters, responses and refusals

Issue a Pix attempt for the partner's channel

codespar collect create-links-attempts link_0000000000000000 --input '{"surface":"whatsapp","payer":{},"renew":false,"idempotency_key":"string"}'
argumentwhat it is
<linkId>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/collect/links/{linkId}/attempts · parameters, responses and refusals

codespar collect list-attempts

List the project's Collect charges with their payments

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

GET /v1/collect/attempts · parameters, responses and refusals

List a Collect link's payments

codespar collect links-payments link_0000000000000000
argumentwhat it is
<linkId>String.
optionwhat it does
-q, --query <key=value>Query parameter (repeatable) (default: [])
--timeout <ms>Per-request timeout in milliseconds

GET /v1/collect/links/{linkId}/payments · parameters, responses and refusals

Archive a Collect link

codespar collect links-archive link_0000000000000000 --input '{"subscriptions":"cancel"}'
argumentwhat it is
<linkId>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/collect/links/{linkId}/archive · parameters, responses and refusals

codespar collect attempts-test-pay

Pay a Test attempt's charge from the shared Test payer (the payer button)

codespar collect attempts-test-pay attempt_0000000000000000
argumentwhat it is
<attemptId>String.
optionwhat it does
-q, --query <key=value>Query parameter (repeatable) (default: [])
--timeout <ms>Per-request timeout in milliseconds

POST /v1/collect/attempts/{attemptId}/test-pay · parameters, responses and refusals

codespar collect attempts-artifact

The WhatsApp material of an attempt

codespar collect attempts-artifact attempt_0000000000000000
argumentwhat it is
<attemptId>String.
optionwhat it does
-q, --query <key=value>Query parameter (repeatable) (default: [])
--timeout <ms>Per-request timeout in milliseconds

GET /v1/collect/attempts/{attemptId}/artifact · parameters, responses and refusals

codespar collect get

The hosted page's read of a Collect link (public)

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

GET /v1/collect/{linkId} · parameters, responses and refusals

codespar collect create-attempts

Ask a Collect link for a payable Pix (public)

codespar collect create-attempts link_0000000000000000 --input '{"page_session":"string","payer":{},"renew":false}'
argumentwhat it is
<linkId>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/collect/{linkId}/attempts · parameters, responses and refusals

The refund obligations of a link's exception payments

codespar collect links-refunds link_0000000000000000
argumentwhat it is
<linkId>String.
optionwhat it does
-q, --query <key=value>Query parameter (repeatable) (default: [])
--timeout <ms>Per-request timeout in milliseconds

GET /v1/collect/links/{linkId}/refunds · parameters, responses and refusals

codespar collect payments-refund

Refund a late payment instead of keeping it

codespar collect payments-refund payment_0000000000000000
argumentwhat it is
<paymentId>String.
optionwhat it does
-q, --query <key=value>Query parameter (repeatable) (default: [])
--timeout <ms>Per-request timeout in milliseconds

POST /v1/collect/payments/{paymentId}/refund · parameters, responses and refusals

codespar collect payments-honor

Keep a late payment instead of refunding it

codespar collect payments-honor payment_0000000000000000
argumentwhat it is
<paymentId>String.
optionwhat it does
-q, --query <key=value>Query parameter (repeatable) (default: [])
--timeout <ms>Per-request timeout in milliseconds

POST /v1/collect/payments/{paymentId}/honor · parameters, responses and refusals

The adhesions of a recurring offer

codespar collect links-subscriptions link_0000000000000000
argumentwhat it is
<linkId>String.
optionwhat it does
-q, --query <key=value>Query parameter (repeatable) (default: [])
--timeout <ms>Per-request timeout in milliseconds

GET /v1/collect/links/{linkId}/subscriptions · parameters, responses and refusals

codespar collect get-subscriptions

One adhesion of a recurring offer

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

GET /v1/collect/subscriptions/{subscriptionId} · parameters, responses and refusals

codespar collect subscriptions-cancel

Cancel an adhesion commercially

codespar collect subscriptions-cancel subscription_0000000000000000 --input '{"reason":"customer_request"}'
argumentwhat it is
<subscriptionId>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/collect/subscriptions/{subscriptionId}/cancel · parameters, responses and refusals

codespar collect subscriptions-test-pay

Pay a Test adhesion's first payment from the shared Test payer (Pagar (teste))

codespar collect subscriptions-test-pay subscription_0000000000000000
argumentwhat it is
<subscriptionId>String.
optionwhat it does
-q, --query <key=value>Query parameter (repeatable) (default: [])
--timeout <ms>Per-request timeout in milliseconds

POST /v1/collect/subscriptions/{subscriptionId}/test-pay · parameters, responses and refusals

codespar collect create-subscriptions

A payer follows their adhesion to a recurring offer (public)

codespar collect create-subscriptions link_0000000000000000 subscription_0000000000000000 --input '{"page_session":"string"}'
argumentwhat it is
<linkId>String.
<subscriptionId>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/collect/{linkId}/subscriptions/{subscriptionId} · parameters, responses and refusals

codespar collect | CodeSpar