> ## Documentation Index
> Fetch the complete documentation index at: https://docs.sequenzy.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Attach Delivery File

> Attach the distributable file delivered after a purchase

Attach the distributable file buyers receive after purchasing this product. Purchase events then expose it as `{{event.download.url}}` and `{{event.download.name}}` in sequence emails.

## Request

<ParamField path="productId" type="string" required>
  Product ID (from [List Products](/api-reference/products/list)). For products
  pushed via the Commerce API, you can also use your own productId (e.g.
  `my-ebook`).
</ParamField>

<ParamField body="url" type="string" required>
  Public http(s) URL of the file. Use [Create Upload
  URL](/api-reference/products/upload-url) to host the file on Sequenzy, or link
  to a file hosted elsewhere.
</ParamField>

<ParamField body="source" type="string" default="url">
  `upload` for files hosted on Sequenzy, `url` for external links.
</ParamField>

<ParamField body="fileName" type="string">
  Display name for the file (e.g. `guide.pdf`). Used as `{{event.download.name}}`.
</ParamField>

<ParamField body="fileSizeBytes" type="number">
  File size in bytes.
</ParamField>

<ParamField body="mimeType" type="string">
  File MIME type.
</ParamField>

```bash theme={null}
curl -X PUT "https://api.sequenzy.com/api/v1/products/prod_internal_1/delivery" \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"url": "https://example.com/guide.pdf", "fileName": "guide.pdf"}'
```

## Responses

<ResponseExample>
  ```json 200 theme={null}
  {
    "success": true,
    "product": {
      "id": "prod_internal_1",
      "title": "The Indie Hacker Guide",
      "digitalDelivery": {
        "url": "https://example.com/guide.pdf",
        "source": "url",
        "fileName": "guide.pdf",
        "fileSizeBytes": null,
        "mimeType": null,
        "updatedAt": "2026-06-11T00:00:00.000Z"
      }
    }
  }
  ```

  ```json 400 theme={null}
  {
    "success": false,
    "error": "Delivery URL must start with http:// or https://"
  }
  ```

  ```json 401 theme={null}
  {
    "success": false,
    "error": "Invalid or missing API key"
  }
  ```

  ```json 404 theme={null}
  {
    "success": false,
    "error": "Product not found"
  }
  ```
</ResponseExample>
