curl --request POST \
--url https://api.rootfi.dev/v4/ecommerce/items \
--header 'Content-Type: application/json' \
--header 'api_key: <api-key>' \
--data '
{
"company_id": 1089,
"data": [
{
"name": "Wireless Headphones",
"description": "Premium wireless headphones with noise cancellation",
"sku": "WH-2024-BLK",
"status": "active",
"variants": [
{
"name": "Black - Medium",
"sku": "WH-2024-BLK-M",
"price": 99.99,
"compare_at_price": 129.99,
"currency_id": "USD"
}
]
}
]
}
'{
"data": {
"rootfi_id": 157,
"rootfi_created_at": "2024-01-22T05:07:31.465Z",
"rootfi_updated_at": "2024-01-22T05:07:31.000Z",
"rootfi_company_id": 1089,
"platform_id": "prod_789",
"name": "Wireless Headphones",
"description": "Premium wireless headphones",
"sku": "WH-2024-BLK",
"status": "active",
"variants": [
{
"rootfi_id": 3101,
"platform_id": "var_001",
"name": "Black - Medium",
"sku": "WH-2024-BLK-M",
"price": 99.99,
"currency_id": "USD",
"status": "active"
}
]
},
"sync_id": "sync_123456"
}Create an item with variants.
curl --request POST \
--url https://api.rootfi.dev/v4/ecommerce/items \
--header 'Content-Type: application/json' \
--header 'api_key: <api-key>' \
--data '
{
"company_id": 1089,
"data": [
{
"name": "Wireless Headphones",
"description": "Premium wireless headphones with noise cancellation",
"sku": "WH-2024-BLK",
"status": "active",
"variants": [
{
"name": "Black - Medium",
"sku": "WH-2024-BLK-M",
"price": 99.99,
"compare_at_price": 129.99,
"currency_id": "USD"
}
]
}
]
}
'{
"data": {
"rootfi_id": 157,
"rootfi_created_at": "2024-01-22T05:07:31.465Z",
"rootfi_updated_at": "2024-01-22T05:07:31.000Z",
"rootfi_company_id": 1089,
"platform_id": "prod_789",
"name": "Wireless Headphones",
"description": "Premium wireless headphones",
"sku": "WH-2024-BLK",
"status": "active",
"variants": [
{
"rootfi_id": 3101,
"platform_id": "var_001",
"name": "Black - Medium",
"sku": "WH-2024-BLK-M",
"price": 99.99,
"currency_id": "USD",
"status": "active"
}
]
},
"sync_id": "sync_123456"
}| Field | Type | Required | Description |
|---|---|---|---|
| company_id | integer | Yes | The rootfi_company_id to associate this item with |
| data | array | Yes | Array of item objects to create |
| data[].name | string | Yes | Product name |
| data[].description | string | No | Product description |
| data[].sku | string | No | Stock keeping unit (SKU) |
| data[].price | number | Yes | Base price of the item |
| data[].currency_id | string | Yes | ISO 4217 currency code (e.g., USD, EUR) |
| data[].status | string | No | Item status (active, inactive, archived). Defaults to active |
| data[].variants | array | No | Array of variant objects (size, color, etc.) |