Skip to content

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 ​

EndpointMethod
/api/admin/catalog/products/{productId}/downloadable-links/uploadPOST
/api/admin/catalog/products/{productId}/downloadable-samples/uploadPOST

Content type ​

multipart/form-data — required.

Form fields ​

FieldTypeRequiredNotes
filefileyesThe binary file to store (max 128 MB).

Response ​

201 Created

FieldTypeNotes
typestringlink or sample.
pathstringStorage-relative file path — use this on the product update.
namestringOriginal file name.
urlstring | nullURL if the storage disk exposes one, otherwise null.

Errors ​

HTTPCause
401 UnauthorizedMissing or invalid admin Bearer token.
403 ForbiddenAdmin role lacks catalog.products.edit.
404 Not FoundProduct not found.
422 Unprocessable EntityMissing file, or file too large.

Released under the MIT License.