Skip to navigation

Create a cart

Creates a new cart and adds inventory items to it in a single request. Holds the inventory for the customer. Send the signed-in customer’s access token, as Authorization: Bearer <token>, to hold the cart for them and price it for them; a cart created with no token is priced for a guest.

  • AssignedSeat variants always require quantity: 1 (each seat is unique)
  • GeneralAdmission and Extra variants support quantity > 1
  • All items must be from the same event + occurrence.
  • A cart cannot mix general admission and assigned seats. Use a separate cart for each.

Send a currency in the body to create the cart in that currency: the cart keeps pricing in it on later reads and the order settles in it. Omit it for base-currency prices.

Send a voucherCode in the body to hold inventory that is hidden behind that code and to apply the code to the new cart in the same request. A well-formed code that does not match a voucher, or that cannot be applied to these items, is ignored rather than reported — the cart is created as if the field were omitted.

Send previousCartId when the customer re-selects seats: once the new cart is created, the previous cart is released so the customer holds one set of inventory instead of stacking a fresh hold on every selection. The release is best-effort and never fails the create — a cart that cannot be released is left alone.

Authentication

X-TT-API-Keystring
API Key authentication via header

Headers

X-TT-PlatformenumRequired
Identifies the platform the request comes from.
Allowed values:
X-TT-RetailerstringRequired
Your retailer identifier, provided during onboarding. It must be a retailer your API key was issued for.

Request

This endpoint expects an object.
itemslist of objectsRequired
One or more items to reserve. All items must share the same occurrence.
currencystring or nullOptionalformat: "^[A-Z]{3}$"

ISO 4217 currency to create the cart in: the cart keeps pricing in it on later reads and the order settles in it. Omit for the event base currency.

voucherCodestring or nullOptionalformat: ".*\S.*"0-15 characters

A promo or access code, as entered by the customer. Some inventory is hidden behind a code; sending the code here is what lets this cart hold those items — applying it after the cart exists is too late to unlock them. The code is also applied to the new cart, as POST /carts/{cartId}/vouchers would, so the response already shows the discount. Must be 1–15 characters when sent. A well-formed code that does not match a voucher, or that cannot be applied to these items, is ignored: the cart is created as if this field were omitted and no error is returned. To find out why a code does not work, apply it with POST /carts/{cartId}/vouchers.

previousCartIdstring or nullOptionalformat: "^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$"

The id of the customer’s previous cart, from an earlier POST /carts — send it when the customer re-selects seats: once the new cart is created, the previous cart is released and its inventory freed. The release is best-effort and never fails the create: a cart that is unknown, already released, expired, or already turned into an order is simply left alone and the new cart is still created. When the request carries a customer access token, the other carts created with that same token are released too, on the same best-effort terms, and a cart whose order is being placed is left alone; carts the customer made with another token are not touched. Without a customer token, omit it to leave any earlier cart in place until it times out.

Response headers

X-RateLimit-Limitinteger
How many requests this API key may make for this retailer in the current window. Sent only when the request was counted against that limit. A response served from cache was not counted and repeats the value it was cached with.
X-RateLimit-Remaininginteger
How many requests this API key has left for this retailer in the current window. Sent only when the request was counted against that limit. A response served from cache was not counted and repeats the value it was cached with.

Response

Cart created successfully.
dataobject
Shopping cart containing held inventory cart items.

Errors

400
Bad Request Error
401
Unauthorized Error
403
Forbidden Error
409
Conflict Error
429
Too Many Requests Error
500
Internal Server Error
503
Service Unavailable Error