Change object statuses in batch
This endpoint belongs to the priority lane.
This API call allows changing the status for multiple objects in multiple events, in one transaction: either all status changes get applied (in order), or none.
This endpoint can be useful for a number of use cases:
- a shopping basket, in which you allow your customers to select tickets for many events. When the customer confirms the purchase.
- a tool that allows swapping seats (i.e.: releasing some seats, and booking other seats).
- holding seats again after they got booked. Since you cannot hold already booked seats directly, you need to release them first. With this API endpoint, you can release and hold a single seat in one transaction.
- putting up an object for resale, after overriding the season status
- Text
- PHP
- C#
- Java
- Python
- Ruby
- Javascript
- Go
POST https://api-{region}.seatsio.net/events/actions/change-object-status
POST https://api-{region}.seatsio.net/events/actions/change-object-status?expand=objects
// Booking seats
$seatsioClient->events->changeObjectStatusInBatch([
(new StatusChangeRequest())->setEvent("event1")->setObjects(["A-3", "A-5"])->setStatus("booked")),
(new StatusChangeRequest())->setEvent("event2")->setObjects(["B-27"])->setStatus("booked"),
]);
// Holding seats
$seatsioClient->events->changeObjectStatusInBatch([
(new StatusChangeRequest())->setEvent("event1")->setObjects(["A-3", "A-5"])->setStatus("reservedByToken")->setHoldToken("wvXbB9MlHt")),
(new StatusChangeRequest())->setEvent("event2")->setObjects(["B-27"])->setStatus("reservedByToken")->setHoldToken("wvXbB9MlHt")),
]);
// re-holding booked seats
$seatsioClient->events->changeObjectStatusInBatch([
(new StatusChangeRequest())->setEvent("myEvent")->setObjects(["A-3", "A-5"])->setStatus("free"),
(new StatusChangeRequest())->setEvent("myEvent")->setObjects([
["objectId" => "A-3", "ticketType" => "adult"],
["objectId" => "A-5", "ticketType" => "child"]
])->setStatus"reservedByToken")->setHoldToken("wvXbB9MlHt")
]);
// Overriding the season status
$seatsioClient->events->changeObjectStatusInBatch([
(new StatusChangeRequest())
->setType(StatusChangeRequest::$TYPE_OVERRIDE_SEASON_STATUS)
->setEvent("myEvent")
->setObjects(["A-3", "A-5"])
]);
// Using the season status
$seatsioClient->events->changeObjectStatusInBatch([
(new StatusChangeRequest())
->setType(StatusChangeRequest::$TYPE_USE_SEASON_STATUS)
->setEvent("myEvent")
->setObjects(["A-3", "A-5"])
]);
// Booking seats
await Client.Events.ChangeObjectStatusAsync(new[] {
new StatusChangeRequest(eventKey: "event1", objects: new[] {"A-3", "A-5"}, status: "booked"),
new StatusChangeRequest(eventKey: "event2", objects: new[] {"B-27"}, status: "booked"),
});
// Holding seats
await Client.Events.ChangeObjectStatusAsync(new[] {
new StatusChangeRequest(eventKey: "event1", objects: new[] {"A-3", "A-5"}, status: "reservedByToken", holdToken: "wvXbB9MlHt"),
new StatusChangeRequest(eventKey: "event2", objects: new[] {"B-27"}, status: "reservedByToken", holdToken: "wvXbB9MlHt"),
});
// Releasing seats
await Client.Events.ChangeObjectStatusAsync(new[] {
new StatusChangeRequest(type: StatusChangeRequest.RELEASE, eventKey: "event1", objects: new[] {"A-3", "A-5"}),
new StatusChangeRequest(type: StatusChangeRequest.RELEASE, eventKey: "event2", objects: new[] {"B-27"}),
});
// Re-holding booked seats
await Client.Events.ChangeObjectStatusAsync(new[] {
new StatusChangeRequest(eventKey: "myEvent", objects: new[] {"A-3", "A-5"}, "free"),
new StatusChangeRequest(eventKey: "myEvent", objects: new[] {
new ObjectProperties("A-3", "adult"),
new ObjectProperties("A-5", "child")
}, status: "reservedByToken", holdToken: "wvXbB9MlHt"),
});
// Overriding the season status
await Client.Events.ChangeObjectStatusAsync(new[] {
new StatusChangeRequest(type: StatusChangeRequest.OVERRIDE_SEASON_STATUS, eventKey: "event1", objects: new[] {"A-3", "A-5"})
});
// Using the season status
await Client.Events.ChangeObjectStatusAsync(new[] {
new StatusChangeRequest(type: StatusChangeRequest.USE_SEASON_STATUS, eventKey: "event1", objects: new[] {"A-3", "A-5"})
});
// Booking seats
client.events.changeObjectStatus(List.of(
new StatusChangeRequest.Builder().withEventKey("event1").withObjects(List.of("A-3", "A-5")).withStatus("booked"),
new StatusChangeRequest.Builder().withEventKey("event2").withObjects(List.of("B-27").withStatus("booked")
));
// Holding seats
client.events.changeObjectStatus(List.of(
new StatusChangeRequest.Builder().withEventKey("event1").withObjects(List.of("A-3", "A-5")).withStatus("reservedByToken").withHoldToken("wvXbB9MlHt"),
new StatusChangeRequest.Builder().withEventKey("event2").withObjects(List.of("B-27")).withStatus("reservedByToken").withHoldToken("wvXbB9MlHt")
));
// Releasing seats
client.events.changeObjectStatus(List.of(
new StatusChangeRequest.Builder().withType(RELEASE).withEventKey("event1").withObjects(List.of("A-3", "A-5")),
new StatusChangeRequest.Builder().withType(RELEASE).withEventKey("event2").withObjects(List.of("B-27"))
));
// Re-holding booked seats
client.events.changeObjectStatus(List.of(
new StatusChangeRequest.Builder().withEventKey("myEvent").withObjects(List.of("A-3", "A-5")).withStatus("free"),
new StatusChangeRequest.Builder().withEventKey("myEvent").withObjects(List.of(
new ObjectProperties("A-3", "adult"),
new ObjectProperties("A-5", "child")
)).withStatus("reservedByToken").withHoldToken("wvXbB9MlHt")
));
// Overriding the season status
client.events.changeObjectStatus(List.of(
new StatusChangeRequest.Builder().withType(OVERRIDE_SEASON_STATUS).withEventKey("event1").withObjects(List.of("A-3", "A-5"))
));
// Using the season status
));client.events.changeObjectStatus(List.of(
new StatusChangeRequest.Builder().withType(USE_SEASON_STATUS).withEventKey("event1").withObjects(List.of("A-3", "A-5"))
));
# Booking seats
client.events.change_object_status_in_batch([
StatusChangeRequest("event1", ["A-3", "A-5"], "booked"),
StatusChangeRequest("event2", ["B-27"], "booked")
])
# Holding seats
client.events.change_object_status_in_batch([
StatusChangeRequest("event1", ["A-3", "A-5"], "reservedByToken", "wvXbB9MlHt"),
StatusChangeRequest("event2", ["B-27"], "reservedByToken", "wvXbB9MlHt")
])
# Releasing seats
client.events.change_object_status_in_batch([
StatusChangeRequest("event1", ["A-3", "A-5"], type=StatusChangeRequest.RELEASE),
StatusChangeRequest("event2", ["B-27"], type=StatusChangeRequest.RELEASE)
])
# Re-holding booked seats
client.events.change_object_status_in_batch([
StatusChangeRequest("myEvent", ["A-3", "A-5"], "free"),
StatusChangeRequest("myEvent", [ObjectProperties("A-3", ticket_type="adult"), ObjectProperties("A-5", ticket_type="child")], "reservedByToken", "wvXbB9MlHt")
])
# Overriding the season status
client.events.change_object_status_in_batch([
StatusChangeRequest("event1", ["A-3", "A-5"], type=StatusChangeRequest.OVERRIDE_SEASON_STATUS)
])
# Using the season status
client.events.change_object_status_in_batch([
StatusChangeRequest("event1", ["A-3", "A-5"], type=StatusChangeRequest.USE_SEASON_STATUS)
])
# Booking seats
client.events.change_object_status_in_batch([
{ :event => 'event1', :objects => ['A-3', 'A-5'], :status => 'booked'},
{ :event => 'event2', :objects => ['B-27'], :status => 'booked'}
])
# Holding seats
client.events.change_object_status_in_batch([
{ :event => 'event1', :objects => ['A-3', 'A-5'], :status => 'reservedByToken', :holdToken => 'wvXbB9MlHt'},
{ :event => 'event2', :objects => ['B-27'], :status => 'reservedByToken', :holdToken => 'wvXbB9MlHt'}
])
# Releasing seats
client.events.change_object_status_in_batch([
{ :type => Seatsio::StatusChangeType::RELEASE, :event => 'event1', :objects => ['A-3', 'A-5']},
{ :type => Seatsio::StatusChangeType::RELEASE, :event => 'event2', :objects => ['B-27']}
])
# Re-holding booked seats
client.events.change_object_status_in_batch([
{ :event => 'myEvent', :objects => ['A-3', 'A-5'], :status => 'free'},
{ :event => 'myEvent', :objects => [
{:objectId => 'A-3', :ticketType => 'adult'},
{:objectId => 'A-5', :ticketType => 'child'}],
:status => 'reservedByToken', :holdToken => 'wvXbB9MlHt'}
])
# Overriding the season status
client.events.change_object_status_in_batch([
{ :type => Seatsio::StatusChangeType::OVERRIDE_SEASON_STATUS, :event => 'event1', :objects => ['A-3', 'A-5']}
])
# Using the season status
client.events.change_object_status_in_batch([
{ :type => Seatsio::StatusChangeType::USE_SEASON_STATUS, :event => 'event1', :objects => ['A-3', 'A-5']}
])
// Booking seats
client.events.changeObjectStatus([
new StatusChangeRequest().withEventKey('event1').withObjects(['A-3', 'A-5']).withStatus('booked'),
new StatusChangeRequest().withEventKey('event2').withObjects(['B-27']).withStatus('booked')
]);
// Holding seats
client.events.changeObjectStatus([
new StatusChangeRequest().withEventKey('event1').withObjects(['A-3', 'A-5']).withStatus('reservedByToken').withHoldToken('wvXbB9MlHt'),
new StatusChangeRequest().withEventKey('event2').withObjects(['B-27']).withStatus('reservedByToken').withHoldToken('wvXbB9MlHt')
]);
// Releasing seats
client.events.changeObjectStatus([
new StatusChangeRequest().withType(StatusChangeRequest.TYPE_RELEASE).withEventKey('event1').withObjects(['A-3', 'A-5']),
new StatusChangeRequest().withType(StatusChangeRequest.TYPE_RELEASE).withEventKey('event2').withObjects(['B-27'])
]);
// Re-holding booked seats
client.events.changeObjectStatus([
new StatusChangeRequest().withEventKey('myEvent').withObjects(['A-3', 'A-5']).withStatus('free').withHoldToken('wvXbB9MlHt'),
new StatusChangeRequest().withEventKey('myEvent').withObjects([
{objectId: 'A-3', ticketType: 'adult'},
{objectId: 'A-5', ticketType: 'child'}
]).withStatus('reservedByToken').withHoldToken('wvXbB9MlHt')
]);
// Overriding the season status
client.events.changeObjectStatus([
new StatusChangeRequest().withType(StatusChangeRequest.TYPE_OVERRIDE_SEASON_STATUS).withEventKey('event1').withObjects(['A-3', 'A-5'])
]);
// Using the season status
client.events.changeObjectStatus([
new StatusChangeRequest().withType(StatusChangeRequest.TYPE_USE_SEASON_STATUS).withEventKey('event1').withObjects(['A-3', 'A-5'])
]);
// Booking seats
result, err := client.Events.ChangeObjectStatusInBatch(
events.StatusChangeInBatchParams{
Event: "event1",
StatusChanges: events.StatusChanges{
Status: events.BOOKED,
Objects: []events.ObjectProperties{
{ObjectId: "A-3"},
{ObjectId: "A-5"},
},
},
},
events.StatusChangeInBatchParams{
Event: "event2",
StatusChanges: events.StatusChanges{
Status: events.BOOKED,
Objects: []events.ObjectProperties{{ObjectId: "B-27"}},
},
},
)
// Holding seats
result, err := client.Events.ChangeObjectStatusInBatch(
events.StatusChangeInBatchParams{
Event: "event1",
StatusChanges: events.StatusChanges{
Status: events.HELD,
HoldToken: "wvXbB9MlHt",
Objects: []events.ObjectProperties{
{ObjectId: "A-3"},
{ObjectId: "A-5"},
},
},
},
events.StatusChangeInBatchParams{
Event: "event2",
StatusChanges: events.StatusChanges{
Status: events.HELD,
HoldToken: "wvXbB9MlHt",
Objects: []events.ObjectProperties{{ObjectId: "B-27"}},
},
},
)
// Releasing seats
result, err := client.Events.ChangeObjectStatusInBatch(
events.StatusChangeInBatchParams{
Event: "event1",
StatusChanges: events.StatusChanges{
Type: events.RELEASE,
Objects: []events.ObjectProperties{
{ObjectId: "A-3"},
{ObjectId: "A-5"},
},
},
},
events.StatusChangeInBatchParams{
Event: "event2",
StatusChanges: events.StatusChanges{
Type: events.RELEASE,
Objects: []events.ObjectProperties{{ObjectId: "B-27"}},
},
},
)
// Re-holding booked seats
result, err := client.Events.ChangeObjectStatusInBatch(
events.StatusChangeInBatchParams{
Event: "myEvent",
StatusChanges: events.StatusChanges{
Status: events.FREE,
HoldToken: "wvXbB9MlHt",
Objects: []events.ObjectProperties{
{ObjectId: "A-3"},
{ObjectId: "A-5"},
},
},
},
events.StatusChangeInBatchParams{
Event: "myEvent",
StatusChanges: events.StatusChanges{
Status: events.HELD,
HoldToken: "wvXbB9MlHt",
Objects: []events.ObjectProperties{
{ObjectId: "A-3", TicketType: "adult"},
{ObjectId: "A-5", TicketType: "child"},
},
},
},
)
// Overriding the season status
result, err := client.Events.ChangeObjectStatusInBatch(
events.StatusChangeInBatchParams{
Event: "event1",
StatusChanges: events.StatusChanges{
Type: events.OVERRIDE_SEASON_STATUS,
Objects: []events.ObjectProperties{
{ObjectId: "A-3"},
{ObjectId: "A-5"},
},
},
},
)
// Using the season status
result, err := client.Events.ChangeObjectStatusInBatch(
events.StatusChangeInBatchParams{
Event: "event1",
StatusChanges: events.StatusChanges{
Type: events.USE_SEASON_STATUS,
Objects: []events.ObjectProperties{
{ObjectId: "A-3"},
{ObjectId: "A-5"},
},
},
},
)
All seats (or tables, booths or GA places) passed in to this API will be considered as "used seats" for pricing purposes, if you set their status to non-free.
This is different from changing the object status in an event group, in the sense that not all events need to be linked to the same chart. The events can be completely independent.
This API call only supports events that belong to the same workspace. It's not possible to book objects in events across workspaces in a single API call. To do so, you'll need to make multiple calls.
Request
// Booking objects
{
statusChanges: [
{ event: 'event1', objects: ['A-3', 'A-5'], status: 'booked' },
{ event: 'event2', objects: ['B-27'], status: 'booked' }
]
}
// Holding objects
{
statusChanges: [
{
event: 'event1',
objects: ['A-3', 'A-5'],
status: 'reservedByToken',
holdToken: 'wvXbB9MlHt'
},
...
]
}
// Releasing objects
{
statusChanges: [
{
event: 'event1',
objects: ['A-3', 'A-5'],
type: 'RELEASE'
},
...
]
}
// Overriding the season status
{
statusChanges: [
{
event: 'event1',
objects: ['A-3', 'A-5'],
type: 'OVERRIDE_SEASON_STATUS'
},
...
]
}
// Using the season status
{
statusChanges: [
{
event: 'event1',
objects: ['A-3', 'A-5'],
type: 'USE_SEASON_STATUS'
},
...
]
}
The request is a JSON object with one property: statusChanges
. This is an array of JSON objects, with the following properties:
- event: the event key
- objects: an array of object IDs, or an array of object ids and ticket types
- type (optional): the type of action to perform. Possible values are
CHANGE_STATUS_TO
(the default),RELEASE
,OVERRIDE_SEASON_STATUS
orUSE_SEASON_STATUS
. - status: the status you want to assign to an object. Cannot be passed in if
type
isRELEASE
. Must be passed in iftype
isCHANGE_STATUS_TO
. - holdToken (optional): the hold token must be supplied when you hold a seat (status
reservedByToken
), or want to make sure that the same person that made the hold confirms his booking. - keepExtraData (optional): boolean. If set to true, the existing extra data doesn't get cleared
- orderId (optional): an order id, defined by yourself, to be able to retrieve the objects IDs per order later on.
- channelKeys (optional): an array of strings, i.e. the channel keys of the channel(s) to which the objects belong. If omitted, and the objects are assigned to a channel, the request will fail with 400 Bad request. Pass in
NO_CHANNEL
as channel key to allow objects without a channel. - ignoreChannels (optional): if true, the status change call succeeds, even if the objects belong to a channel. Useful inside a back office application, in which the user is allowed to book any seat - no matter the channel. Should not be used in combination with
channelKeys
. - allowedPreviousStatuses (optional): an array of strings, i.e. the list of statuses that the objects must be in. The request will fail with a 400 Bad Request if any of the objects have a status not present in the
allowedPreviousStatuses
list. Cannot be used in combination withrejectedPreviousStatuses
. - rejectedPreviousStatuses (optional): an array of strings, i.e. the list of statuses that the objects cannot be in. The request will fail with a 400 Bad Request if any of the objects have a status that is present in the
rejectedPreviousStatuses
list. Cannot be used in combination withallowedPreviousStatuses
.
A note on type
There are two types of actions you can perform: CHANGE_STATUS_TO
(the default) and RELEASE
.
CHANGE_STATUS_TO
is the default action, and is used to change the status of objects in the event group to a specific status:free
,resale
,booked
or a custom status.RELEASE
is used to release objects in the event group: in that case you don't specify a specific status, but the objects will get the selectable status it had previously (eitherfree
orresale
).
Response
Without expand=objects 204 - No Content
With expand=objects 200 - ok
- results: JSON array that contains detailed information about the objects. results[0] corresponds to the first status change request you passed in, results[1] to the second one etc.
{
results: [
{
"objects": {
"A-3": {
"label": "A-3",
...
},
"A-5": {
"label": "A-5",
...
}
}
},
{
"objects": {
"B-27": {
"label": "B-27",
...
}
}
}
]
}