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 type. For sales channel types that allow multiple instances, this is always prefixed with type..

label

multi-lingual string

Human-readable name of the sales channel

type

string

Type of the sales channel. Only channels with type api can currently be created through the API.

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",
      "name": {
        "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:
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",
  "name": {
    "en": "Online shop"
  },
  "type": "web",
  "position": 0
}
Parameters:
  • organizer – The slug field of the organizer to fetch

  • identifier – The identifier field of the sales channel to fetch

Status Codes:
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",
  "name": {
    "en": "Custom integration"
  },
  "type": "api",
  "position": 2
}

Example response:

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

{
  "identifier": "api.custom",
  "name": {
    "en": "Custom integration"
  },
  "type": "api",
  "position": 2
}
Parameters:
  • organizer – The slug field of the organizer to create a sales channel for

Status Codes:
PATCH /api/v1/organizers/(organizer)/saleschannels/(identifier)/

Update a sales channel. 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 identifier and type 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",
  "name": {
    "en": "Online shop"
  },
  "type": "web",
  "position": 5
}
Parameters:
  • organizer – The slug field of the organizer to modify

  • identifier – 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 modify

  • identifier – 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.