Jetron TicketFluid

Promo codes

Apply event-scoped promo codes when pricing a reservation.

Promo codes are applied when you create a reservation. The reservation endpoint validates the code, prices the cart, and returns the discount that was actually applied. Do not calculate the discount in your frontend.

Promo codes are event-scoped

A promo code must belong to the event in the request URL. A code configured for one event cannot be used for another event, even under the same host, and global promo codes are not supported.

Create a promo code

Event hosts create and manage promo codes from the Jetron Ticket admin dashboard. Open the event, then go to Manage Event → Promo Codes and select Create. Once created, the promo-code table shows the code's type and value, total and maximum uses, expiry, and creation date. You can also edit or delete a code from this page.

The Promo Codes page in the Jetron Ticket admin dashboard, showing an event promo code and the Create button

Codes created here belong to the current event. Give the code to attendees or collect it in your checkout UI, then send it when pricing their reservation.

Apply a code

Send the attendee's code as promoCode in POST /events/{slug}/reservations:

const { data: reservation } = await client.createReservation(
  'my-event',
  {
    items: [{ sku: 'ticket-type-uuid', quantity: 2 }],
    promoCode: 'EARLYBIRD',
  },
  { deviceId },
)

There is no separate promo-code validation call. A successful reservation is the confirmation that the code was accepted and applied to this cart.

Use the priced response

Read the applied values from the reservation:

FieldPurpose
promoCodeThe code applied to the reservation, when present.
discountThe applied discount in the event currency's smallest unit.
totalThe authoritative amount for the priced cart.
quoteReferenceThe quote to send when creating the order.
showOrderSummary({
  promoCode: reservation.promoCode,
  discount: reservation.discount,
  total: reservation.total,
})

See Money for currency units. Always render the values returned by the API rather than subtracting the discount yourself.

Change or remove a code

When the attendee changes the code or removes it, create the reservation again with the same X-Device-ID. That refreshes the existing hold and returns a new priced quote. Use the new quoteReference when creating the order; do not keep an earlier quote after the cart or promo code changes.

Omit promoCode when the cart has no code:

const { data: reservation } = await client.createReservation(
  'my-event',
  {
    items,
    promoCode: enteredCode.trim() || undefined,
  },
  { deviceId },
)

If a code cannot be applied, handle the reservation's 400 response like any other validation error and leave the current cart unchanged. See Error handling.

Checkout with the quote

You do not send the promo code again when creating the order. Send the quoteReference from the accepted reservation; the server-held quote carries the applied pricing into checkout. The order response can also include promoCode and discount for the resulting order summary.

The checkout embed already includes a promo-code field and handles validation and repricing for you.

On this page