Swarmtix Help Center
Tool Reference

swarmtix_ticket_types_create

Adds a ticket type to an event — the product definition buyers choose from, not a sold ticket

swarmtix_ticket_types_create

Adds a ticket type to an event and returns it. A ticket type is the product definition buyers choose from; creating one sells nothing and charges nobody.

When you would reach for it

  • Building out a new draft's tiers — general admission, early bird, student, workshop add-on.
  • Adding a tier to a live event that is selling faster than expected.
  • Creating a free ticket — a price of 0 does it.

Scope

events:write

Calling this twice adds two ticket types with the same name. It is not idempotent. If a call times out, check swarmtix_ticket_types_list before calling again.

Parameters

NameTypeRequiredDefaultDescription
eventstringYesThe event's id (a GUID) or its URL slug.
namestringYesThe name buyers see, for example "General Admission". Up to 500 characters.
pricenumberYesThe price of one ticket in the event's currency. 0 for a free ticket. Up to 1,000,000.
quantityintegerYesHow many of this ticket to put on sale. 1 to 1,000,000.
descriptionstringNoWhat this ticket includes, shown under its name. Up to 4,000 characters.
minimumPerOrderintegerNo1The smallest number of this ticket one order may contain.
maximumPerOrderintegerNo10, or quantity if that is smallerThe largest number of this ticket one order may contain.

Both per-order limits must be between 1 and quantity, and the minimum must not exceed the maximum.

price is rounded to two decimal places. That is what keeps 19.99 from being stored as 19.989999999999998 and reported back with a fractional cent nobody typed.

The sale window is not a parameter

The ticket goes on sale as soon as the event itself is published and stops when the event starts — the same defaults the dashboard produces. Scheduling when money starts changing hands is a decision that stays with a person; set a custom window in the dashboard.

Example call

{
  "name": "swarmtix_ticket_types_create",
  "arguments": {
    "event": "spring-summit-2027",
    "name": "Early Bird",
    "price": 39.5,
    "quantity": 100,
    "description": "All talks and the evening reception. Limited to the first 100.",
    "maximumPerOrder": 4
  }
}

What comes back

The ticket type as stored:

{
  "id": "b7d3e5a1-92c4-4f18-8a6b-3e0f1c7d9a52",
  "eventId": "3b6f81ce-04a2-4d97-b5e8-7c10924af3d6",
  "name": "Early Bird",
  "description": "All talks and the evening reception. Limited to the first 100.",
  "price": 39.5,
  "free": false,
  "quantity": 100,
  "available": 100,
  "minimumPerOrder": 1,
  "maximumPerOrder": 4,
  "onSaleFrom": "2027-01-14T11:02:48",
  "onSaleUntil": "2027-11-03T19:00:00",
  "active": true
}
FieldWhat it is
idThe new ticket type's id
eventIdThe event it was added to
name, descriptionAs stored
priceThe face price, rounded to two decimals
freeWhether this is a free ticket rather than a paid one
quantityHow many were put on sale
availableHow many are still available — equal to quantity on a new type
minimumPerOrder, maximumPerOrderThe per-order limits
onSaleFromWhen sales open — set to the moment the ticket type was created
onSaleUntilWhen sales close — taken from the event's earliest date. Absent when the event has no dates yet, and filled in once it has.
activeWhether the type is switched on

Creating ticket types before setting the schedule is fine and common; onSaleUntil simply stays empty until swarmtix_event_dates_set has run.

free is derived from the price rather than accepted as an argument. A price of 0 makes a free ticket; anything above makes a paid one. Keeping them in step is what stops a ticket priced at zero being reported as a paid one.

What happens when you call it

  1. The event is resolved through the edit gate. The service behind this tool performs no authorization of its own, so that gate is the whole control.
  2. Every argument is validated. The protocol layer publishes the schema and enforces none of it, so on a write path the schema is a suggestion until this step makes it a contract.
  3. The ticket type is created against the event from the gate — never an event id taken from your arguments.
  4. Its remaining availability is seeded from the quantity. Without that step a new ticket type would be on sale with nothing available.
  5. The stored row is read back and returned.

Troubleshooting

"name is not valid: it was empty. Expected the name buyers see for this ticket."

name is required.

"price is not valid: it was -5. Expected an amount from 0 to 1000000."

Prices cannot be negative. Use 0 for a free ticket.

"quantity is not valid: it was 0. Expected a whole number from 1 to 1000000."

At least one ticket must be put on sale.

"maximumPerOrder is not valid: it was 250. Expected a whole number from 1 to 100."

The per-order maximum cannot exceed the quantity on sale. The upper bound in the message is the quantity you sent.

"minimumPerOrder is not valid: it is 5 and maximumPerOrder is 2. Expected a minimum no larger than the maximum."

The two limits contradict each other.

"description is not valid: it is 5200 characters. Expected what this ticket includes, at most 4000 characters."

Shorten the description. It is refused rather than cut — a description silently trimmed is a write you did not ask for and cannot see.

"Event not found, or this connection does not have access to it."

The event does not exist, it belongs to another organisation, or this organizer may read it but not edit it.

"This connection is not authorized for events:write. Reconnect and grant it to use this tool."

Reconnect and approve events:write.

"Swarmtix could not complete this request. Nothing was changed."

The ticket type was not created. Nothing partly applied, so calling again is safe.

Two identical ticket types now exist

Expected after a retry — the tool is not idempotent. Deactivate the spare in the dashboard; there is no delete tool here.

The new type is not on sale yet

It goes on sale when the event is published. A draft event sells nothing, by design.

Use cases

  • Tiering a new event — general, early bird, student, in three calls
  • Free workshop add-onprice: 0
  • Group controlmaximumPerOrder to stop one buyer taking the block
  • Late release — a second tier once the first sells out

On this page