chart.holdBestAvailable()
Type: function(config)
Returns: Promise<{objects: object[], nextToEachOther?: boolean}>
Holds the best available seats based on the provided configuration. Requires session to be set.
The promise resolves with an object containing:
objects: an array of held objectsnextToEachOther: whether the held objects are next to each other
The promise is rejected when the hold fails (e.g. not enough available seats).
Parameters
The config object supports the following properties:
| Property | Type | Description |
|---|---|---|
number | number | The number of best available seats to hold. Required unless ticketTypes is provided. |
ticketTypes | object | An object mapping ticket type names to quantities (e.g. {adult: 2, child: 1}). Cannot be combined with number. |
categories | string[] | Restrict best available selection to specific categories. Required when using ticketTypes. |
zone | string | Restrict best available selection to a specific zone. |
sections | string[] | Restrict best available selection to specific sections. |
accessibleSeats | number | Number of wheelchair accessible seats needed. Must be less than or equal to the total number of requested seats. |
info
Either number or ticketTypes must be provided, but not both.
Examples
Hold by number
const result = await chart.holdBestAvailable({ number: 2 });
// result.objects: [{id: '...', label: 'A-1', status: 'reservedByToken', ...}, ...]
// result.nextToEachOther: true
Hold by category
const result = await chart.holdBestAvailable({
number: 3,
categories: ['Balcony']
});
Hold by zone
const result = await chart.holdBestAvailable({
number: 3,
zone: 'finishline'
});
Hold by sections
const result = await chart.holdBestAvailable({
number: 2,
sections: ['Section A']
});
Hold by ticket types
const result = await chart.holdBestAvailable({
categories: ['Balcony'],
ticketTypes: {
adult: 2,
child: 1
}
});
When using ticketTypes, you must provide categories, and all specified categories must have pricing configured for all requested ticket types.