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 |
internal_name |
string |
An optional name that is only used in the backend |
rate |
decimal (string) |
Tax rate in percent |
price_includes_tax |
boolean |
If |
eu_reverse_charge |
boolean |
DEPRECATED. If |
home_country |
string |
Merchant country (required for reverse charge), can be
|
keep_gross_if_rate_changes |
boolean |
If |
custom_rules |
object |
Dynamic rules specification. Each list element corresponds to one rule that will be processed in order. The current version of the schema in use can be found here. |
Changed in version 4.6: The internal_name
and keep_gross_if_rate_changes
attributes have been added.
Changed in version 2023.6: The custom_rules
attribute has 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"}, "internal_name": "VAT", "rate": "19.00", "price_includes_tax": true, "eu_reverse_charge": false, "keep_gross_if_rate_changes": false, "custom_rules": null, "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 organizerevent – The
slug
field of the event 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 it.
- 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"}, "internal_name": "VAT", "rate": "19.00", "price_includes_tax": true, "eu_reverse_charge": false, "keep_gross_if_rate_changes": false, "custom_rules": null, "home_country": "DE" }
- Parameters:
organizer – The
slug
field of the organizer to fetchevent – The
slug
field of the event to fetchid – The
id
field of the tax rule to fetch
- Status Codes:
200 OK – no error
401 Unauthorized – Authentication failure
403 Forbidden – The requested organizer/event/rule does not exist or you have no permission to view it.
- 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"}, "internal_name": "VAT", "rate": "19.00", "price_includes_tax": true, "eu_reverse_charge": false, "keep_gross_if_rate_changes": false, "custom_rules": null, "home_country": "DE" }
- Parameters:
organizer – The
slug
field of the organizer to create a tax rule forevent – The
slug
field of the event to create a tax rule for
- Status Codes:
201 Created – no error
400 Bad Request – The tax rule could not be created due to invalid submitted data.
401 Unauthorized – Authentication failure
403 Forbidden – The requested organizer/event does not exist or you have no permission to create tax rules.
- PATCH /api/v1/organizers/(organizer)/events/(event)/taxrules/(id)/¶
Update a tax rule. 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.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"}, "internal_name": "VAT", "rate": "20.00", "price_includes_tax": true, "eu_reverse_charge": false, "keep_gross_if_rate_changes": false, "custom_rules": null, "home_country": "DE" }
- Parameters:
organizer – The
slug
field of the organizer to modifyevent – The
slug
field of the event to modifyid – 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 modifyevent – The
slug
field of the event to modifyid – 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.