Add Seats
How to add a numbered seat tutorial
This guide shows how to add numbered seats for a numbered event manually to the shopping cart.
Let's get started with the examplesStep-by-step examples
This guide shows how to obtaining and apply an rate 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.
Create a new shopping cart
Now we create a new shopping cart. This shopping cart will be the "basket" or "holder" that will contain all the data required during the buying process.
curl --location --request POST 'https://api.oneboxtds.net/onebox-rest2/rest/shoppingCart/create' \
--header 'Accept: application/json' \
--header 'Authorization: Bearer {{access_token}}' \
--data-raw ''
This call will return an empty shopping cart. The token attribute is the shopping cart unique identifier that you will use in the rest of the calls. Important: a shopping cart will expire after 10 minutes of inactivity. Once the shopping cart has expired, it will release all it's products and be permanently deleted. Tip: some http client will not let you make a post call without body, that's why we send an empty body on this request.
Get seats root map view
With call we get the id of the Seat Map View that we will need later:
- session-id The id of the session from which we want to add the seat.
curl --location --request GET 'http://gateway-pre.oneboxtickets.net/onebox-rest2/rest/session/{{session-id}}/seatMap/rootView' \
--header 'Accept: application/json' \
--header 'Content-Type: application/x-www-form-urlencoded' \
--header 'Authorization: Bearer {{access_token}}'
Note: When making a call to the seat-map endpoint, information is obtained from a physical level, with all the seats of the view, regardless of the availability of session seats assigned to your channel by the Event Manager.
Seat Status
This call returns a list of seat status and each one contains a seatId and the status of the seat.
- session-id The id of the session from which we want to add the seat.
- seat-map-view The id of the session from which we want to add the seat.
curl --location --request GET 'http://gateway-pre.oneboxtickets.net/onebox-rest2/rest/session/{{session-id}}/seatStatus/{{seat-map-view}}' \
--header 'Accept: application/json' \
--header 'Content-Type: application/json' \
--header 'Authorization: Bearer {{access_token}}'
Example of the response:
"seatsStatus": {
"seatStatus": [
{
"@id": "134154306",
"@sessionId": "245938",
"@status": "1",
"@priceZoneId": "32716"
}
Note: In this way we obtain the id ("@id": "134154306" in the example response) of the seat that we are going to use later in the step of Add Seats, note that the "@status" attribute have to be "@status": "1" (seat unlocked and available) else you will get an error in the next step because the seat will be blocked or occupied.
In addition, note that unlike the seat-map endpoint (detailed above), the seat-status endpoint only returns information of the seats on which your relation of events/channel have visibility by business rules. It is for this reason that there are some seats that may not appear on this response but yes when we call to seat-map, you must have in account the seats of this response since this endpoint is the one that will give you the real availability of seats for your channel.
Add seats
Finally, we make this call to add the desired seats to the Shopping Cart.
- cart-token: The shopping cart identifier.
- session-id The id of the session from which we want to add the seat.
- seat-id The id of the seat we want to add and was obtained on the previous step.
curl --location --request POST 'https://api.oneboxtds.net/onebox-rest2/rest/shoppingCart/addSeats' \
--header 'Accept: application/json' \
--header 'Content-Type: application/x-www-form-urlencoded' \
--header 'Authorization: Bearer {{access_token}}' \
--data-urlencode 'seatsList=<?xml version="1.0" encoding="UTF-8"?><seatsList xmlns="http://www.oneboxtm.es/ns/input-data/shopping/cart"><seat xmlns="http://www.oneboxtm.es/ns/input-data/shopping/cart" id="{{seat-id}}" sessionId="{{session-id}}" /></seatsList>' \
--data-urlencode 'token={{cart-token}}'
Note: In this way we add the nominal seat to the Shopping Cart, if you need to add more than 1 in the same call only need to send more "seat" structures into the "seatsList" list structure of the seatsList XML parameter.