Add Product to Cart
Adding a Product to Cart is the most common Cart action. If you wish to add any custom products or promotions, you'll need to do that separately.
Any requests to add a product to cart will return a collection of cart items.
Tax items may optionally be added with the product, although client credentials must be used to do this. If included, they replace any existing taxes on the product.
The product being added to the cart requires a price in the same currency as the cart. The API will return a
400
error if a price is not defined in the correct currency.
Please note that there is a hard limit of up to 100 unique items in a cart at any one time.
There are a number of actions that happen to your inventory when checking out and paying for an order. For more information please be sure to evaluate our detailed article explaining the processes.
Add Product to Cart
POST
https://api.moltin.com/v2/carts/:reference/items
Path Parameters
Name | Type | Description |
---|---|---|
reference | string | A custom reference for this cart created by you |
Headers
Name | Type | Description |
---|---|---|
X-MOLTIN-CURRENCY | string | Specifies the currency to be used for the products in the cart. Your site's default will be used if not specified |
Authorization | string | The Bearer token to grant access to the API |
Request Body
Name | Type | Description |
---|---|---|
tax | array | An list of tax items to apply to the cart item |
quantity | integer | The amount of products to add to cart |
type | string |
|
id | string | The ID of the product you wish to add to cart |
Last updated