Introduction
Welcome to the Visit Galaxy API Reference for the legacy V2 version. If you don’t have an API key, get in touch with us.
The API gives you access to some of the Citybreak functionaility, enabling you to search for products, get content, search availability and use shopping baskets for booking and generating pay-later invoices.
This documentation is too long? You can check out the Swagger UI https://galaxy.test.citybreak.com/v2/. It targets test data and you can request a test API key for internal products that you can make bookings and do availability searches for. Give it a try and come back later.
The live Galaxy API endpoint is accessible at https://galaxy.citybreak.com/v2/
The docs for the latest version of the API are available at https://visit.github.io/galaxy-docs/.
Point of Sales
A point of sales is concept widely used in the Citybreak system, implementation will guide you about which one you should use. The following settings can be configured per point of sales:
- Suppliers
- Business Model
- Fees
- Commissions
- Payment regulation
- Payment options
If you wish different combination of those settings for different purposes, you most likely would like to use more than 1 point of sales. Talk to our implementation team help.citybreak.com, they know all there is to know on the subject.
Example Workflow
Example Workflow
This section will provide a very basic example workflow for booking a hotel room for one adult and one child that encompasses creating a basket, searching for availability, adding items and customer information, commiting then checking the reservation and, finally, cancelling it. For each step, see to the right of the page for ptototype calls using cURL or simple Javascript calls as well as example responses. Each of these calls (not counting the API keys and specific parameters that you will need to plug in) are the minimum requirements for a successful response.
Choose a Point of Sale Choose a currency Search availability Create basket Add booking item Add customer info Commit Basket Get Status Review reservation Cancel Reservation
Get Point of Sale
curl -X GET
--header 'Accept: application/json'
--header 'apiKey: APIKEY132456789EWOK'
'https://galaxy.citybreak.com/v2/api/pointofsales'
var r = fetch("https://galaxy.citybreak.com/v2/api/pointofsales",
{
headers: {
"ApiKey:" "APIKEY132456789EWOK",
"Accept": "application/json",
"Accept-Language": "en-US"
}
});
Response:
[
{
"Id": 1234561,
"Name": "Online"
},
{
"Id": 1234562,
"Name": "online viktors hotell 3"
},
{
"Id": 1234565,
"Name": "callcenter test"
},
{
"Id": 1234569,
"Name": "Veras Call Center"
},
{
"Id": 1234570,
"Name": "Test salespoint Distribution API"
}
]
The first step is to obtain a valid Point of Sale Identifier. This is needed for many of the following operations and defines the products available for search as well as many of the settings important for creating a booking, such as rate codes availability periods, etc. We will go with the “Test salespoint Distribution API” Point of Sale - 1234570
HTTP Request
GET https://galaxy.citybreak.com/v2/api/pointofsales
Choose A Currency
curl -X GET
--header 'Accept: application/json'
--header 'apiKey: APIKEY132456789EWOK'
'https://galaxy.citybreak.com/v2/api/pointofsales/currencies/1234570'
var r = fetch("https://galaxy.citybreak.com/v2/api/pointofsales/currencies/1234570",
{
headers: {
"ApiKey:" "APIKEY132456789EWOK",
"Accept": "application/json",
"Accept-Language": "en-US"
}
});
Example of response:
[
"DKK",
"SEK",
"NOK",
"EUR"
]
Once we have a Point of Sale we need to choose a Currency. Rates for hotel room products in the Availability Search are shown in whatever currency you choose but certain hotels do not have products for sale in all currencies so your results may be filtered depending on the currency you choose. We will choose Swedish Kronor - SEK.
HTTP Request
GET https://galaxy.citybreak.com/v2/api/pointofsales/currencies/1234570
Create A Basket
curl -X POST
--header 'Accept: application/json'
--header 'apiKey: APIKEY132456789EWOK' 'https://galaxy.citybreak.com/v2/api/basket/create/1234570/SEK'
var r = fetch("https://galaxy.citybreak.com/v2/api/basket/create/1234570/SEK",
{
method:"POST"
headers: {
"ApiKey:" "APIKEY132456789EWOK",
"Accept": "application/json"
}
});
Example of response:
{
"BasketId": 87654321,
"Success": true
}
For all booking operations you will need a Shopping Basket. This entity will be the reference for all information related to a booking, right up until the time the customer decides to commit to the booking and has provided all the necessary information. It is therefore very important to hold a reference to the BasketId, in this case - 87654321
HTTP Request
POST https://galaxy.citybreak.com/v2/api/basket/create
Search Availability
curl -X POST
--header 'Content-Type: application/json'
--header 'Accept: application/json'
--header 'Accept-Language: en-us'
--header 'apiKey: APIKEY132456789EWOK' -d '{
"PointOfSalesId": 1234570,
"Arrival": "2017-10-14T12:27:58.851Z",
"Departure": "2017-10-15T12:27:58.851Z",
"Currency": "SEK",
"PageSize": 20,
"Page": 0,
"PersonConfigurations": [
{
"Adults": 1,
"ChildrenAges": [
1
]
}
]
}' 'https://galaxy.citybreak.com/v2/api/availability/accommodation'
var r = fetch("https://galaxy.citybreak.com/v2/api/availability/accommodation",
{
method: "POST",
headers: {
"ApiKey:" "APIKEY132456789EWOK",
"Accept": "application/json",
"Accept-Language": "en-US"
},
body: JSON.Stringify({
"PointOfSalesId": 1234570,
"Arrival": "2017-10-14T12:27:58.851Z",
"Departure": "2017-10-15T12:27:58.851Z",
"Currency": "SEK",
"PageSize": 20,
"Page": 0,
"PersonConfigurations": [
{
"Adults": 1,
"ChildrenAges": [
1
]
}
]
})
});
Example of response:
{
"AccommodationSearch": {
"PointOfSalesId": 1234570,
"Arrival": "2017-10-14T00:00:00Z",
"Departure": "2017-10-15T00:00:00Z",
"Currency": "SEK",
"PageSize": 20,
"Page": 0,
"Sort": {
"Order": 0,
"Field": "Price"
},
"PersonConfigurations": [
{
"Adults": 1,
"ChildrenAges": [
1
]
}
],
"ContentFilter": null,
"OutputFilter": null
},
"Accommodations": [
{
"Id": 1136433,
"Name": "Edelbrock Hotell 3",
"Content": {
"PriceFrom": 0,
"Images": [
{
"Uri": "//images.citybreak.com/image.aspx?ImageId=4014876",
"IsMain": true,
"Name": null,
"Copyright": null,
"Description": null
},
{
"Uri": "//images.citybreak.com/image.aspx?ImageId=4014877",
"IsMain": false,
"Name": null,
"Copyright": null,
"Description": null
}
],
"Information": [
{
"Id": 99,
"Name": "Name",
"Value": "Edelbrock Hotell 3"
},
{
"Id": 101,
"Name": "Introduction",
"Value": "Edelbrock Hotell"
},
{
"Id": 102,
"Name": "Description",
"Value": "Edelbrock Hotell!"
},
{
"Id": 100038,
"Name": "Elevator",
"Value": "False"
},
{
"Id": 100163,
"Name": "Reception",
"Value": "False"
}
],
"Categories": null,
"Geos": [],
"Pois": [],
"Position": null
},
"Placements": [
{
"Price": {
"Price": 450,
"TotalPersons": 2,
"Currency": "SEK",
"DateStart": "2017-10-14T00:00:00Z",
"DateEnd": "2017-10-15T00:00:00Z"
},
"Placements": [
{
"Name": "Dubbelrum med xbädd ÖSD",
"Content": {
"PriceFrom": null,
"Images": [],
"Information": [
{
"Id": 99,
"Name": "Name",
"Value": "Dubbelrum med xbädd ÖSD"
}
],
"Categories": null,
"Geos": null,
"Pois": null,
"Position": null
},
"IncludedSubProducts": [],
"MaxPopopulation": 3,
"MinPopulation": 1,
"ExtraBeds": 1,
"PersonConfiguration": {
"Adults": 1,
"ChildrenAges": [
1
]
},
"PricePeriods": [
{
"DateStart": "2017-10-14T00:00:00",
"DateEnd": "2017-10-15T00:00:00",
"AdultPrice": 300,
"ChildPrice": 150,
"TotalPrice": 450,
"Currency": "SEK"
}
],
"BookingConditions": {
"Name": null,
"Terms": null
}
}
],
"BookingKey": "18-A"
},
{
"Price": {
"Price": 500,
"TotalPersons": 2,
"Currency": "SEK",
"DateStart": "2017-10-14T00:00:00Z",
"DateEnd": "2017-10-15T00:00:00Z"
},
"Placements": [
{
"Name": "Dubbelrum ÖSD",
"Content": {
"PriceFrom": null,
"Images": [],
"Information": [
{
"Id": 99,
"Name": "Name",
"Value": "Dubbelrum ÖSD"
}
],
"Categories": null,
"Geos": null,
"Pois": null,
"Position": null
},
"IncludedSubProducts": [
{
"Name": "Trädgårdstomte",
"Content": {
"PriceFrom": null,
"Images": [],
"Information": [
{
"Id": 99,
"Name": "Name",
"Value": "Trädgårdstomte"
}
],
"Categories": null,
"Geos": null,
"Pois": null,
"Position": null
},
"Price": 150,
"Amount": 1,
"Currency": "SEK",
"PriceIncluded": false,
"IsExtraBed": false,
"PayOnSite": false
}
],
"MaxPopopulation": 3,
"MinPopulation": 1,
"ExtraBeds": 1,
"PersonConfiguration": {
"Adults": 1,
"ChildrenAges": [
1
]
},
"PricePeriods": [
{
"DateStart": "2017-10-14T00:00:00",
"DateEnd": "2017-10-15T00:00:00",
"AdultPrice": 250,
"ChildPrice": 100,
"TotalPrice": 350,
"Currency": "SEK"
}
],
"BookingConditions": {
"Name": null,
"Terms": null
}
}
],
"BookingKey": "19-A"
}
],
"TotalResults": 2
}
],
"SearchId": "899fe054-3bb4-4ff8-b577-ba716b0b3317",
"ExpirationDate": "2017-09-15T09:15:46.0619347Z",
"TotalResults": 1
}
At a minimum, an Availability Search requires the PointOfSalesId we obtained earlier (1234570) and the Currency (“SEK”) as well as the Arrival and Departure dates we want to search for, the PersonConfigurations (i.e. the number of guests both Adult and Child), and the “PageSize” of the result you want. If there are 50 results and you want to have 20 products at a time, you can check the total number products in the first response at Page 0 and repeat the request incrementing the Page as necessary.
The information above is one of the most complex and probably the most important parts of the Galaxy API. It returns a list of “Accommodations”, which in this case for Citybreak are Hotel Properties (or Bed & Breakfasts, Apartments, etc), within which is a list of “Placements” which are Hotel Rooms (or Beds or Apartments, etc. depending on the property. These may also come with compulsory Add-ons (also known as sub-products) like breakfast included or champagne on arrival.
Each Accomodation object will also have content information about the property, that can also be found in an Accommodation Search, and how many room types (Placements) are available.
The placement objects represent the products that will actually be booked. As such they have a lot of the important information a customer might want to see, they contain a “Price” that represents total spend as well as a “PricePeriods” list that breaks the cost dow for example. Other useful information might be included in the content info or the room configuration/occupancy allowances, etc. The most important information for the booking process however is the BookingKey. There is one per “Placement” and is used to add a product to a Basket.
Also required is the SearchId that represents your search. The object represented by this unique id will hold references to all the products that were returned in the Accomodation Search. Also keep note of the ExpirationDate of the search as the reference will be invalid after this timestamp is passed.
For this example we will use the double room at Edelbrock Hotell 3 with a handy Garden Gnome included:
“BookingKey” = 19-A “SearchId” = 899fe054-3bb4-4ff8-b577-ba716b0b3317
HTTP Request
POST https://galaxy.citybreak.com/v2/api/availability/accommodation
Add A Booking Item
curl -X PUT
--header 'Accept: application/json'
--header 'apiKey: APIKEY132456789EWOK'
'https://galaxy.citybreak.com/v2/api/basket/add/accommodation/87654321/899fe054-3bb4-4ff8-b577-ba716b0b3317/19-A'
var r = fetch("https://galaxy.citybreak.com/v2/api/basket/add/accommodation/87654321/899fe054-3bb4-4ff8-b577-ba716b0b3317/19-A",
{
method:"PUT"
headers: {
"ApiKey:" "APIKEY132456789EWOK",
"Accept": "application/json",
}
});
Example of response:
true
Taking the BasketId: 87654321 of the basket we created earlier, the SearchId: 899fe054-3bb4-4ff8-b577-ba716b0b3317 from the availability search and the BookingCode: 19-A of the product we selected, we can now add a product to our Basket.
PUT https://galaxy.citybreak.com/v2/api/basket/add/accommodation/87654321/899fe054-3bb4-4ff8-b577-ba716b0b3317/19-A"
Add Customer Info
curl -X POST
--header 'Content-Type: application/json'
--header 'apiKey: APIKEY132456789EWOK' -d '{
"NameFirst": "Test",
"NameLast": "User",
"Salutation": "Ms",
"CustomerType": "Private",
"Culture": "en-US",
"Address": {
"StreetAddress1": "Test Road 123",
"PostalCode": "41111",
"City": "Gothenburg",
"CountryCode": "SE"
},
"Email": "testuser%40visit.com",
"PhoneMobile": {
"CountryCode": "46",
"AreaCode": "07",
"Number": "2222222"
}
}' 'https://galaxy.citybreak.com/v2/api/basket/customer/87654321'
var r = fetch("https://galaxy.citybreak.com/v2/api/basket/customer/87654321",
{
method:"POST"
headers: {
"ApiKey:" "APIKEY132456789EWOK",
"Accept": "application/json",
}
body: JSON.Stringify({
"NameFirst": "Test",
"NameLast": "User",
"Salutation": "Ms",
"CustomerType": "Private",
"Culture": "en-US",
"Address": {
"StreetAddress1": "Test Road 123",
"PostalCode": "41111",
"City": "Gothenburg",
"CountryCode": "SE"
},
"Email": "testuser@visit.com",
"PhoneMobile": {
"CountryCode": "46",
"AreaCode": "07",
"Number": "2222222"
}
}
}
});
Example of response: no content
To commit a Basket we will need to provide Customer Information using our BasketId: 87654321. In the example, we have created Ms. Test User and will POST her data which will attach it to the basket. You will only receive a status code of 204 to indicate success. The basket now has the bare minimum required to commit it.
HTTP Request
GET https://galaxy.citybreak.com/v2/api/basket/customer/87654321"
Commit Basket
curl -X POST
--header 'Accept: application/json'
--header 'apiKey: APIKEY132456789EWOK'
'https://galaxy.citybreak.com/v2/api/basket/commit/87654321'
var r = fetch("https://galaxy.citybreak.com/v2/api/basket/commit/87654321",
{
method:"POST"
headers: {
"ApiKey:" "APIKEY132456789EWOK",
"Accept": "application/json",
}
});
Example of response: an integer representing the CommitJobId
98761234
Once you have all the information in the basket, you can Commit it. This will start the process of finalising bookings and generating the necessary financial information. You only need to provide the Basket Id for this call. The whole commit process is a two step one. First, in this call, we will use a POST call and the BasketId: 87654321 to trigger the Basket commit job. What you get in return is the CommitJobId, you should use it with Commit Status to get the status of the job. Our CommitJobId is 98761234.
HTTP Request
POST https://galaxy.citybreak.com/v2/api/basket/commit/87654321
Get Commit Job Status
curl -X GET
--header 'Accept: application/json'
--header 'apiKey: APIKEY132456789EWOK'
'https://galaxy.citybreak.com/v2/api/basket/commit/status/98761234'
var r = fetch("https://galaxy.citybreak.com/v2/api/basket/commit/status/98761234",
{
headers: {
"ApiKey:" "APIKEY132456789EWOK",
"Accept": "application/json"
}
});
Example of response:
{
"Status": "CompletedOk",
"Subtasks": [
{
"Task": "StartingCommit",
"Status": "CompletedOk",
"ExtraInfo": null
},
{
"Task": "CreatingConfirmations",
"Status": "CompletedOk",
"ExtraInfo": null
},
{
"Task": "CreditCardAction",
"Status": "CompletedOk",
"ExtraInfo": null
},
{
"Task": "CreatingInvoices",
"Status": "NotStarted",
"ExtraInfo": null
},
{
"Task": "CreatingStatistics",
"Status": "NotStarted",
"ExtraInfo": null
},
{
"Task": "FinishingTransaction",
"Status": "CompletedOk",
"ExtraInfo": null
}
],
"ResvVersionId": 12349876,
"BookingCode": "EWOK12"
}
Once the basket has been ordered to be Committed, in order to get information about the booking you will need to use the CommitJobId: 98761234 to query the Commit Status of the job. As you can see in the example return, there are a number of different tasks that run as a part of a commit job. All of these are running in the back ground. Continue polling /basket/commit/status/{id} until you get either CompletedOk ok Failed as status. Both of them are final statuses. If you get Ok your reservation is confirmed and you have the booking code in the result. If you get Fail you will be provided with some detailes what went wrong. Like if you failed to confirm the reservation in a sub system or you havent provided enough information.
The other important information returned by the status is the ResvVersionId (reservation version id), for us: 12349876 and the BookingCode, for us: EWOK12, which are used to obtain information about the Reservation
HTTP Request
GET https://galaxy.citybreak.com/v2/api/basket/commit/status/98761234
Review A Reservation
curl -X GET
--header 'Accept: application/json'
--header 'apiKey: APIKEY132456789EWOK'
'https://galaxy.citybreak.com/v2/api/reservation/latest/EWOK12'
var r = fetch("https://galaxy.citybreak.com/v2/api/reservation/latest/EWOK12",
{
headers: {
"ApiKey:" "APIKEY132456789EWOK",
"Accept": "application/json"
}
});
Example of response:
{
"BookingCode": "EWOK12",
"Version": 1,
"BookingDate": "2017-09-27T13:12:54.1938577Z",
"AutoCancellation": "9999-12-31T23:59:59.9999999",
"Fees": [],
"BookingUser": {
"Id": 113685,
"NameFirst": "Galaxy",
"NameLast": "Api user",
"Email": null
},
"CancellationMessage": null,
"Customer": {
"NameFirst": "Test",
"NameLast": "User",
"Salutation": Ms,
"CustomerNumber": null,
"CustomerType": 0,
"Culture": null,
"CivicRegistrationNumber": null,
"Company": null,
"CompanyDepartment": null,
"Address": {
"StreetAddress1": "Test Road 123",
"StreetAddress2": null,
"StreetAddress3": null,
"PostalCode": "41111",
"City": "Gothenburg",
"CountryCode": "SE",
"State": null
},
"Email": null,
"PhoneHome": {
"CountryCode": null,
"AreaCode": null,
"Number": null
},
"PhoneWork": {
"CountryCode": null,
"AreaCode": null,
"Number": null
},
"PhoneMobile": {
"CountryCode": "46",
"AreaCode": "07",
"Number": "2222222"
}
},
"ProductGroups": [
{
"Products": [
{
"Id": 3,
"Name": "Dubbelrum ÖSD",
"Price": 350
}
],
"Id": 153663,
"Name": "Edelbrock Hotell"
}
]
}
There are two ways to return information about a reservation, either by the Version of the Reservation, using the BookingCode and ResVersionId or by the latest version as we have done here where we just require our BookingCode: EWOK12. It displays limited information about the booked products, the customer and some meta information about the booking itself. The user should retain a reference to the BookingCode so that they are able to reference their reservation
HTTP Request
GET https://galaxy.citybreak.com/v2/api/reservation/latest/EWOK12
Cancel A Reservation
curl -X GET
--header 'Accept: application/json'
--header 'apiKey: APIKEY132456789EWOK'
'https://galaxy.citybreak.com/v2/api/reservation/cancel/info/EWOK12'
var r = fetch("https://galaxy.citybreak.com/v2/api/reservation/cancel/info/EWOK12",
{
headers: {
"ApiKey:" "APIKEY132456789EWOK",
"Accept": "application/json"
}
});
Example of response:
{
"BookingCode": "EWOK12",
"NoProducts": 1,
"ReservationVersionId": 12349876,
"LastCancellationDate": "9999-12-31T23:59:59.9999999"
}
Finally, lets cancel our reservation. Cancelling policies can vary for products and so it is worth noting here that the only guaranteed cancellation that of the reservation. There might be part or full payments due depending on policies, cancellation insurance and other factors, that can differ product to product. To cancel, we once again just require our BookingCode: EWOK12 and with a GET query we will close out our reservation and end the example workflow.
HTTP Request
GET https://galaxy.citybreak.com/v2/api/reservation/cancel/info/EWOK12
Points of Sale
Content
Points of Sale are the distribution channels controlled by an Citybreak Organisation. An API key may give access to multiple Points of Sale, each with it’s own rate and currency information and selection of available products. Having a valid Point of Sale Id is important for most other queries in the API
All GET operations
Point Of Sales
curl -X GET
--header 'Accept: application/json'
--header 'apiKey: APIKEY132456789EWOK'
'https://galaxy.citybreak.com/v2/api/pointofsales'
var r = fetch("https://galaxy.citybreak.com/v2/api/pointofsales",
{
headers: {
"ApiKey:" "APIKEY132456789EWOK",
"Accept": "application/json",
"Accept-Language": "en-US"
}
});
Example of response:
[
{
"Id": 1,
"Name": "Online"
},
{
"Id": 2,
"Name": "online viktors hotell 3"
},
{
"Id": 5,
"Name": "callcenter test"
},
{
"Id": 9,
"Name": "Veras Call Center"
}
]
Get the points of sale available to the current API Key.
HTTP Request
GET https://galaxy.citybreak.com/v2/api/pointofsales
Currencies
curl -X GET
--header 'Accept: application/json'
--header 'apiKey: APIKEY132456789EWOK'
'https://galaxy.citybreak.com/v2/api/pointofsales/currencies/{pointOfSaleId}'
var r = fetch("https://galaxy.citybreak.com/v2/api/pointofsales/currencies/{pointOfSaleId}",
{
headers: {
"ApiKey:" "APIKEY132456789EWOK",
"Accept": "application/json",
"Accept-Language": "en-US"
}
});
Example of response:
[
"DKK",
"SEK",
"NOK",
"EUR"
]
Get currencies available for a given Point of Sale. Availability searches will require a currency for a valid search.
HTTP Request
GET https://galaxy.citybreak.com/v2/api/pointofsales/currencies
Query Parameters
Parameter | Description |
---|---|
pointOfSalesId | The point of sales identifier. |
Accommodation
Accommodation
Accommodation operations provide information on Accommodation products available in a point of sale. No availability information is included here, it is primarily content (images, position, categories, etc).
All GET operations
Accommodation
curl -X GET
--header 'ApiKey: APIKEY132456789EWOK'
--header 'Accept: application/json'
--header 'Accept-Language: en-US'
'https://galaxy.citybreak.com/v2/api/accommodation/{pointOfSaleId}/20/0'
var r = fetch("https://galaxy.citybreak.com/v2/api/accommodation/{pointOfSaleId}/20/0",
{
headers: {
"ApiKey:" "APIKEY132456789EWOK",
"Accept": "application/json",
"Accept-Language": "en-US"
}
});
Example of response:
{
"Page": 0,
"PageSize": 20,
"TotalResults": 1,
"Items": [
{
"Id": "cbis:1222681",
"Name": "BookVisit Hotel",
"Content": {
"PriceFrom": 0,
"Images": [
{
"Uri": "//images.citybreak.com/image.aspx?ImageId=4136104",
"IsMain": true,
"Name": null,
"Copyright": "",
"Description": null
},
],
"Information": [
{
"Id": 99,
"Name": "Name",
"Value": "BookVisit Hotel"
},
{
"Id": 101,
"Name": "Introduction",
"Value": "Leading e-commerce platform for the DMO and individual hotels in the Nordics."
},
],
"Categories": null,
"Geos": [
{
"Id": 69962,
"Path": null
},
],
"Pois": [],
"Position": {
"Latitude": 57.7039005352791,
"Longitude": 11.9626625079345
}
},
"Children": [
{
"Id": "pt:355468",
"Name": "BookVisit Hotel BookVisit",
"Content": {
"PriceFrom": null,
"Images": null,
"Information": null,
"Categories": null,
"Geos": null,
"Pois": null,
"Position": null
}
}
]
}
]
}
Get details about Accommodation
HTTP Request
GET https://galaxy.citybreak.com/v2/api/accommodation
Query Parameters
Parameter | Description |
---|---|
pointOfSalesId | The point of sales identifier. |
pageSize | Size of the page. |
page | The page. |
Product
curl -X GET
--header 'Accept: application/json'
--header 'Accept-Language: en-us'
--header 'apiKey: APIKEY132456789EWOK'
'https://galaxy.citybreak.com/v2/api/accommodation/view/{pointOfSaleId}/{productId}'
var r = fetch("https://galaxy.citybreak.com/v2/api/accommodation/view/{pointOfSaleId}/{productId}'",
{
headers: {
"ApiKey:" "APIKEY132456789EWOK",
"Accept": "application/json",
"Accept-Language": "en-US"
}
});
Example of response:
{
"Id": "cbis:1222681",
"Name": "BookVisit Hotel",
"Content": {
"PriceFrom": 0,
"Images": [
{
"Uri": "//images.citybreak.com/image.aspx?ImageId=4136104",
"IsMain": true,
"Name": null,
"Copyright": "",
"Description": null
},
],
"Information": [
{
"Id": 99,
"Name": "Name",
"Value": "BookVisit Hotel"
},
{
"Id": 101,
"Name": "Introduction",
"Value": "Leading e-commerce platform for the DMO and individual hotels in the Nordics."
},
],
"Categories": null,
"Geos": [
{
"Id": 69962,
"Path": null
},
],
"Pois": [],
"Position": {
"Latitude": 57.7039005352791,
"Longitude": 11.9626625079345
}
},
"Children": [
{
"Id": "pt:542664"
"Name": "BookVisit Hotel BookVisit",
"Content": {
"PriceFrom": null,
"Images": null,
"Information": null,
"Categories": null,
"Geos": null,
"Pois": null,
"Position": null
}
}
]
}
Get details and content about a specific Citybreak product, the requests requires that you have both a Point of Sale Id and a valid Product Id
HTTP Request
GET https://galaxy.citybreak.com/v2/api/accommodation/view/
Query Parameters
Parameter | Description |
---|---|
pointOfSalesId | The point of sales identifier. |
productId | The Id of the product you wish to retrieve. |
Availability
Availability
Availability calls provide information about the availability of accomodation products and (seperately) cabin products. These product types are split due to the nature of Cabin booking, typically set periods like Mon-Thurs, that produce different results for searches. Hotels, etc. return results based on the provided arrival and departure date. Cabins produce a “fuzzier” result, looking for matching periods for the requested dates within a margin of error. Both searches will return products with availability, including content, pricing groups with room information (Placements) and subproduct information (such as breakfasts or tickets to nearby attractions), as well as a Search ID with its Expiry.
The Search Id can be used to retrieve prior, cached searches in a much shorter amount of time for both Accomodation Search and Cabin Scan if used before its Expiry. The object recalled by the search contains all the unfiltered information retrieved in the first search, so further or different filtering on content, etc. can be done in this call.
The Search Id and the Booking Key of each room product are used in the basket operations to add the product found to the Basket
The Cabin Search has additional functionality - the GET calls -
GET and POST operations
Accommodation
curl -X POST
--header 'Content-Type: application/json'
--header 'Accept: application/json'
--header 'Accept-Language: en-us'
--header 'apiKey: APIKEY132456789EWOK' -d '{
"PointOfSalesId": {pointOfSalesId},
"Arrival": "2017-10-14T12:27:58.851Z",
"Departure": "2017-10-15T12:27:58.851Z",
"Currency": "SEK",
"PageSize": 20,
"PersonConfigurations": [
{
"Adults": 1,
"ChildrenAges": [
0
]
}
]
}' 'https://galaxy.citybreak.com/v2/api/availability/accommodation'
var r = fetch("https://galaxy.citybreak.com/v2/api/availability/accommodation",
{
method: "POST",
headers: {
"ApiKey:" "APIKEY132456789EWOK",
"Accept": "application/json",
"Accept-Language": "en-US"
},
body: JSON.Stringify({
"PointOfSalesId": {pointOfSalesId},
"Arrival": "2017-10-14T12:27:58.851Z",
"Departure": "2017-10-15T12:27:58.851Z",
"Currency": "SEK",
"PageSize": 20,
"PersonConfigurations": [
{
"Adults": 1,
"ChildrenAges": [
0
]
}
]
})
});
Example of response:
{
"AccommodationSearch": {
"PointOfSalesId": {pointOfSaleId},
"Arrival": "2017-10-14T00:00:00Z",
"Departure": "2017-10-15T00:00:00Z",
"Currency": "SEK",
"PageSize": 20,
"Page": 0,
"Sort": {
"Order": 0,
"Field": "Price"
},
"PersonConfigurations": [
{
"Adults": 1,
"ChildrenAges": [
0
]
}
],
"ContentFilter": null,
"OutputFilter": null
},
"Accommodations": [
{
"Id": "cbis:1136433",
"Name": "Edelbrock Hotell 3",
"Content": {
"PriceFrom": 0,
"Images": [
{
"Uri": "//images.citybreak.com/image.aspx?ImageId=4014876",
"IsMain": true,
"Name": null,
"Copyright": null,
"Description": null
},
{
"Uri": "//images.citybreak.com/image.aspx?ImageId=4014877",
"IsMain": false,
"Name": null,
"Copyright": null,
"Description": null
}
],
"Information": [
{
"Id": 99,
"Name": "Name",
"Value": "Edelbrock Hotell 3"
},
{
"Id": 101,
"Name": "Introduction",
"Value": "Edelbrock Hotell"
},
{
"Id": 102,
"Name": "Description",
"Value": "Edelbrock Hotell!"
},
{
"Id": 100038,
"Name": "Elevator",
"Value": "False"
},
{
"Id": 100163,
"Name": "Reception",
"Value": "False"
}
],
"Categories": null,
"Geos": [],
"Pois": [],
"Position": null
},
"Placements": [
{
"Price": {
"Price": 450,
"TotalPersons": 2,
"Currency": "SEK",
"DateStart": "2017-10-14T00:00:00Z",
"DateEnd": "2017-10-15T00:00:00Z"
},
"Placements": [
{
"Name": "Dubbelrum med xbädd ÖSD",
"Content": {
"PriceFrom": null,
"Images": [],
"Information": [
{
"Id": 99,
"Name": "Name",
"Value": "Dubbelrum med xbädd ÖSD"
}
],
"Categories": null,
"Geos": null,
"Pois": null,
"Position": null
},
"IncludedSubProducts": [],
"MaxPopopulation": 3,
"MinPopulation": 1,
"ExtraBeds": 1,
"PersonConfiguration": {
"Adults": 1,
"ChildrenAges": [
0
]
},
"PricePeriods": [
{
"DateStart": "2017-10-14T00:00:00",
"DateEnd": "2017-10-15T00:00:00",
"AdultPrice": 300,
"ChildPrice": 150,
"TotalPrice": 450,
"Currency": "SEK"
}
],
"BookingConditions": {
"Name": null,
"Terms": null
}
}
],
"BookingKey": "18-A"
},
{
"Price": {
"Price": 500,
"TotalPersons": 2,
"Currency": "SEK",
"DateStart": "2017-10-14T00:00:00Z",
"DateEnd": "2017-10-15T00:00:00Z"
},
"Placements": [
{
"Name": "Dubbelrum ÖSD",
"Content": {
"PriceFrom": null,
"Images": [],
"Information": [
{
"Id": 99,
"Name": "Name",
"Value": "Dubbelrum ÖSD"
}
],
"Categories": null,
"Geos": null,
"Pois": null,
"Position": null
},
"IncludedSubProducts": [
{
"Name": "Trädgårdstomte",
"Content": {
"PriceFrom": null,
"Images": [],
"Information": [
{
"Id": 99,
"Name": "Name",
"Value": "Trädgårdstomte"
}
],
"Categories": null,
"Geos": null,
"Pois": null,
"Position": null
},
"Price": 150,
"Amount": 1,
"Currency": "SEK",
"PriceIncluded": false,
"IsExtraBed": false,
"PayOnSite": false
}
],
"MaxPopopulation": 3,
"MinPopulation": 1,
"ExtraBeds": 1,
"PersonConfiguration": {
"Adults": 1,
"ChildrenAges": [
0
]
},
"PricePeriods": [
{
"DateStart": "2017-10-14T00:00:00",
"DateEnd": "2017-10-15T00:00:00",
"AdultPrice": 250,
"ChildPrice": 100,
"TotalPrice": 350,
"Currency": "SEK"
}
],
"BookingConditions": {
"Name": null,
"Terms": null
}
}
],
"BookingKey": "19-A"
}
],
"TotalResults": 2
}
],
"SearchId": "899fe054-3bb4-4ff8-b577-ba716b0b3317",
"ExpirationDate": "2017-09-15T09:15:46.0619347Z",
"TotalResults": 1
}
This is a POST request that requires a filter with some mandatory properties, such as arrival and depature dates. The filter can also include content filtering, such as only those hotels associated with a particular CBIS category or that have 24 hr reception. Content possibilities can be found in the Content Section You can see a bare minimum verison of this search in the examples. The Most important return values in this response are the SearchId and the BookingKey used in the Basket, also pay attention to the ExpirationDate of the SearchId
HTTP Request
POST https://galaxy.citybreak.com/availability/accommodation
Query Parameters
Parameter | Description |
---|---|
filter | the POST filter |
Accept-Language | The language culture (e.g en-us) |
Get Previous Search
curl -X POST
--header 'Content-Type: application/json'
--header 'Accept: application/json'
--header 'Accept-Language: en-us'
--header 'apiKey: APIKEY132456789EWOK' -d '{
"PointOfSalesId": {pointOfSalesId},
"Arrival": "2017-10-14T12:27:58.851Z",
"Departure": "2017-10-15T12:27:58.851Z",
"Currency": "SEK",
"PageSize": 20,
"Page": 1,
"PersonConfigurations": [
{
"Adults": 1,
"ChildrenAges": [
1
]
}
]
}' 'https://galaxy.citybreak.com/v2/api/availability/get'
var r = fetch("https://galaxy.citybreak.com/v2/api/availability/get",
{
method: "POST",
headers: {
"ApiKey:" "APIKEY132456789EWOK",
"Accept": "application/json",
"Accept-Language": "en-US"
},
body: JSON.Stringify({
"PointOfSalesId": {pointOfSalesId},
"Arrival": "2017-10-14T12:27:58.851Z",
"Departure": "2017-10-15T12:27:58.851Z",
"Currency": "SEK",
"PageSize": 20,
"Page": 1,
"PersonConfigurations": [
{
"Adults": 1,
"ChildrenAges": [
1
]
}
]
})
});
Example of response:
{
"AccommodationSearch": {
"PointOfSalesId": {pointOfSaleId},
"Arrival": "2017-10-14T00:00:00Z",
"Departure": "2017-10-15T00:00:00Z",
"Currency": "SEK",
"PageSize": 20,
"Page": 1,
"Sort": {
"Order": 0,
"Field": "Price"
},
"PersonConfigurations": [
{
"Adults": 1,
"ChildrenAges": [
0
]
}
],
"ContentFilter": null,
"OutputFilter": null
},
"Accommodations": [
{
"Id": "cbis:1136433",
"Name": "Edelbrock Hotell 3",
"Content": {
"PriceFrom": 0,
"Images": [
{
"Uri": "//images.citybreak.com/image.aspx?ImageId=4014876",
"IsMain": true,
"Name": null,
"Copyright": null,
"Description": null
},
{
"Uri": "//images.citybreak.com/image.aspx?ImageId=4014877",
"IsMain": false,
"Name": null,
"Copyright": null,
"Description": null
}
],
"Information": [
{
"Id": 99,
"Name": "Name",
"Value": "Edelbrock Hotell 3"
},
{
"Id": 101,
"Name": "Introduction",
"Value": "Edelbrock Hotell"
},
{
"Id": 102,
"Name": "Description",
"Value": "Edelbrock Hotell!"
},
{
"Id": 100038,
"Name": "Elevator",
"Value": "False"
},
{
"Id": 100163,
"Name": "Reception",
"Value": "False"
}
],
"Categories": null,
"Geos": [],
"Pois": [],
"Position": null
},
"Placements": [
{
"Price": {
"Price": 450,
"TotalPersons": 2,
"Currency": "SEK",
"DateStart": "2017-10-14T00:00:00Z",
"DateEnd": "2017-10-15T00:00:00Z"
},
"Placements": [
{
"Name": "Dubbelrum med xbädd ÖSD",
"Content": {
"PriceFrom": null,
"Images": [],
"Information": [
{
"Id": 99,
"Name": "Name",
"Value": "Dubbelrum med xbädd ÖSD"
}
],
"Categories": null,
"Geos": null,
"Pois": null,
"Position": null
},
"IncludedSubProducts": [],
"MaxPopopulation": 3,
"MinPopulation": 1,
"ExtraBeds": 1,
"PersonConfiguration": {
"Adults": 1,
"ChildrenAges": [
1
]
},
"PricePeriods": [
{
"DateStart": "2017-10-14T00:00:00",
"DateEnd": "2017-10-15T00:00:00",
"AdultPrice": 300,
"ChildPrice": 150,
"TotalPrice": 450,
"Currency": "SEK"
}
],
"BookingConditions": {
"Name": null,
"Terms": null
}
}
],
"BookingKey": "18-A"
},
{
"Price": {
"Price": 500,
"TotalPersons": 2,
"Currency": "SEK",
"DateStart": "2017-10-14T00:00:00Z",
"DateEnd": "2017-10-15T00:00:00Z"
},
"Placements": [
{
"Name": "Dubbelrum ÖSD",
"Content": {
"PriceFrom": null,
"Images": [],
"Information": [
{
"Id": 99,
"Name": "Name",
"Value": "Dubbelrum ÖSD"
}
],
"Categories": null,
"Geos": null,
"Pois": null,
"Position": null
},
"IncludedSubProducts": [
{
"Name": "Trädgårdstomte",
"Content": {
"PriceFrom": null,
"Images": [],
"Information": [
{
"Id": 99,
"Name": "Name",
"Value": "Trädgårdstomte"
}
],
"Categories": null,
"Geos": null,
"Pois": null,
"Position": null
},
"Price": 150,
"Amount": 1,
"Currency": "SEK",
"PriceIncluded": false,
"IsExtraBed": false,
"PayOnSite": false
}
],
"MaxPopopulation": 3,
"MinPopulation": 1,
"ExtraBeds": 1,
"PersonConfiguration": {
"Adults": 1,
"ChildrenAges": [
1
]
},
"PricePeriods": [
{
"DateStart": "2017-10-14T00:00:00",
"DateEnd": "2017-10-15T00:00:00",
"AdultPrice": 250,
"ChildPrice": 100,
"TotalPrice": 350,
"Currency": "SEK"
}
],
"BookingConditions": {
"Name": null,
"Terms": null
}
}
],
"BookingKey": "19-A"
}
],
"TotalResults": 2
}
],
"SearchId": "899fe054-3bb4-4ff8-b577-ba716b0b3317",
"ExpirationDate": "2017-09-15T09:15:46.0619347Z",
"TotalResults": 1
}
NB under active development This is a POST request that requires a filter with a valid (non-expired) SearchId. The filter otherwise behaves the same as it would in the original Accommodation search. You can see a bare minimum verison of this search in the examples.
HTTP Request
POST https://galaxy.citybreak.com/availability/get
Query Parameters
Parameter | Description |
---|---|
filter | the POST filter |
Accept-Language | The language culture (e.g en-us) |
Cabin Search
The cabin search will look for available cabins in the neighburhood of the requested Arrival/Departure of the stay definition. The result will give you cabins that matches or partially matches the stay definition. A score will tell how good of a match it was. You can use the related methods to navigate in the search result until it is resolved into a bookable match. Once there you can put the selected cabin and stay dates in the basket.
How to add a result to basket
Call Scan
First you call the Scan method to get perform a search. You will get a partial listing
back describing the first set of results. The SearchId
will be used in all other methods
to refer back to the original search you made.
The scan operation will examine dates around the stay (-10 days before arrival and +10
days after the selected departure).
Page through the result
By using the Get method you will be able to page through the result.
Get arrival dates in search span
Once you get a result you like and would like to investigate further you can get more details of the possible stays with that result by calling arrivaldates. That will give you all valid arrival dates available in scan sector that was used.
Get departure dates
By calling the depaturedates, given an arrival date you will get all valid departures from that date.
List bookable alternatives
By calling bookablealternatives you will get back actual bookable items between a specified arrival and departure. You will get a list of items back. Since a cabin may be sold under certain conditions, you may get more than one back. Each describing a price and the conditions under it will be sold. Included subproducts can differ between the items for instance.
Add to basket
Once you have a bookable alternative you can add it to the basket by calling PUT api/basket/add/cabin/{basketId}/{searchId}/{bookKey}
Suggested implementation
Do a scan and sort over Score
Descending
. Navigate using the Get to find
a result on a page that you would like more detailed information on.
Keep the search id and go to a page which presents that item in a good way.
Create an arrival calendar by calling getarrivaldates. Upon selecting
an arrival date, populate the departure dates.
When selecting a departure date, call bookablealternatives and get the details
and present them with a book button next to them.
Default all calender items with the example dates from the scan.
If you would like to show the next period, you will need to call scan once again
and get the new ResultId
.
Scan
Use this method first to get a ResultId
to be able to proceed with all other
operations.
Search parameters
All parameters are submitted through an instance of the CabinSearchFilter object as described below.
Parameter | Description |
---|---|
PointOfSalesId | The point of sales that should be used. It defines the assortment that could be searched. |
Currency | The currency the basket search should deliver results for. It must match the currency your basket is in. |
PageSize | The number of results in the return object. It may not exceed 50 and suggested is between 10 and 20. |
Page | The page you would like to start with. Normally 0, it will give you the first page with the best matches |
Stay | The Stay object describes what types of stay results you would like to get. |
Stay.ArrivalDayMask | The arrival day mask, see DayMask below. |
Stay.DepartureDayMask | The departure day mask, see DayMask below. |
Stay.MinStayLength | The minimum length of stay you require. |
Stay.MaxStayLength | The maximum length of stay you require. |
Stay.Arrival | The suggested arrival date. |
Stay.Departure | The suggested departure date. |
Using the Stay object
The arrival
and depature
makes up a sweet spot span where you would like to arrive.
The search is performed with the focus on that area.
However you can get results that partially matches that span.
The Score
property will tell how good of a match a specific result was.
It will also give you the best price for the specified stay that the item used to
calculate the score.
The example properties on that object will tell which ones it was.
Use the arrival
/departure
day mask to create queries to match like short week,
weekends and such.
For instance, use 0x18 to create results arriving on Thurday or Friday and use departure
mask 0x61 to specify acceptable depatures on Saturday, Sunday or Monday.
That could be your weekend day filter.
Use the MinStayLength
/MaxStayLength
stay to specify an acceptable length of you stay.
7/7 will give you exactly seven days of stay.
2-3 will restrict the stay to 2 or 3 days.
That could be used in conjunction with the week days filter.
1/7 will give you results where you could stay anywhere between 1 or 7 days.
Usually not a very good definition.
Keep in mind that this is only used to give you relevant stay dates as the result. You can use the get arrival dates and departure dates when you examine a specified result to create a bookable result that does not neccisarily matches your original constraints. So there is certainly no need to use the 1-7 days span to be able to do so later on.
Day mask
A bit mask describing which days that are valid for arriving at or depart at.
Day | Bit |
---|---|
Monday | 0x01 |
Tuesday | 0x02 |
Wednesday | 0x04 |
Thursday | 0x08 |
Friday | 0x10 |
Saturday | 0x20 |
Sunday | 0x40 |
Mask examples
- 0x7F
- Any day, this is the default if 0 is submitted.
- 0x18
- Thursday or Friday.
- 0x0F
- Monday, Tuesday, Wednesday, Thursday or Friday.
Sort definition
The sort definition is used to order the paged results you get.
Order | Meaning |
---|---|
Asc | Ascending - The item with the lowest field value first. Suggested when sorting by Price. |
Desc | Descending - The item the highest field value first. Suggested when sorting by Score. |
Valid sort fields
- Name
- Sort by the name of the Cabin
- Price
- Sort by example price
- Random
- Sort by a random order.
- Score
- Sort by the relevance of the example stay.
Note that the field names are case sensitive.
Sugested sort order is by Score
/Descending
.
That will give you the most relevant items first.
Please note that price may give some unintended side effects when using
MaxStayLength
/MinStayLength
and ArrivalDayMask
/DepartureDayMask
filter.
The items may not compare well to each other sice one item may have produced
a result that is shorter than another (hence a different price) or
using ArrivalDayMask
/DepartureDayMask
.
The price may differ heavily if you are in a high season week and low season week.
Ordering by Price
is therefor not neccisarily a good sorting for listing
relevant results.
ContentFilter
The content filter specifies that the search result should be narrowed to certain results that only matches that filter. See Availability search for specification.
ContentOutputFilter
The output filter describes which content that should be included with the item. See the availability search for specifications.
curl -X POST --header 'Content-Type: application/json' --header 'Accept: application/json' --header 'Accept-Language: en-us' --header 'apiKey: APIKEY132456789EWOK' -d '{
{
"PointOfSalesId": 0,
"Currency": "SEK",
"PageSize": 10,
"Stay": {
"ArrivalDaysMask": 0x7F,
"DepartureDayMask": 0x7F,
"MinStayLength": 7,
"MaxStayLength": 7,
"Arrival": "2018-04-01",
"Departure": "2018-04-08"
},
"PersonConfiguration": {
"Adults": 2,
"ChildrenAges": [
3
]
},
"Sort": {
"Order": "Asc",
"Field": "Score"
}
} }' 'https://galaxy.citybreak.com/v2/api/availability/cabin/scan'
var r = fetch("https://galaxy.citybreak.com/v2/api/availability/cabin/scan",
{
method: "POST",
headers: {
"ApiKey:" "APIKEY132456789EWOK",
"Accept": "application/json",
"Accept-Language": "en-US"
},
body: JSON.Stringify({
"PointOfSalesId": 0,
"Currency": "SEK",
"PageSize": 10,
"Stay": {
"ArrivalDaysMask": 0x7F,
"DepartureDayMask": 0x7F,
"MinStayLength": 7,
"MaxStayLength": 7,
"Arrival": "2018-04-01",
"Departure": "2018-04-08"
},
"PersonConfiguration": {
"Adults": 2,
"ChildrenAges": [
3
]
},
"Sort": {
"Order": "Asc",
"Field": "Score"
})
});
Example of response:
{
"SearchId": "12313212313",
"TotalResults": 15,
"Result": [
{
"Id": "cbis:154623",
"BookingKey": "253-C",
"Name": "My cabin",
"Content": {
"PriceFrom": 0,
"Images": [
{
"Uri": "//images.citybreak.com/image.aspx?ImageId=4014876",
"IsMain": true,
"Name": null,
"Copyright": null,
"Description": null
}
],
"Information": [
{
"Id": 99,
"Name": "Name",
"Value": "My Cabin"
},
{
"Id": 101,
"Name": "Introduction",
"Value": "A really nice cabin"
},
{
"Id": 102,
"Name": "Description",
"Value": "A cabin located in the centre of all slopes."
},
{
"Id": 100038,
"Name": "Elevator",
"Value": "False"
}
],
"Categories": [
{
"Id": 0,
"Path": "string"
}
],
"Geos": [
{
"Id": 0,
"Path": "string"
}
],
"Pois": [
{
"Id": 0,
"Name": "string",
"Position": {
"Latitude": 0,
"Longitude": 0
}
}
],
"Position": {
"Latitude": 0,
"Longitude": 0
}
},
"Score": 0,
"ExampleArrival": "2017-12-13T06:13:08.820Z",
"ExampleDeparture": "2017-12-13T06:13:08.820Z",
"Extrabeds": 0,
"MaxPopluationForAnyItem": 0,
"MaxPopulation": 0,
"OriginalPrice": 0,
"Price": 0
}
],
"SearchContext": {
/* Copy of what was sent to the method.
...
*/
},
"PageSize": 10,
"Page": 0,
"PersonConfiguration": {
"Adults": 2,
"ChildrenAges": [
3
]
},
"Currency": "SEK",
"ArrivalDayMask": 0x7f,
"DepartureDayMask": 0x7f,
"MinStayLength": 7,
"MaxStayLength": 7,
"Sort": {
"Order": "Asc",
"Field": "Score"
}
}
}
Get
This method is used to get a different page of the result.
POST /api/availability/cabin/get
{
"Page": 1, /* The second page */
"PageSize": 10,
"Sort": {
"Order": "Desc",
"Field": "Score"
},
"SearchId": "123123132",
"ContentOutputFilter": {
"Attributes": [
99, 101, 102
],
"Categories": true,
"Geos": true,
"Pois": true,
"Position": true
}
}
Arrival dates
Get a set of valid arrival dates for a specified item.
GET api/availability/cabin/arrivaldates
Parameters are:
- searchId - From the
result
- bookKey - From the
result.Result[n].BookKey
- firstArrival - First acceptable date for the result.
- lastArrival - Last acceptable date for the result.
- personConfig - Typically the same used in Scan
It returns a list of dates that are valid for arrival.
Departure dates
Get a set of valid departure dates for the specficed item given the arrival date.
GET api/availability/cabin/departuredates
Parameters are:
- searchId - From the
result
- bookKey - From the
result.Result[n].BookKey
- arrival - The specified arrival date from which you would like valid departure dates.
- personConfig - Typically the same used in Scan
It returns a set of dates that are valid for departure given the arrival date.
Get bookable alternatives
GET api/availability/cabin/bookablealternatives
Parameters are:
- searchId - From the
result
- bookKey - From the
result.Result[n].BookKey
- arrival - The specified arrival date.
- departure - The specifeid departure date.
- personConfig - Typically the same used in Scan
It returns a list of valid alternatives to book:
[
{
"BookId": 0,
"DiscountInformation": {
"Name": "string",
"Description": "string"
},
"Arrival": "2018-04-03",
"Departure": "2018-04-10",
"Subproducts": [
{
"Name": "string",
"Currency": "string",
"Description": "string",
"IncludedInPrice": true,
"PayOnSite": false,
"Price": 0
}
],
"OriginalPrice": 0,
"Price": 0,
"RateInformation": {
"Name": "string",
"CancellationLatest": "2017-12-13",
"Terms": "string"
}
}
]
Use the BookId
when referring to this specific result when adding it to the basket.
Content
Content
Content calls provide information about several content types used by your org, Attributes, GeoNodes, Points of Interest and Categories. This can be useful when creating content filters on your site as each of these types are suitable for content filtering on Availability searches. As with other calls, these are available in the languages your organisation supports and has translated (for non-system content). You need the relevant Point of Sale Id for all these calls.
All GET operations
Attributes
curl -X GET
--header 'apiKey: APIKEY132456789EWOK'
--header 'Accept: application/json'
--header 'Accept-Language: en-us'
'https://galaxy.citybreak.com/v2/api/content/attribute/{pointOfSaleId}'
var r = fetch("https://galaxy.citybreak.com/v2/api/content/attribute/{pointOfSaleId}",
{
headers: {
"ApiKey:" "APIKEY132456789EWOK",
"Accept": "application/json",
"Accept-Language": "en-US"
}
});
Example of response:
[
{
"Id": 99,
"Name": "Name",
"Type": "String"
},
{
"Id": 101,
"Name": "Introduction",
"Type": "String"
},
{
"Id": 102,
"Name": "Description",
"Type": "String"
},
{
"Id": 103,
"Name": "Directions",
"Type": "String"
},
{
"Id": 104,
"Name": "Opening hours",
"Type": "String"
},
{
"Id": 102728,
"Name": "1 level apartment",
"Type": "Boolean"
},
{
"Id": 102729,
"Name": "2 level apartment",
"Type": "Boolean"
},
{
"Id": 102732,
"Name": "Cleaning included",
"Type": "Boolean"
},
{
"Id": 102733,
"Name": "Shop",
"Type": "Boolean"
},
{
"Id": 102734,
"Name": "Ski buses",
"Type": "Boolean"
}
]
Get localised Attribute information.
HTTP Request
GET https://galaxy.citybreak.com/v2/api/content/attribute
Query Parameters
Parameter | Description |
---|---|
pointOfSalesId | The point of sales identifier. |
GeoNodes
curl -X GET
--header 'apiKey: APIKEY132456789EWOK'
--header 'Accept: application/json'
--header 'Accept-Language: en-us'
'https://galaxy.citybreak.com/v2/api/content/geo/{pointOfSaleId}'
var r = fetch("https://galaxy.citybreak.com/v2/api/content/geo/{pointOfSaleId}",
{
headers: {
"ApiKey:" "APIKEY132456789EWOK",
"Accept": "application/json",
"Accept-Language": "en-US"
}
});
Example of response:
{
"Id": 69962,
"Children": [
{
"Id": 105634,
"Children": []
},
{
"Id": 106922,
"Children": [
{
"Id": 106923,
"Children": []
}
]
},
{
"Id": 70494,
"Children": [
{
"Id": 70505,
"Children": [
{
"Id": 70495,
"Children": []
}
]
}
]
}
]
}
Get the GeoNode tree. This is a nested list of client-defined geo-locations that can be associated with products, e.g. a hotel in Gothenburg might have both the node representing Sweden and the node representing Gothenburg included in its content, enabling you to filter on either.
HTTP Request
GET https://galaxy.citybreak.com/v2/api/content/geo
Query Parameters
Parameter | Description |
---|---|
pointOfSalesId | The point of sales identifier. |
Category
curl -X GET
--header 'apiKey: APIKEY132456789EWOK'
--header 'Accept: application/json'
--header 'Accept-Language: en-us'
'https://galaxy.citybreak.com/v2/api/content/category/{pointOfSaleId}'
var r = fetch("https://galaxy.citybreak.com/v2/api/content/category/{pointOfSaleId}",
{
headers: {
"ApiKey:" "APIKEY132456789EWOK",
"Accept": "application/json",
"Accept-Language": "en-US"
}
});
Example of response:
{
"Id": 5946,
"Children": [
{
"Id": 30701,
"Children": [
{
"Id": 26219,
"Children": [
{
"Id": 26218,
"Children": []
}
]
},
{
"Id": 26217,
"Children": []
},
{
"Id": 26220,
"Children": [
{
"Id": 30610,
"Children": []
}
]
}
],
}
]
}
Get the Category tree. This is a nested list of client-defined categories that can be associated with products, e.g. a hotel might have both the node representing Hotel and the child node representing Boutique Hotel included in its content, enabling you to filter on either.
HTTP Request
GET https://galaxy.citybreak.com/v2/api/content/category
Query Parameters
Parameter | Description |
---|---|
pointOfSalesId | The point of sales identifier. |
Point Of Interest
curl -X GET
--header 'apiKey: APIKEY132456789EWOK'
--header 'Accept: application/json'
--header 'Accept-Language: en-us'
'https://galaxy.citybreak.com/v2/api/content/poi/{pointOfSaleId}'
var r = fetch("https://galaxy.citybreak.com/v2/api/content/poi/{pointOfSaleId}",
{
headers: {
"ApiKey:" "APIKEY132456789EWOK",
"Accept": "application/json",
"Accept-Language": "en-US"
}
});
Example of response:
[
{
"Id": 16,
"Name": "Leksand",
"Position": {
"Longitude": 15.0032043457031,
"Latitude": 60.7338905334473
}
},
{
"Id": 17,
"Name": "Mora (Mora-Siljan flygplats)",
"Position": {
"Longitude": 14.5049390792847,
"Latitude": 60.958568572998
}
},
{
"Id": 18,
"Name": "Borlänge (Dala Airport)",
"Position": {
"Longitude": 15.5104637145996,
"Latitude": 60.4233436584473
}
},
{
"Id": 8305,
"Name": "Inlandsbanan",
"Position": {
"Longitude": 16.2033634185791,
"Latitude": 64.113899230957
}
},
]
Get a list of Points of Interest. This is a mixed list of system and client-defined geographic Points of Interest that can be associated with products, e.g. a hotel might be nearby a train station or a key landmark and this information can be associated with the product and used for content filtering.
HTTP Request
GET https://galaxy.citybreak.com/v2/api/content/poi
Query Parameters
Parameter | Description |
---|---|
pointOfSalesId | The point of sales identifier. |
Languages
curl -X GET
--header 'apiKey: APIKEY132456789EWOK'
--header 'Accept: application/json'
'https://galaxy.citybreak.com/v2/api/content/language/{pointOfSaleId}'
var r = fetch("https://galaxy.citybreak.com/v2/api/content/language/{pointOfSaleId}",
{
headers: {
"ApiKey:" "APIKEY132456789EWOK",
"Accept": "application/json"
}
});
Example of response:
[
"en-us",
"sv-se",
"fr-fr"
]
Get a list of languages available for a given point of sales.
HTTP Request
GET https://galaxy.citybreak.com/v2/api/content/language
Query Parameters
Parameter | Description |
---|---|
pointOfSalesId | The point of sales identifier. |
Basket
Basket
Basket calls are the most complicated in the API workflow as they encapsulate the booking process in typical “shopping basket” object that can have many operations performed on it and which has a limited life span, connected as it is to availability/bookability of products, both internal to Citybreak and from external inventories. It is NOT a reservation but products in a basket are “held” for 60 mins from the time of the Availability Search where possible (i.e. where external inventories allow).
Create Basket
curl -X POST
--header 'Accept: application/json'
--header 'apiKey: APIKEY132456789EWOK'
--header 'Accept-Language: en-us' -d '{
"PointOfSalesId": 1234570,
"Currency": "SEK"
}' 'https://galaxy.citybreak.com/v2/api/basket/create'
var r = fetch("https://galaxy.citybreak.com/v2/api/basket/create",
{
method:"POST"
headers: {
"ApiKey:" "APIKEY132456789EWOK",
"Accept": "application/json",
"Accept-Language": "en-US"
},
body: JSON.Stringify({
"PointOfSalesId": 1234570,
"Currency": "SEK"
})
});
Example of response:
{
"BasketId": 12345678,
"Success": true
}
Create a new basket object, you’ll need to preserve this ID in order to process further operations on the basket.
HTTP Request
POST https://galaxy.citybreak.com/v2/api/basket/create
Parameters
Parameter | Description |
---|---|
PointOfSalesId | The point of sales identifier. |
Currency | The currency of the basket |
Create Basket for hybrid checkout in Citybreak Online3
curl -X POST
--header 'Accept: application/json'
--header 'apiKey: APIKEY132456789EWOK'
--header 'Accept-Language: en-us' -d '{
"PointOfSalesId": 1234570,
"Currency": "SEK",
"Online3Session": {
"Id": "abcdefg12345678,
"OnlineId": 123456789
}
}' 'https://galaxy.citybreak.com/v2/api/basket/create'
var r = fetch("https://galaxy.citybreak.com/v2/api/basket/create",
{
method:"POST"
headers: {
"ApiKey:" "APIKEY132456789EWOK",
"Accept": "application/json",
"Accept-Language": "en-US"
},
body: JSON.Stringify({
"PointOfSalesId": 1234570,
"Currency": "SEK",
"Online3Session": {
"Id": "abcdefg12345678,
"OnlineId": 123456789
}
})
});
Example of response:
{
"BasketId": 12345678,
"Success": true
}
This alternative way to create a basket is used when you intend to link the customer basket to a Citybreak Online3 guide for customer details & payments
HTTP Request
POST https://galaxy.citybreak.com/v2/api/basket/create
Parameters
Parameter | Description |
---|---|
PointOfSalesId | The point of sales identifier. |
Currency | The currency of the basket. |
Online3Session.Id | The user session identifier. |
Online3Session.OnlineId | The online3 identifier. |
Delete Basket
curl -X DELETE
--header 'Accept: application/json'
--header 'apiKey: APIKEY132456789EWOK'
--header 'Accept-Language: en-us'
'https://galaxy.citybreak.com/v2/api/basket/delete/{basketId}'
var r = fetch("https://galaxy.citybreak.com/v2/api/basket/delete/{basketId}",
{
method:"DELETE"
headers: {
"ApiKey:" "APIKEY132456789EWOK",
"Accept": "application/json",
"Accept-Language": "en-US"
}
});
Example of response:
true
Delete a basket. This will remove all associated information attached to the basket as well.
HTTP Request
DELETE https://galaxy.citybreak.com/v2/api/basket/delete/{basketId}
Query Parameters
Parameter | Description |
---|---|
basketId | The Id of the basket to delete. |
Get Basket
curl -X GET
--header 'Accept: application/json'
--header 'apiKey: APIKEY132456789EWOK'
--header 'Accept-Language: en-us'
'https://galaxy.citybreak.com/v2/api/basket/{basketId}'
var r = fetch("https://galaxy.citybreak.com/v2/api/basket/{basketId}",
{
method:"GET"
headers: {
"ApiKey:" "APIKEY132456789EWOK",
"Accept": "application/json",
"Accept-Language": "en-US"
}
});
Example of response:
{
"BasketId": 48869100,
"Groups": [
{
"Id": 1136433,
"Name": "Edelbrock Hotell 3",
"Content": {
"PriceFrom": 0,
"Images": [
{
"Uri": "//images.citybreak.com/image.aspx?ImageId=4014876",
"IsMain": true,
"Name": null,
"Copyright": null,
"Description": null
},
{
"Uri": "//images.citybreak.com/image.aspx?ImageId=4014877",
"IsMain": false,
"Name": null,
"Copyright": null,
"Description": null
}
],
"Information": [
{
"Id": 99,
"Name": "Name",
"Value": "Edelbrock Hotell 3"
},
{
"Id": 101,
"Name": "Introduction",
"Value": "Edelbrock Hotell"
},
{
"Id": 102,
"Name": "Description",
"Value": "Edelbrock Hotell!"
},
{
"Id": 100038,
"Name": "Elevator",
"Value": "False"
},
{
"Id": 100163,
"Name": "Reception",
"Value": "False"
}
],
"Categories": null,
"Geos": [],
"Pois": [],
"Position": null
},
"Products": [
{
"BookItemId": 8,
"Addons": [
{
"Id": 9,
"NoUnits": 1,
"IsExtraBed": false,
"Name": null,
"IsDeletable": false,
"Price": {
"Price": 150,
"VatAmount": 30,
"Currency": "SEK"
}
}
],
"Persons": [
{
"Name": "Vuxen",
"No": 1
},
{
"Name": "Barn 0-11",
"No": 1
}
],
"Guests": [
{
"GuestLinkId": 6,
"PriceGroupName": "Vuxen",
"Guest": {
"GuestId": 1,
"NameFirst": "Test",
"NameLast": "User",
"Age": 35,
"Sex": "F",
"Salutation": "Ms"
}
},
{
"GuestLinkId": 7,
"PriceGroupName": "Barn 0-11",
"Guest": {
"GuestId": 2,
"NameFirst": null,
"NameLast": null,
"Age": 0,
"Sex": null,
"Salutation": null
}
}
],
"NoUnits": 1,
"StartDate": "2017-10-14T00:00:00Z",
"EndDate": "2017-10-15T00:00:00Z",
"Content": {
"PriceFrom": null,
"Images": [
{
"Uri": null,
"IsMain": false,
"Name": null,
"Copyright": null,
"Description": null
}
],
"Information": [
{
"Id": 99,
"Name": "Name",
"Value": "Dubbelrum ÖSD"
}
],
"Categories": null,
"Geos": null,
"Pois": null,
"Position": null
},
"Name": "Dubbelrum ÖSD",
"IsDeletable": true,
"Price": {
"Price": 350,
"VatAmount": 5.172413793103448,
"Currency": "SEK"
}
}
],
"Price": {
"Price": 500,
"VatAmount": 35.172413793103445,
"Currency": "SEK"
},
"Position": null
}
],
"OkToBook": true,
"TotalPrice": {
"Price": 500,
"VatAmount": 35.172413793103445,
"Currency": "SEK"
},
"PointOfSalesId": 17692,
"AutoCancellationDate": "9999-12-31T23:59:59.9999999",
"CancellationInsurrances": []
}
Get a basket. This will fetch a Basket along with all associated information attached to the Basket (the example has one booking added to it). This includes the product booked, the total price and VAT, possible cancellation insurances (can be added), OkToBook which will be checked before the Basket can be commited and Guest Information which is a separate entity to the number of people included and is used to track and record customer information (also can be added to the booking item later in the basket process). Of note is the BookItemId in the Products section, it is used to delete the item from the basket.
HTTP Request
GET https://galaxy.citybreak.com/v2/api/basket
Query Parameters
Parameter | Description |
---|---|
basketId | The Id of the basket to get. |
Find basket by session for hybrid checkout in Citybreak Online3
curl -X GET
--header 'Accept: application/json'
--header 'apiKey: APIKEY132456789EWOK'
--header 'Accept-Language: en-us'
'https://galaxy.citybreak.com/v2/api/basket/findByOnline3Session?pointOfSalesId={pointOfSalesId&online3Session={online3Session}&online3GuideId={online3GuideId}'
var r = fetch("https://galaxy.citybreak.com/v2/api/basket/findByOnline3Session?pointOfSalesId={pointOfSalesId&online3Session={online3Session}&online3GuideId={online3GuideId}",
{
method:"GET"
headers: {
"ApiKey:" "APIKEY132456789EWOK",
"Accept": "application/json",
"Accept-Language": "en-US"
}
});
Example of response:
48869100
In Online3 hybrid checkout setups, this locates an existing basket by an Online3 session id. Returns the basket id, if found.
HTTP Request
GET https://galaxy.citybreak.com/v2/api/basket/findByOnline3Session?pointOfSalesId={pointOfSalesId&online3Session={online3Session}&online3GuideId={online3GuideId}
Query Parameters
Parameter | Description |
---|---|
pointOfSalesId | The point of sales identifier. |
online3Session | The online 3 session. |
online3GuideId | The online 3 guide identifier |
Add Booking Item
curl -X PUT
--header 'Accept: application/json'
--header 'apiKey: APIKEY132456789EWOK'
--header 'Accept-Language: en-us'
'https://galaxy.citybreak.com/v2/api/basket/add/accommodation/{basketId}/{searchId}/{bookingKey}'
var r = fetch("https://galaxy.citybreak.com/v2/api/basket/add/accommodation/{basketId}/{searchId}/{bookingKey}",
{
method:"PUT"
headers: {
"ApiKey:" "APIKEY132456789EWOK",
"Accept": "application/json",
"Accept-Language": "en-US"
}
});
Example of response:
true
Add a booking item to the basket, you must first have checked for the Availability of a property or properties and obtained the search Id and the bookingKey of the product you wish to add to the basket.
PUT https://galaxy.citybreak.com/v2/api/basket/add/accommodation
Query Parameters
Parameter | Description |
---|---|
basketId | The Id of the basket. |
searchId | The search Id returned by the Availability Response |
bookingKey | The key of the booking item (product) to add to the basket, found in Availability Response |
Delete Booking Item
curl -X DELETE
--header 'Accept: application/json'
--header 'apiKey: APIKEY132456789EWOK'
--header 'Accept-Language: en-us'
'https://galaxy.citybreak.com/v2/api/basket/deleteItem/{basketId}/{bookItemId}'
var r = fetch("https://galaxy.citybreak.com/v2/api/basket/deleteItem/{basketId}/{bookItemId}",
{
method:"DELETE"
headers: {
"ApiKey:" "APIKEY132456789EWOK",
"Accept": "application/json",
"Accept-Language": "en-US"
}
});
Example of response:
true
Delete a booking item from the basket. In the Get Basket response you can find the bookItemId (this is different to the booking key and is specific to the basket)
HTTP Request
DELETE https://galaxy.citybreak.com/v2/api/basket/deleteItem
Query Parameters
Parameter | Description |
---|---|
basketId | The Id of the basket. |
bookItemId | The Id of the booking item to delete from the basket |
Toggle Cancellation Insurance
curl -X PUT
--header 'Accept: application/json'
--header 'apiKey: APIKEY132456789EWOK'
--header 'Accept-Language: en-us'
'https://galaxy.citybreak.com/v2/api/basket/cancellation/{basketId}/{cancellationId}/{true|false}'
var r = fetch("https://galaxy.citybreak.com/v2/api/basket/cancellation/{basketId}/{cancellationId}/{true|false}",
{
method:"PUT"
headers: {
"ApiKey:" "APIKEY132456789EWOK",
"Accept": "application/json",
"Accept-Language": "en-US"
}
});
Example of response:
no content
If your basket has a set of cancellation insurances you can use this call to add one (true) or switch it off (false)
HTTP Request
PUT https://galaxy.citybreak.com/v2/api/basket/cancellation
Query Parameters
Parameter | Description |
---|---|
basketId | The Id of the basket. |
cancellationId | The Id of the cancellation insurance to toggle |
state | true (added) or false (not added) |
Update Customer Information
curl -X POST
--header 'Content-Type: application/json'
--header 'apiKey: APIKEY132456789EWOK'
--header 'Accept-Language: en-us' -d '{
"NameFirst": "Test",
"NameLast": "User",
"Salutation": "Ms",
"CustomerType": "Private",
"Culture": "en-US",
"Address": {
"StreetAddress1": "Test Road 123",
"PostalCode": "41111",
"City": "Gothenburg",
"CountryCode": "SE"
},
"Email": "testuser%40visit.com",
"PhoneMobile": {
"CountryCode": "46",
"AreaCode": "07",
"Number": "2222222"
}
}' 'https://galaxy.citybreak.com/v2/api/basket/customer/{basketId}'
var r = fetch("https://galaxy.citybreak.com/v2/api/basket/customer/{basketId}",
{
method:"POST"
headers: {
"ApiKey:" "APIKEY132456789EWOK",
"Accept": "application/json",
"Accept-Language": "en-US"
}
body: JSON.Stringify({
"NameFirst": "Test",
"NameLast": "User",
"Salutation": "Ms",
"CustomerType": "Private",
"Culture": "en-US",
"Address": {
"StreetAddress1": "Test Road 123",
"PostalCode": "41111",
"City": "Gothenburg",
"CountryCode": "SE"
},
"Email": "testuser@visit.com",
"PhoneMobile": {
"CountryCode": "46",
"AreaCode": "07",
"Number": "2222222"
}
}
}
});
Example of response:
no content
To commit a Basket you will need to provide customer information. This is fairly standard: name, address, email. phone, etc. for the person conducting the booking (not necessarily the Guests)
HTTP Request
POST https://galaxy.citybreak.com/v2/api/basket/customer
Query Parameters
Parameter | Description |
---|---|
basketId | The Id of the basket. |
Get Customer Information
curl -X GET
--header 'Accept: application/json'
--header 'apiKey: APIKEY132456789EWOK'
--header 'Accept-Language: en-US'
'https://galaxy.testcitybreak.com/v2/api/basket/customer/{basketId}'
var r = fetch("https://galaxy.citybreak.com/v2/api/basket/customer/{basketId}",
{
headers: {
"ApiKey:" "APIKEY132456789EWOK",
"Accept": "application/json",
"Accept-Language": "en-US"
}
});
Example of response:
{
"NameFirst": "Test",
"NameLast": "User",
"Salutation": null,
"CustomerNumber": null,
"CustomerType": 1,
"Culture": "en-US",
"CivicRegistrationNumber": null,
"Company": null,
"CompanyDepartment": null,
"Address": {
"StreetAddress1": "Test Road 123",
"StreetAddress2": null,
"StreetAddress3": null,
"PostalCode": "41111",
"City": "Gothenburg",
"CountryCode": "SE",
"State": null
},
"Email": "testuser@visit.com",
"PhoneHome": {
"CountryCode": null,
"AreaCode": null,
"Number": null
},
"PhoneWork": {
"CountryCode": null,
"AreaCode": null,
"Number": null
},
"PhoneMobile": {
"CountryCode": "46",
"AreaCode": "07",
"Number": "2222222"
}
}
Get currencies available for a given Point of Sale. Availability searches will require a currency for a valid search.
HTTP Request
GET https://galaxy.citybreak.com/v2/api/basket/customer
Query Parameters
Parameter | Description |
---|---|
basketId | The Id of the basket. |
Commit Basket
curl -X POST
--header 'Accept: application/json'
--header 'apiKey: APIKEY132456789EWOK'
--header 'Accept-Language: en-US'
'https://galaxy.citybreak.com/v2/api/basket/commit/{basketId}'
var r = fetch("https://galaxy.citybreak.com/v2/api/basket/commit/{basketId}",
{
method:"POST"
headers: {
"ApiKey:" "APIKEY132456789EWOK",
"Accept": "application/json",
"Accept-Language": "en-US"
}
});
Example of response:
int32
This is the method used to start a commit job for a basket. You only need to provide the Basket Id for this call. As there may be many products from different internal and external providers this is essentially a two step async operation. Once you have commited the basket you can query Commit Status to get the status of the job and the ReservationID and BookingCode if it is completed. Before you may commit a basket, there is some information you must provide first. Add at least one Booking Item and provide Customer Information.
The return value is a job number with which you can check the status of commit
HTTP Request
POST https://galaxy.citybreak.com/v2/api/basket/commit
Query Parameters
Parameter | Description |
---|---|
basketId | The Id of the basket. |
Commit Status
curl -X GET
--header 'Accept: application/json'
--header 'apiKey: APIKEY132456789EWOK'
--header 'Accept-Language: en-US'
'https://galaxy.citybreak.com/v2/api/basket/commit/status/{commitJobId}'
var r = fetch("https://galaxy.citybreak.com/v2/api/basket/commit/status/{commitJobId}",
{
headers: {
"ApiKey:" "APIKEY132456789EWOK",
"Accept": "application/json"
"Accept-Language": "en-US"
}
});
Example of response:
{
"Status": "CompletedOk",
"Subtasks": [
{
"Task": "StartingCommit",
"Status": "CompletedOk",
"ExtraInfo": null
},
{
"Task": "CreatingConfirmations",
"Status": "CompletedOk",
"ExtraInfo": null
},
{
"Task": "CreditCardAction",
"Status": "CompletedOk",
"ExtraInfo": null
},
{
"Task": "CreatingInvoices",
"Status": "NotStarted",
"ExtraInfo": null
},
{
"Task": "CreatingStatistics",
"Status": "NotStarted",
"ExtraInfo": null
},
{
"Task": "FinishingTransaction",
"Status": "CompletedOk",
"ExtraInfo": null
}
],
"ResvversionId": 1234567,
"BookingCode": "EWOK12"
}
Gets the ResvversionId (reservation version id) and BookingCode, important for Reservation calls, and the status of a commit job. Get the commit job id when you make the Commit.
HTTP Request
GET https://galaxy.citybreak.com/v2/api/basket/commit/status
Query Parameters
Parameter | Description |
---|---|
commitJobId | The Id of the commit job returned from Commit Basket |
Add Guest
curl -X POST
--header 'Accept: application/json'
--header 'apiKey: APIKEY132456789EWOK'
--header 'Accept-Language: en-us'
'https://galaxy.citybreak.com/v2/api/basket/guests/add/{basketId}'
var r = fetch("https://galaxy.citybreak.com/v2/api/basket/guests/add/{basketId}",
{
method:"POST"
headers: {
"ApiKey:" "APIKEY132456789EWOK",
"Accept": "application/json",
"Accept-Language": "en-US"
}
body: JSON.Stringify([
{
"GuestId": 1,
"NameFirst": "Test",
"NameLast": "User",
"Age": 35,
"Sex": "F",
"Salutation": "Ms"
}
]
);
Example of response: no content
Returns Response Code 204 if successful. Add a guest to a Booking Item, this is not the same as Customer Information. The Guest ID in the filter must match one in the Basket or be 0 to create a new guest
HTTP Request
GET https://galaxy.citybreak.com/v2/api/basket/guests/add
Query Parameters
Parameter | Description |
---|---|
basketId | The Id of the basket. |
Optional products
Once a product is added to the basket, all mandatory included sub products are also included. There may however be optional products that needs extra attention.
HTTP Request
GET https://galaxy.citybreak.com/v2/api/api/basket/optional/{basketId}/{bookItemId}
See javascript example.
var r = fetch("https://galaxy.citybreak.com/v2/api/api/basket/optional/{basketId}/{bookItemId}",
{
method:"GET"
headers: {
"ApiKey:" "APIKEY132456789EWOK",
"Accept": "application/json",
"Accept-Language": "en-US"
}
);
It could return something like:
{
"Product": {
"BookItemId": 1,
"ContentId": "pt:444365",
"Arrival": "2018-04-01T00:00:00",
"Departure": "2018-04-08T00:00:00",
"Name": "KRYSTALLEN LEILIGHET A603",
"Subproducts": [
{
"Id": 2,
"NoUnits": 1,
"IsExtraBed": false,
"ProductType": 12,
"Name": "Sluttvask",
"IsMandatory": false,
"Price": {
"Price": 1900,
"VatAmount": 228,
"Currency": "NOK"
}
}
],
"Price": {
"Price": 21450,
"VatAmount": 2574,
"Currency": "NOK"
}
},
"OptionalProducts": [
{
"NeedsToSpecifyPricegroups": false,
"NeedsToSpecifyQuantity": true,
"Name": "Sengetøy og håndklær",
"ProducttypeId": 445409,
"BookedProducts": [
{
"Id": 6,
"NoUnits": 1,
"IsExtraBed": false,
"ProductType": 12,
"Name": "Sengetøy og håndklær",
"IsMandatory": false,
"Price": {
"Price": 175,
"VatAmount": 43.75,
"Currency": "NOK"
}
}
],
"AmountType": "Unlimited",
"TemplateArguments": {
"MainProductId": 1,
"OptionalProducttypeId": 445409,
"Config": [
{
"PricegroupName": "Unit",
"IsLocalized": false,
"Price": {
"Price": 175,
"VatAmount": 0,
"Currency": "NOK"
},
"PricegroupId": -1,
"Quantity": 0
}
]
}
},
{
"NeedsToSpecifyPricegroups": false,
"NeedsToSpecifyQuantity": true,
"Name": "Vedsekk (sjekk at enheten har ildsted)",
"ProducttypeId": 456793,
"BookedProducts": [
{
"Id": 5,
"NoUnits": 1,
"IsExtraBed": false,
"ProductType": 12,
"Name": "Vedsekk (sjekk at enheten har ildsted)",
"IsMandatory": false,
"Price": {
"Price": 150,
"VatAmount": 37.5,
"Currency": "NOK"
}
}
],
"AmountType": "Unlimited",
"TemplateArguments": {
"MainProductId": 1,
"OptionalProducttypeId": 456793,
"Config": [
{
"PricegroupName": "Unit",
"IsLocalized": false,
"Price": {
"Price": 150,
"VatAmount": 0,
"Currency": "NOK"
},
"PricegroupId": -1,
"Quantity": 0
}
]
}
},
{
"NeedsToSpecifyPricegroups": false,
"NeedsToSpecifyQuantity": true,
"Name": "Barneseng",
"ProducttypeId": 456758,
"BookedProducts": [],
"AmountType": "Unlimited",
"TemplateArguments": {
"MainProductId": 1,
"OptionalProducttypeId": 456758,
"Config": [
{
"PricegroupName": "Unit",
"IsLocalized": false,
"Price": {
"Price": 175,
"VatAmount": 0,
"Currency": "NOK"
},
"PricegroupId": -1,
"Quantity": 1
}
]
}
},
{
"NeedsToSpecifyPricegroups": false,
"NeedsToSpecifyQuantity": true,
"Name": "Barnestol",
"ProducttypeId": 456740,
"BookedProducts": [],
"AmountType": "Unlimited",
"TemplateArguments": {
"MainProductId": 1,
"OptionalProducttypeId": 456740,
"Config": [
{
"PricegroupName": "Unit",
"IsLocalized": false,
"Price": {
"Price": 175,
"VatAmount": 0,
"Currency": "NOK"
},
"PricegroupId": -1,
"Quantity": 1
}
]
}
}
]
}
You will get back a structure that describes the available sub products for the specific product.
Get the basket and use
basket.Groups[n].Products[p].BookItemId
as the mainProductId.
If NeedsToSpecifyQuantity
is set to true
you can set it to any value between
0 and 50 depending on the number of units you require.
If NeedsToSpecifyQuantity
is set to false
you can set quantity to either
0 or 1 depending on if you would like to include the product or not.
If NeedsToSpecifyPricegroups
is set to true
you need to configure
each price group item with the specified quantity.
Let’s take a look at the templateArgument section:
"TemplateArguments": {
"MainProductId": 1,
"OptionalProducttypeId": 456740,
"Config": [
{
"PricegroupName": "Unit",
"IsLocalized": false,
"Price": {
"Price": 175,
"VatAmount": 0,
"Currency": "NOK"
},
"PricegroupId": -1,
"Quantity": 1
}
]
}
It’s there to help you decide how to configurate the product. Cross reference this with the datatype the post takes, you can see that they are identical on some parts. The price on the outer section is there to tell that the price is valid for the entire configuration. The price in the config section is there to tell the price if it depends on the number of units for the specific price group.
Basically, if the sub product is inlcuded as one per guest, that configuration must be submitted for each guest, also the price is known at that time and presented on the outer section.
In this case the NeedsToSpecifyQuantity
is set and you will have to configure how
many items you would like. The price is then presented in the config item so you
can tell the price depending on the number of units selected.
The PricegroupId
set to minus one represents that the price is not dependent
on pricegroup but on the type Unit, meaning that regardless of the age of the
person associated with the item, the price will be the same.
IsLocalized
tells the consumer if the price group is generated using the
translation of the price group. If set to false
you will have to bring your
own translation when presenting in to the user.
In order to use that configuration you can simply omit some parts:
{
"MainProductId": 1,
"OptionalProducttypeId": 456740,
"Config": [
{
"PricegroupId": -1,
"Quantity": 1
}
]
}
There is a valid configuration object that could be used with the SetOptionalProducts method.
The default values (Quantity) will be set to a positive value if the subproduct is not configured. When configured, the default value would be to remove it.
Set optional product
Set optional products arguments
See javascript example.
var r = fetch("https://galaxy.citybreak.com/v2/api/basket/guests/add/{basketId}",
{
method:"POST"
headers: {
"ApiKey:" "APIKEY132456789EWOK",
"Accept": "application/json",
"Accept-Language": "en-US"
}
body: JSON.Stringify([
{
"MainProductId": 1,
"OptionalProducttypeId": 456793,
"Config": [
{
"PricegroupId": -1,
"Quantity": 3
}
]
},
{
"MainProductId": 1,
"OptionalProducttypeId": 445409,
"Config": [
{
"PricegroupId": -1,
"Quantity": 1
}
]
}
]
);
This will configure the first product to be three and the second to be one. The other two will be removed if configured.
Keep in mind that you must at all times configure the sub products that you would like. For instance if you add one optional sub product and later you would like to configure one more, you must submit the configuration for the existing one in order to keep it. Otherwise it will be removed.
So omitting sub product configurations, means that they should be removed if configured.
Supplier messages
It is possible to send a note to the supplier while acting on the basket.
Get supplier messages
Getting supplier messages
See javascript section.
var r = fetch("https://galaxy.citybreak.com/v2/api/basket/suppliermessage/{basketId}",
{
headers: {
"ApiKey:" "APIKEY132456789EWOK",
"Accept": "application/json"
"Accept-Language": "en-US"
}
});
That will result in a list of available suppliers and the configured messages.
Response of getting supplier messages
[
{
"SupplierName": "HafjellKvitfjell Booking AS - Hytter",
"SupplierId": 54705,
"Message": null
}
]
Set supplier messages
Update the messages by posting to the same url
Update supplier messages
See javascript section.
var r = fetch("https://galaxy.citybreak.com/v2/api/basket/suppliermessage/{basketId}",
{
method:"POST"
headers: {
"ApiKey:" "APIKEY132456789EWOK",
"Accept": "application/json",
"Accept-Language": "en-US"
}
body: JSON.Stringify([
{
"SupplierId": 54705,
"Message": "Will arrive late."
}
]
);
The example will set the message to the supplier. You can update one or more messages to the suppliers with a single post.
Cancellation insurance
If an cancellation insurance is available, you can find a reference in the basket to it.
Cancellation insurance in the basket
/* parts of the basket */
"CancellationInsurrances": [
{
"Name": "Avbestillingsforsikring ",
"Description": "",
"Id": 97,
"CurrentCost": 500,
"Currency": "NOK",
"Selected": false,
"PreSelect": false,
"CanBeChanged": true,
"Introduction": "",
"CancellationInsuranceProducts": []
}
]
You can configure the cancellation insurance by calling
https://galaxy.citybreak.com/v2/api/basket/cancellation/49989888/97/false
Update Cancellation Insurance status
See javascript section.
var r = fetch("https://galaxy.citybreak.com/v2/api/basket/cancellation/{basketId}/{insuranceId}/{state}",
{
method:"PUT"
headers: {
"ApiKey:" "APIKEY132456789EWOK",
"Accept": "application/json",
"Accept-Language": "en-US"
}
);
The state is either true
or false
.
The basket price will reflect the new total.
The insurance is usually based on the types of products that are included in the
basket right now. It could be fixed per booking, fixed per product or a percentage
of the product cost. Hence the CurrentCost
.
Reservation
Reservation
Reservation calls provide information on, and the ability to cancel, bookings that have been commited. The Booking Code is a universal reference for a reservation while the ReservationVersionId will show you the different versions of the booking if things have been changed
GET and POST operations
Get Reservation
curl -X GET
--header 'Accept: application/json'
--header 'apiKey: APIKEY132456789EWOK'
'https://galaxy.citybreak.com/v2/api/reservation/{bookingCode}'
var r = fetch("https://galaxy.citybreak.com/v2/api/reservation/{bookingCode}",
{
headers: {
"ApiKey:" "APIKEY132456789EWOK",
"Accept": "application/json"
}
});
Example of response:
[
{
"BookingCode": "EWOK12",
"ReservationVersionId": 1234567,
"Version": 1,
"Created": "2017-09-27T13:12:54.1938577Z"
},
{
"BookingCode": "EWOK12",
"ReservationVersionId": 1234568,
"Version": 2,
"Created": "2017-09-27T13:14:54.4237553Z"
}
]
Gets all the versions of a booking that have been created with a Booking Code
HTTP Request
GET https://galaxy.citybreak.com/v2/api/reservation
Query Parameters
Parameter | Description |
---|---|
BookingCode | The code representing the reservation returned from Commit Status |
Get Reservation Version
curl -X GET
--header 'Accept: application/json'
--header 'apiKey: APIKEY132456789EWOK'
'https://galaxy.citybreak.com/v2/api/reservation/version/{reservationVersionId}}'
var r = fetch("https://galaxy.citybreak.com/v2/api/reservation/version/{reservationVersionId}",
{
headers: {
"ApiKey:" "APIKEY132456789EWOK",
"Accept": "application/json"
}
});
Example of response:
{
"BookingCode": "EWOK12",
"Version": 1,
"BookingDate": "2017-09-27T13:12:54.1938577Z",
"AutoCancellation": "9999-12-31T23:59:59.9999999",
"Fees": [],
"BookingUser": {
"Id": 113685,
"NameFirst": "Galaxy",
"NameLast": "Api user",
"Email": null
},
"CancellationMessage": null,
"Customer": {
"NameFirst": "Test",
"NameLast": "User",
"Salutation": null,
"CustomerNumber": null,
"CustomerType": 0,
"Culture": null,
"CivicRegistrationNumber": null,
"Company": null,
"CompanyDepartment": null,
"Address": {
"StreetAddress1": "Test Road 123",
"StreetAddress2": null,
"StreetAddress3": null,
"PostalCode": "41111",
"City": "Gothenburg",
"CountryCode": "SE",
"State": null
},
"Email": null,
"PhoneHome": {
"CountryCode": null,
"AreaCode": null,
"Number": null
},
"PhoneWork": {
"CountryCode": null,
"AreaCode": null,
"Number": null
},
"PhoneMobile": {
"CountryCode": "46",
"AreaCode": "07",
"Number": "2222222"
}
},
"ProductGroups": [
{
"Products": [
{
"Id": 3,
"Name": "Dubbelrum ÖSD",
"Price": 350
}
],
"Id": 153663,
"Name": "Edelbrock Hotell"
}
]
}
Gets all the information about a booking by version
HTTP Request
GET https://galaxy.citybreak.com/v2/api/reservation/version
Query Parameters
Parameter | Description |
---|---|
reservationVersionId | The Id for the specific verion of the Reservation |
Get Latest Reservation Version
curl -X GET
--header 'Accept: application/json'
--header 'apiKey: APIKEY132456789EWOK'
'https://galaxy.citybreak.com/v2/api/reservation/latest/{bookingCode}'
var r = fetch("https://galaxy.citybreak.com/v2/api/reservation/latest/{bookingCode}",
{
headers: {
"ApiKey:" "APIKEY132456789EWOK",
"Accept": "application/json"
}
});
Example of response:
{
"BookingCode": "EWOK12",
"Version": 1,
"BookingDate": "2017-09-27T13:12:54.1938577Z",
"AutoCancellation": "9999-12-31T23:59:59.9999999",
"Fees": [],
"BookingUser": {
"Id": 113685,
"NameFirst": "Galaxy",
"NameLast": "Api user",
"Email": null
},
"CancellationMessage": null,
"Customer": {
"NameFirst": "Test",
"NameLast": "User",
"Salutation": null,
"CustomerNumber": null,
"CustomerType": 0,
"Culture": null,
"CivicRegistrationNumber": null,
"Company": null,
"CompanyDepartment": null,
"Address": {
"StreetAddress1": "Test Road 123",
"StreetAddress2": null,
"StreetAddress3": null,
"PostalCode": "41111",
"City": "Gothenburg",
"CountryCode": "SE",
"State": null
},
"Email": null,
"PhoneHome": {
"CountryCode": null,
"AreaCode": null,
"Number": null
},
"PhoneWork": {
"CountryCode": null,
"AreaCode": null,
"Number": null
},
"PhoneMobile": {
"CountryCode": "46",
"AreaCode": "07",
"Number": "2222222"
}
},
"ProductGroups": [
{
"Products": [
{
"Id": 3,
"Name": "Dubbelrum ÖSD",
"Price": 350
}
],
"Id": 153663,
"Name": "Edelbrock Hotell"
}
]
}
Gets all the information about a booking by version
HTTP Request
GET https://galaxy.citybreak.com/v2/api/reservation/latest
Query Parameters
Parameter | Description |
---|---|
BookingCode | The code representing the reservation returned from Commit Status |
Cancel Reservation
curl -X POST
--header 'Accept: application/json'
--header 'apiKey: APIKEY132456789EWOK'
'https://galaxy.citybreak.com/v2/api/reservation/cancel/{bookingCode}'
var r = fetch("https://galaxy.citybreak.com/v2/api/reservation/cancel/{bookingCode}",
{
method:"POST"
headers: {
"ApiKey:" "APIKEY132456789EWOK",
"Accept": "application/json",
}
});
Example of response: int32
This will cancel a reservation. Similarly to commiting a Basket, it reurns an integer. Use this value in Commit Status to see the status of your cancel job
HTTP Request
POST https://galaxy.citybreak.com/v2/api/basket/commit
Query Parameters
Parameter | Description |
---|---|
BookingCode | The code representing the reservation returned from Commit Status |
Get Cancel Information
curl -X GET
--header 'Accept: application/json'
--header 'apiKey: APIKEY132456789EWOK'
'https://galaxy.citybreak.com/v2/api/reservation/cancel/info/{bookingCode}'
var r = fetch("https://galaxy.citybreak.com/v2/api/reservation/cancel/info/{bookingCode}",
{
headers: {
"ApiKey:" "APIKEY132456789EWOK",
"Accept": "application/json"
}
});
Example of response:
{
"BookingCode": "EWOK12",
"NoProducts": 1,
"ReservationVersionId": 1234567,
"LastCancellationDate": "9999-12-31T23:59:59.9999999"
}
After a concellation, get the cancellation info of the booking based on the booking code.
HTTP Request
GET https://galaxy.citybreak.com/v2/api/reservation/cancel/info
Query Parameters
Parameter | Description |
---|---|
BookingCode | The code representing the reservation returned from Commit Status |
Country Code
Country Code
Country Code calls provide information about available country codes for your API key. There are two calls, one to provide all available country codes and one HEAD call to check if a specified country code is supported.
GET and HEAD operations
Country Code
curl -X GET
--header 'Accept: application/json'
--header 'apiKey: APIKEY132456789EWOK'
'https://galaxy.citybreak.com/v2/api/countrycode'
var r = fetch("https://galaxy.citybreak.com/v2/api/countrycode",
{
headers: {
"ApiKey:" "APIKEY132456789EWOK",
"Accept": "application/json"
}
});
Example of response:
[
"SE",
"US"
]
Gets all available country codes for a specified API key.
HTTP Request
GET https://galaxy.citybreak.com/v2/api/countrycode
Check Country Code
curl -X HEAD
--header 'Accept: application/json'
--header 'apiKey: APIKEY132456789EWOK'
'https://galaxy.citybreak.com/v2/api/countrycode/{CountryCode}'
var r = fetch("https://galaxy.citybreak.com/v2/api/countrycode/{CountryCode}",
{
method: "HEAD"
headers: {
"ApiKey:" "APIKEY132456789EWOK",
"Accept": "application/json"
}
});
Example of response:
{}
Returns a 200 status code if country code is supported, otherwise 404.
HTTP Request
HEAD https://galaxy.citybreak.com/v2/api/countrycode/{CountryCode}
Errors
The API uses the following error codes:
Error Code | Meaning |
---|---|
400 | Bad Request – Could not understand your request |
401 | Unauthorized – Your API key is wrong, see Authentication |
404 | Not Found – Could not find what you are looking for |
405 | Method Not Allowed – Method not supported for this request |
500 | Internal Server Error – Server trouble, try again later. If recurring, contact us. |
503 | Service Unavailable – Offline for maintanance. Please try again later. |