1.31.13 • Published 2 months ago

tte-api-services v1.31.13

Weekly downloads
183
License
-
Repository
-
Last release
2 months ago

TTE JS SDK

Developer portal

Installation

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: 1) Import service object 2) 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

Basket Service in the developer portal

basketService.create(environment, settings, sourceInformation)

ParamType
environmentEnvironment
settingsSettings
sourceInformationSourceInformation
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

➥ getBasket(reference, channelId, returnTTId) ⇒ Basket

Get basket by reference Returns: Basket - basket model

ParamType
referencestring
channelIdstring
returnTTIdbool

➥ createBasket(basketData, returnTTId) ⇒ Basket

Create new basket Returns: Basket - basket model

ParamType
basketDataRequestBasketData
returnTTIdbool
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"
}

➥ getDeliveries(basketReference, basketItems, channelId) ⇒ Array<Delivery>

Get delivery options available for basket Returns: Array<Delivery> - delivery models

ParamType
basketReferencestring
basketItemsBasketItemsCollection
channelIdstring

➥ setSelectedDelivery(basket, selectedDelivery) ⇒ Basket

Set delivery option Returns: Basket - basket

ParamType
basketBasket
selectedDeliveryDeliveryData
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;
}

➥ addItems(basket, basketItems, returnTTId) ⇒ Basket

Add item to the basket Returns: Basket - basket

ParamType
basketBasket
basketItemsArray<BasketItemData>
returnTTIdbool
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;
}

➥ replaceItems(basket, basketItems, returnTTId) ⇒ Basket

Replace items in basket with new items Returns: Basket - basket

ParamType
basketBasket
basketItemsArray<BasketItemData>
returnTTIdbool
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;
}

➥ removeItem(basketReference, itemId, channelId) ⇒ Basket

Remove item from the basket Returns: Basket - basket

ParamType
basketReferencestring
itemIdnumber
channelIdstring

➥ addPromoCode(basket, promoCode, returnTTId) ⇒ Basket

Apply promo code Returns: Basket - basket

ParamType
basketBasket
promoCodestring
returnTTIdbool

➥ removePromoCode(basket, returnTTId) ⇒ Basket

Remove promo code Returns: Basket - basket

ParamType
basketBasket
returnTTIdbool

➥ clearBasket(basketReference, channelId) ⇒ Basket

Remove all items from basket Returns: Basket - basket

ParamType
basketReferencestring
channelIdstring

Checkout Service

Checkout Service in the developer portal

checkoutService.create(environment, checkoutApiUrl, sourceInformation)

ParamType
environmentEnvironment
checkoutApiUrlstring
sourceInformationSourceInformation
interface SourceInformation {
    sourceName?: string;
    sourceVersion?: string;
    viewName?: string;
}
  • createOrder(bookingData, channelId) ⇒ Order;
  • confirmBooking(reference, channelId, paymentId, agentDetails) ⇒ ApiConfirmBooking;

➥ createOrder(bookingData, channelId) ⇒ Order;

create new Order Returns: Order - new order model

ParamType
bookingDataApiBookingData
channelIdstring
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',
}

➥ confirmBooking(reference, channelId, paymentId, agentDetails) ⇒ ApiConfirmBooking

Confirm booking Returns: ApiConfirmBooking - API booking confirmation response

ParamType
referencestring
channelIdstring
paymentIdstring
agentDetailsApiConfirmBookingAgentDetails
interface ApiConfirmBookingAgentDetails {
    agentId: string;
    agentPassword: string;
}

Content Service

Content Service in the developer portal

contentService.create(environment, settings, sourceInformation)

ParamType
environmentEnvironment
settingsSettings
sourceInformationSourceInformation
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>

➥ getProducts(page, limit) ⇒ Array<Product>

Get list of products Returns: Array<Product> - product models

ParamType
pagenumber
limitnumber

➥ getProduct(productId, getContentFromV3) ⇒ Product

Get product details Returns: Product - product model

ParamType
productIdstring
getContentFromV3bool

➥ getProductFromV3(productId) ⇒ ProductV3

Get product from V3 details Returns: ProductV3 - product model

ParamType
productIdstring

➥ getImages(entityType, entityId, orientation) ⇒ Array<Image>

Get list of images Returns: Array<Image> - image models

ParamType
entityTypeEntityType
entityIdstring
orientationImageOrientation
enum EntityType {
    Products = "products"
}

enum ImageOrientation {
    Square = "square",
    Landscape = "landscape",
    Portrait = "portrait",
    Default = "default"
}

Inventory Service

Inventory Service in the developer portal

inventoryService.create(environment, inventoryApiUrl, sourceInformation)

ParamType
environmentEnvironment
inventoryApiUrlstring
sourceInformationSourceInformation
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

➥ getPerformanceAvailability(affiliateId, productId, quantity, date, time) ⇒ Availability

Get performance availability Returns: Availability - performance availability models

ParamType
affiliateIdstring
productIdstring
quantitynumber
datestring (YYYYMMDD)
timestring (HHmm)

➥ getMaxQuantity(productId, affiliateId) ⇒ number

Get max quantity Returns: number - max quantity

ParamType
productIdstring
affiliateIdstring

➥ getSummaryAvailability(affiliateId, productId, quantity, fromDate, toDate) ⇒ SummaryAvailability

Get summary availability Returns: SummaryAvailability - summary availability models

ParamType
affiliateIdstring
productIdstring
quantitynumber
fromDatestring (YYYYMMDD)
toDatestring (YYYYMMDD)

Pricing Service

Pricing Service in the developer portal

pricingService.create(environment, pricingApiUrl, sourceInformation)

ParamType
environmentEnvironment
pricingApiUrlstring
sourceInformationSourceInformation
interface SourceInformation {
    sourceName?: string;
    sourceVersion?: string;
    viewName?: string;
}
  • getFromPrices(productId) ⇒ Array<FromPrices>

➥ getFromPrices(productId) ⇒ Array<FromPrices>

Get list of from prices Returns: Array<FromPrices> - from prices models

ParamType
productIdstring

Venue Service

Venue Service in the developer portal

venueService.create(environment, venueApiUrl, sourceInformation)

ParamType
environmentEnvironment
venueApiUrlstring
sourceInformationSourceInformation
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>

➥ getSeatAttributes(venueId) ⇒ Array<SeatAttributes>

Get list of seat attributes Returns: Array<SeatAttributes> - seat attribute models

ParamType
venueIdstring
performanceDatestring
performanceTimestring

performanceDate should have format YYYY-MM-DD, e.g. 2021-12-24 performanceTime should have format HH:MM e.g. 12:30

➥ getSeatAttributesBySeatIds(venueId, seatIdCollection) ⇒ Array<SeatAttributes>

Get list of seat attributes by seat id Returns: Array<SeatAttributes> - seat attribute models

ParamType
venueIdstring
seatIdCollectionarray

seatIdCollection should contain array with seat identifier e.g. STALLS-A13, STALLS-R24

➥ getDetails(venueId) ⇒ Array<VenueDetails>

Get venue details Returns: Object<VenueDetails> - venue details models

ParamType
venueIdstring

➥ getChartDetails(venueId) ⇒ Array<ChartDetails>

Get chart details Returns: Object<ChartDetails> - chart details models

ParamType
venueIdstring
datestring

➥ getVenueChartByKey(venueChartKey) ⇒ VenueChartType;

Get venue chart Returns: VenueChart; - venue chart model

ParamType
venueChartKeystring
1.31.13

2 months ago

1.31.11

3 months ago

1.31.12

3 months ago

1.31.10

5 months ago

1.31.6

5 months ago

1.31.9

5 months ago

1.31.7

5 months ago

1.31.8

5 months ago

1.31.5

1 year ago

1.31.3

2 years ago

1.31.4

1 year ago

1.31.0-dev.1

2 years ago

1.31.0-dev.2

2 years ago

1.31.1

2 years ago

1.31.2

2 years ago

1.31.0

2 years ago

1.30.6

2 years ago

1.30.7

2 years ago

1.30.6-dev.3

2 years ago

1.30.6-dev.2

2 years ago

1.30.6-dev.1

2 years ago

1.30.6-dev.0

2 years ago

1.30.6-dev.5

2 years ago

1.30.6-dev.4

2 years ago

1.30.3

2 years ago

1.30.4

2 years ago

1.30.5

2 years ago

1.30.2

2 years ago

1.30.0

3 years ago

1.30.1

3 years ago

1.29.0

3 years ago

1.29.1

3 years ago

1.28.0

3 years ago

1.27.0

3 years ago

1.26.0

3 years ago

1.25.0

3 years ago

1.24.0

3 years ago

1.23.0

3 years ago

1.22.1

3 years ago

1.22.0

3 years ago

1.21.1

3 years ago

1.21.0

3 years ago

1.20.0

3 years ago

1.19.0

3 years ago

1.18.1

3 years ago

1.18.0

3 years ago

1.17.0

3 years ago

1.16.1

3 years ago

1.16.0

3 years ago

1.15.1

3 years ago

1.15.0

3 years ago

1.14.0

4 years ago

1.13.0

4 years ago

1.12.0

4 years ago

1.11.0

4 years ago

1.10.0

4 years ago

1.9.0

4 years ago

1.8.0

4 years ago

1.7.2

4 years ago

1.7.1

4 years ago

1.7.0

4 years ago

1.6.0

4 years ago

1.5.0

4 years ago

1.4.1

4 years ago

1.4.0

4 years ago

1.3.0

4 years ago

1.2.0

4 years ago

1.1.0

4 years ago

1.0.6

4 years ago

1.0.5

4 years ago

1.0.4

4 years ago

1.0.3

4 years ago

1.0.2

4 years ago

1.0.1

4 years ago

1.0.0

4 years ago