Creating a new cart

POST {{api_url}}/cart/{{tenant}}/carts

Creates a new cart. When a cart is created, its status is set to open.

Note: There can be only one open cart per customer. If another cart needs to be created for a specific customer, you need to update the existing cart's status to closed.


Required scopes

  • cart.cart_manage

    Note: Only required if the following conditions are met:

    • You want to create a cart for a logged in customer.
    • The access_token used to authorize the request and the customerId in the request body belong to different customers.

Request Body

{"siteCode"=>"main", "currency"=>"EUR"}

HEADERS

KeyDatatypeRequiredDescription
session-idnumberAnonymous customer's unique session identifier.

Note: The session-id is only required if you want to create a cart for an anonymous customer. | | saas-token | string | | Customer’s saasToken generated when the customer token is generated.

Note: The saas-token is only required if you want to create a cart for a logged in customer. | | Content-Type | string | | | | Authorization | string | | |

RESPONSES

status: Created

{"cartId":"{cartId}","yrn":"{cartYrn}"}