- Support
- Product Releases
- Blog
- Overview
- API References
- API Authentication
- Getting Started with fabric APIs
- Making your first API request
- Example
- Using Developer Portal
- Security and Compliance
Attributes Mapping
Attributes
- Developer Guide
- Product Catalog API - Overview
- Product Catalog - Attributes API
Attribute Groups
Bulk Action for Categories and Collections
Categories
Collections
- Navigation Paths
Files
Jobs
Product Operations by ID
Product Operations by SKU
General Product Operations
- Product Catalog - Files and Jobs API
Published Products by ID
Published Products by SKU
- Product Catalog - Published Products API
Allocations
- Orders (3.0.0)
Backorders Preorders
Exports
Developer Guide
Invoices
Shopping Lists
Shopping List Items
Notifications
Orders
Returns
Cancellations
Tracking
Frauds
Payments
Appeasements
Credits
Shipments
Shipping Methods
Shipping Method Items
Webhooks
- Orders FAQ(s)
- Overview
- Algolia standard integration
- Avalara standard integration
- Constructor.io standard integration
- Stripe standard integration
- Offers (3.0.0)
Real-time Pricing Engine
Promotions
Webhook Events
Redemptions
Priced Products
Product Exclusion Lists
Price Types
Coupons
Coupon Codes
Segments
Prices
Price Methods
Price Controls
Price Lists
Add-ons
Exports
Imports
Attributes
Customer Profile
Customer Address
Customer Self
Getting Started
Product Catalog
Orders
Integrations
Offers
Customers
Create a line item
Add an item to specified cart. If the cart does not exist, create it and add the item.
Bearer authentication header of the form Bearer <token>
, where <token>
is your auth token.
Merchant's 24-character tenant ID
Sales channel ID
Unique request ID
Cart ID
Line items to add to cart
Item SKU
The item ID of the free product
Number of line items in cart
Item price list ID
Additional data passed by the caller
Fulfillment request details
Fulfillment type
Inventory network code
Sales channel
Inventory type - a classifier attribute that provides flexibility to define inventory types
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
Bearer authentication header of the form Bearer <token>
, where <token>
is your auth token.
Headers
Merchant's 24-character tenant ID
Sales channel ID
Unique request ID
Path Parameters
Cart ID
Body
Item SKU
The item ID of the free product
Number of line items in cart
Item price list ID
Additional data passed by the caller
Fulfillment request details
Fulfillment type
Inventory network code
Sales channel
Inventory type - a classifier attribute that provides flexibility to define inventory types
System-generated fee ID, in UUID format. While creating a cart or line item with fee, fabric generates this ID for the specified fee.
Attribute for which fee is applied
Fee type
Fee amount
Placeholder for additional information in key:value
pairs
Response
Line item ID
The item ID of the free product
Line item position number (starts at 1)
Line item name
Line item SKU
Additional line item options
Attribute ID
Attribute name
Attribute description
Attribute mapping
Attribute type
Attribute value
Attribute price
Attribute level
Time line item was created
Time line item was last updated
Line item quantity
Line item price list ID
true: Item is active<br />false: Item is inactive
Individual line item price
Individual line item discount
Actual discount amount
The number of items eligible for the promotional discount.
The discount amount distributed proportionally among all the selected items. The distribution is determined based on each item's price relative to the total price of all participating items. Typically, proratedAmount
matches the amount
. However, there might be variations, particularly in the context of Buy-Get promotions.
This is used in conjunction with proratedAmount
to determine the discount portion allocated to the respective units of BuyGet promotions. This is applicable in partial return scenarios.
An identifier for an instance of the Buy-Get promotion that can be applied repeatedly. For example, consider a promotion - Buy 1 shirt and get 1 pant at a 20% off. If a shopper buys three shirts, 20% discount is individually applied to each shirt-pant pair. Each such discounted pair is assigned a unique application
number for tracking purposes.
The promotion details.
A 24-character system-generated Promotion ID.
The discount in percent or amount.
ID of the group or category this product belongs to
The order in which the current promotion is executed.
A flag indicating whether the promotion is stackable. Set to true
to combine the given promotion with other promotions. The discount of the current promotion is combined with other promotions, if applicable, to the item. Set to false
if the promotion is not stackable; the given promotion cannot be combined with other promotions.
A flag indicating whether the promotion is always applied regardless of any exclusive promotions on the same item. Set to true
if the promotion is always applied and set to false
if the promotion is not applied on the item by default.
The name of the promotion.
The type of the promotion.
The type of discount.
PERCENTAGE_OFF
, AMOUNT_OFF
, FIXED_PRICE
Attributes passed by caller
Sales channel
true: Item is set for pickup<br />false: Item is set for delivery
Warehouse ID
Shipping details
Shipping details ID
Time shipping detail was created
Time shipping detail was last updated
Shipping address
Address line 1
Address line 2
Address line 3
Address line 4
City
Region or state
Country (can be full name, or ISO 3166-1 alpha-2 or alpha-3 code)
Postal or ZIP code
Address recipient
Receiver's email address
Address type
Recipient's name
Recipient's phone number and type
Phone number
Phone type
Shipping type
Shipping tax code
true: Item is set for pickup<br />false: Item is set for delivery
Alternative pickup person
Person's full name
Phone number details
Phone number
Phone type
Receiver's email address
Designated pickup person
Person's full name
Phone number details
Phone number
Phone type
Receiver's email address
Warehouse ID
Store ID
Shipping cost
Shipping method ID
Discount amount
Shipping method name
The fulfillment details.
Fulfillment type
Inventory network code
Sales channel
Inventory type - a classifier attribute that provides flexibility to define inventory types
The inventory response.
System-generated inventory ID. This ID is generated during inventory creation.
Product SKU (Stock Keeping Unit) identifier. It serves as the primary reference key for the inventory and provides uniqueness to the item.
Merchant-defined item ID whose inventory is created or updated. If omitted, fabric Inventory service generates the itemId
. If you choose to use the itemId
in your environment, you must include it in all inventory Write requests.
Represents the warehouse or store location where the inventory is stored. It is recommended to link locationNumber
to the corresponding value in the fabric Locations service.
Region where inventory is managed
Sales channel ID; identifies business operations location.
ID of the vendor who will replenish the inventory for the retailer
Time of inventory creation
Time when inventory was last updated
Time between when an order is placed to replenish inventory and when the order is received at warehouse
Inventory type - a classifier attribute that provides flexibility to define inventory types
Infinite inventory flag.<br />true: Inventory can be used any number of times and does not have any consumption limit.<br />false: Inventory cannot be used infinitely, and has a consumption limit.
Time when backorder is shipped
Time when preorder is shipped
Maximum restock inventory quantity
Maximum first-shipping inventory quantity
Reserved inventory quantity at the location
Inventory quantity below which consumer service wants to be alerted as low stock at the location
Code of the network to which the inventory belongs
Merchant-defined inventory counter (also known as inventory position)
Placeholder for additional info
Indicates inventory positions at network
Virtual counters are calculated at run time from counters
System-generated fee ID, in UUID format. While creating a cart or line item with fee, fabric generates this ID for the specified fee.
Attribute for which fee is applied
Fee type
Fee amount
Placeholder for additional information in key:value
pairs
Price adjustment ID; it identifies a single price adjustment object within the price adjustments array.
Amount by which the line item's total amount or the specified cart's total amount is adjusted
Price adjustment reason
Placeholder for additional information
Time cart was created
Time cart was last updated
Was this page helpful?
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"
}
]
}