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

Downloads also appear in the downloads field of every order, whether you fetch one or list them. See Orders.


List Order Downloads

Retrieve the download links for an order. This endpoint is not paginated.

Endpoint: GET /api/v1/orders/{order_id}/downloads/

Scope Required: orders: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://shop.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. The order’s history records a download_regenerated event naming the API key.

Endpoint: POST /api/v1/orders/{order_id}/downloads/{download_id}/regenerate/

Scope Required: orders: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://shop.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. The order’s history records a download_revoked event naming the API key. Revoking a link that’s already revoked changes nothing and records nothing.

Endpoint: POST /api/v1/orders/{order_id}/downloads/{download_id}/revoke/

Scope Required: orders: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 on the site the order was placed on: its custom domain, or else its subdomain of the dashboard’s domain
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