# Payment links API

> Create, list, retrieve, update and deactivate hosted payment links with the Anytime Capital Payments API, and prefill checkout from the link's URL.

Source: https://anytime-capital.com/docs/payment-links · Markdown: https://anytime-capital.com/docs/payment-links.md · All docs: https://anytime-capital.com/docs/llms-full.txt

A payment link is a hosted checkout page for one price. Share its `url` by text, email, DM or QR code, put it behind a button on your site, or create one per order from your backend and send the customer straight to it. Customers pay by card, Apple Pay or Google Pay, and by bank account where you have turned it on.

Links made for invoices and subscription plans are managed with those and don't appear here.

## The payment link object

```json
{
  "object": "payment_link",
  "id": "pl_4kTz8QwN2xYb6RcD1mPa",
  "url": "https://anytime-capital.com/pay/business/pl_4kTz8QwN2xYb6RcD1mPa",
  "title": "Consulting — October",
  "description": "Two strategy sessions",
  "amountCents": 12500,
  "currency": "usd",
  "active": true,
  "singleUse": false,
  "shippingCents": 0,
  "collectShipping": false,
  "allowDiscountCodes": false,
  "successUrl": null,
  "confirmationMessage": "Thanks! We'll email your session times within a day.",
  "requireTermsConsent": false,
  "metadata": {
    "campaign": "fall-launch"
  },
  "items": [],
  "createdAt": "2026-10-01T09:30:00.000Z",
  "deactivatedAt": null,
  "allowQuantity": false,
  "maxQuantity": null,
  "customFields": [],
  "tipsEnabled": false,
  "payWhatYouWant": false,
  "minAmountCents": null
}
```

| Field | Type | Description |
| --- | --- | --- |
| `id` | string | `pl_` followed by 20 letters and digits. |
| `url` | string | The pay page. Share it, redirect to it or embed it. |
| `title`, `description` | string | What the customer sees at the top of checkout. |
| `amountCents` | integer | The price in cents. With `payWhatYouWant`, the suggested amount. |
| `currency` | string | `usd`. |
| `active` | boolean | False once the link is deactivated (`deactivatedAt` is set). |
| `singleUse` | boolean | The link closes after its first successful payment. |
| `shippingCents`, `collectShipping` | integer, boolean | Flat shipping added to each payment; whether a shipping address is asked for. |
| `allowDiscountCodes` | boolean | Customers may enter one of your discount codes. |
| `successUrl`, `confirmationMessage` | string or null | Where customers go, or what they read, after paying. A link has at most one of them. |
| `requireTermsConsent` | boolean | Customers must agree to your terms before paying. |
| `metadata` | object | Your own key/value pairs, copied onto each payment made on the link. |
| `items` | array | Catalog products, for links made in the dashboard from products. Empty for single-price links. |
| `allowQuantity`, `maxQuantity` | boolean, integer or null | Customers choose how many, up to `maxQuantity`. |
| `customFields` | array | Questions asked at checkout. |
| `tipsEnabled` | boolean | A tip is offered at checkout. |
| `payWhatYouWant`, `minAmountCents` | boolean, integer or null | Customers choose the amount, at least `minAmountCents`. |
| `createdAt`, `deactivatedAt` | string, string or null | ISO 8601 times in UTC. |

## Endpoints

### List payment links

`GET /api/v1/payment-links`

Your payment links, newest first, each with the choices it offers the buyer.

**Query**

| Name | Type | Required | Description |
| --- | --- | --- | --- |
| `active` | boolean | no | `true` for links taking payments, `false` for deactivated ones. |
| `limit` | integer | no | How many objects per page. See [Pagination](https://anytime-capital.com/docs/pagination.md). |
| `cursor` | string | no | The previous page's `nextCursor`, for the page after it. |

**Request**

```bash
curl "https://anytime-capital.com/api/v1/payment-links?active=true&limit=10" \
  -H "Authorization: Bearer $ANYTIME_API_KEY"
```

**Response** (200)

```json
{
  "object": "list",
  "data": [
    {
      "object": "payment_link",
      "id": "pl_4kTz8QwN2xYb6RcD1mPa",
      "url": "https://anytime-capital.com/pay/business/pl_4kTz8QwN2xYb6RcD1mPa",
      "title": "Consulting — October",
      "description": "Two strategy sessions",
      "amountCents": 12500,
      "currency": "usd",
      "active": true,
      "singleUse": false,
      "shippingCents": 0,
      "collectShipping": false,
      "allowDiscountCodes": false,
      "successUrl": null,
      "confirmationMessage": "Thanks! We'll email your session times within a day.",
      "requireTermsConsent": false,
      "metadata": {
        "campaign": "fall-launch"
      },
      "items": [],
      "createdAt": "2026-10-01T09:30:00.000Z",
      "deactivatedAt": null,
      "allowQuantity": false,
      "maxQuantity": null,
      "customFields": [],
      "tipsEnabled": false,
      "payWhatYouWant": false,
      "minAmountCents": null
    }
  ],
  "hasMore": false,
  "nextCursor": null
}
```

### Create a payment link

`POST /api/v1/payment-links`

Creates a single-price link and answers `201` with it. Supports Idempotency-Key.

**Body**

| Name | Type | Required | Description |
| --- | --- | --- | --- |
| `title` | string | yes | What the customer is paying for, up to 120 characters. |
| `amountCents` | integer | yes | The price, from 100 ($1.00) to 1000000 ($10,000.00). |
| `description` | string | no | Shown under the title, up to 500 characters. |
| `singleUse` | boolean | no | Close the link after its first successful payment. Use it for one link per order. Default `false`. |
| `shippingCents` | integer | no | Flat shipping added to each payment, up to $1,000.00. Default 0. |
| `collectShipping` | boolean | no | Ask for a shipping address. Default `false`. |
| `allowDiscountCodes` | boolean | no | Let customers enter one of your discount codes. Default `false`. |
| `successUrl` | string | no | An `https://` page on your site to send customers to after paying. Not with `confirmationMessage`. |
| `confirmationMessage` | string | no | Up to 500 characters shown on our confirmation page after paying, instead of a `successUrl`. |
| `requireTermsConsent` | boolean | no | Customers must tick “I agree to the terms” before paying. Needs a terms link in Settings → Payments (`409 TERMS_URL_REQUIRED` otherwise). Default `false`. |
| `metadata` | object | no | Up to 20 of your own key/value pairs, e.g. `{"orderId": "1042"}`. Keys: up to 40 letters, numbers, `-` and `_`; values: text up to 500 characters. Copied onto each payment; customers never see it. |
| `allowQuantity` | boolean | no | Let customers choose how many. Default `false`. |
| `maxQuantity` | integer | no | With `allowQuantity`: the most per payment, 1–99. Default 10. |
| `tipsEnabled` | boolean | no | Offer a tip (10%, 15%, 20% or an amount). Default `false`. |
| `payWhatYouWant` | boolean | no | Customers choose the amount; `amountCents` is the suggestion. Not with quantity, tips or discount codes. Default `false`. |
| `minAmountCents` | integer | no | With `payWhatYouWant`: the smallest amount. Default 100. |
| `customFields` | array | no | Up to 3 checkout questions: `{ id, label, type, options, required }` with a label up to 60 characters, `type` one of `text`, `long_text`, `phone` or `dropdown`, and 2–10 `options` for a dropdown. |

**Headers**

| Header | Type | Required | Description |
| --- | --- | --- | --- |
| `Idempotency-Key` | string | no | Recommended. See [Idempotency](https://anytime-capital.com/docs/idempotency.md). |

**Request**

```bash
curl -X POST https://anytime-capital.com/api/v1/payment-links \
  -H "Authorization: Bearer $ANYTIME_API_KEY" \
  -H "Idempotency-Key: order-1042-link" \
  -H "Content-Type: application/json" \
  -d '{
    "title": "Consulting — October",
    "description": "Two strategy sessions",
    "amountCents": 12500,
    "metadata": { "campaign": "fall-launch" }
  }'
```

**Response** (201)

```json
{
  "object": "payment_link",
  "id": "pl_4kTz8QwN2xYb6RcD1mPa",
  "url": "https://anytime-capital.com/pay/business/pl_4kTz8QwN2xYb6RcD1mPa",
  "title": "Consulting — October",
  "description": "Two strategy sessions",
  "amountCents": 12500,
  "currency": "usd",
  "active": true,
  "singleUse": false,
  "shippingCents": 0,
  "collectShipping": false,
  "allowDiscountCodes": false,
  "successUrl": null,
  "confirmationMessage": "Thanks! We'll email your session times within a day.",
  "requireTermsConsent": false,
  "metadata": {
    "campaign": "fall-launch"
  },
  "items": [],
  "createdAt": "2026-10-01T09:30:00.000Z",
  "deactivatedAt": null,
  "allowQuantity": false,
  "maxQuantity": null,
  "customFields": [],
  "tipsEnabled": false,
  "payWhatYouWant": false,
  "minAmountCents": null
}
```

> **Note:** Catalog products (`items`) can't be sent through the API yet: send `amountCents` for a single price. Links built from products in the dashboard still list and retrieve with their `items`.

### Retrieve a payment link

`GET /api/v1/payment-links/{id}`

Returns the link, or `404 NOT_FOUND` if it isn't one of yours.

**Request**

```bash
curl https://anytime-capital.com/api/v1/payment-links/pl_4kTz8QwN2xYb6RcD1mPa \
  -H "Authorization: Bearer $ANYTIME_API_KEY"
```

**Response** (200)

```json
{
  "object": "payment_link",
  "id": "pl_4kTz8QwN2xYb6RcD1mPa",
  "url": "https://anytime-capital.com/pay/business/pl_4kTz8QwN2xYb6RcD1mPa",
  "title": "Consulting — October",
  "description": "Two strategy sessions",
  "amountCents": 12500,
  "currency": "usd",
  "active": true,
  "singleUse": false,
  "shippingCents": 0,
  "collectShipping": false,
  "allowDiscountCodes": false,
  "successUrl": null,
  "confirmationMessage": "Thanks! We'll email your session times within a day.",
  "requireTermsConsent": false,
  "metadata": {
    "campaign": "fall-launch"
  },
  "items": [],
  "createdAt": "2026-10-01T09:30:00.000Z",
  "deactivatedAt": null,
  "allowQuantity": false,
  "maxQuantity": null,
  "customFields": [],
  "tipsEnabled": false,
  "payWhatYouWant": false,
  "minAmountCents": null
}
```

### Update a payment link

`POST /api/v1/payment-links/{id}`

Send only what changes; everything else stays as it is. Changes apply to the link straight away; payments already made keep what they were charged. Supports Idempotency-Key.

**Body**

| Name | Type | Required | Description |
| --- | --- | --- | --- |
| `title, description` | string | no | As on create. A `null` description removes it. |
| `successUrl, confirmationMessage` | string or null | no | What customers see after paying. Setting one clears the other; `null` clears it. |
| `requireTermsConsent` | boolean | no | Turning it on needs a terms link in Settings → Payments. |
| `metadata` | object or null | no | Replaces all of the link's metadata; `null` or `{}` clears it. |
| `customFields` | array | no | Replaces the link's checkout questions; `[]` removes them. |
| `tipsEnabled, allowQuantity, maxQuantity, collectShipping` | boolean / integer | no | As on create. Quantity and tips stay off on a link where customers choose the amount. |

**Request**

```bash
curl -X POST https://anytime-capital.com/api/v1/payment-links/pl_4kTz8QwN2xYb6RcD1mPa \
  -H "Authorization: Bearer $ANYTIME_API_KEY" \
  -H "Idempotency-Key: 1d2c4b6a-update-title" \
  -H "Content-Type: application/json" \
  -d '{
    "title": "Consulting — November",
    "metadata": { "campaign": "winter" }
  }'
```

**Response** (200)

```json
{
  "object": "payment_link",
  "id": "pl_4kTz8QwN2xYb6RcD1mPa",
  "url": "https://anytime-capital.com/pay/business/pl_4kTz8QwN2xYb6RcD1mPa",
  "title": "Consulting — November",
  "description": "Two strategy sessions",
  "amountCents": 12500,
  "currency": "usd",
  "active": true,
  "singleUse": false,
  "shippingCents": 0,
  "collectShipping": false,
  "allowDiscountCodes": false,
  "successUrl": null,
  "confirmationMessage": "Thanks! We'll email your session times within a day.",
  "requireTermsConsent": false,
  "metadata": {
    "campaign": "winter"
  },
  "items": [],
  "createdAt": "2026-10-01T09:30:00.000Z",
  "deactivatedAt": null,
  "allowQuantity": false,
  "maxQuantity": null,
  "customFields": [],
  "tipsEnabled": false,
  "payWhatYouWant": false,
  "minAmountCents": null
}
```

The price is fixed once a link exists: `amountCents`, `items`, `payWhatYouWant`, `minAmountCents`, `shippingCents`, `allowDiscountCodes` and `singleUse` answer `400 NOT_EDITABLE`. Create a new link to sell at a new price, and deactivate the old one.

### Deactivate a payment link

`POST /api/v1/payment-links/{id}/deactivate`

The link stops taking payments; anyone who opens it sees that it's closed. Payments already made are unaffected. Deactivating a link that is already off returns it unchanged. Supports Idempotency-Key.

**Request**

```bash
curl -X POST https://anytime-capital.com/api/v1/payment-links/pl_4kTz8QwN2xYb6RcD1mPa/deactivate \
  -H "Authorization: Bearer $ANYTIME_API_KEY" \
  -H "Idempotency-Key: deactivate-pl_4kTz8Q"
```

**Response** (200)

```json
{
  "object": "payment_link",
  "id": "pl_4kTz8QwN2xYb6RcD1mPa",
  "url": "https://anytime-capital.com/pay/business/pl_4kTz8QwN2xYb6RcD1mPa",
  "title": "Consulting — October",
  "description": "Two strategy sessions",
  "amountCents": 12500,
  "currency": "usd",
  "active": false,
  "singleUse": false,
  "shippingCents": 0,
  "collectShipping": false,
  "allowDiscountCodes": false,
  "successUrl": null,
  "confirmationMessage": "Thanks! We'll email your session times within a day.",
  "requireTermsConsent": false,
  "metadata": {
    "campaign": "fall-launch"
  },
  "items": [],
  "createdAt": "2026-10-01T09:30:00.000Z",
  "deactivatedAt": "2026-10-16T10:00:00.000Z",
  "allowQuantity": false,
  "maxQuantity": null,
  "customFields": [],
  "tipsEnabled": false,
  "payWhatYouWant": false,
  "minAmountCents": null
}
```

## Prefill checkout

Fill in details for your customer by adding parameters to a link's `url`. A value that isn't valid is ignored, never an error.

| Parameter | What it does |
| --- | --- |
| `prefilled_email` | The customer's email for their receipt. They can still change it. |
| `code` | One of your discount codes, applied when checkout opens, on links that accept codes. |
| `ref` | Your own reference for the payment, up to 200 letters, numbers, spaces and `_ . : / # @ + -`. Stored on the payment as `clientReference` and returned by the API and in webhooks. |

```text
https://anytime-capital.com/pay/business/pl_4kTz8QwN2xYb6RcD1mPa?prefilled_email=jordan%40example.com&code=FALL20&ref=order_1042
```

On your own website, the Pay button and the inline checkout take the same values as `data-email`, `data-code` and `data-ref`. See [Checkout](https://anytime-capital.com/docs/checkout.md).

## One link per order

For a cart or an order whose total you work out yourself, create a `singleUse` link per order with the order id in `metadata`, send the customer to its `url`, and mark the order paid when the `payment.succeeded` webhook arrives: `data.metadata` carries your order id and `data.source.id` the link id. Use a stored Idempotency-Key so a retry never makes a second link. For a fixed price you sell again and again, one reusable link with `?ref=` per customer does the same job.

---

Anytime Capital is a fintech company, not a bank. Payment processing, banking and payout services are provided by Anytime Capital's licensed partners. Rates shown are for US card payments; international cards, currency conversion and disputes may carry additional fees shown in your dashboard before you accept a payment.
