Apply a voucher

Applies a promo code to the cart and returns the updated cart with the discount reflected in receiptLines and total.

Authentication

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

Path parameters

cartIdstringRequiredformat: "(?i)^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$"

Headers

X-TT-PlatformenumRequired
Identifies the platform the request comes from.
Allowed values:

Request

This endpoint expects an object.
codestringRequired0-15 characters
The promo code to apply, as entered by the customer.

Response

Voucher applied; updated cart returned.

idstring
Cart ID
expires_atstring
UTC timestamp when the cart hold expires and inventory is released. Clients should display a countdown timer and warn users before expiration.
itemslist of objects

Items currently in the cart (held inventory). Does NOT include fees, protection, or credits — see receiptLines for those.

receipt_lineslist of objects

Server-ordered display lines for receipt rendering. Iterate in sequence. Always includes SubtotalLine. Conditionally: VoucherLine, ProtectionLine.

totalobject

Monetary amount in minor units (cents for USD). Never uses floating point to avoid precision errors.

protectionobject
Protection covering all items. Null if not added.
optionsobject
Options that can be applied to this cart. Each key is present only when that option is available.
voucherobject
A promo code applied to a cart.
total_taxesobject

Monetary amount in minor units (cents for USD). Never uses floating point to avoid precision errors.