Skip to content

Create a cart

POST
/carts
curl --request POST \
--url https://acme.mykreezalid.com/front_api/v1/carts

Creates an empty, open cart in the marketplace’s currency and returns its url_key, which addresses the cart in every other cart endpoint. With a token, the cart belongs to the signed-in member. Without one, it is a guest cart: anyone holding its url_key can use it, so keep the key private to the visitor. Send no request body: any field is refused.

The cart was created.

Media typeapplication/json
object
status
string
message
string
cart
object
id
integer
object
string
customer_id

The signed-in member, or null for a guest cart.

integer
nullable
tmp_customer_id

Guest visitor identifier, set when no token was sent.

integer
nullable
url_key
string

Example

{
"status": "success",
"message": "Cart created successfully",
"cart": {
"id": 4242,
"object": "Cart",
"customer_id": 4242,
"tmp_customer_id": null,
"url_key": "k3v9q2m8x1c7z5b4n6t0p2r8s1d3f7"
}
}

A request body was sent (status and message), or the cart could not be saved (errors).

Media typeapplication/json
object
status
string
message
string
errors

Why the cart could not be saved.

object

Example

{
"status": "failed",
"message": "Only empty body is allowed for this request"
}