Seats.io

The seatsio Developer Hub

Welcome to the seatsio developer hub. You'll find comprehensive guides and documentation to help you start working with seatsio as quickly as possible, as well as support if you get stuck. Let's jump right in!

Get Started    

selectBestAvailable

Type: object

Automatically pre-select the best available objects (and deselect already selected objects).

The object you pass in must contain the number of objects to select, either by specifying a plain number, or a number per ticket type. It can have an optional category key or label, to auto select only objects in that category.

This works for seats in rows, seats of tables, whole tables (if 'book whole tables' is enabled for the event) and booths.

General admission areas.

To select 2 objects in any category:

selectBestAvailable: {
    number: 2
}

To select 2 objects in category 'Stalls':

selectBestAvailable: {
    number: 2,
    category: 'Stalls'
}

You can also pass in an array of categories. Suppose you want to select seats in the Stalls or Balcony categories:

selectBestAvailable: {
    number: 2,
    category: ['Stalls', 'Balcony']
}

Ticket types are supported as well. E.g. 2 adult tickets and 3 child tickets in either category ‘Stalls’ or ‘Balcony’:

selectBestAvailable: {
  category: ['Stalls', 'Balcony'],
  ticketTypes: {
    'adult': 2,
    'child': 3
  }
}

Or 2 adult tickets and 3 child tickets in any category:

selectBestAvailable: {
  ticketTypes: {
    'adult': 2,
    'child': 3
  }
}

By default, selecting best available objects clears the current selection. If you want to prevent that, pass in clearSelection: false

selectedObjects: ['A-1', 'A-2'],
selectBestAvailable: {
    number: 5,
    clearSelection: false // select the 5 best available seats in addition to A-1 and A-2
}