Downloadable Products API
A downloadable product gives the client a file to download after the order is active. Each order keeps its own copy of the file name, so a new product file reaches existing orders only with Keep Orders Updated on, or one order at a time with update. See Downloads.
Admin calls need Module access on the Servicedownloadable card of the staff group’s Permissions tab, plus each call’s own permission below (Super Administrators have all). See Authentication.
Admin calls
Section titled “Admin calls”upload
Section titled “upload”POST /api/admin/servicedownloadable/upload
Uploads a new file for a downloadable product. With Keep Orders Updated set to Yes, every order of the product gets the new file too.
Permission: Manage downloadable products (servicedownloadable.manage)
| Parameter | Type | Description |
|---|---|---|
id |
integer, required | The product id. |
file_data |
file, required | The file, sent as a multipart form upload. Allowed extensions include archives (zip, tar, gz, 7z and more), documents (pdf, docx, txt, csv), images, audio and video, and installers (exe, msi, dmg, deb, apk, iso). |
Returns: true.
Errors:
- Product not found (code 9999)
- File was not uploaded. (code 9999)
- File upload failed: The uploaded file exceeds the upload_max_filesize directive in php.ini (code 9999)
- File extension exe2 is not allowed. Allowed extensions: … (code 9999)
The old file is deleted once no product or order uses it.
update
Section titled “update”POST /api/admin/servicedownloadable/update
Changes the file of one order. With a file_data upload, the order gets that file; without one, the order’s service is set again to the file name saved on the order.
Permission: Manage downloadable products (servicedownloadable.manage)
| Parameter | Type | Description |
|---|---|---|
order_id |
integer, required | The order. |
file_data |
file | A new file for this order only, sent as a multipart form upload. The same extensions as upload. |
Returns: true.
Errors:
- Order not found (code 9999)
- Order is not activated (code 9999) when the order has no downloadable service yet
- No filename available for order file update (code 9999)
- File extension exe2 is not allowed. Allowed extensions: … (code 9999)
config_save
Section titled “config_save”POST /api/admin/servicedownloadable/config_save
Saves the product’s download settings: Keep Orders Updated.
Permission: Manage downloadable products (servicedownloadable.manage)
| Parameter | Type | Description |
|---|---|---|
id |
integer, required | The product id. |
update_orders |
boolean | Keep Orders Updated: a new upload also goes to every order of the product. Default false. |
Returns: true.
Errors:
- Product not found (code 9999)
Example
Request parameters:
{ "id": 12, "update_orders": true}result:
truesend_file
Section titled “send_file”POST /api/admin/servicedownloadable/send_file
Downloads the product’s current file.
Permission: Manage downloadable products (servicedownloadable.manage)
| Parameter | Type | Description |
|---|---|---|
id |
integer, required | The product id. |
Returns: The file as a download (application/octet-stream, with its original name), not JSON.
Errors:
- Product not found (code 9999)
- No file associated with this product. (code 404)
- File cannot be downloaded at the moment. Please contact support. (code 404) when the stored file is missing
Client calls
Section titled “Client calls”send_file (client)
Section titled “send_file (client)”POST /api/client/servicedownloadable/send_file
Downloads the file of one of the client’s active downloadable services. Each download adds one to the service’s download count.
| Parameter | Type | Description |
|---|---|---|
order_id |
integer, required | The client’s order. |
Returns: The file as a download (application/octet-stream, with its original name), not JSON.
Errors:
- Order not found (code 404) for an order of another client
- Subscription expired (code 9999) when the order’s expiry date has passed
- Order is not activated (code 404) when the order is not active
- File cannot be downloaded at the moment. Please contact support. (code 404)
Authorized users need the View services permission.

