Exchange an existing ticket for a coupon

Cancels the given ticket and issues a coupon the shopper can redeem toward another purchase. Supply the ticket identifier and, optionally, a coupon type; the response returns the new coupon identifier and its redeemable code.

Authentication

AuthorizationBearer
Short-lived access token for endpoints that return personal data. Obtain one from POST /oauth/token (RFC 7523 JWT-bearer), signing the assertion with the private key of the key pair registered for your store. Sent as `Authorization: Bearer <token>`. This is separate from the `x-entria` store header, which is still required.

Headers

x-entriastringRequired
Identifies which store this request is for. Required on every store-scoped route. It is not authentication and not a secret — it grants no privileges and is safe to send from a browser. You receive the value once your Entria backend has been created and configured. Missing header returns 400; an unknown store returns 404.

Query parameters

ticketIdstringRequired
The identifier of the existing ticket to exchange.
couponTypestringOptional

Optional coupon type to issue; omit to use the default coupon type.

Response

The ticket was exchanged and a coupon was issued
couponIdstring
The identifier of the coupon created for the shopper.
couponNumberstring
The coupon code the shopper can redeem toward another purchase.

Errors

400
Bad Request Error
401
Unauthorized Error
403
Forbidden Error
503
Service Unavailable Error