Skip to content

Get how many units of a listing a cart holds

GET
/carts/{url_key}/listings/{listing_id}/quantity
curl --request GET \
--url https://acme.mykreezalid.com/front_api/v1/carts/k3v9q2m8x1c7z5b4n6t0p2r8s1d3f7/listings/4242/quantity

Returns the total quantity of a listing across all the cart’s items (every option and variant combined). Works without a token for a guest cart; a member’s cart only accepts that member’s token. When you send a token and the cart is a guest cart, the cart (and the guest’s other carts and orders) is attached to the signed-in member first.

url_key
required
string

The cart’s url_key, returned when the cart is created.

Example

k3v9q2m8x1c7z5b4n6t0p2r8s1d3f7
listing_id
required
integer

Id of the listing.

Example

4242

The quantity. success is false, with quantity 0, when the listing is not in the cart.

Media typeapplication/json
object
success
boolean
listing_id

The listing_id of the path, as a string.

string
quantity
One of:
string

Example

{
"success": true,
"listing_id": "4242",
"quantity": "3"
}

The cart belongs to a member and the request is not made by that member.

Media typeapplication/json

Error body returned by several cart endpoints.

object
success

Error body of the cart endpoints that report success and error.

boolean
error

Human-readable reason.

string

Example

{
"success": false,
"error": "Cart not found"
}

No open cart has this key: it does not exist or is closed.

Media typeapplication/json

Error body returned by several cart endpoints.

object
success

Error body of the cart endpoints that report success and error.

boolean
error

Human-readable reason.

string

Example

{
"success": false,
"error": "Cart not found"
}