# Create a payment link (/docs/api/payment-links/create-payment-link)

## Create a payment link

`POST https://runepay.co/api/v1/payment_links`

A reusable checkout URL. Pass `amount`, or omit it and pass `min_amount` and `max_amount` to let the buyer choose.

Scope: `payment_links:write`

| Parameter | In | Type | Description |
| --- | --- | --- | --- |
| `Idempotency-Key` | header | string | Makes a retry safe: the same key and body within 24 hours does not repeat the request. |

Body:

| Field | Type | Description |
| --- | --- | --- |
| `name` (required) | string | Shown to the buyer. |
| `description` | string or null | Shown to the buyer. |
| `amount` | integer or null | Fixed amount in minor units. |
| `min_amount` | integer or null | Lowest amount the buyer may choose, in minor units. |
| `max_amount` | integer or null | Highest amount the buyer may choose, in minor units. |
| `currency` | string or null | ISO 4217 code, any case. Defaults to the account's currency. |
| `success_url` | string or null | Where the buyer goes after paying. Absolute http(s) URL. |
| `metadata` |  | Key-value strings stored on the object. Values that are not strings are ignored. |

Example request body:

```json
{
  "name": "Pro plan",
  "description": "One month of Pro",
  "amount": 1999,
  "success_url": "https://merchant.example/thanks",
  "metadata": {
    "plan": "pro"
  }
}
```

Response `201`:

```json
{
  "id": "plink_01KA7D4E6F8G0H2J4K6M8N0P2Q",
  "object": "payment_link",
  "livemode": false,
  "active": true,
  "name": "Pro plan",
  "description": "One month of Pro",
  "amount": 1999,
  "min_amount": null,
  "max_amount": null,
  "currency": "USD",
  "success_url": "https://merchant.example/thanks",
  "metadata": {
    "plan": "pro"
  },
  "url": "https://runepay.co/pay/l/plink_01KA7D4E6F8G0H2J4K6M8N0P2Q",
  "created": 1767225600,
  "updated": 1767225600
}
```

Errors: 400, 401, 403, 409, 413, 422, 500, 503, with the [error shape](/docs/api/errors).
