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. Available on the Basic plan and higher.

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

Looking up the order ID

If you only have the Shopify order number, resolve it to Fileflare’s order ID first:

GET https://app.digital-downloads.com/api/v1/orders?order_number={shopify_order_number}

Use Shopify’s sequential order number (order_number in Shopify’s REST Admin API, number in GraphQL). It usually matches the number the Shopify admin shows, without the #, but not on stores with custom order names or migrated orders. There, get it from the Shopify Admin API. The response’s `id` field is Fileflare’s order ID — note it’s labeled `id`, not `uuid`.

Parameters

Path

  • {order} — Fileflare’s order ID (a UUID), not the Shopify order ID. See “Looking up the order ID” above to get it.

Body (JSON)

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

Example request

curl -X POST https://app.digital-downloads.com/api/v1/orders/9f2c1a3e-4b7d-4e21-8a6f-1c9d5e7b2f04/attach \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"assets": ["82664d96-6dfd-4343-96b0-05c46f412a5b"]}'

Example response — 201 Created


  Empty body.

Notes

  • Attach and detach both return 201 Created with an empty body.
  • 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.

Array validation (May 2026)

Array fields (asset_ids, product_ids, order_ids) must contain scalar IDs — strings or integers. Items that are objects or nested arrays return a 422 with field-level error details. Before May 2026 these requests returned a 500; well-formed requests are unchanged.

Common errors

  • 403 — the current plan doesn’t include attaching assets directly to orders. Upgrade to Basic or higher, then retry the request.
  • `404` — order doesn’t exist on your store, or the `{order}` value isn’t a valid Fileflare order ID (e.g. a Shopify order ID was passed instead — see “Looking up the order ID” above).
  • One of the asset IDs is invalid.

Keep learning