Using npm:
$ npm i tte-api-services
// In Browser:
var { contentService } = require('tte-api-services');
// or
import { contentService } from 'tte-api-services';
// or
import apiServices from 'tte-api-services';
// In Node.js:
var { contentService } = require('tte-api-services/node');
// or
import { contentService } from 'tte-api-services/node';
// or
import apiServices from 'tte-api-services/node';
Usage:
- Import service object
- Call create function to get service methods configured for specific environment
*
All requests in the services methods are asynchronous
**
Params in the square brackets are non-mandatory
Basket Service in the developer portal
Param | Type |
---|---|
environment | Environment |
[settings] | Settings |
[sourceInformation] | SourceInformation |
interface Settings {
basketApiUrl?: string;
}
interface SourceInformation {
sourceName?: string;
sourceVersion?: string;
viewName?: string;
}
- getBasket(reference, [channelId], returnTTId) ⇒ Basket
- createBasket(basketData, returnTTId) ⇒ Basket
- getDeliveries(basketReference, basketItems, [channelId]) ⇒ Array<Delivery>
- setSelectedDelivery(basket, selectedDelivery) ⇒ Basket
- addItems(basket, basketItems, returnTTId) ⇒ Basket
- replaceItems(basket, basketItems, returnTTId) ⇒ Basket
- removeItem(basketReference, itemId, [channelId]) ⇒ Basket
- addPromoCode(basket, promoCode, returnTTId) ⇒ Basket
- removePromoCode(basket, returnTTId) ⇒ Basket
- clearBasket(basketReference, [channelId]) ⇒ Basket
Get basket by reference Returns: Basket - basket model
Param | Type |
---|---|
reference | string |
[channelId] | string |
returnTTId | bool |
Create new basket Returns: Basket - basket model
Param | Type |
---|---|
basketData | RequestBasketData |
returnTTId | bool |
interface RequestBasketData {
channelId: string;
reservations: RequestBasketItemData[];
reference?: string;
checksum?: string;
delivery?: DeliveryData;
createdAt?: string;
expiredAt?: string;
status?: BasketStatus;
coupon?: CouponData;
shopperReference?: string;
shopperCurrency?: string;
exchangeRate?: number;
}
interface RequestBasketItemData {
productId: string;
venueId: string;
quantity: number;
items: RequestSeat[];
date: string; /* date format: 'YYYY-MM-DDTHH:mm:ssZ' */
id?: string;
productName?: string;
productType?: ProductType;
venueName?: string;
adjustedSalePriceInShopperCurrency?: Amount;
faceValueInShopperCurrency?: Amount | null;
adjustmentAmountInShopperCurrency?: Amount;
salePriceInShopperCurrency?: Amount;
feeInShopperCurrency?: Amount | null;
deliveryFeeInShopperCurrency?: Amount | null;
}
interface RequestSeat {
aggregateReference: string;
blockId?: string;
blockName?: string;
row?: string;
number?: string;
locationDescription?: string;
}
interface Amount {
value: number;
currency: string;
decimalPlaces?: number;
}
enum ProductType {
Show = "SHW",
Attraction = "ATT",
Flexitickets = "FLX",
GiftVoucher = "GVC",
Postage = "PST"
}
Get delivery options available for basket Returns: Array<Delivery> - delivery models
Param | Type |
---|---|
basketReference | string |
basketItems | BasketItemsCollection |
[channelId] | string |
Set delivery option Returns: Basket - basket
Param | Type |
---|---|
basket | Basket |
selectedDelivery | DeliveryData |
interface DeliveryData {
method: DeliveryMethod;
charge: Amount;
}
enum DeliveryMethod {
Collection = "collection",
Postage = "postage",
Eticket = "eticket",
Evoucher = "evoucher",
PrintBoxOffice = 'print_box_office',
HandDelivered = 'hand_delivered',
DelayedBarcode = 'delayed_barcode',
Streaming = 'streaming',
Supplier = 'supplier',
}
interface Amount {
value: number;
currency: string;
decimalPlaces?: number;
}
Add item to the basket Returns: Basket - basket
Param | Type |
---|---|
basket | Basket |
basketItems | Array<BasketItemData> |
returnTTId | bool |
interface BasketItemData {
id: string;
productId: string;
productName: string;
productType: ProductType;
venueId: string;
venueName: string;
date: string; /* date format: 'YYYY-MM-DDTHH:mm:ssZ' */
quantity: number;
items: ReservationSeat[];
adjustedSalePriceInShopperCurrency: Amount;
salePriceInShopperCurrency: Amount;
faceValueInShopperCurrency: Amount | null;
adjustmentAmountInShopperCurrency: Amount;
feeInShopperCurrency: Amount | null;
deliveryFeeInShopperCurrency: Amount | null;
linkedReservationId?: number;
seats?: ReservationSeat[];
}
enum ProductType {
Show = "SHW",
Attraction = "ATT",
Flexitickets = "FLX",
GiftVoucher = "GVC",
Postage = "PST"
}
interface ReservationSeat {
aggregateReference: string;
areaId: string;
areaName: string;
row: string;
number: string;
locationDescription: string;
}
interface Amount {
value: number;
currency: string;
decimalPlaces?: number;
}
Replace items in basket with new items Returns: Basket - basket
Param | Type |
---|---|
basket | Basket |
basketItems | Array<BasketItemData> |
returnTTId | bool |
interface BasketItemData {
id: string;
productId: string;
productName: string;
productType: ProductType;
venueId: string;
venueName: string;
date: string; /* date format: 'YYYY-MM-DDTHH:mm:ssZ' */
quantity: number;
items: ReservationSeat[];
adjustedSalePriceInShopperCurrency: Amount;
salePriceInShopperCurrency: Amount;
faceValueInShopperCurrency: Amount | null;
adjustmentAmountInShopperCurrency: Amount;
feeInShopperCurrency: Amount | null;
deliveryFeeInShopperCurrency: Amount | null;
linkedReservationId?: number;
seats?: ReservationSeat[];
}
enum ProductType {
Show = "SHW",
Attraction = "ATT",
Flexitickets = "FLX",
GiftVoucher = "GVC",
Postage = "PST"
}
interface ReservationSeat {
aggregateReference: string;
areaId: string;
areaName: string;
row: string;
number: string;
locationDescription: string;
}
interface Amount {
value: number;
currency: string;
decimalPlaces?: number;
}
Remove item from the basket Returns: Basket - basket
Param | Type |
---|---|
basketReference | string |
itemId | number |
[channelId] | string |
Apply promo code Returns: Basket - basket
Param | Type |
---|---|
basket | Basket |
promoCode | string |
returnTTId | bool |
Remove promo code Returns: Basket - basket
Param | Type |
---|---|
basket | Basket |
returnTTId | bool |
Remove all items from basket Returns: Basket - basket
Param | Type |
---|---|
basketReference | string |
[channelId] | string |
Checkout Service in the developer portal
Param | Type |
---|---|
environment | Environment |
[checkoutApiUrl] | string |
[sourceInformation] | SourceInformation |
interface SourceInformation {
sourceName?: string;
sourceVersion?: string;
viewName?: string;
}
- createOrder(bookingData, [channelId]) ⇒ Order;
- confirmBooking(reference, channelId, paymentId, [agentDetails]) ⇒ ApiConfirmBooking;
create new Order Returns: Order - new order model
Param | Type |
---|---|
bookingData | ApiBookingData |
[channelId] | string |
interface ApiBookingData {
channelId: string;
billingAddress: ApiAddress;
deliveryMethod: ApiDeliveryMethodCheckout;
redirectUrl: string;
reference: string;
shopper: ApiShopper;
origin?: string;
deliveryCharge?: number;
recipientName?: string;
giftVoucherMessage?: string;
hasFlexiTickets?: boolean;
paymentType?: PaymentType;
deliveryAddress?: ApiAddress;
}
type ApiDeliveryMethodCheckout = 'C' | 'E' | 'M';
interface ApiShopper {
firstName: string;
lastName: string;
email?: string;
title?: string;
telephoneNumber?: string;
externalId?: string;
}
interface ApiAddress {
countryCode: string;
line1?: string;
line2?: string;
postalCode?: string;
state?: string;
city?: string;
countryName?: string;
stateOrProvince?: string;
}
enum PaymentType {
Card = 'card',
Amex = 'amex',
Paypal = 'paypal',
Account = 'account',
Alipay = 'alipay',
Wechatpay = 'wechatpay',
}
Confirm booking Returns: ApiConfirmBooking - API booking confirmation response
Param | Type |
---|---|
reference | string |
channelId | string |
paymentId | string |
[agentDetails] | ApiConfirmBookingAgentDetails |
interface ApiConfirmBookingAgentDetails {
agentId: string;
agentPassword: string;
}
Content Service in the developer portal
Param | Type |
---|---|
environment | Environment |
[settings] | Settings |
[sourceInformation] | SourceInformation |
interface Settings {
contentApiUrl?: string;
contentImagesUrl?: string;
}
interface SourceInformation {
sourceName?: string;
sourceVersion?: string;
viewName?: string;
}
- getProducts(page, limit) ⇒ Array<Product>
- getProduct(productId, getContentFromV3) ⇒ Product
- getProductFromV3(productId) ⇒ ProductV3
- getImages(entityType, entityId, orientation) ⇒ Array<Image>
Get list of products Returns: Array<Product> - product models
Param | Type |
---|---|
[page] | number |
[limit] | number |
Get product details Returns: Product - product model
Param | Type |
---|---|
productId | string |
getContentFromV3 | bool |
Get product from V3 details Returns: ProductV3 - product model
Param | Type |
---|---|
productId | string |
Get list of images Returns: Array<Image> - image models
Param | Type |
---|---|
entityType | EntityType |
entityId | string |
[orientation] | ImageOrientation |
enum EntityType {
Products = "products"
}
enum ImageOrientation {
Square = "square",
Landscape = "landscape",
Portrait = "portrait",
Default = "default"
}
Inventory Service in the developer portal
Param | Type |
---|---|
environment | Environment |
[inventoryApiUrl] | string |
[sourceInformation] | SourceInformation |
interface SourceInformation {
sourceName?: string;
sourceVersion?: string;
viewName?: string;
}
- getPerformanceAvailability(affiliateId, productId, quantity, date, time) ⇒ Availability
- getMaxQuantity(productId, [affiliateId]) ⇒ number
- getSummaryAvailability(affiliateId, productId, quantity, fromDate, toDate) ⇒ SummaryAvailability
Get performance availability Returns: Availability - performance availability models
Param | Type |
---|---|
affiliateId | string |
productId | string |
quantity | number |
date | string (YYYYMMDD) |
time | string (HHmm) |
Get max quantity Returns: number - max quantity
Param | Type |
---|---|
productId | string |
[affiliateId] | string |
Get summary availability Returns: SummaryAvailability - summary availability models
Param | Type |
---|---|
affiliateId | string |
productId | string |
quantity | number |
fromDate | string (YYYYMMDD) |
toDate | string (YYYYMMDD) |
Pricing Service in the developer portal
Param | Type |
---|---|
environment | Environment |
[pricingApiUrl] | string |
[sourceInformation] | SourceInformation |
interface SourceInformation {
sourceName?: string;
sourceVersion?: string;
viewName?: string;
}
- getFromPrices(productId) ⇒ Array<FromPrices>
Get list of from prices Returns: Array<FromPrices> - from prices models
Param | Type |
---|---|
productId | string |
Venue Service in the developer portal
Param | Type |
---|---|
environment | Environment |
[venueApiUrl] | string |
[sourceInformation] | SourceInformation |
interface SourceInformation {
sourceName?: string;
sourceVersion?: string;
viewName?: string;
}
- getSeatAttributes(venueId) ⇒ Array<SeatAttributes>
- getSeatAttributesBySeatIds(venueId, seatIdCollection) ⇒ Array<SeatAttributes>
- getDetails(venueId) ⇒ Object<VenueDetails>
- getChartDetails(productId, date) ⇒ Object<ChartDetails>
Get list of seat attributes Returns: Array<SeatAttributes> - seat attribute models
Param | Type |
---|---|
venueId | string |
[performanceDate] | string |
[performanceTime] | string |
performanceDate should have format YYYY-MM-DD, e.g. 2021-12-24 performanceTime should have format HH:MM e.g. 12:30
Get list of seat attributes by seat id Returns: Array<SeatAttributes> - seat attribute models
Param | Type |
---|---|
venueId | string |
seatIdCollection | array |
seatIdCollection should contain array with seat identifier e.g. [STALLS-A13, STALLS-R24]
Get venue details Returns: Object<VenueDetails> - venue details models
Param | Type |
---|---|
venueId | string |
Get chart details Returns: Object<ChartDetails> - chart details models
Param | Type |
---|---|
venueId | string |
[date] | string |
Get venue chart Returns: VenueChart; - venue chart model
Param | Type |
---|---|
venueChartKey | string |