Tax rules

Resource description

Tax rules specify how tax should be calculated for specific products. Custom taxation rule sets are currently to available via the API.

Field Type Description
id integer Internal ID of the tax rule
name multi-lingual string The tax rules’ name
rate decimal (string) Tax rate in percent
price_includes_tax boolean If true (default), tax is assumed to be included in the specified product price
eu_reverse_charge boolean If true, EU reverse charge rules are applied
home_country string Merchant country (required for reverse charge), can be null or empty string

Changed in version 1.7: This resource has been added.

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

Endpoints

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

Returns a list of all tax rules configured for an event.

Example request:

GET /api/v1/organizers/bigevents/events/sampleconf/taxrules/ 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": {"en": "VAT"},
      "rate": "19.00",
      "price_includes_tax": true,
      "eu_reverse_charge": false,
      "home_country": "DE"
    }
  ]
}
Query Parameters:
 
  • page – The page number in case of a multi-page result set, default is 1
Parameters:
  • organizer – The slug field of a valid organizer
  • event – The slug field of the event to fetch
Status Codes:
GET /api/v1/organizers/(organizer)/events/(event)/taxrules/(id)/

Returns information on one tax rule, identified by its ID.

Example request:

GET /api/v1/organizers/bigevents/events/sampleconf/taxrules/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": {"en": "VAT"},
  "rate": "19.00",
  "price_includes_tax": true,
  "eu_reverse_charge": false,
  "home_country": "DE"
}
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 tax rule to fetch
Status Codes:
POST /api/v1/organizers/(organizer)/events/(event)/taxrules/

Create a new tax rule.

Example request:

POST /api/v1/organizers/bigevents/events/sampleconf/taxrules/ HTTP/1.1
Host: pretix.eu
Accept: application/json, text/javascript
Content-Type: application/json
Content-Length: 166

{
  "name": {"en": "VAT"},
  "rate": "19.00",
  "price_includes_tax": true,
  "eu_reverse_charge": false,
  "home_country": "DE"
}

Example response:

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

{
  "id": 1,
  "name": {"en": "VAT"},
  "rate": "19.00",
  "price_includes_tax": true,
  "eu_reverse_charge": false,
  "home_country": "DE"
}
Parameters:
  • organizer – The slug field of the organizer to create a tax rule for
  • event – The slug field of the event to create a tax rule for
Status Codes:
PATCH /api/v1/organizers/(organizer)/events/(event)/taxrules/(id)/

Update a tax rule. 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.

Example request:

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

{
  "rate": "20.00",
}

Example response:

HTTP/1.1 200 OK
Vary: Accept
Content-Type: text/javascript

{
  "id": 1,
  "name": {"en": "VAT"},
  "rate": "20.00",
  "price_includes_tax": true,
  "eu_reverse_charge": false,
  "home_country": "DE"
}
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 tax rule to modify
Status Codes:
  • 200 OK – no error
  • 400 Bad Request – The tax rule could not be modified due to invalid submitted data.
  • 401 Unauthorized – Authentication failure
  • 403 Forbidden – The requested organizer/event/rule does not exist or you have no permission to change it.
DELETE /api/v1/organizers/(organizer)/events/(event)/taxrules/(id)/

Delete a tax rule. Note that tax rules can only be deleted if they are not in use for any products, settings or orders. If you cannot delete a tax rule, this method will return a 403 status code and you can only discontinue using it everywhere else.

Example request:

DELETE /api/v1/organizers/bigevents/events/sampleconf/taxrules/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 tax rule to delete
Status Codes:
  • 204 No Content – no error
  • 401 Unauthorized – Authentication failure
  • 403 Forbidden – The requested organizer/event/rule does not exist or you have no permission to change it or this tax rule cannot be deleted since it is currently in use.