Skip to content

Attach Assets to Order

Attach one or more assets to an order as custom files.

Last updated

Attach existing assets to a specific order. This creates a custom (order-level) collection for the order and links the provided assets to it. Assets attached this way appear on the customer’s download page alongside any product-level assets.

Use this endpoint together with Create Asset and Notify Order to programmatically deliver files to customers.

  • id (string, path, required)

    The order’s unique identifier (UUID).

  • asset_ids (array, required)

    An array of asset UUIDs to attach to the order. Assets must belong to your store. Existing attachments are preserved — duplicates are silently ignored.

  • order (object, required)

    The order object.

  • attached_assets (array, required)

    List of assets that were attached (or already attached) to the order.

    Asset properties:

    • id (string, required)

      Unique asset identifier (UUID).

    • type (string, required)

      Asset type: internal, external, or licence.

    • name (string | null)

      Display name of the asset.

    • filename (string | null)

      Filename of the asset.

    • content_type (string | null)

      MIME type of the asset.

    • byte_size (integer)

      File size in bytes.

Example request

Terminal window
curl -X POST 'https://app.filemonk.io/api/v1/external/orders/a1b2c3d4-e5f6-7890-abcd-ef1234567890/attach_assets' \
-H 'X-Auth-Token: fm_api_key_your_key_here' \
-H 'Content-Type: application/json' \
-d '{
"asset_ids": [
"f1e2d3c4-b5a6-7890-fedc-ba0987654321",
"a9b8c7d6-e5f4-3210-abcd-ef9876543210"
]
}'
const orderId = 'a1b2c3d4-e5f6-7890-abcd-ef1234567890';
const response = await fetch(
`https://app.filemonk.io/api/v1/external/orders/${orderId}/attach_assets`,
{
method: 'POST',
headers: {
'X-Auth-Token': 'fm_api_key_your_key_here',
'Content-Type': 'application/json'
},
body: JSON.stringify({
asset_ids: [
'f1e2d3c4-b5a6-7890-fedc-ba0987654321',
'a9b8c7d6-e5f4-3210-abcd-ef9876543210'
]
})
}
);
const data = await response.json();
order_id = 'a1b2c3d4-e5f6-7890-abcd-ef1234567890'
response = requests.post(
f'https://app.filemonk.io/api/v1/external/orders/{order_id}/attach_assets',
headers={'X-Auth-Token': 'fm_api_key_your_key_here'},
json={
'asset_ids': [
'f1e2d3c4-b5a6-7890-fedc-ba0987654321',
'a9b8c7d6-e5f4-3210-abcd-ef9876543210'
]
}
)
data = response.json()

Example response

{
"order": {
"id": "a1b2c3d4-e5f6-7890-abcd-ef1234567890",
"name": "#1042",
"email": "customer@example.com",
"phone": "+1234567890",
"financial_status": "paid",
"fulfillment_status": null,
"total_price": "29.99",
"currency": "USD",
"created_at": "2026-03-01T14:30:00Z",
"download_count": 0
},
"attached_assets": [
{
"id": "f1e2d3c4-b5a6-7890-fedc-ba0987654321",
"type": "internal",
"name": "Custom Song - Order 1042",
"filename": "custom-song-1042.mp3",
"content_type": "audio/mpeg",
"byte_size": 5242880
}
]
}
{
"error": "Order not found"
}
{
"error": "asset_ids must be a non-empty array"
}
Was this page helpful?

Still stuck? Ask Quinn or chat with support