booking/session

While creating a booking, the details of the proposed booking are stored in an API session. This allows you to add multiple items to a booking, remove items and inform the server of your intent to book the item(s) in order to prevent over-bookings.

Each session call will return the session_id of the active session, and any attached session information. Your application must use the session_id in order to further modify the session or submit the booking beyond this point, and can pass it back to the API either as a cookie or a request parameter.

To start a new session, you simply pass in the booking SLIPs returned when from earlier “rated” inventory item queries.

POST /api/3.0/booking/session

Create or return information about and stored in the current server session. Once initiated, you can fetch the details of a proposed booking by accessing the session again with the session_id found in the response. The item details for the session will be returned with your request.

Form Parameters:
 
  • string session_id – The session ID to be loaded or written to. Can also be sent as a cookie.
  • string/array slip – A SLIP, or multiple SLIPs to be added to a session. If need to add or remove more of the same item to a session, use alter below.
  • array alter – Alterations to be made on the current session, based on the line_id of items in the session and actions to be taken. To change the qty of an item in the session, send an alter for the line_id of that item with the integer value you need to set (e.g alter[3]=5 sets item 3 to a qty of 5). To remove an item, use alter ‘remove’; and to opt-in or out of listed package items use ‘optin’ or ‘optout’ respectively.
GET /api/3.0/booking/session
Query Parameters:
 
  • session_id (string) – The session ID to read information from. Can also be sent as a cookie.
  1
  2
  3
  4
  5
  6
  7
  8
  9
 10
 11
 12
 13
 14
 15
 16
 17
 18
 19
 20
 21
 22
 23
 24
 25
 26
 27
 28
 29
 30
 31
 32
 33
 34
 35
 36
 37
 38
 39
 40
 41
 42
 43
 44
 45
 46
 47
 48
 49
 50
 51
 52
 53
 54
 55
 56
 57
 58
 59
 60
 61
 62
 63
 64
 65
 66
 67
 68
 69
 70
 71
 72
 73
 74
 75
 76
 77
 78
 79
 80
 81
 82
 83
 84
 85
 86
 87
 88
 89
 90
 91
 92
 93
 94
 95
 96
 97
 98
 99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
{
    "version": "3.0",
    "account_id": 1,
    "host_id": "your-company.checkfront.com",
    "name": "Your Company",
    "locale": {
        "id": "en_US",
        "lang": "en",
        "currency": "CAD"
    },
    "request": {
        "status": "OK",
        "resource": "booking",
        "id": "session",
        "records": 4,
        "limit": 0,
        "page": 1,
        "pages": 1,
        "time": 0.0132,
        "method": "get"
    },
    "booking": {
        "session": {
            "id": "60rq7eme0tmhlmpkeg2fb2p287",
            "age": 0,
            "summary": "Bungee Jumping from the Top of the O2 Arena",
            "start_date": 1507186800,
            "end_date": 1507186800,
            "date_desc": "Thu Oct 5, 2017",
            "time_desc": "",
            "account_id": 1,
            "partner_id": 0,
            "currency_id": "CAD",
            "sub_total": "130.00",
            "tax_total": "0.00",
            "tax_inc_total": "0.00",
            "discount": "0.00",
            "total": "130.00",
            "due": "130.00",
            "paid_total": "0.00",
            "flat_discount": {
                "total": 0,
                "total_pretax": 0
            },
            "deposit": null,
            "tax": [],
            "qty": 1,
            "item": {
                "1": {
                    "sku": "bungeejumpingfromthetopoftheo2arena",
                    "item_id": 18,
                    "name": "Bungee Jumping from the Top of the O2 Arena",
                    "unit": "D",
                    "rate": {
                        "total": "130.00",
                        "item_total": "130.00",
                        "qty": 1,
                        "summary": "<strong title="Adults">Adults:</strong> 1 Day @ $130.00"
                    },
                    "date": {
                        "summary": "Thu Oct 5, 2017",
                        "start_date": 1507186800,
                        "end_date": 1507186800
                    },
                    "slip": "18.20171005X1-adults.1-children.0",
                    "available": 9
                },
                "1.1": {
                    "sku": "memorabiliaphoto",
                    "item_id": 21,
                    "name": "Memorabilia - Photo Package",
                    "unit": "D",
                    "rate": {
                        "total": "18.00",
                        "item_total": "0.00",
                        "qty": 1,
                        "summary": "$18.00"
                    },
                    "date": {
                        "summary": "Thu Oct 5, 2017",
                        "start_date": 1507186800,
                        "end_date": 1507186800
                    },
                    "slip": "21.20171005X1-1",
                    "available": 1000000000,
                    "optin": "O",
                    "opt": "out"
                },
                "1.2": {
                    "sku": "thelondonexperiencet-hat",
                    "item_id": 20,
                    "name": "The London Experience Hat",
                    "unit": "D",
                    "rate": {
                        "total": "15.00",
                        "item_total": "0.00",
                        "qty": 1,
                        "summary": "$15.00"
                    },
                    "date": {
                        "summary": "Thu Oct 5, 2017",
                        "start_date": 1507186800,
                        "end_date": 1507186800
                    },
                    "slip": "20.20171005X1-1",
                    "available": 1000000000,
                    "optin": "O",
                    "opt": "out"
                },
                "1.3": {
                    "sku": "thelondonexperiencet-shirt",
                    "item_id": 19,
                    "name": "The London Experience Mini-Bus",
                    "unit": "D",
                    "rate": {
                        "total": "25.00",
                        "item_total": "0.00",
                        "qty": 1,
                        "summary": "$25.00"
                    },
                    "date": {
                        "summary": "Thu Oct 5, 2017",
                        "start_date": 1507186800,
                        "end_date": 1507186800
                    },
                    "slip": "19.20171005X1-1",
                    "available": 1000000000,
                    "optin": "O",
                    "opt": "out"
                }
            }
        }
    }
}
POST /api/3.0/booking/session/clear
POST /api/3.0/booking/session/end
Query Parameters:
 
  • session_id (string) – The session ID to empty or close. Can also be sent as a cookie.