If an intermediate step to proceed with a payment process is needed, then you have the choice of performing a two-step confirmation.
Instead of the confirm call. The reason is that you will be holding the allotment or tickets until the confirmation has gone through correctly and the reconfirming. In the event of using only that the confirm call, you will be already confirming the booking regardless of the payment being successful or not. The following diagram summarizes this:
The difference between the previous example and this one is the use of two calls rather than the confirmation call. In this example:
Preconfirm: The booking is pre-confirmed and the allotment is locked.
Payment Platform: Although this step is NOT PROVIDED BY APITUDE for Activities
Reconfirm:
PUT https://api.test.hotelbeds.com/activity-api/3.0/bookings/preconfirm
The preconfirm request is the same as the confirm api call request. See here for details.
The pre-confirm api call will deliver a booking reference and the same information as the booking response but status "PRECONFIRMED".
The following is a preconfirm request example:
{
"clientReference": "Exp 132223/2016",
"holder": {
"surname": "Smith",
"name": "John",
"title": "Mr",
"email": "j.smith@hotelbeds.com",
"address": "Cami Son Fangos 100",
"zipCode": "07007",
"telephones": ["555123123", "555456456", "555789789"],
"mailing": false,
"country": "ES"
},
"language": "en",
"activities": [{
"rateKey": "3ajeb1pcqslb8r850t2atsqk4d",
"from": "2016-03-29",
"to": "2016-03-29"
}]
}
And the following is a fragment of a preconfirm response where the generated booking number can be seen:
{
"operationId": "ACTRTR-BOOKINGPreconfirm-74hn4h1n7ptjpafl3ap16dasge",
"auditData": {},
"booking": {
"creationDate": "2016-03-22T17:06:32.000Z",
"paymentData": {... },
"reference": "102-6112608",
"status": "PRECONFIRMED"
...
}
}
As it can be seen, a booking in “PRECONFIRMED” status has been generated and a booking reference too.
PUT https://api.test.hotelbeds.com/activity-api/3.0/bookings/reconfirm
NAME |
Type |
DESCRIPTION |
language |
String |
Language code to be used in the response. |
reference |
String |
Booking reference generated in the preconfirm api call. |
A call to reconfirm with the returned booking number will generate the valid booking. The following is an example request to reconfirm the previous booking:
{
"language": "en",
"reference": "102-6112608"
}
And the, the booking is marked as confirmed. See the following reconfirmation fragment for the example above:
{
"operationId": "ACTRTR-BOOKINGReconfirm-rair2pu6d8ehli9q73s29aq847",
"auditData": {},
"booking": {
"creationDate": "2016-03-22T17:07:19.776",
"paymentData": {... },
"reference": "102-6112608",
"status": "CONFIRMED"
...
}
}