Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

tte-api-services

Package Overview
Dependencies
Maintainers
0
Versions
76
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

tte-api-services

[Developer portal](https://developer.encore.co.uk/)

  • 1.32.0
  • latest
  • npm
  • Socket score

Version published
Maintainers
0
Created
Source

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
[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
➥ getBasket(reference, [channelId], returnTTId) ⇒ Basket

Get basket by reference Returns: Basket - basket model

ParamType
referencestring
[channelId]string
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
[channelId]string
➥ 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
[channelId]string
➥ 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
[channelId]string

Checkout Service

Checkout Service in the developer portal

checkoutService.create(environment, [checkoutApiUrl], [sourceInformation])

ParamType
environmentEnvironment
[checkoutApiUrl]string
[sourceInformation]SourceInformation
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
[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',
}
➥ confirmBooking(reference, channelId, paymentId, [agentDetails]) ⇒ ApiConfirmBooking

Confirm booking Returns: ApiConfirmBooking - API booking confirmation response

ParamType
referencestring
channelIdstring
paymentIdstring
[agentDetails]ApiConfirmBookingAgentDetails
interface ApiConfirmBookingAgentDetails {
    agentId: string;
    agentPassword: string;
}

Content Service

Content Service in the developer portal

contentService.create(environment, [settings], [sourceInformation])

ParamType
environmentEnvironment
[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>
➥ getProducts([page], [limit]) ⇒ Array<Product>

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

ParamType
[page]number
[limit]number
➥ 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
[orientation]ImageOrientation
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
[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
➥ 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
[affiliateId]string
➥ 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
[pricingApiUrl]string
[sourceInformation]SourceInformation
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
[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>
➥ getSeatAttributes(venueId) ⇒ Array<SeatAttributes>

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

ParamType
venueIdstring
[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

➥ 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
[date]string
➥ getVenueChartByKey(venueChartKey) ⇒ VenueChartType;

Get venue chart Returns: VenueChart; - venue chart model

ParamType
venueChartKeystring

FAQs

Package last updated on 21 Nov 2024

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc