@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
The resource's API context
Returns
ServerExperience
Overrides
Properties
_context
protected_context:ApiContext
Defined in: src/resource.ts:148
The API context for this resource.
Inherited from
additionalItems?
optionaladditionalItems?: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
address?
optionaladdress?:string
Defined in: src/resources/experience.ts:515
The physical address of the experience, unless it's purely online or virtual.
Inherited from
advanceNotice?
optionaladvanceNotice?:ExperienceAdvanceNotice
Defined in: src/resources/experience.ts:571
The advance notice this experience requires, if any.
Inherited from
amenities?
optionalamenities?:string[]
Defined in: src/resources/experience.ts:550
A list of amenities offered by the experience.
Inherited from
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
availabilities
availabilities:
ExperienceAvailabilityBlock[]
Defined in: src/resources/experience.ts:586
This experience's availability times.
Inherited from
cancellationPolicy?
optionalcancellationPolicy?:string
Defined in: src/resources/experience.ts:532
The experience's cancellation policy, if it has defined a custom policy.
Inherited from
category
category:
ExperienceCategory
Defined in: src/resources/experience.ts:431
The category of experience, such as event, tour, or class.
Inherited from
description?
optionaldescription?:string
Defined in: src/resources/experience.ts:441
A freeform description of the experience.
Inherited from
disclaimer?
optionaldisclaimer?:string
Defined in: src/resources/experience.ts:561
Freeform disclaimer text for the experience as a whole.
Inherited from
duration
duration:
number
Defined in: src/resources/experience.ts:510
The length of the experience, in minutes.
Inherited from
endTime?
optionalendTime?:Date
Defined in: src/resources/experience.ts:527
The end time of the experience.
Inherited from
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
idealAge?
optionalidealAge?:ExperienceIdealAge
Defined in: src/resources/experience.ts:576
The ideal age range for this experience, if any.
Inherited from
images
images:
string[]
Defined in: src/resources/experience.ts:446
A list of URLs for this experience's images.
Inherited from
likes?
optionallikes?:number
Defined in: src/resources/experience.ts:494
The number of users who have "liked" or "starred" this experience.
Inherited from
location?
optionallocation?:ExperienceLocation
Defined in: src/resources/experience.ts:436
A predefined location for where this experience takes place.
Inherited from
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
memberPrice?
optionalmemberPrice?: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
minAge?
optionalminAge?: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
minGuests?
optionalminGuests?:number
Defined in: src/resources/experience.ts:477
The minimum number of guests allowed on a purchase for this experience.
Inherited from
minimumTier?
optionalminimumTier?:number
Defined in: src/resources/experience.ts:566
The minimum membership level required to purchase this experience.
Inherited from
minPrice?
optionalminPrice?: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
name
name:
string
Defined in: src/resources/experience.ts:415
The displayed name or title of the experience.
Inherited from
perGuestPricing?
optionalperGuestPricing?: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
petFriendly?
optionalpetFriendly?:boolean
Defined in: src/resources/experience.ts:505
Whether this experience allows pets.
Inherited from
provider?
optionalprovider?:ExperienceProvider
Defined in: src/resources/experience.ts:426
The business or creator who provides this experience.
Inherited from
rating?
optionalrating?: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
retailPrice?
optionalretailPrice?: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
startTime?
optionalstartTime?:Date
Defined in: src/resources/experience.ts:522
The start time of the experience.
Inherited from
themes?
optionalthemes?: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
timezone?
optionaltimezone?:string
Defined in: src/resources/experience.ts:517
Inherited from
transportation?
optionaltransportation?:ExperienceTransportationOptions
Defined in: src/resources/experience.ts:581
The transportation options available for this experience, if any.
Inherited from
types?
optionaltypes?: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
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
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
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
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
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
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
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
The destination and recipient of the share.
Returns
Promise<boolean>
Inherited from
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