POST
/
carts
/
{cartId}
/
line-items
curl --request POST \
  --url https://api.fabric.inc/v3/carts/{cartId}/line-items \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --header 'x-fabric-tenant-id: <x-fabric-tenant-id>' \
  --data '{
  "sku": "16B2GS8LD5FDS",
  "itemId": 234343,
  "quantity": 1,
  "priceListId": 100000,
  "attributes": {
    "productFamily": "Laptop computers"
  },
  "fulfillment": {
    "type": "WEB_SDD",
    "networkCode": "ShipToHome",
    "channelId": "12",
    "inventoryType": "availableToPurchase"
  },
  "fees": [
    {
      "feeId": "73bc09d0-874a-4c3d-84d0-df1670d03578",
      "name": "gift",
      "type": "gift_wrap",
      "amount": 10.5,
      "attributes": {
        "from": "sam"
      }
    }
  ]
}'
{
  "id": "12gved0f-7645-40cb-y7b0-167f8bggdb3z",
  "itemId": 234343,
  "position": 1,
  "name": "Varnet Garden Light Kit",
  "sku": "16B2GS8LD5FDS",
  "productAttributes": [
    {
      "attributeId": "60c2a358eb2ec30008ae70a1",
      "name": "gift wrapping (small)",
      "description": "Gift wrapping for a small package",
      "mapping": "ITEM",
      "type": "GIFT",
      "value": "true",
      "price": 10,
      "level": "order"
    }
  ],
  "createdAt": "2022-09-06T14:07:17.000Z",
  "updatedAt": "2022-09-06T14:07:17.000Z",
  "quantity": 15,
  "priceListId": 108674,
  "isActive": true,
  "price": "<any>",
  "discounts": [
    {
      "amount": 100.15,
      "quantity": 1,
      "proratedAmount": 100.15,
      "proratedQuantity": 1,
      "application": 1,
      "promotion": {
        "id": "6197ec46e836ff000952d668",
        "value": 2000.15,
        "groupId": "61a6354d0d70e30009415f16",
        "level": 1,
        "isStackable": true,
        "isAlwaysApplied": true,
        "name": "20% OFF",
        "type": "Coupon",
        "discountType": "AMOUNT_OFF"
      }
    }
  ],
  "groups": [
    "61d38e117162b7dba69c3d6d"
  ],
  "attributes": {
    "productFamily": "Laptop computers"
  },
  "channel": "12",
  "isPickup": true,
  "warehouseId": "XYZ-1234",
  "shippingDetails": {
    "id": "fef78121-bee3-4448-bf1c-d5b5461dbda2",
    "createdAt": "2022-09-06T14:07:17.000Z",
    "updatedAt": "2022-09-06T14:07:17.000Z",
    "address": {
      "addressLine1": "123 Main St.",
      "addressLine2": "Suite 100",
      "addressLine3": "Seventh floor",
      "addressLine4": "Attention: Pat E. Kake",
      "city": "Seattle",
      "region": "WA",
      "country": "USA",
      "postalCode": "98121",
      "attention": "Billing manager",
      "email": "test@example.com",
      "type": "shipping",
      "name": "Pat E Kake",
      "phone": {
        "number": "123-456-7899",
        "type": "MOBILE"
      }
    },
    "type": "SHIP_TO_ADDRESS",
    "taxCode": "FR1000",
    "isPickup": true,
    "altPickupPerson": {
      "name": "Pat E Kake",
      "phone": {
        "number": "123-456-7899",
        "type": "MOBILE"
      },
      "email": "test@example.com"
    },
    "pickupPerson": {
      "name": "Pat E Kake",
      "phone": {
        "number": "123-456-7899",
        "type": "MOBILE"
      },
      "email": "test@example.com"
    },
    "warehouseId": "XYZ-1234",
    "storeId": "ABC-123",
    "shippingCost": 150.25,
    "shippingMethodId": "dfsae-2d32113-32lpdd",
    "shippingDiscount": 150.25,
    "shippingMethodName": "Express Delivery"
  },
  "fulfillment": {
    "type": "WEB_SDD",
    "networkCode": "ShipToHome",
    "channelId": "12",
    "inventoryType": "availableToPurchase",
    "inventory": {
      "inventoryId": "723910d81723",
      "sku": "SKU1",
      "itemId": 12345,
      "locationNumber": 12345,
      "region": "North America",
      "channelId": "channel_xyz",
      "vendorId": "vendor1",
      "createdAt": "2022-08-01T18:03:28.483Z",
      "updatedAt": "2022-08-01T20:03:28.483Z",
      "leadTime": "5 days",
      "type": "primary",
      "hasInfiniteInventory": true,
      "backorderShipmentAt": "2022-08-01T20:03:28.483Z",
      "preorderShipmentAt": "2022-08-01T20:03:28.483Z",
      "backorderLimit": 50,
      "preorderLimit": 40,
      "safetyStock": 10,
      "lowStock": 10,
      "networkCode": "ShipToHome",
      "counters": {
        "onHand": 100,
        "allocated": 10,
        "shipped": 20
      },
      "customAttributes": {
        "isBopis": true
      },
      "networkCounters": {
        "softReserve": 10
      },
      "virtualCounters": {
        "availableToPurchase": 60
      }
    }
  },
  "fees": [
    {
      "feeId": "73bc09d0-874a-4c3d-84d0-df1670d03578",
      "name": "gift",
      "type": "gift_wrap",
      "amount": 10.5,
      "attributes": {
        "from": "sam"
      }
    }
  ],
  "adjustments": [
    {
      "id": "c695af14-5e33-402c-9d8d-71edcf4856a8",
      "amount": 60.5,
      "reason": "CSR Adjustment",
      "attributes": {
        "productFamily": "Laptop computers"
      },
      "createdAt": "2022-09-06T14:07:17.000Z",
      "updatedAt": "2022-09-06T14:07:17.000Z"
    }
  ]
}

Authorizations

Authorization
string
headerrequired

Bearer authentication header of the form Bearer <token>, where <token> is your auth token.

Headers

x-fabric-tenant-id
string
required

Merchant's 24-character tenant ID

x-fabric-channel-id
string

Sales channel ID

x-fabric-request-id
string

Unique request ID

Path Parameters

cartId
string
required

Cart ID

Body

application/json
sku
string | null

Item SKU

itemId
integer | null
required

The item ID of the free product

quantity
integer
required

Number of line items in cart

priceListId
integer | null

Item price list ID

attributes
object | null

Additional data passed by the caller

fulfillment
object | null

Fulfillment request details

fees
object[] | null

Response

201 - application/json
id
string | null

Line item ID

itemId
integer | null

The item ID of the free product

position
integer

Line item position number (starts at 1)

name
string | null

Line item name

sku
string

Line item SKU

productAttributes
object[] | null

Additional line item options

createdAt
string

Time line item was created

updatedAt
string

Time line item was last updated

quantity
integer

Line item quantity

priceListId
integer | null

Line item price list ID

isActive
boolean | null

true: Item is active<br />false: Item is inactive

price
any | null

Individual line item price

discounts
object[]

Individual line item discount

groups
string[] | null
attributes
object | null

Attributes passed by caller

channel
string

Sales channel

isPickup
boolean

true: Item is set for pickup<br />false: Item is set for delivery

warehouseId
string | null

Warehouse ID

shippingDetails
object

Shipping details

fulfillment
object | null

The fulfillment details.

fees
object[] | null
adjustments
object[] | null