Skip to content

@collectivtech/alana-sdk-js


@collectivtech/alana-sdk-js / resources/server/experience / ServerExperience

Class: ServerExperience ​

Defined in: src/resources/server/experience.ts:4

An Experience is a single "gathering" service provided by a business on the ALANA Platform. It may be a trip, tour, event, or anything else that involves activity.

Extends ​

Constructors ​

Constructor ​

new ServerExperience(apiResponse, context): ServerExperience

Defined in: src/resources/server/experience.ts:11

Create a new Server-enabled Experience resource

Parameters ​

apiResponse ​

any

An API response

context ​

ApiContext

The resource's API context

Returns ​

ServerExperience

Overrides ​

Experience.constructor

Properties ​

_context ​

protected _context: ApiContext

Defined in: src/resource.ts:148

The API context for this resource.

Inherited from ​

Experience._context


additionalItems? ​

optional additionalItems?: string[]

Defined in: src/resources/experience.ts:556

A list of miscellaneous notes for the experience that might be helpful for users to know.

Inherited from ​

Experience.additionalItems


address? ​

optional address?: string

Defined in: src/resources/experience.ts:515

The physical address of the experience, unless it's purely online or virtual.

Inherited from ​

Experience.address


advanceNotice? ​

optional advanceNotice?: ExperienceAdvanceNotice

Defined in: src/resources/experience.ts:571

The advance notice this experience requires, if any.

Inherited from ​

Experience.advanceNotice


amenities? ​

optional amenities?: string[]

Defined in: src/resources/experience.ts:550

A list of amenities offered by the experience.

Inherited from ​

Experience.amenities


archived ​

archived: boolean

Defined in: src/resources/experience.ts:421

Whether this experience has been archived to be invisible to most users of the ALANA API.

Inherited from ​

Experience.archived


availabilities ​

availabilities: ExperienceAvailabilityBlock[]

Defined in: src/resources/experience.ts:586

This experience's availability times.

Inherited from ​

Experience.availabilities


cancellationPolicy? ​

optional cancellationPolicy?: string

Defined in: src/resources/experience.ts:532

The experience's cancellation policy, if it has defined a custom policy.

Inherited from ​

Experience.cancellationPolicy


category ​

category: ExperienceCategory

Defined in: src/resources/experience.ts:431

The category of experience, such as event, tour, or class.

Inherited from ​

Experience.category


description? ​

optional description?: string

Defined in: src/resources/experience.ts:441

A freeform description of the experience.

Inherited from ​

Experience.description


disclaimer? ​

optional disclaimer?: string

Defined in: src/resources/experience.ts:561

Freeform disclaimer text for the experience as a whole.

Inherited from ​

Experience.disclaimer


duration ​

duration: number

Defined in: src/resources/experience.ts:510

The length of the experience, in minutes.

Inherited from ​

Experience.duration


endTime? ​

optional endTime?: Date

Defined in: src/resources/experience.ts:527

The end time of the experience.

Inherited from ​

Experience.endTime


id ​

id: string

Defined in: src/resources/experience.ts:410

A unique ID for this experience, which must be used to identify it in all operations.

Inherited from ​

Experience.id


idealAge? ​

optional idealAge?: ExperienceIdealAge

Defined in: src/resources/experience.ts:576

The ideal age range for this experience, if any.

Inherited from ​

Experience.idealAge


images ​

images: string[]

Defined in: src/resources/experience.ts:446

A list of URLs for this experience's images.

Inherited from ​

Experience.images


likes? ​

optional likes?: number

Defined in: src/resources/experience.ts:494

The number of users who have "liked" or "starred" this experience.

Inherited from ​

Experience.likes


location? ​

optional location?: ExperienceLocation

Defined in: src/resources/experience.ts:436

A predefined location for where this experience takes place.

Inherited from ​

Experience.location


maxGuests ​

maxGuests: number

Defined in: src/resources/experience.ts:482

The maximum number of guests allowed on a single purchase for this experience.

Inherited from ​

Experience.maxGuests


memberPrice? ​

optional memberPrice?: number

Defined in: src/resources/experience.ts:460

The member price for this experience. This is usually a discounted price which will be shown to users who are logged in and have an appropriate membership level.

Inherited from ​

Experience.memberPrice


minAge? ​

optional minAge?: number

Defined in: src/resources/experience.ts:500

The minimum age required for guests of this experience. (For example, a wine tour might require its guests to be at least 21.)

Inherited from ​

Experience.minAge


minGuests? ​

optional minGuests?: number

Defined in: src/resources/experience.ts:477

The minimum number of guests allowed on a purchase for this experience.

Inherited from ​

Experience.minGuests


minimumTier? ​

optional minimumTier?: number

Defined in: src/resources/experience.ts:566

The minimum membership level required to purchase this experience.

Inherited from ​

Experience.minimumTier


minPrice? ​

optional minPrice?: number

Defined in: src/resources/experience.ts:472

The minimum price for the experience. If the price is defined as per-guest, this defines a price floor: no matter how many guests, the price will be no less than this value, if set.

Inherited from ​

Experience.minPrice


name ​

name: string

Defined in: src/resources/experience.ts:415

The displayed name or title of the experience.

Inherited from ​

Experience.name


perGuestPricing? ​

optional perGuestPricing?: boolean

Defined in: src/resources/experience.ts:465

Whether the price of the experience is per-guest or for a package as a whole.

Inherited from ​

Experience.perGuestPricing


petFriendly? ​

optional petFriendly?: boolean

Defined in: src/resources/experience.ts:505

Whether this experience allows pets.

Inherited from ​

Experience.petFriendly


provider? ​

optional provider?: ExperienceProvider

Defined in: src/resources/experience.ts:426

The business or creator who provides this experience.

Inherited from ​

Experience.provider


rating? ​

optional rating?: number

Defined in: src/resources/experience.ts:489

The overall rating for the experience, from 1-5 stars. (For "thumbs" systems, a thumbs-up is treated as 5 stars, a thumbs-down as 1 star, and a neutral rating as 3 stars.)

Inherited from ​

Experience.rating


retailPrice? ​

optional retailPrice?: number

Defined in: src/resources/experience.ts:453

The retail price for this experience. This is the price that will be charged to non-members who purchase the experience. If it is not set, then this experience is only available to members.

Inherited from ​

Experience.retailPrice


startTime? ​

optional startTime?: Date

Defined in: src/resources/experience.ts:522

The start time of the experience.

Inherited from ​

Experience.startTime


themes? ​

optional themes?: ExperienceThemeTag[]

Defined in: src/resources/experience.ts:545

A list of theme tags for the experience. These indicate the topics or focus of the experience in user-friendly terms, in a categorized scheme. (e.g., Outdoors > Hiking)

Inherited from ​

Experience.themes


timezone? ​

optional timezone?: string

Defined in: src/resources/experience.ts:517

Inherited from ​

Experience.timezone


transportation? ​

optional transportation?: ExperienceTransportationOptions

Defined in: src/resources/experience.ts:581

The transportation options available for this experience, if any.

Inherited from ​

Experience.transportation


types? ​

optional types?: string[]

Defined in: src/resources/experience.ts:538

A list of "type tags" for the experience, indicating what sort of experience it is. (e.g., business or personal, travel-oriented)

Inherited from ​

Experience.types

Methods ​

checkout() ​

checkout(data, successUrl, cancelUrl): Promise<ExperienceCheckout>

Defined in: src/resources/experience.ts:895

Create a checkout session for the active user purchasing this experience. The result of calling this method is an object with a url string property. The caller MUST redirect the user to this URL to complete the checkout process.

Note that the checkout URL is hosted by Stripe.

Parameters ​

data ​

ExperiencePurchaseOptions

The options for purchasing this experience, such as number of guests

successUrl ​

string

The URL to redirect to after successfully completing checkout

cancelUrl ​

string

The URL to redirect to if the checkout is canceled

Returns ​

Promise<ExperienceCheckout>

A URL and session ID

Inherited from ​

Experience.checkout


coverImage() ​

coverImage(image): Promise<Experience>

Defined in: src/resources/experience.ts:788

Change the cover image for this experience by uploading a new image. The image may be in any common image format (JPG, PNG, GIF, WEBP), and must be no more than 6 MB in size.

The cover image is the primary image associated with an experience, and it will always be returned in APIs or SDK methods for that experience.

Images which violate the ALANA Platform Terms of Service may result in account suspension.

Parameters ​

image ​

File

An image file to be used as the experience's cover image

Returns ​

Promise<Experience>

The updated Experience resource object

Inherited from ​

Experience.coverImage


delete() ​

delete(): Promise<boolean>

Defined in: src/resources/server/experience.ts:63

Delete this experience from the ALANA Platform. This is a soft delete, allowing the experience to be restored at a later date if needed, and preserving records of the experience's purchase history.

Returns ​

Promise<boolean>

true if the operation succeeded


dislike() ​

dislike(): Promise<Experience>

Defined in: src/resources/experience.ts:710

Remove a like from this experience. As the active user, this will remove any like you have previously placed on this experience, also removing the experience from your promotional lists, etc.

If the active user has not already liked this experience, this method has no effect.

Returns ​

Promise<Experience>

The experience

Inherited from ​

Experience.dislike


hide() ​

hide(): Promise<ServerExperience>

Defined in: src/resources/server/experience.ts:23

Hide this experience, removing it from API list operations and access operations by anyone other than the creator or owning business.

This method has no effect on an experience that is already hidden.

Returns ​

Promise<ServerExperience>

An updated Experience resource


like() ​

like(): Promise<Experience>

Defined in: src/resources/experience.ts:687

Like this experience. As the active user, this adds the experience to your list of likes. This allows finding the experience more easily, while also offering opportunities to promote it.

If the active user has already liked this experience, this method has no effect.

Returns ​

Promise<Experience>

The experience

Inherited from ​

Experience.like


purchases() ​

purchases(): Promise<TicketPurchaser[]>

Defined in: src/resources/server/experience.ts:87

List all users who have purchased this experience, and the tickets they have purchased. This will return an array of objects, one for each ticket, containing user data.

For example, if a user purchased 5 tickets for this experience, the array will contain 5 entries for the same user, but with different ticketIndex and ticketId properties, representing individual tickets.

Returns ​

Promise<TicketPurchaser[]>

An array of objects representing each ticket purchased for this experience


save() ​

save(): Promise<Experience>

Defined in: src/resources/experience.ts:813

Save this experience to the ALANA Platform.

Returns ​

Promise<Experience>

The created experience

Inherited from ​

Experience.save


share() ​

share(data): Promise<boolean>

Defined in: src/resources/experience.ts:732

Share an experience with another user. The share originates from the active user, and must include either an email address or phone number for the recipient, as well as a target URL. Additional text is optional, and will replace a generic message if provided.

Parameters ​

data ​

ExperienceShareOptions

The destination and recipient of the share.

Returns ​

Promise<boolean>

Inherited from ​

Experience.share


show() ​

show(): Promise<ServerExperience>

Defined in: src/resources/server/experience.ts:43

Show this experience, allowing it to appear in API list operations again.

This method has no effect on an experience that is not hidden.

Returns ​

Promise<ServerExperience>

An updated Experience resource


tickets() ​

tickets(open?): Promise<Ticket[]>

Defined in: src/resources/experience.ts:759

Get a list of the active user's tickets for this experience. This list may span multiple purchases.

Parameters ​

open? ​

boolean = true

Whether to only include open tickets (default true)

Returns ​

Promise<Ticket[]>

A list of Ticket resource objects

Inherited from ​

Experience.tickets

ALANA™, ALANA Platform™, ALANA Guide™, and ALANA Partner™ are trademarks of Collectiv Technologies Inc.