> Index of every page: https://docs.merchantservicedepot.com/llms.txt

# Send payment link


`POST /v1/payment_links/{payment_link_id}/deliveries`

Sends the link, or mints a tracked copy of its URL. `channel` is `email` or `sms` with a `to`, or `qr` or `copied` with no `to`; those two send nothing and only give you a `url` to print or paste, so opens and payments through it are counted separately. Every delivery's `url` is the link's own `url` plus `?d=…`; the link's `url` itself never changes. A message the provider refuses is still a `201`, with `status: "failed"` and a `failureCode`. Takes `Idempotency-Key`: the same key and body returns the first delivery and sends nothing. With a test key, email and text reach only the test recipients Myela approved for your account. At most 20 email and text sends per link. Uses the same capability as creating a link, `paymentLinks.create`.

Auth: a secret key with the `paymentLinks.create` permission. Returns `201` with Link delivery.

## Parameters

| Name | In | Type | Required | Description |
| --- | --- | --- | --- | --- |
| `paymentLinkId` | path | string | Yes | The payment link id in the request path. |
| `channel` | body | string | Yes | The channel value. |

## Request

**curl**

```curl
curl -X POST "https://payments-api-sandbox.merchantservicedepot.com/v1/payment_links/{payment_link_id}/deliveries" \
  -H "Authorization: Bearer $MYELA_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
  "channel": "qr"
}'
```

**Node**

```node
const res = await fetch("https://payments-api-sandbox.merchantservicedepot.com/v1/payment_links/{payment_link_id}/deliveries", {
  method: "POST",
  headers: {
    Authorization: `Bearer ${process.env.MYELA_API_KEY}`,
    "Content-Type": "application/json",
  },
  body: JSON.stringify({
    "channel": "qr"
  }),
});

if (!res.ok) {
  const { error } = await res.json();
  // Branch on error.code — never on error.message.
  throw new Error(error.code);
}
const data = await res.json();
```

**Python**

```python
import os
import requests

res = requests.post(
    "https://payments-api-sandbox.merchantservicedepot.com/v1/payment_links/{payment_link_id}/deliveries",
    headers={
        "Authorization": f"Bearer {os.environ['MYELA_API_KEY']}",
    },
    json={
        "channel": "qr"
    },
)

if not res.ok:
    # Branch on error["code"] — never on error["message"].
    raise RuntimeError(res.json()["error"]["code"])
data = res.json()
```

## Response

| Field | Type | Description |
| --- | --- | --- |
| `id` | string | Unique delivery identifier. Also the list cursor. |
| `object` | "link_delivery" | Stable resource discriminator. |
| `channel` | string | One of email, sms, qr or copied. |
| `status` | string | created (qr, copied), queued, sent or failed. An open set: more values will be added, and a value you do not know means in progress. |
| `recipient` | string | Masked address, email and sms only. The full address is never stored. |
| `url` | string | The link's or invoice's own url plus ?d=…, so opens and payments through this delivery are counted. That url never changes. |
| `sentAt` | string | When the message was handed to the provider. |
| `failureCode` | string | When status is failed: DELIVERY_SEND_FAILED, DELIVERY_RECIPIENT_INVALID, DELIVERY_RECIPIENT_NOT_ALLOWED or DELIVERY_CHANNEL_UNAVAILABLE. |
| `openedAt` | string | First page load through this delivery. |
| `openCount` | integer | Page loads through this delivery. Link previewers and scanners count. |
| `paid` | boolean | True once a payment through this delivery succeeded. |
| `paymentId` | string | When paid: the payment, as GET /v1/payments/{id} takes it. |
| `createdAt` | string | ISO 8601 creation timestamp. |

```json
{
  "id": "ld_01JEXAMPLE",
  "object": "link_delivery",
  "channel": "email",
  "status": "sent",
  "recipient": "p•••@example.com",
  "url": "https://example.com/pay/9Yb3xK1t0QWEs7vLzR2mNc4h?d=Qm9Zb3xK1t0QWEs7vLzR2w",
  "sentAt": "2026-11-18T03:00:00.000Z",
  "failureCode": "DELIVERY_SEND_FAILED",
  "openedAt": "2026-11-18T03:04:10.000Z",
  "openCount": 2,
  "paid": false,
  "paymentId": "txn_01JEXAMPLE",
  "createdAt": "2026-11-18T03:00:00.000Z"
}
```

Source: https://docs.merchantservicedepot.com/api-reference/send-payment-link/
