openapi: 3.0.1
info:
title: Cart API
description: >-
fabric's **Cart API** lets you add, update, and remove items from your
Storefront cart, either as a guest user or as a logged-in user. It also
provides functionality to merge carts when you switch from guest user to
logged-in user, and apply coupons and other attributes (for example, gift
wrapping) to the line items. Additionally, the API supports more advanced
tasks such as using multiple carts within a B2B organization, sharing carts,
and supporting a unified cart experience for multi-region and multi-brand
businesses.<p>The Cart API provides high performance, scalability,
multi-tenancy, and configurability to the end-to-end order processing
actions that start from the item being added to the cart; through the
pre-checkout stage that includes billing, shipping, and payment details; to
the checkout stage where the order is processed and confirmed by fabric's
Order Management System (OMS)
contact:
name: Cart Support
email: [email protected]
license:
name: fabric API License
url: https://fabric.inc/api-license
version: 3.0.0
servers:
- url: https://api.fabric.inc/v3
security:
- bearerAuth: []
tags:
- name: Cart
description: >-
Cart endpoints are used to do basic cart operations, such as create a
cart, add item to the corresponding cart, update items, remove items,
delete cart, update status of the cart, and more.
- name: Items
description: Item endpoints are used to add, update and remove items from the Cart.
- name: Cart Fees
description: >-
Cart fee endpoints are used to add, update and remove fees at the Cart
level.
- name: Fulfillment Fees
description: >-
Fulfillment fees endpoints are used to add, update and remove fees at the
Fulfillment level.
- name: Addresses
description: >-
Address endpoints are used to add add, update and remove addresses from
the Cart.
- name: Item Fees
description: >-
Item fee endpoints are used to add, update and remove fees at the Item
level.
- name: Cart Adjustments
description: >-
Cart adjustment endpoints are used to add, update and remove adjustments
at the Cart level.
- name: Payments
description: >-
Payments endpoints are used to add add, update and remove payments from
the Cart.
- name: Customer
description: >-
Customer endpoints are used do basic customer operations, such as update a
customer, add attributes and more.
- name: Coupons
description: Coupon endpoints are used to add and remove coupons from the Cart
- name: Item Adjustments
description: >-
Item adjustments endpoints are used to add, update and remove adjustments
at the Item level.
- name: Fulfillment Adjustments
description: >-
Fulfillment adjustments endpoints are used to add, update and remove
adjustments at the Fulfillment level.
- name: Fulfillments
description: >-
Fulfillment endpoints are used to add add, update and remove fulfillments
from the Cart.
- name: Validations
description: >-
Validation endpoints are used to pass in data from fabric and third-party
services to perform business logic on the Cart
paths:
/carts/{cartId}/tax:
put:
tags:
- Validations
summary: Replace Tax Data
description: >
Replaces tax data associated with the corresponding cart.
The Cart ID from the [Create
cart](/v3/cart-and-checkout/api-reference/carts-v3/carts/carts) endpoint
is used in the path parameter.
operationId: addTax
parameters:
- name: cartId
in: path
required: true
schema:
type: string
description: >-
The 24-character system-generated Cart ID. This ID is generated
using the [Create
cart](/v3/cart-and-checkout/api-reference/carts-v3/carts/carts)
endpoint.
- name: x-fabric-tenant-id
in: header
description: >
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](/v3/platform/settings/account-details/getting-the-account-id).
This header is required.
required: true
schema:
type: string
example: 617329dfd5288b0011332311
- name: x-fabric-request-id
in: header
description: ' Unique request ID for tracking.'
required: false
schema:
type: string
example: 263e731c-45c8-11ed-b878-0242ac120002
- name: x-fabric-channel-id
in: header
description: >-
x-fabric-channel-id identifies the sales channel through which the
API request is being made; primarily for multichannel use cases. It
is a required field. The default US channel is 12 while the default
Canada channel is 11.
required: false
schema:
type: string
example: '12'
requestBody:
content:
application/json:
schema:
$ref: '#/components/schemas/TaxRequest'
required: true
responses:
'200':
description: OK
content:
application/json:
schema:
$ref: '#/components/schemas/CartResponse'
'400':
description: Client error
content:
application/json:
schema:
$ref: '#/components/schemas/ClientError'
'404':
description: Cart not found
content:
application/json:
schema:
$ref: '#/components/schemas/NotFound'
/carts/{cartId}/promotions:
put:
tags:
- Validations
summary: Replace Promotions
description: >
Replaces promotions associated with the corresponding cart.
The Cart ID from the [Create
cart](/v3/cart-and-checkout/api-reference/carts-v3/carts/carts) endpoint
is used in the path parameter.
operationId: addPromotions
parameters:
- name: cartId
in: path
required: true
schema:
type: string
description: >-
The 24-character system-generated Cart ID. This ID is generated
using the [Create
cart](/v3/cart-and-checkout/api-reference/carts-v3/carts/carts)
endpoint.
- name: x-fabric-tenant-id
in: header
description: >
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](/v3/platform/settings/account-details/getting-the-account-id).
This header is required.
required: true
schema:
type: string
example: 617329dfd5288b0011332311
- name: x-fabric-request-id
in: header
description: ' Unique request ID for tracking.'
required: false
schema:
type: string
example: 263e731c-45c8-11ed-b878-0242ac120002
- name: x-fabric-channel-id
in: header
description: >-
x-fabric-channel-id identifies the sales channel through which the
API request is being made; primarily for multichannel use cases. It
is a required field. The default US channel is 12 while the default
Canada channel is 11.
required: false
schema:
type: string
example: '12'
requestBody:
content:
application/json:
schema:
$ref: '#/components/schemas/PromotionsRequest'
required: true
responses:
'200':
description: OK
content:
application/json:
schema:
$ref: '#/components/schemas/CartResponse'
'400':
description: Client error
content:
application/json:
schema:
$ref: '#/components/schemas/ClientError'
'404':
description: Cart not found
content:
application/json:
schema:
$ref: '#/components/schemas/NotFound'
/carts/{cartId}/product:
put:
tags:
- Validations
summary: Replace Product Data
description: >
Replaces product data associated with the corresponding cart.
The Cart ID from the [Create
cart](/v3/cart-and-checkout/api-reference/carts-v3/carts/carts) endpoint
is used in the path parameter.
operationId: replaceProduct
parameters:
- name: cartId
in: path
required: true
schema:
type: string
description: >-
The 24-character system-generated Cart ID. This ID is generated
using the [Create
cart](/v3/cart-and-checkout/api-reference/carts-v3/carts/carts)
endpoint.
- name: x-fabric-tenant-id
in: header
description: >
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](/v3/platform/settings/account-details/getting-the-account-id).
This header is required.
required: true
schema:
type: string
example: 617329dfd5288b0011332311
- name: x-fabric-request-id
in: header
description: ' Unique request ID for tracking.'
required: false
schema:
type: string
example: 263e731c-45c8-11ed-b878-0242ac120002
- name: x-fabric-channel-id
in: header
description: >-
x-fabric-channel-id identifies the sales channel through which the
API request is being made; primarily for multichannel use cases. It
is a required field. The default US channel is 12 while the default
Canada channel is 11.
required: false
schema:
type: string
example: '12'
requestBody:
content:
application/json:
schema:
$ref: '#/components/schemas/ProductRequest'
required: true
responses:
'200':
description: OK
content:
application/json:
schema:
$ref: '#/components/schemas/CartResponse'
'400':
description: Client error
content:
application/json:
schema:
$ref: '#/components/schemas/ClientError'
'404':
description: Cart not found
content:
application/json:
schema:
$ref: '#/components/schemas/NotFound'
patch:
tags:
- Validations
summary: Updates Product Data
description: >
Partially updates product data associated with the corresponding cart.
The Cart ID from the [Create
cart](/v3/cart-and-checkout/api-reference/carts-v3/carts/carts) endpoint
is used in the path parameter.
operationId: updateProduct
parameters:
- name: cartId
in: path
required: true
schema:
type: string
description: >-
The 24-character system-generated Cart ID. This ID is generated
using the [Create
cart](/v3/cart-and-checkout/api-reference/carts-v3/carts/carts)
endpoint.
- name: x-fabric-tenant-id
in: header
description: >
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](/v3/platform/settings/account-details/getting-the-account-id).
This header is required.
required: true
schema:
type: string
example: 617329dfd5288b0011332311
- name: x-fabric-request-id
in: header
description: ' Unique request ID for tracking.'
required: false
schema:
type: string
example: 263e731c-45c8-11ed-b878-0242ac120002
- name: x-fabric-channel-id
in: header
description: >-
x-fabric-channel-id identifies the sales channel through which the
API request is being made; primarily for multichannel use cases. It
is a required field. The default US channel is 12 while the default
Canada channel is 11.
required: false
schema:
type: string
example: '12'
requestBody:
content:
application/json:
schema:
$ref: '#/components/schemas/ProductRequest'
required: true
responses:
'200':
description: OK
content:
application/json:
schema:
$ref: '#/components/schemas/CartResponse'
'400':
description: Client error
content:
application/json:
schema:
$ref: '#/components/schemas/ClientError'
'404':
description: Cart not found
content:
application/json:
schema:
$ref: '#/components/schemas/NotFound'
/carts/{cartId}/inventory:
put:
tags:
- Validations
summary: Replace Inventory Data
description: >
Replaces inventory data associated with the corresponding cart.
The Cart ID from the [Create
cart](/v3/cart-and-checkout/api-reference/carts-v3/carts/carts) endpoint
is used in the path parameter.
operationId: addInventory
parameters:
- name: cartId
in: path
required: true
schema:
type: string
description: >-
The 24-character system-generated Cart ID. This ID is generated
using the [Create
cart](/v3/cart-and-checkout/api-reference/carts-v3/carts/carts)
endpoint.
- name: x-fabric-tenant-id
in: header
description: >
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](/v3/platform/settings/account-details/getting-the-account-id).
This header is required.
required: true
schema:
type: string
example: 617329dfd5288b0011332311
- name: x-fabric-request-id
in: header
description: ' Unique request ID for tracking.'
required: false
schema:
type: string
example: 263e731c-45c8-11ed-b878-0242ac120002
- name: x-fabric-channel-id
in: header
description: >-
x-fabric-channel-id identifies the sales channel through which the
API request is being made; primarily for multichannel use cases. It
is a required field. The default US channel is 12 while the default
Canada channel is 11.
required: false
schema:
type: string
example: '12'
requestBody:
content:
application/json:
schema:
$ref: '#/components/schemas/InventoryRequest'
required: true
responses:
'200':
description: OK
content:
application/json:
schema:
$ref: '#/components/schemas/CartResponse'
'400':
description: Client error
content:
application/json:
schema:
$ref: '#/components/schemas/ClientError'
'404':
description: Cart not found
content:
application/json:
schema:
$ref: '#/components/schemas/NotFound'
patch:
tags:
- Validations
summary: Updates Inventory Data
description: >
Partially updates inventory data associated with the corresponding cart.
The Cart ID from the [Create
cart](/v3/cart-and-checkout/api-reference/carts-v3/carts/carts) endpoint
is used in the path parameter.
operationId: updateInventory
parameters:
- name: cartId
in: path
required: true
schema:
type: string
description: >-
The 24-character system-generated Cart ID. This ID is generated
using the [Create
cart](/v3/cart-and-checkout/api-reference/carts-v3/carts/carts)
endpoint.
- name: x-fabric-tenant-id
in: header
description: >
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](/v3/platform/settings/account-details/getting-the-account-id).
This header is required.
required: true
schema:
type: string
example: 617329dfd5288b0011332311
- name: x-fabric-request-id
in: header
description: ' Unique request ID for tracking.'
required: false
schema:
type: string
example: 263e731c-45c8-11ed-b878-0242ac120002
- name: x-fabric-channel-id
in: header
description: >-
x-fabric-channel-id identifies the sales channel through which the
API request is being made; primarily for multichannel use cases. It
is a required field. The default US channel is 12 while the default
Canada channel is 11.
required: false
schema:
type: string
example: '12'
requestBody:
content:
application/json:
schema:
$ref: '#/components/schemas/InventoryRequest'
required: true
responses:
'200':
description: OK
content:
application/json:
schema:
$ref: '#/components/schemas/CartResponse'
'400':
description: Client error
content:
application/json:
schema:
$ref: '#/components/schemas/ClientError'
'404':
description: Cart not found
content:
application/json:
schema:
$ref: '#/components/schemas/NotFound'
/carts/{cartId}/fulfillments/{fulfillmentId}:
get:
tags:
- Fulfillments
summary: Get Fulfillment
description: >
Returns the fulfillment associated with the corresponding cart.
The Cart ID from the [Create
cart](/v3/cart-and-checkout/api-reference/carts-v3/carts/carts) endpoint
is used in the path parameter.
The Fulfillment ID from the [Create
fulfillment](/v3/cart-and-checkout/api-reference/carts-v3/fulfillment/create-fulfillments)
endpoint is used in the path parameter.
operationId: getFulfillment
parameters:
- name: cartId
in: path
required: true
schema:
type: string
description: >-
The 24-character system-generated Cart ID. This ID is generated
using the [Create
cart](/v3/cart-and-checkout/api-reference/carts-v3/carts/carts)
endpoint.
- name: fulfillmentId
in: path
required: true
schema:
type: string
description: >-
The Fulfilmment ID that was generated when a fulfillment was
created using the [Create
fulfillment](/v3/cart-and-checkout/api-reference/carts-v3/fulfillment/create-fulfillments)
endpoint.
- name: x-fabric-tenant-id
in: header
description: >
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](/v3/platform/settings/account-details/getting-the-account-id).
This header is required.
required: true
schema:
type: string
example: 617329dfd5288b0011332311
- name: x-fabric-request-id
in: header
description: ' Unique request ID for tracking.'
required: false
schema:
type: string
example: 263e731c-45c8-11ed-b878-0242ac120002
- name: x-fabric-channel-id
in: header
description: >-
x-fabric-channel-id identifies the sales channel through which the
API request is being made; primarily for multichannel use cases. It
is a required field. The default US channel is 12 while the default
Canada channel is 11.
required: false
schema:
type: string
example: '12'
responses:
'200':
description: OK
content:
application/json:
schema:
$ref: '#/components/schemas/Fulfillment'
'400':
description: Client error
content:
application/json:
schema:
$ref: '#/components/schemas/ClientError'
'404':
description: Cart or Item not found
content:
application/json:
schema:
$ref: '#/components/schemas/NotFound'
put:
tags:
- Fulfillments
summary: Update Fulfillment
description: >
Updates the fulfillment associated with the corresponding cart.
The Cart ID from the [Create
cart](/v3/cart-and-checkout/api-reference/carts-v3/carts/carts) endpoint
is used in the path parameter.
The Fulfillment ID from the [Create
fulfillment](/v3/cart-and-checkout/api-reference/carts-v3/fulfillment/create-fulfillments)
endpoint is used in the path parameter.
operationId: updateFulfillment
parameters:
- name: cartId
in: path
required: true
schema:
type: string
description: >-
The 24-character system-generated Cart ID. This ID is generated
using the [Create
cart](/v3/cart-and-checkout/api-reference/carts-v3/carts/carts)
endpoint.
- name: fulfillmentId
in: path
required: true
schema:
type: string
description: >-
The Fulfilmment ID that was generated when a fulfillment was
created using the [Create
fulfillment](/v3/cart-and-checkout/api-reference/carts-v3/fulfillment/create-fulfillments)
endpoint.
- name: x-fabric-tenant-id
in: header
description: >
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](/v3/platform/settings/account-details/getting-the-account-id).
This header is required.
required: true
schema:
type: string
example: 617329dfd5288b0011332311
- name: x-fabric-request-id
in: header
description: ' Unique request ID for tracking.'
required: false
schema:
type: string
example: 263e731c-45c8-11ed-b878-0242ac120002
- name: x-fabric-channel-id
in: header
description: >-
x-fabric-channel-id identifies the sales channel through which the
API request is being made; primarily for multichannel use cases. It
is a required field. The default US channel is 12 while the default
Canada channel is 11.
required: false
schema:
type: string
example: '12'
requestBody:
content:
application/json:
schema:
$ref: '#/components/schemas/UpdateFulfillmentRequest'
required: true
responses:
'200':
description: OK
content:
application/json:
schema:
$ref: '#/components/schemas/Fulfillment'
'400':
description: Client error
content:
application/json:
schema:
$ref: '#/components/schemas/ClientError'
'404':
description: Cart or Item not found
content:
application/json:
schema:
$ref: '#/components/schemas/NotFound'
delete:
tags:
- Fulfillments
summary: Delete Fulfillment
description: >
Removes the fulfillment associated with the corresponding cart.
The Cart ID from the [Create
cart](/v3/cart-and-checkout/api-reference/carts-v3/carts/carts) endpoint
is used in the path parameter.
The Fulfillment ID from the [Create
fulfillment](/v3/cart-and-checkout/api-reference/carts-v3/fulfillment/create-fulfillments)
endpoint is used in the path parameter.
operationId: deleteFulfillment
parameters:
- name: cartId
in: path
required: true
schema:
type: string
description: >-
The 24-character system-generated Cart ID. This ID is generated
using the [Create
cart](/v3/cart-and-checkout/api-reference/carts-v3/carts/carts)
endpoint.
- name: fulfillmentId
in: path
required: true
schema:
type: string
description: >-
The Fulfilmment ID that was generated when a fulfillment was
created using the [Create
fulfillment](/v3/cart-and-checkout/api-reference/carts-v3/fulfillment/create-fulfillments)
endpoint.
- name: x-fabric-tenant-id
in: header
description: >
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](/v3/platform/settings/account-details/getting-the-account-id).
This header is required.
required: true
schema:
type: string
example: 617329dfd5288b0011332311
- name: x-fabric-request-id
in: header
description: ' Unique request ID for tracking.'
required: false
schema:
type: string
example: 263e731c-45c8-11ed-b878-0242ac120002
- name: x-fabric-channel-id
in: header
description: >-
x-fabric-channel-id identifies the sales channel through which the
API request is being made; primarily for multichannel use cases. It
is a required field. The default US channel is 12 while the default
Canada channel is 11.
required: false
schema:
type: string
example: '12'
responses:
'204':
description: No Content
'400':
description: Client error
content:
application/json:
schema:
$ref: '#/components/schemas/ClientError'
'404':
description: Cart or Item not found
content:
application/json:
schema:
$ref: '#/components/schemas/NotFound'
/order-drafts:
post:
tags:
- Cart
summary: Create an Order Draft
description: Create an order using the cart ID of the cart that contains the order.
operationId: createOrderDraft
parameters:
- name: x-fabric-tenant-id
in: header
description: >
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](/v3/platform/settings/account-details/getting-the-account-id).
This header is required.
required: true
schema:
type: string
example: 617329dfd5288b0011332311
- name: x-fabric-request-id
in: header
description: ' Unique request ID for tracking.'
required: false
schema:
type: string
example: 263e731c-45c8-11ed-b878-0242ac120002
- name: x-fabric-channel-id
in: header
description: >-
x-fabric-channel-id identifies the sales channel through which the
API request is being made; primarily for multichannel use cases. It
is a required field. The default US channel is 12 while the default
Canada channel is 11.
required: false
schema:
type: string
example: '12'
requestBody:
content:
application/json:
schema:
$ref: '#/components/schemas/CreateOrderDraftRequest'
required: true
responses:
'200':
description: OK
content:
application/json:
schema:
$ref: '#/components/schemas/OrderDraft'
'201':
description: Created
content:
'*/*':
schema:
$ref: '#/components/schemas/OrderDraft'
'404':
description: Cart not found
content:
application/json:
schema:
$ref: '#/components/schemas/NotFound'
/carts:
post:
tags:
- Cart
summary: Create an Empty Cart
description: >
Use this endpoint to create a new cart.
**Default Configurations**: To create a cart with default
configurations, send a request with an empty body.
**Provided Configurations**: To create a cart with provided
configurations, include the configurations in the request body. To learn
more about configuration behaviors, visit the [Configuration
Behaviors](/v3/cart-and-checkout/api-reference/carts-v3/configuration-behaviors)
page.
operationId: createCart
parameters:
- name: x-fabric-tenant-id
in: header
description: >
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 acce
# --- truncated at 32 KB (330 KB total) ---
# Full source: https://raw.githubusercontent.com/api-evangelist/fabric-com/refs/heads/main/openapi/fabric-cart-openapi.yml