Order Downloads API
Manage download links for the digital items in an order. Links are created at
checkout and can be regenerated or revoked. A download link is tied to a single
digital variant on a single order.
Endpoints
- List Order Downloads -
GET /api/v1/orders/{id}/downloads/ - Regenerate Download -
POST /api/v1/orders/{id}/downloads/{download_id}/regenerate/ - Revoke Download -
POST /api/v1/orders/{id}/downloads/{download_id}/revoke/
Downloads also appear in the downloads field when you fetch a single order.
See Orders.
List Order Downloads
Retrieve the download links for an order. This endpoint is not paginated.
Endpoint: GET /api/v1/orders/{id}/downloads/
Permission Required: Read
Request
curl -X GET "https://studio.easel.engineering/api/v1/orders/ord_d0b6fmv28q6vn14peun0/downloads/" \
-H "Authorization: Bearer your_api_key_here"
Response
Status: 200 OK
{
"data": [
{
"id": "ovd_d0b6fmv28q6vn14peun0",
"product_name": "Ebook",
"variant_name": "PDF",
"download_url": "https://studio.easel.engineering/downloads/...",
"download_count": 1,
"downloads_remaining": 9,
"status": "active",
"expires_at": "2023-02-01T10:00:00Z",
"created_at": "2023-01-01T10:00:00Z"
}
]
}
Regenerate Download
Issue a fresh link for a download and extend its expiry. The old link stops
working.
Endpoint: POST /api/v1/orders/{id}/downloads/{download_id}/regenerate/
Permission Required: Write
Request
curl -X POST "https://studio.easel.engineering/api/v1/orders/ord_d0b6fmv28q6vn14peun0/downloads/ovd_d0b6fmv28q6vn14peun0/regenerate/" \
-H "Authorization: Bearer your_api_key_here" \
-H "Idempotency-Key: unique-request-id-12345"
Response
Status: 200 OK
{
"download_url": "https://studio.easel.engineering/downloads/...",
"expires_at": "2023-03-01T10:00:00Z"
}
Error Responses
Download not found
Status: 404 Not Found
{
"error": "Resource not found",
"code": "NOT_FOUND"
}
Revoke Download
Revoke a download link. Revoked links can be regenerated later.
Endpoint: POST /api/v1/orders/{id}/downloads/{download_id}/revoke/
Permission Required: Write
Request
curl -X POST "https://studio.easel.engineering/api/v1/orders/ord_d0b6fmv28q6vn14peun0/downloads/ovd_d0b6fmv28q6vn14peun0/revoke/" \
-H "Authorization: Bearer your_api_key_here" \
-H "Idempotency-Key: unique-request-id-67890"
Response
Status: 204 No Content
Order Download Object
Fields
| Field | Type | Description |
|---|---|---|
id |
string | Download public ID |
product_name |
string | Product name at the time of purchase |
variant_name |
string | Variant name |
download_url |
string | Signed download URL |
download_count |
integer | Number of times the file has been downloaded |
downloads_remaining |
integer | Downloads left before the link expires |
status |
string | active, revoked, or expired |
expires_at |
string | ISO 8601 timestamp when the link expires |
created_at |
string | ISO 8601 timestamp |