<!-- canonical: https://docs.costplus.io/api-reference/payment-links/createPaymentLink -->

> Create a new reusable payment link. The response includes a `payment_url` to share with the customer.
The customer can attempt payment multiple times (up to 25 attempts) until the link expires or payment succeeds.

# Create a payment link

Create a new reusable payment link. The response includes a `payment_url` to share with the customer.
The customer can attempt payment multiple times (up to 25 attempts) until the link expires or payment succeeds.

## Endpoint

```
POST /paymentlinks/
```

## Authentication

HTTP Basic — use your API key as the username with an empty password.

```bash
curl -u YOUR_API_KEY: https://api.costplus.online/v1/paymentlinks//
```

## Request body

Content-Type: `application/json` (required)

Fields:

- `id` — string. Payment link identifier
- `merchant_order_id` — string (required). Merchant's internal order ID
- `description` — string,null. Payment link description
- `amount` — integer (required). Amount in minor units (including VAT)
- `currency` — string (required). ISO 4217 currency code
- `expiration_period` — string,null. Expiration interval (ISO 8601 duration)
- `payment_url` — string,null. Payment URL to share with customer
- `payment_methods` — array. Limit available payment methods for this payment link. Supports multiple values.
- `created` — string. Creation timestamp
- `modified` — string. Last modified timestamp
- `completed_order_id` — string. ID of the completed order
- `status` — string. Payment link status
- `reason` — string. Reason for current status
- `completed` — string. Completion timestamp
- `orders` — object. Orders associated with this payment link
- `customer` — object. Customer details

Example:

```json
{
  "merchant_order_id": "invoice-1234",
  "amount": 995,
  "currency": "EUR",
  "description": "Invoice #1234"
}
```

## Responses

### 201 — The created payment link

```json
{
  "id": "e6eecc6a-47c5-4948-bcc0-d8b73f5c55a1",
  "merchant_order_id": "invoice-1234",
  "amount": 995,
  "currency": "EUR",
  "description": "Invoice #1234",
  "expiration_period": "P30D",
  "payment_url": "https://api.costplus.online/paymentlinks/e6eecc6a-47c5-4948-bcc0-d8b73f5c55a1/",
  "status": "new",
  "reason": "Payment Link was created, not yet visited",
  "orders": {},
  "created": "2026-01-15T12:00:00.000000Z"
}
```

### 401 — Invalid or missing API key

### 403 — No authorization for the requested resource

## cURL

```bash
curl -u YOUR_API_KEY: \
  -X POST https://api.costplus.online/v1/paymentlinks/ \
  -H 'Content-Type: application/json' \
  -d '{ "merchant_order_id": "invoice-1234", "amount": 995, "currency": "EUR", "description": "Invoice #1234" }'
```
