Skip to main content
POST
/
api
/
v1
/
customer
/
promotions
/
preview
Preview Promotion
curl --request POST \
  --url https://api.example.com/api/v1/customer/promotions/preview \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '
{
  "tickets": [
    {
      "tripId": "0195e7a1-8b5c-7d3e-9f4a-2c6b8d0e1f3a",
      "tripItineraryId": "0195e7a1-8b5c-7d3e-9f4a-2c6b8d0e1f3a",
      "seatTypeId": "0195e7a1-8b5c-7d3e-9f4a-2c6b8d0e1f3a",
      "passengerId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
      "price": 12000
    }
  ],
  "promotionalId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
  "promotionalCode": "PROMO-ROTA-10"
}
'
{
  "promotionalId": "0195e7a1-8b5c-7d3e-9f4a-2c6b8d0e1f3a",
  "code": "PROMO-ROTA-10",
  "eligible": true,
  "rejectionReason": "<string>",
  "originalAmount": 12000,
  "discountAmount": 1200,
  "finalAmount": 10800
}

Authorizations

Authorization
string
header
required

Bearer authentication header of the form Bearer <token>, where <token> is your auth token.

Body

application/json

Promotion preview payload. Provide promotionalId or promotionalCode.

tickets
object[]
required

Tickets to evaluate

promotionalId
string<uuid> | null

Promotion identifier

promotionalCode
string | null

Promotion code

Example:

"PROMO-ROTA-10"

Response

OK

Promotion preview result.

promotionalId
string<uuid>
required

Promotion identifier

Example:

"0195e7a1-8b5c-7d3e-9f4a-2c6b8d0e1f3a"

code
string
required

Promotion code

Example:

"PROMO-ROTA-10"

eligible
boolean
required

Whether the promotion can be applied

rejectionReason
string | null
required

Reason when the promotion is not eligible

originalAmount
integer
required

Original amount in cents

Example:

12000

discountAmount
integer
required

Discount amount in cents

Example:

1200

finalAmount
integer
required

Final amount in cents

Example:

10800