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

# Link delivery QR code


`GET /v1/payment_links/{payment_link_id}/deliveries/{link_delivery_id}/qr`

The delivery's `url` as a QR code: `format=svg` (the default, `image/svg+xml`) or `format=png` (`image/png`).

Auth: a secret key with the `paymentLinks.retrieve` permission. Returns `200` with Link delivery.

## Parameters

| Name | In | Type | Required | Description |
| --- | --- | --- | --- | --- |
| `paymentLinkId` | path | string | Yes | The payment link id in the request path. |
| `linkDeliveryId` | path | string | Yes | The link delivery id in the request path. |
| `format` | query | string | No | Optional format filter. |

## Request

**curl**

```curl
curl -X GET "https://payments-api-sandbox.merchantservicedepot.com/v1/payment_links/{payment_link_id}/deliveries/{link_delivery_id}/qr?format=svg" \
  -H "Authorization: Bearer $MYELA_API_KEY"
```

**Node**

```node
import { writeFile } from "node:fs/promises";

const res = await fetch("https://payments-api-sandbox.merchantservicedepot.com/v1/payment_links/{payment_link_id}/deliveries/{link_delivery_id}/qr?format=svg", {
  method: "GET",
  headers: {
    Authorization: `Bearer ${process.env.MYELA_API_KEY}`,
  },
});

if (!res.ok) {
  const { error } = await res.json();
  // Branch on error.code — never on error.message.
  throw new Error(error.code);
}
await writeFile("invoice.pdf", Buffer.from(await res.arrayBuffer()));
```

**Python**

```python
import os
import requests

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

if not res.ok:
    # Branch on error["code"] — never on error["message"].
    raise RuntimeError(res.json()["error"]["code"])
open("invoice.pdf", "wb").write(res.content)
```

## 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
null
```

Source: https://docs.merchantservicedepot.com/api-reference/link-delivery-qr-code/
