Booking Modify Request

Modification of bookings can be done in particular for:

  • Add an additional activity
  • Modify an existing activity in a booking, including:
  1. Modify customer and paxes data /  Add paxes /  Modify already answered specific questions needed to confirm a activity
  2. Remove an activity from a booking

Each operation has its own specification.  The response for the modification is returned in the same format as the booking detail.

The following codes are used to modify a booking:

  • The activity code. It can be retrieved by calling a detail. The activity code can be found in the search api call response, in the detail api call response  and in the booking detail api call response. The example below shows the activity code under the path activities/@code for a booking detail response.
  • The activity id understood as a product that is part of a booking. More than one activity with the same code can appear in a booking with different id as independent activities. i.e. the same activity can be booked more than one time for different dates. The activity id is under activities/@id.

See the following fragment of a booking detail API call response with the activity id for the booking and the activity code highlighted:

{
  "operationId": "ACTRTR-BOOKINGGet-g1rf7v8os2ic92d7evlbndvoed",
  "auditData": { ... },
  "booking": {
    "agency": { ... }
    },
    "creationDate": "2016-02-29T10:13:22.000Z",
    "creationUser": "16776",
    "paymentData": { ... },
    "reference": "102-6112235",
    "status": "CONFIRMED",
    "currency": "EUR",
    "pendingAmount": -92.5,
    "clientReference": "Exp 1234/2016",
    "holder": { ... },
    "total": 130,
    "totalNet": 112.7,
    "activities": [
      {
        "id": "102#O#1", // Confirmed activity identifier
        "activityContactInfo": { ... },
        "agencyCommission": { ... },
        "activityAmountDetail": { ... },
        "providerInformation": { ... },
        "status": "CONFIRMED",
        "supplier": { ... },
        "type": "TICKET",
        "modalityCode": "DALIMENU",
        "modalityName": "Menú Dalí y espectáculo",
        "vouchers": [ ... ],
        "activityReference": "102-6112235",
        "code": "E-E10-PF2SHOW", // Activity code
        "name": "Palacio del Flamenco, 2ª sesión, El Gitano Bajanó",
        "dateFrom": "2016-03-03", // Activity was booked for 3 March 2016
        "dateTo": "2016-03-03", // Activity duration was 1 day, same date from and to
        "amount": 130,
        "cancellationPolicies": [ ... ],
        "paxes": [ ... ],
        "content": { ... }
      }
    ]
  }
}

The confirmation of a modified booking allows two new operation depending on the modification you are trying to do: add an activity to a booking or modify an activity from a booking 

The following steps must be followed to modify a booking:

 

The diagram above shows how the new activity and the existing booking are combined. The following funnel is also possible:

 

The important point when modifying a booking (but for deletion) is that a booking detail with the booking reference and a detail with the activity code have been previously called.

Deletions only need a booking detail to retrieve the confirmed activity ids you want to remove form the booking. 

Modifications use cases

The following modifications are supported by APITUDE for Activities:

  • Add a new activity to the booking (note that that will generate a booking with two activities, please, consider performing a new booking before implementing that or ask support@activitiesbank.com if you really think you need that kind of booking).
  • Call Activity Detail to retrieve the activity information. As during a new booking process, write down the rateKey for the desired price and dates and set the possible questions to be answered.

Add PAXES:

Perform a booking as usual. Once confirmed, perform a new Deatils RQ, in which you will inform the new paxes. Write down the returned rateKey.

Method: POST

Live URL: https://api.hotelbeds.com/activity-api/3.0/activities/details

Test URL: https://api.test.hotelbeds.com/activity-api/3.0/activities/details

Request:

{
  "code": "E-E10-BCNSKY",
  "from": "2016-07-01",
  "to": "2016-07-01",
  "language": "es",
  "paxes": [
    {"age": 30},
    {"age": 20},
    {"age": 5}
   ]
}


Response:

{
  // ...
  "activity": {
    "activityCode": "BCNSKY",
    // ...
    "modalities": [
      {
        // ...
        "rates": [
          {
            // ...
            "rateDetails": [
              {
                "rateKey": "mv8ikpp9r9cueq6btnlip977d",
                "operationDates": [
                  {
                    "from": "2016-07-01",
                    "to": "2016-07-01"
                    // ...
                  }
                ]
                // ...
              }
            ]
          }
        ]
        // ...
      }
    ]
    // ...
}
  • Call Add Booking and provide the new activity fields under the “serviceToAdd” attribute. The new activity will be added at the response with “CONFIRMED” status.

Method: POST

LiveURL: https://api.hotelbeds.com/activity-api/3.0/bookings/add/{{language}}/{{booking_reference}} 

Test URL: https://api.test.hotelbeds.com/activity-api/3.0/bookings/add/{{language}}/{{booking_reference}} 

Request:

 {
  "serviceToAdd":
    {
      "rateKey": "7n1bi4fr2ahmqe52gbr1qa07l9", //the rateKey returned for the new service
      "from": "2016-07-01",
      "to": "2016-07-01",
      "paxes": [
            {"age": 30}, //Please, consider that you will be adding two new guests to the booking with this RQ
            {"age": 20}
       ]
    }
}

Response:

{
  // ...
  "booking": {
    // ...
    "activities": [
      // ...
      {
        "id": "102#O#2",
        // ...
        "status": "CONFIRMED",
        // ...
      }
    ]
  }
}

  • Add or remove paxes to the already booked activities or change their personal information. The following steps describe how it can be done:
  • Call Booking Detail to retrieve the booked activities. Write down the “id” attribute for the activity that will be modified.

GET /activity-api/3.0/bookings/{{language}}/{{booking_reference}}

Response:

{
  // ...
  "booking": {
    // ...
    "activities": [
      // ...
      {
        "id": "102#O#2",
        "status": "CONFIRMED",
        // ...
      }
    ]
  }
}
  • Call Activity Details with the new paxes to make sure the activity is available for them. Write down the desired rateKey as usual.

POST /activity-api/3.0/activities/details

Request:

{
  "code": "E-E10-BCNSKY",
  "from": "2016-07-01",
  "to": "2016-07-01",
  "language": "es",
  "paxes": [
    {"age": 30},
    {"age": 20},
    {"age": 5}
   ]
}

Response:

{
  // ...
  "activity": {
    "activityCode": "BCNSKY",
    // ...
    "modalities": [
      {
        // ...
        "rates": [
          {
            // ...
            "rateDetails": [
              {
                "rateKey": "mv8ikpp9r9cueq6btnlip977d",
                "operationDates": [
                  {
                    "from": "2016-07-01",
                    "to": "2016-07-01"
                    // ...
                  }
                ]
                // ...
              }
            ]
          }
        ]
        // ...
      }
    ]
    // ...
}
  • Call Modify Service and provide, attached to the service “id”, the new rateKey and the updated list of paxes in the “serviceToModify” attribute. The updated activity will include both the price and paxes updated at the response.

Please note that the Holder cannot be changed.

POST /activity-api/3.0/bookings/modify/{{language}}/{{booking_reference}}

Request: 

{
  "serviceToModify":
   {
     "activityId": "102#O#2",
     "rateKey": "1v9pll7u8ruj33mt25vd2bj61h",
     "from": "2016-07-01",
     "to": "2016-07-01",
     "paxes": [
        {
            "age": 30,
            "name": "Name one",
            "surname": "Surname one"
        },
        {
            "age": 20,
            "name": "Name two",
            "surname": "Surname two"
        },
        {
            "age": 5,
            "name": "Name three",
            "surname": "Surname three"
        }
      ]
   }
}

Response:

{
  // ...
  "booking": {
    // ...
    "activities": [
      // ...
      {
        "id": "102#O#2",
        "status": "CONFIRMED",
        // ...
        "paxes": [
          // ...
        ],
        // ...
      }
    ]
  }
}
  • Remove a service from a booking. To perform that change, if the booking has more than one service:
  • Call booking detail to retrieve the booked activities. Write down the activity code that you want to remove.

GET /activity-api/3.0/bookings/{{language}}/{{booking_reference}}

Response:

{
  // ...
  "booking": {
    // ...
    "activities": [
      // ...
      {
        "id": "102#O#2",
        "status": "CONFIRMED",
        // ...
      }
    ]
  }
}
  • Call remove service with the booking reference number and the activity id to be removed under the “serviceToRemove” attribute. The service will still be returned under the “activities” list of Booking Detail operation, but its status will have changed to “CANCELLED”.

If the booking contains a single activity, please, use the cancel api call to cancel the whole booking.

            POST /activity-api/3.0/bookings/remove/{{language}}/{{booking_reference}}

Request:


    "serviceToRemove":
    {
        "activityId": "102#O#2"
    }
}     

Response:

{
  // ...
  "booking": {
    // ...
    "activities": [
      // ...
      {
        "id": "102#O#2",
        "status": "CANCELLED",
        // ...
      }
    ]
  }
}
  • Change the answers to the activity questions. The detail operation can return some questions that need to be answered while confirming the booking. Those answers can be changed by the following steps:
  • Call Booking Detail to retrieve the booked activities. Write down both the “activity code” and the required data to perform a new availability on it.

GET /activity-api/3.0/bookings/{{language}}/{{booking_reference}}

Response:

{
  // ...
  "booking": {
    // ...
    "activities": [
      {
        "id": "102#O#1",
        // ...
        "status": "CONFIRMED",
        // ...
        "answers": [
          // ...
        ]
        // ...
      }
    ]
  }
}
  • Call Activity Details to retrieve the activity information, including the set of questions that need to be answered.

POST /activity-api/3.0/activities/details

Request:

{
  "code": "E-E10-BIKEBCN",
  "from": "2016-05-01",
  "to": "2016-05-10",
  "language": "es",
  "paxes": [
    {"age": 30}
   ]
}

 

Response:

{
  // ...
  "activity": {
    "activityCode": "BIKEBCN",
    // ...
    "modalities": [
      {
        // ...
        "rates": [
          {
            // ...
            "rateDetails": [
              {
                // ...
                "rateKey": "j0tk42svejdhdegm7tt9bec0s6",
                "operationDates": [
                  {
                    "from": "2016-05-01",
                    "to": "2016-05-01"
                    // ...
                  }
                ]
                // ...
              }
            ]
          }
        ],
        // ...
        "questions": [
          {
            "code": "PHONENUMBER",
            "text": "Por favor, indique el nº de móvil de contacto en caso de emergencia (incluyendo código internacional )",
            "required": true
          }
        ]
        // ...
      }
    ]
    // ...
  }
}     
  • Call Modify Booking with the same activity code and the whole set of answers properly answered under the “serviceToModify” attribute.

POST /activity-api/3.0/bookings/modify/{{language}}/{{booking_reference}}

Request:

{
    "serviceToModify":
    {
        "activityId": "102#O#1",
        "rateKey": "thke0oikh0kvug7airi2qo5q2f",
        "from": "2016-05-01",
        "to": "2016-05-01",
        "answers": [
            {
                "question":
                {
                    "code": "PHONENUMBER",
                    "text": "Por favor, indique el nº de móvil de contacto en caso de emergencia (incluyendo código internacional )",
                    "required": true
                },
                "text": "My new answer"
            }
        ]    
    }
}

If you plan to perform modifications over already confirmed bookings and your needs don’t fit any of the points above, please ask support@activitiesbank.com to understand how to implement your booking funnel.

Docs Navigation