Getting Started
Authentication v3
- Concepts
- System Apps
- User Apps
- Authentication Endpoints
Product Catalog
- Product Catalog API - Overview
- Developer Guide
- Data Ingestion Best Practices
- Attributes & Attribute Mapping
- Categories
- Products
- Collections
- Background Jobs
- Bulk Import & Export
- Published Products
Orders
- Orders (3.0.0)
- Developer Guide
- Orders FAQ
- Shopping Lists
- Shipping Methods
- Imports
- Exports
- Orders
- Frauds
- Notifications
- Backorders Preorders
- Cancellations
- Allocations
- Shipments
- Inventory Transfers
- Tracking
- Invoices
- Payments
- Credits
- Appeasements
- Returns
Inventory
- Inventory (3.0.0)
- Inventory FAQ
- Imports
- Counters
- Inventory
- Locations
- Networks
Integrations
Offers
- Offers (3.0.0)
- Developer Guide
- Real-time Pricing Engine
- Price Lists
- Prices
- Price Types
- Price Controls
- Price Methods
- Priced Products
- Add-ons
- Promotions
- Coupons
- Coupon Codes
- Redemptions
- Product Exclusion Lists
- Segments
- Imports
- Exports
- Attributes
- Webhook Events
Carts
- Overview
- Developer Guides
- Carts
- Order Draft
- Items
- Addresses
- Payments
- Fulfillment
- Customer
- Coupons
- Validations
- Cart Orchestrator
Customers
- Customer Profile
- Customer Address
- Customer Self
Create a line item
Add an item to specified cart. If the cart doesn’t exist, create it and add the item.
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": 1730902008,
"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": 1730902008,
"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": {
"sale": 1000.15,
"cost": 900.15,
"base": 2000.15,
"unitPriceWithoutDiscounts": 2000.15,
"lineTotalWithoutDiscounts": 2000.15,
"lineTotalWithDiscounts": 2000.15,
"type": "BASE"
},
"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.483971941Z",
"updatedAt": "2022-08-01T20:03:28.483971941Z",
"leadTime": "5 days",
"type": "primary",
"hasInfiniteInventory": false,
"backorderShipmentAt": "2022-08-01T20:03:28.483971941Z",
"preorderShipmentAt": "2022-08-01T20:03:28.483971941Z",
"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
A header used by fabric to identify the tenant making the request. You must include tenant id in the authentication header for an API request to access any of fabric’s endpoints. You can retrieve the tenant id , which is also called account id, from Copilot. This header is required.
x-fabric-channel-id identifies the sales channel where the API request is being made; primarily for multichannel use cases. The channel ids are 12 corresponding to US and 13 corresponding to Canada. The default channel id is 12. This field is required.
Unique request ID
Path Parameters
Cart ID
Body
Line items to add to cart
Number of line items in cart
Fee amount
Placeholder for additional information in key:value
pairs
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
Fulfillment request details
Item price list ID
Item SKU
Response
Line item details
Amount by which the line item's total amount or the specified cart's total amount is adjusted
Price adjustment ID; it identifies a single price adjustment object within the price adjustments array.
Price adjustment reason
Placeholder for additional information
Time cart was created
Time cart was last updated
Sales channel
Time line item was created
Individual line item discount
Fee amount
Placeholder for additional information in key:value
pairs
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
The fulfillment details.
Sales channel
The inventory response.
Maximum restock inventory quantity
Time when backorder is shipped
x-fabric-channel-id identifies the sales channel where the API request is being made; primarily for multichannel use cases. The channel ids are 12 corresponding to US and 13 corresponding to Canada. The default channel id is 12. This field is required.; identifies business operations location.
Merchant-defined inventory counter (also known as inventory position)
Merchant-defined inventory counter (also known as inventory position)
Time of inventory creation
Placeholder for additional info
Placeholder for additional info
Infinite inventory flag.<br />true: Inventory can be used any number of times and doesn't have any consumption limit.<br />false: Inventory can't be used infinitely, and has a consumption limit.
System-generated inventory ID. This ID is generated during inventory creation.
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.
Time between when an order is placed to replenish inventory and when the order is received at warehouse
Represents the warehouse or store location where the inventory is stored. It's recommended to link locationNumber
to the corresponding value in the fabric Locations service.
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
Indicates inventory positions at network
Indicates inventory positions at network
Maximum first-shipping inventory quantity
Time when preorder is shipped
Region where inventory is managed
Reserved inventory quantity at the location
Product SKU (Stock Keeping Unit) identifier. It serves as the primary reference key for the inventory and provides uniqueness to the item.
Inventory type - a classifier attribute that provides flexibility to define inventory types
Time when inventory was last updated
ID of the vendor who will replenish the inventory for the retailer
Inventory type - a classifier attribute that provides flexibility to define inventory types
Inventory network code
Fulfillment type
Line item ID
true: Item is active<br />false: Item is inactive
true: Item is set for pickup<br />false: Item is set for delivery
Line item name
Line item position number (starts at 1)
x > 1
Individual line item price
Line item price list ID
Additional line item options
Attribute name
Attribute value
Attribute ID
Attribute description
Attribute level
Attribute mapping
Attribute price
Attribute type
Line item quantity
Shipping details
Shipping address
Address line 1
City
Country (can be full name, or ISO 3166-1 alpha-2 or alpha-3 code)
Postal or ZIP code
Region or state
Address line 2
Address line 3
Address line 4
Address recipient
Receiver's email address
Recipient's name
Address type
Alternative pickup person
Receiver's email address
Person's full name
Time shipping detail was created
Shipping details ID
true: Item is set for pickup<br />false: Item is set for delivery
Designated pickup person
Receiver's email address
Person's full name
Shipping cost
Discount amount
Shipping method ID
Shipping method name
Store ID
Shipping tax code
Shipping type
Time shipping detail was last updated
Warehouse ID
Line item SKU
Time line item was last updated
Warehouse ID
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": 1730902008,
"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": 1730902008,
"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": {
"sale": 1000.15,
"cost": 900.15,
"base": 2000.15,
"unitPriceWithoutDiscounts": 2000.15,
"lineTotalWithoutDiscounts": 2000.15,
"lineTotalWithDiscounts": 2000.15,
"type": "BASE"
},
"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.483971941Z",
"updatedAt": "2022-08-01T20:03:28.483971941Z",
"leadTime": "5 days",
"type": "primary",
"hasInfiniteInventory": false,
"backorderShipmentAt": "2022-08-01T20:03:28.483971941Z",
"preorderShipmentAt": "2022-08-01T20:03:28.483971941Z",
"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"
}
]
}