Skip to main content
POST
/
orders
/
{id}
/
attach_assets
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();
import requests

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()
{
  "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"
}
Beta. The order asset management endpoints are in active development. The request and response shapes shown here are stable for production use, but we may add new fields or capabilities without notice. Contact support to be notified of breaking changes.
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.

Path parameters

id
string
required
The order’s unique identifier (UUID).

Request body

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.

Response

order
object
required
The order object.
attached_assets
array
required
List of assets that were attached (or already attached) to the order.
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();
import requests

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()
{
  "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"
}