---
title: "codespar collect"
description: "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"
---

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](/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 collect list-links`

List this project's Collect links

```bash
codespar collect list-links
```

| option | what 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](/docs/api/reference/collect#get-v1collectlinks)

### `codespar collect create-links`

Create a Collect link with its first draft

```bash
codespar collect create-links --input-file body.json
```

```json title="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"
}
```

| 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/collect/links` · [parameters, responses and refusals](/docs/api/reference/collect#post-v1collectlinks)

### `codespar collect list-receivers-default`

The project's default receiver for links that name none

```bash
codespar collect list-receivers-default
```

| option | what 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](/docs/api/reference/collect#get-v1collectreceiversdefault)

### `codespar collect set-receivers-default`

Configure (or clear) the project's default receiver

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

`PUT /v1/collect/receivers/default` · [parameters, responses and refusals](/docs/api/reference/collect#put-v1collectreceiversdefault)

### `codespar collect receivers`

The consumers that could receive a Collect charge in this project

```bash
codespar collect receivers
```

| option | what 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](/docs/api/reference/collect#get-v1collectreceivers)

### `codespar collect links-stats`

The project's Collect numbers over the last 30 days

```bash
codespar collect links-stats
```

| option | what 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](/docs/api/reference/collect#get-v1collectlinksstats)

### `codespar collect get-links`

Read a Collect link

```bash
codespar collect get-links link_0000000000000000
```

| argument | what it is |
|---|---|
| `<linkId>` | String. |

| option | what 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](/docs/api/reference/collect#get-v1collectlinkslinkid)

### `codespar collect update-links`

Change a draft link's validity or receiving consumer

```bash
codespar collect update-links link_0000000000000000 --input '{"valid_until":"2026-01-15T12:00:00.000Z","consumer_id":"csm_0000000000000000"}'
```

| argument | what it is |
|---|---|
| `<linkId>` | 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 |

`PATCH /v1/collect/links/{linkId}` · [parameters, responses and refusals](/docs/api/reference/collect#patch-v1collectlinkslinkid)

### `codespar collect links-draft`

Replace the draft of a Collect link

```bash
codespar collect links-draft link_0000000000000000 --input-file body.json
```

```json title="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"
}
```

| argument | what it is |
|---|---|
| `<linkId>` | 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 |

`PUT /v1/collect/links/{linkId}/draft` · [parameters, responses and refusals](/docs/api/reference/collect#put-v1collectlinkslinkiddraft)

### `codespar collect links-publish`

Publish a Collect link

```bash
codespar collect links-publish link_0000000000000000 --input '{"confirm_usdc_price":"string"}'
```

| argument | what it is |
|---|---|
| `<linkId>` | 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/collect/links/{linkId}/publish` · [parameters, responses and refusals](/docs/api/reference/collect#post-v1collectlinkslinkidpublish)

### `codespar collect links-pause`

Pause a Collect link

```bash
codespar collect links-pause link_0000000000000000
```

| argument | what it is |
|---|---|
| `<linkId>` | String. |

| option | what 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](/docs/api/reference/collect#post-v1collectlinkslinkidpause)

### `codespar collect links-resume`

Resume a paused Collect link

```bash
codespar collect links-resume link_0000000000000000
```

| argument | what it is |
|---|---|
| `<linkId>` | String. |

| option | what 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](/docs/api/reference/collect#post-v1collectlinkslinkidresume)

### `codespar collect list-links-attempts`

List a Collect link's attempts

```bash
codespar collect list-links-attempts link_0000000000000000
```

| argument | what it is |
|---|---|
| `<linkId>` | String. |

| option | what 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](/docs/api/reference/collect#get-v1collectlinkslinkidattempts)

### `codespar collect create-links-attempts`

Issue a Pix attempt for the partner's channel

```bash
codespar collect create-links-attempts link_0000000000000000 --input '{"surface":"whatsapp","payer":{},"renew":false,"idempotency_key":"string"}'
```

| argument | what it is |
|---|---|
| `<linkId>` | 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/collect/links/{linkId}/attempts` · [parameters, responses and refusals](/docs/api/reference/collect#post-v1collectlinkslinkidattempts)

### `codespar collect list-attempts`

List the project's Collect charges with their payments

```bash
codespar collect list-attempts
```

| option | what 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](/docs/api/reference/collect#get-v1collectattempts)

### `codespar collect links-payments`

List a Collect link's payments

```bash
codespar collect links-payments link_0000000000000000
```

| argument | what it is |
|---|---|
| `<linkId>` | String. |

| option | what 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](/docs/api/reference/collect#get-v1collectlinkslinkidpayments)

### `codespar collect links-archive`

Archive a Collect link

```bash
codespar collect links-archive link_0000000000000000 --input '{"subscriptions":"cancel"}'
```

| argument | what it is |
|---|---|
| `<linkId>` | 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/collect/links/{linkId}/archive` · [parameters, responses and refusals](/docs/api/reference/collect#post-v1collectlinkslinkidarchive)

### `codespar collect attempts-test-pay`

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

```bash
codespar collect attempts-test-pay attempt_0000000000000000
```

| argument | what it is |
|---|---|
| `<attemptId>` | String. |

| option | what 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](/docs/api/reference/collect#post-v1collectattemptsattemptidtest-pay)

### `codespar collect attempts-artifact`

The WhatsApp material of an attempt

```bash
codespar collect attempts-artifact attempt_0000000000000000
```

| argument | what it is |
|---|---|
| `<attemptId>` | String. |

| option | what 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](/docs/api/reference/collect#get-v1collectattemptsattemptidartifact)

### `codespar collect get`

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

```bash
codespar collect get link_0000000000000000
```

| argument | what it is |
|---|---|
| `<linkId>` | String. |

| option | what 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](/docs/api/reference/collect#get-v1collectlinkid)

### `codespar collect create-attempts`

Ask a Collect link for a payable Pix (public)

```bash
codespar collect create-attempts link_0000000000000000 --input '{"page_session":"string","payer":{},"renew":false}'
```

| argument | what it is |
|---|---|
| `<linkId>` | 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/collect/{linkId}/attempts` · [parameters, responses and refusals](/docs/api/reference/collect#post-v1collectlinkidattempts)

### `codespar collect links-refunds`

The refund obligations of a link's exception payments

```bash
codespar collect links-refunds link_0000000000000000
```

| argument | what it is |
|---|---|
| `<linkId>` | String. |

| option | what 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](/docs/api/reference/collect#get-v1collectlinkslinkidrefunds)

### `codespar collect payments-refund`

Refund a late payment instead of keeping it

```bash
codespar collect payments-refund payment_0000000000000000
```

| argument | what it is |
|---|---|
| `<paymentId>` | String. |

| option | what 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](/docs/api/reference/collect#post-v1collectpaymentspaymentidrefund)

### `codespar collect payments-honor`

Keep a late payment instead of refunding it

```bash
codespar collect payments-honor payment_0000000000000000
```

| argument | what it is |
|---|---|
| `<paymentId>` | String. |

| option | what 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](/docs/api/reference/collect#post-v1collectpaymentspaymentidhonor)

### `codespar collect links-subscriptions`

The adhesions of a recurring offer

```bash
codespar collect links-subscriptions link_0000000000000000
```

| argument | what it is |
|---|---|
| `<linkId>` | String. |

| option | what 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](/docs/api/reference/collect#get-v1collectlinkslinkidsubscriptions)

### `codespar collect get-subscriptions`

One adhesion of a recurring offer

```bash
codespar collect get-subscriptions subscription_0000000000000000
```

| argument | what it is |
|---|---|
| `<subscriptionId>` | String. |

| option | what 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](/docs/api/reference/collect#get-v1collectsubscriptionssubscriptionid)

### `codespar collect subscriptions-cancel`

Cancel an adhesion commercially

```bash
codespar collect subscriptions-cancel subscription_0000000000000000 --input '{"reason":"customer_request"}'
```

| argument | what it is |
|---|---|
| `<subscriptionId>` | 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/collect/subscriptions/{subscriptionId}/cancel` · [parameters, responses and refusals](/docs/api/reference/collect#post-v1collectsubscriptionssubscriptionidcancel)

### `codespar collect subscriptions-test-pay`

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

```bash
codespar collect subscriptions-test-pay subscription_0000000000000000
```

| argument | what it is |
|---|---|
| `<subscriptionId>` | String. |

| option | what 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](/docs/api/reference/collect#post-v1collectsubscriptionssubscriptionidtest-pay)

### `codespar collect create-subscriptions`

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

```bash
codespar collect create-subscriptions link_0000000000000000 subscription_0000000000000000 --input '{"page_session":"string"}'
```

| argument | what it is |
|---|---|
| `<linkId>` | String. |
| `<subscriptionId>` | 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/collect/{linkId}/subscriptions/{subscriptionId}` · [parameters, responses and refusals](/docs/api/reference/collect#post-v1collectlinkidsubscriptionssubscriptionid)
