Skip to main content
POST
/
ecommerce
/
items
Create Item
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 a new item (product with variants) in the e-commerce platform. Items represent products that can have multiple variants (e.g., size, color).

Request Body

FieldTypeRequiredDescription
company_idintegerYesThe rootfi_company_id to associate this item with
dataarrayYesArray of item objects to create
data[].namestringYesProduct name
data[].descriptionstringNoProduct description
data[].skustringNoStock keeping unit (SKU)
data[].pricenumberYesBase price of the item
data[].currency_idstringYesISO 4217 currency code (e.g., USD, EUR)
data[].statusstringNoItem status (active, inactive, archived). Defaults to active
data[].variantsarrayNoArray of variant objects (size, color, etc.)
See Item 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
ecommerceItemsFields · object[]
required

The data of the items endpoint

run_async
boolean | null

Run the request asynchronously

Response

Item created successfully

data
ecommerceItemObject · object

The data of the items endpoint

sync_id
string | null

The sync id of the request