Skip to main content

Download Product File

Download a file attached to a product or a variant.

You don't call this endpoint directly with your API token. Instead, read the product, the product draft, or the variant and follow the file's download_url — a temporary signed link to this endpoint. The signature in the link authorizes the download, so it needs no Authorization header and can be opened straight in a browser. The link expires about an hour after you read the product or variant; read it again to get a fresh one.

A file attached only on an unpublished overlay has download_url: null until the draft is published — there is no stored copy to serve yet. See Downloadable files.

Request​

GET /product-files/{id}/download?expires={expires}&signature={signature}

Path Parameters​

ParameterTypeRequiredDescription
idstringYesFile UUID. Carried by download_url.

Query Parameters​

ParameterTypeRequiredDescription
expiresintegerYesCarried by download_url.
signaturestringYesCarried by download_url.

Example Request​

Use the download_url from the product or variant verbatim — it already carries the required query parameters. Follow redirects (curl -L): a file attached by link answers with a 302 to that URL.

curl -L -X GET "https://cart.easy.tools/api/v1/product-files/9c1e7f42-3b8a-4d6e-9f10-2a5c7d3e8b41/download?expires=1749384000&signature=abc123" \
-o ebook.pdf

Response​

Success Response (200)​

A file uploaded to your store is streamed back as its raw bytes. The response carries:

HeaderValue
Content-Typeapplication/octet-stream
Content-Dispositionattachment; filename="My ebook.pdf"

The filename is the file's name as it appears on the product or variant.

Redirect Response (302)​

A file attached by link is not served here: the response redirects to the url it was attached with, exactly as it was provided, and the contents come from wherever that URL is hosted.

Error Responses​

Not Found Error (404)​

Returned when the link has expired or its signature is invalid, or when the file does not exist. Read the product or variant again to obtain a fresh download_url.