Skip to main content
POST
/
ecommerce
/
orders
Create Order
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. Orders represent contact purchases and include line items, shipping information, and payment details.

Request Body

FieldTypeRequiredDescription
company_idintegerYesThe rootfi_company_id to associate this order with
dataarrayYesArray of order objects to create
data[].customer_idstringYesReference to the Contact who placed the order
data[].currency_idstringYesISO 4217 currency code (e.g., USD, EUR)
data[].order_numberstringNoHuman-readable order number (auto-generated if not provided)
data[].order_datestringNoDate when order was placed (ISO 8601). Defaults to current date
data[].statusstringNoOrder status (pending, processing, shipped, delivered, canceled). Defaults to pending
data[].line_itemsarrayYesArray of line item objects
data[].shipping_addressobjectNoShipping address object
data[].billing_addressobjectNoBilling address object
See Order Overview for complete field details.

Authorizations

api_key
string
header
required

Body

application/json
company_id
integer
required

The ID of the company in the accounting platform

data
ecommerceOrdersFields · object[]
required

The data of the orders endpoint

run_async
boolean | null

Run the request asynchronously

Response

Order created successfully

data
ecommerceOrderObject · object[]
required

The data of the orders endpoint

sync_id
string | null

The sync id of the request