Downloadable Products — Upload Link / Sample File
Uploads the binary file for a file-type downloadable link or sample and returns its stored path.
Uploading is only half the job. This endpoint stores the file and returns its path — it does not attach anything to the product. Attach the returned path on the product update by setting downloadable_links[link_x][file] to that path along with type: file, or downloadable_samples[sample_x][file] for a sample. Skip this endpoint entirely for URL-type links and samples: set their url directly on the update.
Both endpoints are REST-only. A binary file part cannot be carried in a JSON GraphQL request.
Endpoints
| Endpoint | Method |
|---|---|
/api/admin/catalog/products/{productId}/downloadable-links/upload | POST |
/api/admin/catalog/products/{productId}/downloadable-samples/upload | POST |
Content type
multipart/form-data — required.
Form fields
| Field | Type | Required | Notes |
|---|---|---|---|
file | file | yes | The binary file to store (max 128 MB). |
Response
201 Created
| Field | Type | Notes |
|---|---|---|
type | string | link or sample. |
path | string | Storage-relative file path — use this on the product update. |
name | string | Original file name. |
url | string | null | URL if the storage disk exposes one, otherwise null. |
Errors
| HTTP | Cause |
|---|---|
401 Unauthorized | Missing or invalid admin Bearer token. |
403 Forbidden | Admin role lacks catalog.products.edit. |
404 Not Found | Product not found. |
422 Unprocessable Entity | Missing file, or file too large. |

