# Create a PSE payment link

`POST /v1/recharge-links` · [Sandbox · coming soon]

> Base URL: Sandbox `https://sandbox.zulu.com.co/v1`
>
> Not in production yet: it arrives with this same signature. Try it in the sandbox.

Creates a PSE payment link to share: whoever pays it funds your COP balance. With `amount` the amount is fixed; without it, the payer types it at checkout. Without `expiresInHours` the link never expires. You may hold up to 15 active links. In the sandbox the checkout is fake and the payment is simulated with `POST /v1/sandbox/recharge-links/{slug}/pay`; every status change sends the `RECHARGE_LINKS` webhook and the payment, the `DEPOSITS` webhook.

## Authentication

`Authorization: Bearer <access_token>` (401 when missing or expired) and `X-API-Key` (403 when missing or not matching).

## Request

### Headers

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `Idempotency-Key` | string | optional | Idempotency key (up to 255 characters), valid for 24 hours per workspace. Repeating the call with the same key and body returns the original response with `Idempotent-Replayed: true`; a different body answers 422 and, while the first call is still running, 409. Production ignores it today: every call creates a new resource. max. 255 characters. [Sandbox · coming soon] |

### Body

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `amount` | integer \| null | optional | Fixed COP amount (whole pesos, 100,000 to 1,000,000,000). Omit it or send `null` to let the payer type it. |
| `concept` | string | optional | Concept the payer sees (up to 60 characters). max. 60 characters. |
| `reference` | string | optional | Your reconciliation reference (up to 25 characters). max. 25 characters. |
| `paymentMethod` | string | required | Payment method. Values: `PSE` (PSE (debit from any Colombian bank).). |
| `expiresInHours` | integer | optional | Hours until it expires (1 to 720). Without it, the link never expires. ≥ 1, ≤ 720. |

## Responses

### 201

Link created.

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `slug` | string | required | Public identifier of the link (Base58, 10 characters). |
| `reference` | string | required | Your reference (the one you sent, or the slug when you sent none). The deposit the link produces carries it. |
| `amount` | integer \| null | required | Fixed amount (COP); `null` when the payer types it. |
| `concept` | string \| null | required | Concept the payer sees. |
| `paymentMethod` | string | required | Payment method. Values: `PSE` (PSE (debit from any Colombian bank).). |
| `status` | string | required | Link status. Values: `CREATED` (Created; nobody opened it yet.), `AWAITING_PAYMENT` (The payer opened the checkout; the payment is in progress.), `PAID` (Paid: the deposit is in your balance.), `REFUSED` (The bank refused the payment; the payer may retry.), `EXPIRED` (Expired unpaid.), `CANCELLED` (You cancelled it.). |
| `checkoutUrl` | string | required | Payment page to share (a fake checkout in the sandbox). |
| `expiresAt` | string (date-time) \| null | required | Expiry (UTC); `null` when it never expires. |
| `paidAt` | string (date-time) \| null | required | Payment time (UTC); `null` until paid. |
| `failureReason` | string \| null | required | Reason of the last refusal; `null` when there was none. |
| `createdAt` | string (date-time) | required | Creation time (UTC). |

### 400

Invalid request: the body is not JSON, a field has another type or fails its validation.

### 401

The access token is missing, invalid or expired.

### 403

The `X-API-Key` is missing, invalid or does not match the token.

### 409

Conflict with the current state.

### 422

The operation can not be processed; nothing is recorded.

### 429

Too many requests: wait the seconds in `Retry-After`.

### 500

Internal error.

## Errors

| HTTP | error | cause | Description |
| --- | --- | --- | --- |
| 400 | `BadRequestApiError` | `error in struct validation` | One or more fields fail their validation. `values` carries one message per field, keyed by its JSON path, naming the Go validator that failed. |
| 400 | `BadRequestApiError` | `invalid json body: %s` | The body is not valid JSON, or a field has the wrong type (a string where a number goes, for example). Answered before the fields are validated. |
| 401 | — | `Unauthorized` | The `Authorization: Bearer <access_token>` header is missing, or the token is invalid or expired. |
| 403 | — | `Forbidden` | The `X-API-Key` is missing, unknown, revoked or does not belong to the credentials of the token. |
| 409 | `ResourceConflictApiError` | `idempotency key "%s" is still being processed` | Another call with the same `Idempotency-Key` is still running. Retry in a few seconds to receive its response. |
| 422 | `UnprocessableEntityApiError` | `idempotency key "%s" was used with a different request` | The `Idempotency-Key` was already used in the last 24 hours with a different body or operation. Use a new key for every distinct operation. |
| 422 | `UnprocessableEntityApiError` | `the workspace already has %d active recharge links` | You already hold the maximum of active links (`CREATED` or `AWAITING_PAYMENT`). Cancel one or wait until it is paid or expires. |
| 422 | `UnprocessableEntityApiError` | `amount %d is outside the allowed range of %d to %d` | The amount is outside the range allowed for PSE links. |
| 429 | — | `Too Many Requests` | You exceeded the request limit of your credentials. Wait the seconds in `Retry-After`. |
| 500 | `InternalServerApiError` | `[code:1] unexpected error` | Internal error. On operations that move money, check the state before retrying so the operation is not duplicated. |

## Examples

### Fixed amount, expires in 72 hours

```bash
curl https://sandbox.zulu.com.co/v1/recharge-links \
  -H "Authorization: Bearer $ZULU_ACCESS_TOKEN" \
  -H "X-API-Key: $ZULU_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
  "amount": 250000,
  "concept": "Cuota de noviembre",
  "reference": "FAC-2026-0042",
  "paymentMethod": "PSE",
  "expiresInHours": 72
}'
```

**Response 201**

```json
{
  "slug": "7QmVt3KpXz",
  "reference": "FAC-2026-0042",
  "amount": 250000,
  "concept": "Cuota de noviembre",
  "paymentMethod": "PSE",
  "status": "CREATED",
  "checkoutUrl": "https://developers.zulu.com.co/checkout/7QmVt3KpXz",
  "expiresAt": "2026-11-27T15:04:05.123Z",
  "paidAt": null,
  "failureReason": null,
  "createdAt": "2026-11-24T15:04:05.123Z"
}
```

### Open amount, no expiry

```bash
curl https://sandbox.zulu.com.co/v1/recharge-links \
  -H "Authorization: Bearer $ZULU_ACCESS_TOKEN" \
  -H "X-API-Key: $ZULU_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
  "paymentMethod": "PSE",
  "concept": "Abono a tu cuenta"
}'
```

**Response 201**

```json
{
  "slug": "Hn4PzR8wQe",
  "reference": "Hn4PzR8wQe",
  "amount": null,
  "concept": "Abono a tu cuenta",
  "paymentMethod": "PSE",
  "status": "CREATED",
  "checkoutUrl": "https://developers.zulu.com.co/checkout/Hn4PzR8wQe",
  "expiresAt": null,
  "paidAt": null,
  "failureReason": null,
  "createdAt": "2026-11-24T15:04:05.123Z"
}
```

### No payment method

```bash
curl https://sandbox.zulu.com.co/v1/recharge-links \
  -H "Authorization: Bearer $ZULU_ACCESS_TOKEN" \
  -H "X-API-Key: $ZULU_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
  "amount": 250000
}'
```

**Response 400**

```json
{
  "error": "BadRequestApiError",
  "cause": "error in struct validation",
  "values": {
    "paymentMethod": "failed validation on the \"required\" tag"
  }
}
```

### Amount below the minimum

```bash
curl https://sandbox.zulu.com.co/v1/recharge-links \
  -H "Authorization: Bearer $ZULU_ACCESS_TOKEN" \
  -H "X-API-Key: $ZULU_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
  "amount": 50000,
  "paymentMethod": "PSE"
}'
```

**Response 422**

```json
{
  "error": "UnprocessableEntityApiError",
  "cause": "amount 50000 is outside the allowed range of 100000 to 1000000000"
}
```
