Add Items To Cart
POST
/carts
https://api.storefront.wdb.skooldio.dev/carts
Require Authentication: No
Create a new cart and add items to it. Return the created cart and sort items by updatedAt
Request Parameters
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-1","quantity":2}]}' \ --url https://api.storefront.wdb.skooldio.dev/carts
Responses
Results
{ "id": "cart-1", "items": [ { "id": "aehIBBlqv4", "skuCode": "sku-1", "quantity": 2, "productPermalink": "shirt" } ]}
Results
{ "statusCode": 404, "message": "no product exists with skuCode: XXX"}
Results
{ "statusCode": 400, "message": "no items in cart"}