wiki:XTS2API

These is the proposed XTS2 API commands.

The XTS2 API stub is /v2

The stub should be followed with a servlet, one of /tickets, /cafe, /money, /baskets or /xts.

"URL invocation" is used for accessing the API, in which every client call on the API is GET with a URL in the format stub/servlet/command?param1=value1&param2=value2&...

The API commands are:

/tickets

  • DONE getshows - get summaries of all shows
  • DONE getshow - get a little more info on a specific show (first and last performance, publicity info)
  • DONE getperformances - get the performances of a show
  • DONE getperformance - get more detail about a performance including ticket counts
  • DONE getprogramme - get info about upcoming shows and their next performances - the website uses this call
  • DONE getnowandnext - get ticket count info about the next n performances - an applet shows this info in the XTS client
  • DONE getticketcounts - get ticket count info for a performance - this is a lightweight version of getperformance which the client uses for updating counts of performances when tickets have been sold or reserved
  • DONE gettickettypes - get the types of tickets that can be sold for a given show
  • DONE holdbacktickets - set the number of "held back" tickets for a performance (for instance, a fringe allocation)

/cafe

  • DONE getstock - get a list of things that are sold by the cafe

/money

  • DONE getpaymenttypes - get accepted payment types for the terminal the call is made from
  • gettakings - get the amount of money taken with a given payment type by a given terminal since a given time

/baskets

  • DONE getbaskets - get a list of named baskets based on filter parameters. The list may be filtered by name, or by a set of properties such as "contains tickets", "isn't closed", "contains food".
  • DONE getbasket - get all of the items in a basket with a given id. The XML should contain item metadata, ie, ticket items should include which performance they're for, payment items should include the payment type.
  • DONE newbasket - create a new anonymous non-persistent basket. Can take a parameter to set when the basket should expire (box office terminal baskets should expire quickly. Online sales baskets should have a longer expiry)
  • DONE touchbasket - bump the expiry on a non-persistent basket
  • DONE savebasket - make the basket persistent. it is set not to autoexpire and is given a name to aid later retrieval.
  • DONE additem - add an item to a basket. An item type indicates which provider (ie, tickets, cafe or baskets) is providing the item. A nested set of parameters are passed to the provider. The provider can then agree or disagree to the addition of the item to the basket (for instance, based on ticket availability, or presence of other items in the basket).
  • DONE moveitem - move an item from one basket to another. Both baskets must be open.
  • DONE removeitem - remove an item from the basket. This is only permitted while the basket is open.
  • DONE closebasket - set the basket as closed, completing the sale. Can only be done if the value of the basket is 0. The jsclient should automatically close baskets after accepting payments that bring the value of the basket to 0.
  • openbasket - reopen a closed basket, allowing addition or removal of items. Reopening a basket would cause the tickets in the basket to be unsold until the basket is closed again, which would allow for refund to the customer. However, refunds are also possible by selling anti-tickets, so perhaps when baskets are closed they should be closed forever.
  • setmetadata - creates a key-value metadata pair associated with a basket. Client software can use metadata for, for instance, verifying bookings
  • getmetadata - returns a dictionary of all key-value pairs associated with a basket.

/xts

  • DONE isadmin - check whether the password provided works as an admin password
  • getstats - get various bits of meta-information about the code and database - shown on the about page
  • report - fetch a takings, performance or show report