Attaching assets to orders

API reference for attaching and detaching assets to customer orders via the Fileflare API.

Beka Rice Avatar

Written by

Last updated


Attach an asset directly to a specific Shopify order (rather than to a product). Useful for delivering personalized files — each order gets its own custom asset, not a shared product asset.

Requires Bearer authentication with your Fileflare key. Rate-limited to 60 requests per minute.

Endpoint

POST https://app.digital-downloads.com/api/v1/orders/{order}/attach

Or, to detach assets from an order:

POST https://app.digital-downloads.com/api/v1/orders/{order}/detach

Parameters

Path

  • {order} — Shopify order ID

Body (JSON)

  • asset_ids (array of UUIDs) — Fileflare asset IDs to attach to this order

Example request

curl -X POST https://app.digital-downloads.com/api/v1/orders/5234567890/attach \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"asset_ids": ["82664d96-6dfd-4343-96b0-05c46f412a5b"]}'

Example response — 201 Created

{
  "attached": true,
  "asset_ids": ["82664d96-6dfd-4343-96b0-05c46f412a5b"]
}

Notes

  • Attach returns 201 Created; detach (POST /orders/{order}/detach) returns 200 OK.
  • Order-attached assets are added in addition to whatever was already attached via the product. The customer sees both on their download page.
  • After attaching, send the download email with PUT /api/v1/orders/{order} if you want the customer notified.

Common errors

  • 404 — order doesn’t exist on your store, or one of the asset IDs is invalid.

Keep learning