API Methods
The following page describes the methods that the user can call from the hub.
For more implementation details and examples, see the Javascript Tutorials seciton.
Browse API
GetVouchers()
Returns the list of vouchers for a given sales channel ID.
| Parameter | Type | Description |
|---|---|---|
| salesChannelId | guid | The Guid for the sales channel |
Response
The response contains an array of ProductModel objects.
Array(41)
0: {catalogueId: "b00c0000-0000-0000-0000-000000001056", name: "Golf Academy 6 x 1 hour lessons", venueName: "Hotel SK Chase", price: {…}, isPrivate: false, …}
1: {catalogueId: "b00c0000-0000-0000-0000-000000001056", name: "Round of Golf for One", venueName: "Hotel SK Chase", price: {…}, isPrivate: false, …}
2: {catalogueId: "b00c0000-0000-0000-0000-000000001056", name: "Round of Golf for One Midweek", venueName: "Hotel SK Chase", price: {…}, isPrivate: false, …}
3: {catalogueId: "b00c0000-0000-0000-0000-000000001054", name: "Gourmet Spring Dinner Celebration Package for Two", venueName: "Hotel SK Chase", price: {…}, isPrivate: false, …}
...
// Sample object of type ProductModel
[{
catalogueId: "b00c0000-0000-0000-0000-000000000152"
detailedDescription: "<p>This £100 gift certificate can be used at the nine participating Rocco Forte hotels in a variety of ways. </p>↵↵<p><strong><em>Before booking your experience, please refer to the Gift Certificate Redemption Guide, either inserted in your gift box or available online at </em></strong><a href="https://roccofortegifts.skchase.com/gift-tc"><strong><em>roccofortegifts.skchase.com/gift-tc</em></strong></a><strong><em> which also explains your certificate's terms and conditions.</em></strong></p>↵"
id: "1eaf0000-0000-0000-0000-000000000570"
images: ["https://p4.skchase.com/media/11696/monetary-final-2.jpg?umbid=29578"]
isPrivate: false
limitedAvailability: null
marketingDescription: "<p>This £100 gift certificate can be used at the nine participating Rocco Forte hotels in a variety of ways. It can either be delivered online or through the post.</p>↵"
name: "£100 Gift Certificate"
parentPath: (4) ["00000000-0000-0000-0000-000000000000", "bead0000-0000-0000-0000-000000001051", "f0010000-0000-0000-0000-000000077424", "b00c0000-0000-0000-0000-000000000152"]
price: {amount: "100.00", currency: "GBP"}
reservationEmail: "reservations@roccofortehotels.com"
reservationPhone: "+44 207 493 60 20"
tags: ["Monetary"]
terms: "<p>Each Rocco Forte gift certificate is protected by a secure ID code. Monetary Gift certificates can only be redeemed once and are valid at all Rocco Forte hotels, with the exception of Hotel Astoria. Monetary Gift certificates may not be exchanged for cash, cannot be replaced if lost, are non-transferable and non-refundable. Monetary vouchers purchased in Euro currency can be redeemed in our UK hotels, the exchange rate will be confirmed by the hotel when the voucher is redeemed. Monetary vouchers purchased in Sterling currency can be redeemed in our European hotels; the exchange rate will be confirmed by the hotel when the voucher is redeemed .The original gift certificate must be presented upon arrival when redeeming the experience. Advance bookings are required and subject to availability. Cancellation of a booking within 24-hours of arrival will void the certificate. Rocco Forte Hotels reserves the right to ask for your credit card details during your stay as a guarantee. Terms & Conditions are subject to change.</p>"
validity: {validMonths: 15}
venueName: "Rocco Forte Gifts"
version: 28495691
}]
Basket API
CreateBasket()
This method starts to track the basket and returns it's current state.
| Parameter | Type | Description |
|---|---|---|
| basketId | guid | The Guid for the current basket |
| salesChannelId | guid | The Guid for the sales channel |
Response
The response contains a BasketModel object that describes the current state of the basket.
// Object of type BasketModel
[{
"basketId": "4f1a3fc4-b501-43f9-be6d-5608f4282b2e",
"basketVersion": 3,
"items": [
{
"lineItemId": "0908a6c8-af48-4ea5-be78-74d1dcdf95f2",
"productId": "1eaf0000-0000-0000-0000-000000004167",
"productName": "Half Spa Day",
"imageUrl": "https://gifts.skchaseadmin.com/Library/hotel/New Browse 2018/pool.jpg",
"personalMessage": null,
"retailPrice": {
"amount": "60.00",
"currency": "GBP"
},
"quotedPrice": {
"amount": "60.00",
"currency": "GBP"
},
"deliveryId": null,
"availableDeliveryOptions": [
"de110000-0000-0000-0000-000000220018",
"de110000-0000-0000-0000-000000220019",
"de110000-0000-0000-0000-000000220016",
"de110000-0000-0000-0000-000000220017",
"de110000-0000-0000-0000-000000220015"
]
},
{
"lineItemId": "6008ab8e-10fb-4ae2-9e18-5861bd5b425c",
"productId": "1eaf0000-0000-0000-0000-000000004154",
"productName": "Round of Golf for One",
"imageUrl": "https://gifts.skchaseadmin.com/Library/hotel/New Browse 2018/Golf-Man-Playing-Golfcopy.jpg",
"personalMessage": null,
"retailPrice": {
"amount": "75.00",
"currency": "GBP"
},
"quotedPrice": {
"amount": "75.00",
"currency": "GBP"
},
"deliveryId": null,
"availableDeliveryOptions": [
"de110000-0000-0000-0000-000000220018",
"de110000-0000-0000-0000-000000220019",
"de110000-0000-0000-0000-000000220016",
"de110000-0000-0000-0000-000000220017",
"de110000-0000-0000-0000-000000220015"
]
}
],
"promoCode": null,
"deliveries": [],
"deliveryOptions": [
{
"deliveryOptionId": "de110000-0000-0000-0000-000000220015",
"name": "UK First Class",
"kind": "Postal",
"retailPrice": {
"amount": "2.95",
"currency": "GBP"
},
"includeCountries": [
"GB"
],
"excludeCountries": null
},
{
"deliveryOptionId": "de110000-0000-0000-0000-000000220017",
"name": "Airmail",
"kind": "Postal",
"retailPrice": {
"amount": "8.00",
"currency": "GBP"
},
"includeCountries": null,
"excludeCountries": [
"GB"
]
},
{
"deliveryOptionId": "de110000-0000-0000-0000-000000220016",
"name": "Special Delivery",
"kind": "Postal",
"retailPrice": {
"amount": "9.95",
"currency": "GBP"
},
"includeCountries": [
"GB"
],
"excludeCountries": null
},
{
"deliveryOptionId": "de110000-0000-0000-0000-000000220018",
"name": "International Signed-for",
"kind": "Postal",
"retailPrice": {
"amount": "13.95",
"currency": "GBP"
},
"includeCountries": null,
"excludeCountries": [
"GB"
]
},
{
"deliveryOptionId": "de110000-0000-0000-0000-000000220019",
"name": "Email",
"kind": "Email",
"retailPrice": {
"amount": "0.00",
"currency": "GBP"
},
"includeCountries": null,
"excludeCountries": null
}
],
"paymentOptions": [
{
"id": "e47b0612-3afb-44a1-9bfa-5ce3d908e3bc",
"kind": "PaymentExpressApplePay"
},
{
"id": "5a87d4e8-277c-4599-8440-4ce3fbba166f",
"kind": "SagePay"
}
]
}]
ResumeShopping()
This method can be called if the user wants to continue to use the basket with an already existing basketId.
| Parameter | Type | Description |
|---|---|---|
| basketId | string | The Guid for the current basket |
| salesChannelId | string | The Guid for the sales channel |
Response
The response contains a BasketModel object that describes the current state of the basket.
AddItem()
This method adds items to the basket.
| Parameter | Type | Description |
|---|---|---|
| productId | string | The Guid of the product that should be added to the basket |
Response
The server sends back a "BasketUpdated" message which contains a BasketModel object in it's latest state.
The items will be added to the Items[] array of the BasketModel. This array stores objects of type ItemModel.
RemoveItems()
This method removes items from the basket. As a parameter, it accepts an array of lineItemIds from ItemModel objects.
| Parameter | Type | Description |
|---|---|---|
| lineItemIds | guid[] | An array of lineItemIds to be removed from the basket |
Response
The server sends back a "BasketUpdated" message which contains a BasketModel object in it's latest state.
The items will be removed from the Items[] array of the BasketModel. This array stores objects of type ItemModel.