Get Available Promotions And Discounts
Get available promotions and discount tutorial
This guide shows how to obtain the promotion and discounts availables to one cart.
Available promotion types
Now we have two types of promotions:
Event promotion: These promotions are managed by the event organizer. This promotions applies to every single ticket. There are three types of event promotion, automatic, discount and promotion.
Cart promotion: These promotions are defined by the sales channels and their application affects the entire shopping cart. There are two types of cart promotion, automatic and group.
Let's get started with the examples
Step-by-step examples
This guide shows how to obtain available promotions and discounts step by step.
You will need a valid OAuth access_token to be able to make each call! Please refer to our Authentication Guide to obtain one.
Get Available Promotions and Discounts
This call returns the list of available promotions and discounts for the products in the shopping cart:
- token Shopping cart identifier.
curl --location --request GET 'https://api.oneboxtds.net/onebox-rest2/rest/shoppingCart/availablePromotionsAndDiscounts' \
--header 'Accept: application/json' \
--header 'Authorization: Bearer {{access_token}}' \
--header 'Content-Type: application/json'
--data-urlencode 'token={{cart-token}}'
Note: This endpoint returns a list of items containing available discounts and promotions that are applicable to the ticket.
As can be seen in the following example, this response sample has two main nodes:
shopping-cart-item-sales: This object is including all the events promotions that are applicable a certain seat. The first child node occurrence on this list is "@id" which corresponds to the identifier of the seat. Following that, can be seen a list of promotions, and discounts that can be applied to the seat refered by Id.
shopping-cart-sales: This object is including all the group / automatic promotions that satisfy the restrictions. So they can be applied to the cart.
EXAMPLE RESPONSE:
{
"@token": "813ef0815441ea62c8609450b61b6384",
"@currency": "EUR",
"@timeLeft": "520",
"shopping-cart-item-sales": [
{
"@id": "141097127",
"promotions": {
"promotion": {
"@id": "23470",
"promotionComElements": {
"name": "2.5€ promo",
"description": "Basic promotion"
},
"type": "FIXED",
"value": "2.0",
"mandatory": "false",
"self-managed": "false",
"limitedUses": "false"
}
},
"discounts": {
"discount": {
"@id": "23445",
"promotionComElements": {
"name": "33% discount",
"description": "Plus promotion"
},
"type": "PERCENTAGE",
"value": "33.0",
"mandatory": "false",
"self-managed": "false",
"limitedUses": "false"
}
}
},
{
"@id": "141097126",
"promotions": {
"promotion": {
"@id": "23470",
"promotionComElements": {
"name": "2.5€ promo",
"description": "Basic promotion"
},
"type": "FIXED",
"value": "2.0",
"mandatory": "false",
"self-managed": "false",
"limitedUses": "false"
}
},
"discounts": {
"discount": {
"@id": "23445",
"promotionComElements": {
"name": "33% discount",
"description": "Plus promotion"
},
"type": "PERCENTAGE",
"value": "33.0",
"mandatory": "false",
"self-managed": "false",
"limitedUses": "false"
}
}
}
],
"shopping-cart-sales": {
"availableCartPromotions": {
"groupCartPromotion": [
{
"@id": "116",
"name": "10% promotional code",
"type": "PERCENTAGE",
"value": "10.0",
"group": {
"@id": "1236",
"name": "BSM user cart",
"validationType": "INTERNAL",
"validationMethod": "USER"
},
"promotionComElements": {
"name": "10% sale",
"description": "10% sale description"
}
}
]
}
}
}