Sales channels¶
Resource description¶
The sales channel resource contains the following public fields:
Field |
Type |
Description |
---|---|---|
identifier |
string |
Internal ID of the sales channel. For sales channel types
that allow only one instance, this is the same as |
label |
multi-lingual string |
Human-readable name of the sales channel |
type |
string |
Type of the sales channel. Only channels with type |
position |
integer |
Position for sorting lists of sales channels |
Endpoints¶
- GET /api/v1/organizers/(organizer)/saleschannels/¶
Returns a list of all sales channels within a given organizer.
Example request:
GET /api/v1/organizers/bigevents/saleschannels/ 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": [ { "identifier": "web", "label": { "en": "Online shop" }, "type": "web", "position": 0 } ] }
- Query Parameters:
page (integer) – The page number in case of a multi-page result set, default is 1
- Parameters:
organizer – The
slug
field 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)/saleschannels/(identifier)/¶
Returns information on one sales channel, identified by its identifier.
Example request:
GET /api/v1/organizers/bigevents/saleschannels/web/ HTTP/1.1 Host: pretix.eu Accept: application/json, text/javascript
Example response:
HTTP/1.1 200 OK Vary: Accept Content-Type: application/json { "identifier": "web", "label": { "en": "Online shop" }, "type": "web", "position": 0 }
- Parameters:
organizer – The
slug
field of the organizer to fetchidentifier – The
identifier
field of the sales channel 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)/saleschannels/¶
Creates a sales channel
Example request:
POST /api/v1/organizers/bigevents/saleschannels/ HTTP/1.1 Host: pretix.eu Accept: application/json, text/javascript Content-Type: application/json { "identifier": "api.custom", "label": { "en": "Custom integration" }, "type": "api", "position": 2 }
Example response:
HTTP/1.1 201 Created Vary: Accept Content-Type: application/json { "identifier": "api.custom", "label": { "en": "Custom integration" }, "type": "api", "position": 2 }
- Parameters:
organizer – The
slug
field of the organizer to create a sales channel for
- Status Codes:
201 Created – no error
400 Bad Request – The sales channel 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)/saleschannels/(identifier)/¶
Update a sales channel. You can also use
PUT
instead 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
identifier
andtype
fields.Example request:
PATCH /api/v1/organizers/bigevents/saleschannels/web/ HTTP/1.1 Host: pretix.eu Accept: application/json, text/javascript Content-Type: application/json Content-Length: 94 { "position": 5 }
Example response:
HTTP/1.1 200 OK Vary: Accept Content-Type: application/json { "identifier": "web", "label": { "en": "Online shop" }, "type": "web", "position": 5 }
- Parameters:
organizer – The
slug
field of the organizer to modifyidentifier – The
identifier
field of the sales channel to modify
- Status Codes:
200 OK – no error
400 Bad Request – The sales channel 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)/saleschannels/(identifier)/¶
Delete a sales channel. You can not delete sales channels which have already been used or which are integral parts of the system.
Example request:
DELETE /api/v1/organizers/bigevents/saleschannels/api.custom/ 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 modifyidentifier – The
identifier
field of the sales channel 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 sales channel is currently in use.