Quotas

Resource description

Quotas define how many times an item can be sold. The quota resource contains the following public fields:

Field Type Description
id integer Internal ID of the quota
name string The internal name of the quota
size integer The size of the quota or null for unlimited
items list of integers List of item IDs this quota acts on.
variations list of integers List of item variation IDs this quota acts on.
subevent integer ID of the date inside an event series this quota belongs to (or null).

Changed in version 1.10: The write operations POST, PATCH, PUT, and DELETE have been added.

Endpoints

GET /api/v1/organizers/(organizer)/events/(event)/quotas/

Returns a list of all quotas within a given event.

Example request:

GET /api/v1/organizers/bigevents/events/sampleconf/quotas/ HTTP/1.1
Host: pretix.eu
Accept: application/json, text/javascript

Example response:

HTTP/1.1 200 OK
Vary: Accept
Content-Type: application/json

{
  "count": 1,
  "next": null,
  "previous": null,
  "results": [
    {
      "id": 1,
      "name": "Ticket Quota",
      "size": 200,
      "items": [1, 2],
      "variations": [1, 4, 5, 7],
      "subevent": null
    }
  ]
}
Query Parameters:
 
  • page (integer) – The page number in case of a multi-page result set, default is 1
  • ordering (string) – Manually set the ordering of results. Valid fields to be used are id and position. Default: position
  • subevent (integer) – Only return quotas of the sub-event with the given ID
Parameters:
  • organizer – The slug field of the organizer to fetch
  • event – The slug field of the event to fetch
Status Codes:
  • 200 OK – no error
  • 401 Unauthorized – Authentication failure
  • 403 Forbidden – The requested organizer/event does not exist or you have no permission to view this resource.
GET /api/v1/organizers/(organizer)/events/(event)/quotas/(id)/

Returns information on one quota, identified by its ID.

Example request:

GET /api/v1/organizers/bigevents/events/sampleconf/quotas/1/ HTTP/1.1
Host: pretix.eu
Accept: application/json, text/javascript

Example response:

HTTP/1.1 200 OK
Vary: Accept
Content-Type: application/json

{
  "id": 1,
  "name": "Ticket Quota",
  "size": 200,
  "items": [1, 2],
  "variations": [1, 4, 5, 7],
  "subevent": null
}
Parameters:
  • organizer – The slug field of the organizer to fetch
  • event – The slug field of the event to fetch
  • id – The id field of the quota to fetch
Status Codes:
  • 200 OK – no error
  • 401 Unauthorized – Authentication failure
  • 403 Forbidden – The requested organizer/event does not exist or you have no permission to view this resource.
POST /api/v1/organizers/(organizer)/events/(event)/quotas/

Creates a new quota

Example request:

POST /api/v1/organizers/bigevents/events/sampleconf/quotas/ HTTP/1.1
Host: pretix.eu
Accept: application/json, text/javascript
Content: application/json

{
  "name": "Ticket Quota",
  "size": 200,
  "items": [1, 2],
  "variations": [1, 4, 5, 7],
  "subevent": null
}

Example response:

HTTP/1.1 201 Created
Vary: Accept
Content-Type: application/json

{
  "id": 1,
  "name": "Ticket Quota",
  "size": 200,
  "items": [1, 2],
  "variations": [1, 4, 5, 7],
  "subevent": null
}
Parameters:
  • organizer – The slug field of the organizer of the event/item to create a quota for
  • event – The slug field of the event to create a quota for
Status Codes:
PATCH /api/v1/organizers/(organizer)/events/(event)/quotas/(id)/

Update a quota. You can also use PUT instead of PATCH. With PUT, you have to provide all fields of the resource, other fields will be reset to default. With PATCH, you only need to provide the fields that you want to change.

You can change all fields of the resource except the id field.

Example request:

PATCH /api/v1/organizers/bigevents/events/sampleconf/quotas/1/ HTTP/1.1
Host: pretix.eu
Accept: application/json, text/javascript
Content-Type: application/json
Content-Length: 94

{
  "name": "New Ticket Quota",
  "size": 100,
}

Example response:

HTTP/1.1 200 OK
Vary: Accept
Content-Type: application/json

{
  "id": 2,
  "name": "New Ticket Quota",
  "size": 100,
  "items": [
    1,
    2
  ],
  "variations": [
    1,
    2
  ],
  "subevent": null
}
Parameters:
  • organizer – The slug field of the organizer to modify
  • event – The slug field of the event to modify
  • id – The id field of the quota rule to modify
Status Codes:
  • 200 OK – no error
  • 400 Bad Request – The quota could not be modified due to invalid submitted data
  • 401 Unauthorized – Authentication failure
  • 403 Forbidden – The requested organizer/event does not exist or you have no permission to change this resource.
DELETE /api/v1/organizers/(organizer)/events/(event)/quota/(id)/

Delete a quota. Note that if you delete a quota the items the quota acts on might no longer be available for sale.

Example request:

DELETE /api/v1/organizers/bigevents/events/sampleconf/quotas/1/ HTTP/1.1
Host: pretix.eu
Accept: application/json, text/javascript

Example response:

HTTP/1.1 204 No Content
Vary: Accept
Parameters:
  • organizer – The slug field of the organizer to modify
  • event – The slug field of the event to modify
  • id – The id field of the quotas to delete
Status Codes:
GET /api/v1/organizers/(organizer)/events/(event)/quotas/(id)/availability/

Returns availability information on one quota, identified by its ID.

Example request:

GET /api/v1/organizers/bigevents/events/sampleconf/quotas/1/availability/ HTTP/1.1
Host: pretix.eu
Accept: application/json, text/javascript

Example response:

  HTTP/1.1 200 OK
  Vary: Accept
  Content-Type: application/json

  {
    "available": true,
    "available_number": 419,
    "total_size": 1000,
    "pending_orders": 25,
    "paid_orders": 423,
    "cart_positions": 7,
    "blocking_vouchers": 126,
    "waiting_list": 0
}

Note that total_size and available_number are null in case of unlimited quotas.

Parameters:
  • organizer – The slug field of the organizer to fetch
  • event – The slug field of the event to fetch
  • id – The id field of the quota to fetch
Status Codes:
  • 200 OK – no error
  • 401 Unauthorized – Authentication failure
  • 403 Forbidden – The requested organizer/event does not exist or you have no permission to view this resource.