@collectivtech/alana-sdk-js / resources/experience / Experience
Class: Experience
Defined in: src/resources/experience.ts:405
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
Extended by
Constructors
Constructor
new Experience(
apiResponse,context):Experience
Defined in: src/resources/experience.ts:616
Parameters
apiResponse
any
context
Returns
Experience
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.
address?
optionaladdress?:string
Defined in: src/resources/experience.ts:515
The physical address of the experience, unless it's purely online or virtual.
advanceNotice?
optionaladvanceNotice?:ExperienceAdvanceNotice
Defined in: src/resources/experience.ts:571
The advance notice this experience requires, if any.
amenities?
optionalamenities?:string[]
Defined in: src/resources/experience.ts:550
A list of amenities offered by the experience.
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.
availabilities
availabilities:
ExperienceAvailabilityBlock[]
Defined in: src/resources/experience.ts:586
This experience's availability times.
cancellationPolicy?
optionalcancellationPolicy?:string
Defined in: src/resources/experience.ts:532
The experience's cancellation policy, if it has defined a custom policy.
category
category:
ExperienceCategory
Defined in: src/resources/experience.ts:431
The category of experience, such as event, tour, or class.
description?
optionaldescription?:string
Defined in: src/resources/experience.ts:441
A freeform description of the experience.
disclaimer?
optionaldisclaimer?:string
Defined in: src/resources/experience.ts:561
Freeform disclaimer text for the experience as a whole.
duration
duration:
number
Defined in: src/resources/experience.ts:510
The length of the experience, in minutes.
endTime?
optionalendTime?:Date
Defined in: src/resources/experience.ts:527
The end time of the experience.
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.
idealAge?
optionalidealAge?:ExperienceIdealAge
Defined in: src/resources/experience.ts:576
The ideal age range for this experience, if any.
images
images:
string[]
Defined in: src/resources/experience.ts:446
A list of URLs for this experience's images.
likes?
optionallikes?:number
Defined in: src/resources/experience.ts:494
The number of users who have "liked" or "starred" this experience.
location?
optionallocation?:ExperienceLocation
Defined in: src/resources/experience.ts:436
A predefined location for where this experience takes place.
maxGuests
maxGuests:
number
Defined in: src/resources/experience.ts:482
The maximum number of guests allowed on a single purchase for this experience.
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.
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.)
minGuests?
optionalminGuests?:number
Defined in: src/resources/experience.ts:477
The minimum number of guests allowed on a purchase for this experience.
minimumTier?
optionalminimumTier?:number
Defined in: src/resources/experience.ts:566
The minimum membership level required to purchase this experience.
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.
name
name:
string
Defined in: src/resources/experience.ts:415
The displayed name or title of the experience.
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.
petFriendly?
optionalpetFriendly?:boolean
Defined in: src/resources/experience.ts:505
Whether this experience allows pets.
provider?
optionalprovider?:ExperienceProvider
Defined in: src/resources/experience.ts:426
The business or creator who provides this experience.
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.)
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.
startTime?
optionalstartTime?:Date
Defined in: src/resources/experience.ts:522
The start time of the experience.
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)
timezone?
optionaltimezone?:string
Defined in: src/resources/experience.ts:517
transportation?
optionaltransportation?:ExperienceTransportationOptions
Defined in: src/resources/experience.ts:581
The transportation options available for this experience, if any.
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)
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
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
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
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
save()
save():
Promise<Experience>
Defined in: src/resources/experience.ts:813
Save this experience to the ALANA Platform.
Returns
Promise<Experience>
The created experience
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>
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