curl --request POST \
--url https://api.rootfi.dev/v4/ecommerce/orders \
--header 'Content-Type: application/json' \
--header 'api_key: <api-key>' \
--data '
{
"company_id": 1089,
"data": [
{
"customer_id": "cus_123456",
"currency_id": "USD",
"order_number": "ORD-2024-001",
"order_date": "2024-01-22T05:07:31.465Z",
"status": "pending",
"line_items": [
{
"item_id": "prod_789",
"description": "Wireless Headphones - Black",
"quantity": 1,
"unit_amount": 99.99
}
]
}
]
}
'{
"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": "ord_123456",
"order_number": "ORD-2024-001",
"contact_id": "cus_123456",
"currency_id": "USD",
"status": "pending"
}
],
"sync_id": "sync_123456"
}Create a new order in the e-commerce platform.
curl --request POST \
--url https://api.rootfi.dev/v4/ecommerce/orders \
--header 'Content-Type: application/json' \
--header 'api_key: <api-key>' \
--data '
{
"company_id": 1089,
"data": [
{
"customer_id": "cus_123456",
"currency_id": "USD",
"order_number": "ORD-2024-001",
"order_date": "2024-01-22T05:07:31.465Z",
"status": "pending",
"line_items": [
{
"item_id": "prod_789",
"description": "Wireless Headphones - Black",
"quantity": 1,
"unit_amount": 99.99
}
]
}
]
}
'{
"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": "ord_123456",
"order_number": "ORD-2024-001",
"contact_id": "cus_123456",
"currency_id": "USD",
"status": "pending"
}
],
"sync_id": "sync_123456"
}| Field | Type | Required | Description |
|---|---|---|---|
| company_id | integer | Yes | The rootfi_company_id to associate this order with |
| data | array | Yes | Array of order objects to create |
| data[].customer_id | string | Yes | Reference to the Contact who placed the order |
| data[].currency_id | string | Yes | ISO 4217 currency code (e.g., USD, EUR) |
| data[].order_number | string | No | Human-readable order number (auto-generated if not provided) |
| data[].order_date | string | No | Date when order was placed (ISO 8601). Defaults to current date |
| data[].status | string | No | Order status (pending, processing, shipped, delivered, canceled). Defaults to pending |
| data[].line_items | array | Yes | Array of line item objects |
| data[].shipping_address | object | No | Shipping address object |
| data[].billing_address | object | No | Billing address object |