Add Items To Existing Cart
POST
/carts/:id/items
https://api.storefront.wdb.skooldio.dev/carts/:id/items
Require Authentication: No
Add items to existing cart. Return the updated cart and sort items by updatedAt
Request Parameters
Path
id
type: string required
The ID of the cart.
Body
items
type: array required
Array of items to add to the cart
skuCode
type: string required
SKU code of the variant of the product.
quantity
type: number required
Quantity of the product
Example Request
curl --request POST \ --header 'Content-Type:application/json' \ --data '{"items":[{"skuCode":"sku-3","quantity":2}]}' \ --url https://api.storefront.wdb.skooldio.dev/carts/1/items
Responses
Results
{ "id": "cart-1", "items": [ { "id": "p9t3fjjScY", "skuCode": "sku-3", "quantity": 2, "productPermalink": "1" }, { "id": "aehIBBlqv4", "skuCode": "sku-1", "quantity": 2, "productPermalink": "1" }, { "id": "Nljuq9tjFi", "skuCode": "sku-2", "quantity": 1, "productPermalink": "2" } ]}
Results
{ "statusCode": 400, "message": "no items in cart"}