Skip to main content

Booking flow alignment

API Booking flow integration alignment

This guide shows how to perform a complete booking flow. Before you start reading this guide you should be able to create a normal order as described in our Purchase Flow Guide. The main difference between creating an order and creating a booking is a simple parameter.

Let's get started with the examples

Step-by-step examples

This guide shows how to implement a complete booking flow step by step.

Prerequisites!

You will need a valid OAuth access_token to be able to make each call! Please refer to our Authentication Guide to obtain one.

Creating a booking

Once your customer has selected all the desired products and fulfilled their data, the shopping cart should be turned into an order to be able to create the booking. Is needed to indicate that this is a booking order sending the orderType parameter as BOOKING

A booking is longer lived than a shopping cart and allows your customer to fulfill the payment without the risk of loosing their selected items. But eventually an booking will expire after 45 minutes (depending on the type of products in your order this might vary) if not properly confirmed.

curl --location --request POST 'http://gateway-pre.oneboxtickets.net/onebox-rest2/rest/order/createOrder' \
--header 'Accept: application/json' \
--header 'Content-Type: application/x-www-form-urlencoded' \
--header 'Authorization: Bearer {{access_token}}' \
--data-urlencode 'orderType=BOOKING' \
--data-urlencode 'token={{cart-token}}'

This call returns an order with an booking code in it's locator field. This booking code is the one needed to commit the booking and will not change afterwards. If the booking expires, all of it's products will be released and it will be permanently deleted.

Booking Confirmation

Now is needed to confirm the created booking order with this simple step.

  • order-code: the identifier of the booking you wish to confirm
curl --location --request POST 'http://gateway-pre.oneboxtickets.net/onebox-rest2/rest/order/commitOrder' \
--header 'Accept: application/json' \
--header 'Content-Type: application/x-www-form-urlencoded' \
--header 'Authorization: Bearer {{access_token}}' \
--data-urlencode 'orderCode={{order-code}}'

Note: The booking is now confirmed. This booking is permanent and will not expire after 45 minutes. However, there are certain limits that the event organizer might impose on booked items. For instance, she might state that a booked ticket will expire after two weeks from it's creation if it's not converted to an order. This kind of restriction will vary from event to event.