Membership types¶
Resource description¶
The membership type resource contains the following public fields:
Field |
Type |
Description |
|---|---|---|
id |
integer |
Internal ID of the membership type |
name |
multi-lingual string |
Human-readable name of the type |
transferable |
boolean |
Whether a membership of this type can be used by multiple persons |
allow_parallel_usage |
boolean |
Whether a membership of this type can be used for multiple parallel tickets |
max_usages |
integer |
Maximum number of times a membership of this type can be used. |
Endpoints¶
- GET /api/v1/organizers/(organizer)/membershiptypes/¶
Returns a list of all membership types within a given organizer.
Example request:
GET /api/v1/organizers/bigevents/membershiptypes/ 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": 2, "name": { "de": "Wochenkarte", "en": "Week pass" }, "transferable": false, "allow_parallel_usage": false, "max_usages": 7 } ] }
- Query Parameters:
page (integer) – The page number in case of a multi-page result set, default is 1
- Parameters:
organizer – The
slugfield of the organizer to fetch
- Status Codes:
200 OK – no error
401 Unauthorized – Authentication failure
403 Forbidden – The requested organizer does not exist or you have no permission to view this resource.
- GET /api/v1/organizers/(organizer)/membershiptypes/(id)/¶
Returns information on one membership type, identified by its ID.
Example request:
GET /api/v1/organizers/bigevents/membershiptypes/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": { "de": "Wochenkarte", "en": "Week pass" }, "transferable": false, "allow_parallel_usage": false, "max_usages": 7 }
- Parameters:
organizer – The
slugfield of the organizer to fetchid – The
idfield of the membership type to fetch
- Status Codes:
200 OK – no error
401 Unauthorized – Authentication failure
403 Forbidden – The requested organizer does not exist or you have no permission to view this resource.
- POST /api/v1/organizers/(organizer)/membershiptypes/¶
Creates a new membership type
Example request:
POST /api/v1/organizers/bigevents/membershiptypes/ HTTP/1.1 Host: pretix.eu Accept: application/json, text/javascript Content-Type: application/json { "name": { "de": "Wochenkarte", "en": "Week pass" }, "transferable": false, "allow_parallel_usage": false, "max_usages": 7 }
Example response:
HTTP/1.1 201 Created Vary: Accept Content-Type: application/json { "id": 3, "name": { "de": "Wochenkarte", "en": "Week pass" }, "transferable": false, "allow_parallel_usage": false, "max_usages": 7 }
- Parameters:
organizer – The
slugfield of the organizer to create a membership type for
- Status Codes:
201 Created – no error
400 Bad Request – The membership type could not be created due to invalid submitted data.
401 Unauthorized – Authentication failure
403 Forbidden – The requested organizer does not exist or you have no permission to create this resource.
- PATCH /api/v1/organizers/(organizer)/membershiptypes/(id)/¶
Update a membership type. You can also use
PUTinstead ofPATCH. WithPUT, you have to provide all fields of the resource, other fields will be reset to default. WithPATCH, you only need to provide the fields that you want to change.You can change all fields of the resource except the
idfield.Example request:
PATCH /api/v1/organizers/bigevents/membershiptypes/2/ HTTP/1.1 Host: pretix.eu Accept: application/json, text/javascript Content-Type: application/json Content-Length: 94 { "max_usages": 3 }
Example response:
HTTP/1.1 200 OK Vary: Accept Content-Type: application/json { "id": 2, "name": { "de": "Wochenkarte", "en": "Week pass" }, "transferable": false, "allow_parallel_usage": false, "max_usages": 3 }
- Parameters:
organizer – The
slugfield of the organizer to modifyid – The
idfield of the membership type to modify
- Status Codes:
200 OK – no error
400 Bad Request – The membership could not be modified due to invalid submitted data
401 Unauthorized – Authentication failure
403 Forbidden – The requested organizer does not exist or you have no permission to change this resource.
- DELETE /api/v1/organizers/(organizer)/membershiptypes/(id)/¶
Delete a membership type. You can not delete types which have already been used.
Example request:
DELETE /api/v1/organizers/bigevents/membershiptype/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
slugfield of the organizer to modifyid – The
idfield of the type to delete
- Status Codes:
204 No Content – no error
401 Unauthorized – Authentication failure
403 Forbidden – The requested organizer does not exist or you have no permission to delete this resource or the membership type is currently in use.