Skip to navigation

Apply a voucher

Applies a voucher code to the cart and returns the updated cart with the discount reflected in receiptLines and total. Codes limited to one customer or one use per customer need a logged-in customer or the email field.

Authentication

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

Path parameters

cartIdstringRequiredformat: "^[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}$"

Cart ID (UUID)

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.
codestringRequired0-15 characters
The voucher code to apply, as entered by the customer.
emailstringOptionalformat: "^(?=[\u0000-\uD7FF\uE000-\uFFFF]*$)[^@\s]+@[^@\s]+\.[^@\s]+$"0-100 characters

Guest checkout email. Some voucher codes are limited to one customer or one use per customer; without a logged-in customer, that check needs this email. Used only to validate the code — never stored.

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

Voucher applied; updated cart returned.

dataobject
Shopping cart containing held inventory cart items.

Errors

400
Bad Request Error
401
Unauthorized Error
403
Forbidden Error
404
Not Found Error
409
Conflict Error
410
Gone Error
429
Too Many Requests Error