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
cartId
Headers
X-TT-Platform
Identifies the platform the request comes from.
Allowed values:
Request
This endpoint expects an object.
code
The promo code to apply, as entered by the customer.
Response
Voucher applied; updated cart returned.
id
Cart ID
expires_at
UTC timestamp when the cart hold expires and inventory is released. Clients should display a countdown timer and warn users before expiration.
items
Items currently in the cart (held inventory). Does NOT include fees, protection, or credits — see receiptLines for those.
receipt_lines
Server-ordered display lines for receipt rendering. Iterate in sequence. Always includes SubtotalLine. Conditionally: VoucherLine, ProtectionLine.
total
Monetary amount in minor units (cents for USD). Never uses floating point to avoid precision errors.
protection
Protection covering all items. Null if not added.
options
Options that can be applied to this cart. Each key is present only when that option is available.
voucher
A promo code applied to a cart.
total_taxes
Monetary amount in minor units (cents for USD). Never uses floating point to avoid precision errors.