Compare commits
13 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
a021ac6ecc | ||
|
|
e6eb4945a7 | ||
|
|
44b7b15b3e | ||
|
|
022ca8ad6c | ||
|
|
5e37fbb4ef | ||
|
|
5049da95b5 | ||
|
|
c78ca8bc00 | ||
|
|
c40e0bfdff | ||
|
|
ea79ebf105 | ||
|
|
d4b9906638 | ||
|
|
c1c4133ac6 | ||
|
|
ff3e127648 | ||
|
|
970b861947 |
24
.gitattributes
vendored
@@ -1,17 +1,13 @@
|
|||||||
src/pretix/static/fontawesome/* linguist-vendored
|
src/static/fontawesome/* linguist-vendored
|
||||||
src/pretix/static/lightbox/* linguist-vendored
|
src/static/lightbox/* linguist-vendored
|
||||||
src/pretix/static/typeahead/* linguist-vendored
|
src/static/typeahead/* linguist-vendored
|
||||||
src/pretix/static/moment/* linguist-vendored
|
src/static/moment/* linguist-vendored
|
||||||
src/pretix/static/datetimepicker/* linguist-vendored
|
src/static/datetimepicker/* linguist-vendored
|
||||||
src/pretix/static/colorpicker/* linguist-vendored
|
src/static/colorpicker/* linguist-vendored
|
||||||
src/pretix/static/fileupload/* linguist-vendored
|
src/static/fileupload/* linguist-vendored
|
||||||
src/pretix/static/vuejs/* linguist-vendored
|
src/static/charts/* linguist-vendored
|
||||||
src/pretix/static/select2/* linguist-vendored
|
src/pretix/plugins/ticketoutputpdf/static/pretixplugins/ticketoutputpdf/fabric.* linguist-vendored
|
||||||
src/pretix/static/charts/* linguist-vendored
|
src/pretix/plugins/ticketoutputpdf/static/pretixplugins/ticketoutputpdf/pdf.* linguist-vendored
|
||||||
src/pretix/static/rrule/* linguist-vendored
|
|
||||||
src/pretix/static/iframeresizer/* linguist-vendored
|
|
||||||
src/pretix/static/pdfjs/* linguist-vendored
|
|
||||||
src/pretix/static/fabric/* linguist-vendored
|
|
||||||
|
|
||||||
# Denote all files that are truly binary and should not be modified.
|
# Denote all files that are truly binary and should not be modified.
|
||||||
*.eot binary
|
*.eot binary
|
||||||
|
|||||||
@@ -8,8 +8,6 @@ tests:
|
|||||||
- XDG_CACHE_HOME=/cache bash .travis.sh tests
|
- XDG_CACHE_HOME=/cache bash .travis.sh tests
|
||||||
tags:
|
tags:
|
||||||
- python3
|
- python3
|
||||||
except:
|
|
||||||
- pypi
|
|
||||||
pypi:
|
pypi:
|
||||||
stage: release
|
stage: release
|
||||||
script:
|
script:
|
||||||
@@ -19,16 +17,12 @@ pypi:
|
|||||||
- pip install -U pip wheel setuptools
|
- pip install -U pip wheel setuptools
|
||||||
- XDG_CACHE_HOME=/cache pip3 install -Ur src/requirements.txt -r src/requirements/dev.txt -r src/requirements/py34.txt
|
- XDG_CACHE_HOME=/cache pip3 install -Ur src/requirements.txt -r src/requirements/dev.txt -r src/requirements/py34.txt
|
||||||
- cd src
|
- cd src
|
||||||
- python setup.py sdist
|
|
||||||
- pip install dist/pretix-*.tar.gz
|
|
||||||
- python -m pretix migrate
|
|
||||||
- python -m pretix check
|
|
||||||
- python setup.py sdist upload
|
- python setup.py sdist upload
|
||||||
- python setup.py bdist_wheel upload
|
- python setup.py bdist_wheel upload
|
||||||
tags:
|
tags:
|
||||||
- python3
|
- python3
|
||||||
only:
|
only:
|
||||||
- pypi
|
- release
|
||||||
artifacts:
|
artifacts:
|
||||||
paths:
|
paths:
|
||||||
- src/dist/
|
- src/dist/
|
||||||
|
|||||||
21
.travis.sh
@@ -25,32 +25,19 @@ if [ "$1" == "doctests" ]; then
|
|||||||
cd doc
|
cd doc
|
||||||
make doctest
|
make doctest
|
||||||
fi
|
fi
|
||||||
if [ "$1" == "doc-spelling" ]; then
|
|
||||||
XDG_CACHE_HOME=/cache pip3 install -Ur doc/requirements.txt
|
|
||||||
cd doc
|
|
||||||
make spelling
|
|
||||||
if [ -s _build/spelling/output.txt ]; then
|
|
||||||
exit 1
|
|
||||||
fi
|
|
||||||
fi
|
|
||||||
if [ "$1" == "translation-spelling" ]; then
|
|
||||||
XDG_CACHE_HOME=/cache pip3 install -Ur src/requirements/dev.txt
|
|
||||||
cd src
|
|
||||||
potypo
|
|
||||||
fi
|
|
||||||
if [ "$1" == "tests" ]; then
|
if [ "$1" == "tests" ]; then
|
||||||
pip3 install -r src/requirements.txt -Ur src/requirements/dev.txt -r src/requirements/py34.txt pytest-xdist
|
pip3 install -r src/requirements.txt -Ur src/requirements/dev.txt -r src/requirements/py34.txt
|
||||||
cd src
|
cd src
|
||||||
python manage.py check
|
python manage.py check
|
||||||
make all compress
|
make all compress
|
||||||
py.test --reruns 5 -n 2 tests
|
py.test --rerun 5 tests
|
||||||
fi
|
fi
|
||||||
if [ "$1" == "tests-cov" ]; then
|
if [ "$1" == "tests-cov" ]; then
|
||||||
pip3 install -r src/requirements.txt -Ur src/requirements/dev.txt -r src/requirements/py34.txt
|
pip3 install -r src/requirements.txt -Ur src/requirements/dev.txt -r src/requirements/py34.txt
|
||||||
cd src
|
cd src
|
||||||
python manage.py check
|
python manage.py check
|
||||||
make all compress
|
make all compress
|
||||||
coverage run -m py.test --reruns 5 tests && codecov
|
coverage run -m py.test --rerun 5 tests && codecov
|
||||||
fi
|
fi
|
||||||
if [ "$1" == "plugins" ]; then
|
if [ "$1" == "plugins" ]; then
|
||||||
pip3 install -r src/requirements.txt -Ur src/requirements/dev.txt -r src/requirements/py34.txt
|
pip3 install -r src/requirements.txt -Ur src/requirements/dev.txt -r src/requirements/py34.txt
|
||||||
@@ -63,7 +50,7 @@ if [ "$1" == "plugins" ]; then
|
|||||||
cd pretix-cartshare
|
cd pretix-cartshare
|
||||||
python setup.py develop
|
python setup.py develop
|
||||||
make
|
make
|
||||||
py.test --reruns 5 tests
|
py.test --rerun 5 tests
|
||||||
popd
|
popd
|
||||||
|
|
||||||
fi
|
fi
|
||||||
|
|||||||
46
.travis.yml
@@ -12,41 +12,29 @@ services:
|
|||||||
- postgresql
|
- postgresql
|
||||||
matrix:
|
matrix:
|
||||||
include:
|
include:
|
||||||
|
- python: 3.4
|
||||||
|
env: JOB=tests PRETIX_CONFIG_FILE=tests/sqlite.cfg
|
||||||
|
- python: 3.5
|
||||||
|
env: JOB=tests PRETIX_CONFIG_FILE=tests/sqlite.cfg
|
||||||
- python: 3.6
|
- python: 3.6
|
||||||
env: JOB=tests PRETIX_CONFIG_FILE=tests/travis_sqlite.cfg
|
env: JOB=tests PRETIX_CONFIG_FILE=tests/sqlite.cfg
|
||||||
|
- python: 3.4
|
||||||
|
env: JOB=tests PRETIX_CONFIG_FILE=tests/travis_mysql.cfg
|
||||||
|
- python: 3.5
|
||||||
|
env: JOB=tests PRETIX_CONFIG_FILE=tests/travis_mysql.cfg
|
||||||
- python: 3.6
|
- python: 3.6
|
||||||
env: JOB=tests-cov PRETIX_CONFIG_FILE=tests/travis_postgres.cfg
|
env: JOB=tests PRETIX_CONFIG_FILE=tests/travis_mysql.cfg
|
||||||
|
- python: 3.4
|
||||||
|
env: JOB=tests PRETIX_CONFIG_FILE=tests/travis_postgres.cfg
|
||||||
|
- python: 3.5
|
||||||
|
env: JOB=tests PRETIX_CONFIG_FILE=tests/travis_postgres.cfg
|
||||||
|
- python: 3.6
|
||||||
|
env: JOB=tests PRETIX_CONFIG_FILE=tests/travis_postgres.cfg
|
||||||
- python: 3.6
|
- python: 3.6
|
||||||
env: JOB=style
|
env: JOB=style
|
||||||
- python: 3.4
|
|
||||||
env: JOB=tests PRETIX_CONFIG_FILE=tests/travis_sqlite.cfg
|
|
||||||
- python: 3.5
|
|
||||||
env: JOB=tests PRETIX_CONFIG_FILE=tests/travis_sqlite.cfg
|
|
||||||
- python: 3.4
|
|
||||||
env: JOB=tests PRETIX_CONFIG_FILE=tests/travis_mysql.cfg
|
|
||||||
- python: 3.5
|
|
||||||
env: JOB=tests PRETIX_CONFIG_FILE=tests/travis_mysql.cfg
|
|
||||||
- python: 3.6
|
|
||||||
env: JOB=tests PRETIX_CONFIG_FILE=tests/travis_mysql.cfg
|
|
||||||
- python: 3.4
|
|
||||||
env: JOB=tests PRETIX_CONFIG_FILE=tests/travis_postgres.cfg
|
|
||||||
- python: 3.5
|
|
||||||
env: JOB=tests PRETIX_CONFIG_FILE=tests/travis_postgres.cfg
|
|
||||||
- python: 3.6
|
|
||||||
env: JOB=tests PRETIX_CONFIG_FILE=tests/travis_postgres.cfg
|
|
||||||
- python: 3.6
|
- python: 3.6
|
||||||
env: JOB=plugins
|
env: JOB=plugins
|
||||||
- python: 3.6
|
- python: 3.6
|
||||||
env: JOB=doc-spelling
|
env: JOB=tests-cov
|
||||||
- python: 3.6
|
|
||||||
env: JOB=translation-spelling
|
|
||||||
addons:
|
addons:
|
||||||
postgresql: "9.4"
|
postgresql: "9.4"
|
||||||
apt:
|
|
||||||
packages:
|
|
||||||
- enchant
|
|
||||||
- myspell-de-de
|
|
||||||
- aspell-en
|
|
||||||
branches:
|
|
||||||
except:
|
|
||||||
- /^weblate-.*/
|
|
||||||
|
|||||||
@@ -1,5 +0,0 @@
|
|||||||
Code of Conduct
|
|
||||||
===============
|
|
||||||
|
|
||||||
We have a [Code of Conduct](https://docs.pretix.eu/en/latest/development/contribution/codeofconduct.html)
|
|
||||||
in place that applies to all project contributions, including issues, pull requests, etc.
|
|
||||||
@@ -3,7 +3,7 @@ FROM python:3.6
|
|||||||
RUN apt-get update && \
|
RUN apt-get update && \
|
||||||
apt-get install -y git libxml2-dev libxslt1-dev python-dev python-virtualenv locales \
|
apt-get install -y git libxml2-dev libxslt1-dev python-dev python-virtualenv locales \
|
||||||
libffi-dev build-essential python3-dev zlib1g-dev libssl-dev gettext libpq-dev \
|
libffi-dev build-essential python3-dev zlib1g-dev libssl-dev gettext libpq-dev \
|
||||||
default-libmysqlclient-dev libmemcached-dev libjpeg-dev supervisor nginx sudo \
|
libmysqlclient-dev libmemcached-dev libjpeg-dev supervisor nginx sudo \
|
||||||
--no-install-recommends && \
|
--no-install-recommends && \
|
||||||
apt-get clean && \
|
apt-get clean && \
|
||||||
rm -rf /var/lib/apt/lists/* && \
|
rm -rf /var/lib/apt/lists/* && \
|
||||||
|
|||||||
@@ -40,14 +40,6 @@ Contributing
|
|||||||
If you want to contribute to pretix, please read the `developer documentation`_
|
If you want to contribute to pretix, please read the `developer documentation`_
|
||||||
in our documentation. If you have any further questions, please do not hesitate to ask!
|
in our documentation. If you have any further questions, please do not hesitate to ask!
|
||||||
|
|
||||||
.. image:: https://translate.pretix.eu/widgets/pretix/-/pretix/multi-blue.svg
|
|
||||||
:target: https://translate.pretix.eu/engage/pretix/
|
|
||||||
|
|
||||||
Code of Conduct
|
|
||||||
---------------
|
|
||||||
We have a `Code of Conduct`_ in place that applies to all project contributions,
|
|
||||||
including issues, pull requests, etc.
|
|
||||||
|
|
||||||
License
|
License
|
||||||
-------
|
-------
|
||||||
The code in this repository is published under the terms of the Apache License.
|
The code in this repository is published under the terms of the Apache License.
|
||||||
@@ -58,6 +50,5 @@ AUTHORS file for a list of all the awesome folks who contributed to this project
|
|||||||
|
|
||||||
.. _installation guide: https://docs.pretix.eu/en/latest/admin/installation/index.html
|
.. _installation guide: https://docs.pretix.eu/en/latest/admin/installation/index.html
|
||||||
.. _developer documentation: https://docs.pretix.eu/en/latest/development/index.html
|
.. _developer documentation: https://docs.pretix.eu/en/latest/development/index.html
|
||||||
.. _Code of Conduct: https://docs.pretix.eu/en/latest/development/contribution/codeofconduct.html
|
|
||||||
.. _pretix.eu: https://pretix.eu
|
.. _pretix.eu: https://pretix.eu
|
||||||
.. _blog: https://pretix.eu/about/en/blog/
|
.. _blog: https://pretix.eu/about/en/blog/
|
||||||
|
|||||||
@@ -2,8 +2,7 @@
|
|||||||
cd /pretix/src
|
cd /pretix/src
|
||||||
export DJANGO_SETTINGS_MODULE=production_settings
|
export DJANGO_SETTINGS_MODULE=production_settings
|
||||||
export DATA_DIR=/data/
|
export DATA_DIR=/data/
|
||||||
export HOME=/pretix
|
NUM_WORKERS=10
|
||||||
export NUM_WORKERS=$((2 * $(nproc --all)))
|
|
||||||
|
|
||||||
if [ ! -d /data/logs ]; then
|
if [ ! -d /data/logs ]; then
|
||||||
mkdir /data/logs;
|
mkdir /data/logs;
|
||||||
|
|||||||
@@ -23,7 +23,6 @@ autostart=true
|
|||||||
autorestart=true
|
autorestart=true
|
||||||
priority=5
|
priority=5
|
||||||
user=pretixuser
|
user=pretixuser
|
||||||
environment=HOME=/pretix
|
|
||||||
|
|
||||||
[program:pretixtask]
|
[program:pretixtask]
|
||||||
command=/usr/local/bin/pretix taskworker
|
command=/usr/local/bin/pretix taskworker
|
||||||
|
|||||||
@@ -175,9 +175,3 @@ pseudoxml:
|
|||||||
$(SPHINXBUILD) -b pseudoxml $(ALLSPHINXOPTS) $(BUILDDIR)/pseudoxml
|
$(SPHINXBUILD) -b pseudoxml $(ALLSPHINXOPTS) $(BUILDDIR)/pseudoxml
|
||||||
@echo
|
@echo
|
||||||
@echo "Build finished. The pseudo-XML files are in $(BUILDDIR)/pseudoxml."
|
@echo "Build finished. The pseudo-XML files are in $(BUILDDIR)/pseudoxml."
|
||||||
|
|
||||||
spelling:
|
|
||||||
$(SPHINXBUILD) -b spelling $(ALLSPHINXOPTS) $(BUILDDIR)/spelling
|
|
||||||
@echo
|
|
||||||
@echo "Spelling check finished, look at the results in " \
|
|
||||||
"$(BUILDDIR)/spelling/output.txt."
|
|
||||||
|
|||||||
36
doc/_themes/pretix_theme/static/css/pretix.css
vendored
@@ -6063,39 +6063,3 @@ url('../opensans_regular_macroman/OpenSans-Regular-webfont.svg#open_sansregular'
|
|||||||
white-space: normal;
|
white-space: normal;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
img.screenshot, a.screenshot img {
|
|
||||||
box-shadow: 0 4px 18px 0 rgba(0,0,0,0.1), 0 6px 20px 0 rgba(0,0,0,0.09);
|
|
||||||
}
|
|
||||||
|
|
||||||
/* Changes */
|
|
||||||
.versionchanged {
|
|
||||||
background: #e7f2fa;
|
|
||||||
padding: 12px;
|
|
||||||
line-height: 24px;
|
|
||||||
margin-bottom: 24px;
|
|
||||||
-webkit-font-smoothing: antialiased;
|
|
||||||
}
|
|
||||||
.versionmodified {
|
|
||||||
background: #6ab0de;
|
|
||||||
font-weight: bold;
|
|
||||||
display: block;
|
|
||||||
color: #fff;
|
|
||||||
margin: -12px;
|
|
||||||
padding: 6px 12px;
|
|
||||||
margin-bottom: 12px;
|
|
||||||
font-family: inherit;
|
|
||||||
}
|
|
||||||
.versionmodified:before {
|
|
||||||
font-family: "FontAwesome";
|
|
||||||
display: inline-block;
|
|
||||||
font-style: normal;
|
|
||||||
font-weight: normal;
|
|
||||||
line-height: 1;
|
|
||||||
text-decoration: inherit;
|
|
||||||
content: "";
|
|
||||||
margin-right: 4px;
|
|
||||||
}
|
|
||||||
.versionchanged p:last-child {
|
|
||||||
margin-bottom: 0;
|
|
||||||
}
|
|
||||||
|
|||||||
@@ -2,8 +2,6 @@
|
|||||||
|
|
||||||
.. _`config`:
|
.. _`config`:
|
||||||
|
|
||||||
.. spelling:: Galera
|
|
||||||
|
|
||||||
Configuration file
|
Configuration file
|
||||||
==================
|
==================
|
||||||
|
|
||||||
@@ -12,10 +10,9 @@ at the following locations. It will try to read the file from the specified path
|
|||||||
the following order. The file that is found *last* will override the settings from
|
the following order. The file that is found *last* will override the settings from
|
||||||
the files found before.
|
the files found before.
|
||||||
|
|
||||||
1. ``PRETIX_CONFIG_FILE`` environment variable
|
1. ``/etc/pretix/pretix.cfg``
|
||||||
2. ``/etc/pretix/pretix.cfg``
|
2. ``~/.pretix.cfg``
|
||||||
3. ``~/.pretix.cfg``
|
3. ``pretix.cfg`` in the current working directory
|
||||||
4. ``pretix.cfg`` in the current working directory
|
|
||||||
|
|
||||||
The file is expected to be in the INI format as specified in the `Python documentation`_.
|
The file is expected to be in the INI format as specified in the `Python documentation`_.
|
||||||
|
|
||||||
@@ -47,7 +44,7 @@ Example::
|
|||||||
|
|
||||||
``datadir``
|
``datadir``
|
||||||
The local path to a data directory that will be used for storing user uploads and similar
|
The local path to a data directory that will be used for storing user uploads and similar
|
||||||
data. Defaults to the value of the environment variable ``DATA_DIR`` or ``data``.
|
data. Defaults to thea value of the environment variable ``DATA_DIR`` or ``data``.
|
||||||
|
|
||||||
``plugins_default``
|
``plugins_default``
|
||||||
A comma-separated list of plugins that are enabled by default for all new events.
|
A comma-separated list of plugins that are enabled by default for all new events.
|
||||||
@@ -62,18 +59,6 @@ Example::
|
|||||||
``password_reset``
|
``password_reset``
|
||||||
Enables or disables password reset. Defaults to ``on``.
|
Enables or disables password reset. Defaults to ``on``.
|
||||||
|
|
||||||
``long_sessions``
|
|
||||||
Enables or disables the "keep me logged in" button. Defaults to ``on``.
|
|
||||||
|
|
||||||
``ecb_rates``
|
|
||||||
By default, pretix periodically downloads a XML file from the European Central Bank to retrieve exchange rates
|
|
||||||
that are used to print tax amounts in the customer currency on invoices for some currencies. Set to ``off`` to
|
|
||||||
disable this feature. Defaults to ``on``.
|
|
||||||
|
|
||||||
``audit_comments``
|
|
||||||
Enables or disables nagging staff users for leaving comments on their sessions for auditability.
|
|
||||||
Defaults to ``off``.
|
|
||||||
|
|
||||||
|
|
||||||
Locale settings
|
Locale settings
|
||||||
---------------
|
---------------
|
||||||
@@ -178,9 +163,14 @@ Django settings
|
|||||||
Example::
|
Example::
|
||||||
|
|
||||||
[django]
|
[django]
|
||||||
|
hosts=localhost
|
||||||
secret=j1kjps5a5&4ilpn912s7a1!e2h!duz^i3&idu@_907s$wrz@x-
|
secret=j1kjps5a5&4ilpn912s7a1!e2h!duz^i3&idu@_907s$wrz@x-
|
||||||
debug=off
|
debug=off
|
||||||
|
|
||||||
|
``hosts``
|
||||||
|
Comma-separated list of allowed host names for this installation.
|
||||||
|
Default: ``localhost``
|
||||||
|
|
||||||
``secret``
|
``secret``
|
||||||
The secret to be used by Django for signing and verification purposes. If this
|
The secret to be used by Django for signing and verification purposes. If this
|
||||||
setting is not provided, pretix will generate a random secret on the first start
|
setting is not provided, pretix will generate a random secret on the first start
|
||||||
@@ -292,4 +282,4 @@ various places like order codes, secrets in the ticket QR codes, etc. Example::
|
|||||||
voucher_code=16
|
voucher_code=16
|
||||||
|
|
||||||
.. _Python documentation: https://docs.python.org/3/library/configparser.html?highlight=configparser#supported-ini-file-structure
|
.. _Python documentation: https://docs.python.org/3/library/configparser.html?highlight=configparser#supported-ini-file-structure
|
||||||
.. _Celery documentation: http://docs.celeryproject.org/en/latest/userguide/configuration.html
|
.. _Celery documentation: http://docs.celeryproject.org/en/latest/configuration.html
|
||||||
|
|||||||
@@ -162,7 +162,7 @@ named ``/etc/systemd/system/pretix.service`` with the following content::
|
|||||||
-v /etc/pretix:/etc/pretix \
|
-v /etc/pretix:/etc/pretix \
|
||||||
-v /var/run/redis:/var/run/redis \
|
-v /var/run/redis:/var/run/redis \
|
||||||
-v /var/run/mysqld:/var/run/mysqld \
|
-v /var/run/mysqld:/var/run/mysqld \
|
||||||
pretix/standalone:stable all
|
pretix/standalone all
|
||||||
ExecStop=/usr/bin/docker stop %n
|
ExecStop=/usr/bin/docker stop %n
|
||||||
|
|
||||||
[Install]
|
[Install]
|
||||||
@@ -239,8 +239,6 @@ Restarting the service can take a few seconds, especially if the update requires
|
|||||||
Replace ``stable`` above with a specific version number like ``1.0`` or with ``latest`` for the development
|
Replace ``stable`` above with a specific version number like ``1.0`` or with ``latest`` for the development
|
||||||
version, if you want to.
|
version, if you want to.
|
||||||
|
|
||||||
.. _`docker_plugininstall`:
|
|
||||||
|
|
||||||
Install a plugin
|
Install a plugin
|
||||||
----------------
|
----------------
|
||||||
|
|
||||||
@@ -268,8 +266,8 @@ to re-build your custom image after you pulled ``pretix/standalone`` if you want
|
|||||||
.. _pretix.eu: https://pretix.eu/
|
.. _pretix.eu: https://pretix.eu/
|
||||||
.. _MySQL: https://dev.mysql.com/doc/refman/5.7/en/linux-installation-apt-repo.html
|
.. _MySQL: https://dev.mysql.com/doc/refman/5.7/en/linux-installation-apt-repo.html
|
||||||
.. _PostgreSQL: https://www.digitalocean.com/community/tutorials/how-to-install-and-use-postgresql-9-4-on-debian-8
|
.. _PostgreSQL: https://www.digitalocean.com/community/tutorials/how-to-install-and-use-postgresql-9-4-on-debian-8
|
||||||
.. _redis: https://blog.programster.org/debian-8-install-redis-server/
|
.. _redis: http://blog.programster.org/debian-8-install-redis-server/
|
||||||
.. _ufw: https://en.wikipedia.org/wiki/Uncomplicated_Firewall
|
.. _ufw: https://en.wikipedia.org/wiki/Uncomplicated_Firewall
|
||||||
.. _redis website: https://redis.io/topics/security
|
.. _redis website: http://redis.io/topics/security
|
||||||
.. _redis in docker: https://hub.docker.com/r/_/redis/
|
.. _redis in docker: https://hub.docker.com/r/_/redis/
|
||||||
.. _strong encryption settings: https://mozilla.github.io/server-side-tls/ssl-config-generator/
|
.. _strong encryption settings: https://mozilla.github.io/server-side-tls/ssl-config-generator/
|
||||||
|
|||||||
@@ -1,7 +1,5 @@
|
|||||||
.. highlight:: ini
|
.. highlight:: ini
|
||||||
|
|
||||||
.. spelling:: SQL
|
|
||||||
|
|
||||||
General remarks
|
General remarks
|
||||||
===============
|
===============
|
||||||
|
|
||||||
|
|||||||
@@ -177,7 +177,7 @@ For background tasks we need a second service ``/etc/systemd/system/pretix-worke
|
|||||||
[Install]
|
[Install]
|
||||||
WantedBy=multi-user.target
|
WantedBy=multi-user.target
|
||||||
|
|
||||||
You can now run the following commands to enable and start the services::
|
You can now run the following comamnds to enable and start the services::
|
||||||
|
|
||||||
# systemctl daemon-reload
|
# systemctl daemon-reload
|
||||||
# systemctl enable pretix-web pretix-worker
|
# systemctl enable pretix-web pretix-worker
|
||||||
@@ -213,7 +213,7 @@ The following snippet is an example on how to configure a nginx proxy for pretix
|
|||||||
ssl_certificate /path/to/cert.chain.pem;
|
ssl_certificate /path/to/cert.chain.pem;
|
||||||
ssl_certificate_key /path/to/key.pem;
|
ssl_certificate_key /path/to/key.pem;
|
||||||
|
|
||||||
add_header Referrer-Policy same-origin;
|
add_header Referrer-Options same-origin;
|
||||||
add_header X-Content-Type-Options nosniff;
|
add_header X-Content-Type-Options nosniff;
|
||||||
|
|
||||||
location / {
|
location / {
|
||||||
@@ -276,8 +276,6 @@ To upgrade to a new pretix release, pull the latest code changes and run the fol
|
|||||||
# systemctl restart pretix-web pretix-worker
|
# systemctl restart pretix-web pretix-worker
|
||||||
|
|
||||||
|
|
||||||
.. _`manual_plugininstall`:
|
|
||||||
|
|
||||||
Install a plugin
|
Install a plugin
|
||||||
----------------
|
----------------
|
||||||
|
|
||||||
@@ -298,6 +296,6 @@ example::
|
|||||||
.. _pretix.eu: https://pretix.eu/
|
.. _pretix.eu: https://pretix.eu/
|
||||||
.. _MySQL: https://dev.mysql.com/doc/refman/5.7/en/linux-installation-apt-repo.html
|
.. _MySQL: https://dev.mysql.com/doc/refman/5.7/en/linux-installation-apt-repo.html
|
||||||
.. _PostgreSQL: https://www.digitalocean.com/community/tutorials/how-to-install-and-use-postgresql-9-4-on-debian-8
|
.. _PostgreSQL: https://www.digitalocean.com/community/tutorials/how-to-install-and-use-postgresql-9-4-on-debian-8
|
||||||
.. _redis: https://blog.programster.org/debian-8-install-redis-server/
|
.. _redis: http://blog.programster.org/debian-8-install-redis-server/
|
||||||
.. _ufw: https://en.wikipedia.org/wiki/Uncomplicated_Firewall
|
.. _ufw: https://en.wikipedia.org/wiki/Uncomplicated_Firewall
|
||||||
.. _strong encryption settings: https://mozilla.github.io/server-side-tls/ssl-config-generator/
|
.. _strong encryption settings: https://mozilla.github.io/server-side-tls/ssl-config-generator/
|
||||||
|
|||||||
@@ -4,15 +4,25 @@ Basic concepts
|
|||||||
This page describes basic concepts and definition that you need to know to interact
|
This page describes basic concepts and definition that you need to know to interact
|
||||||
with pretix' REST API, such as authentication, pagination and similar definitions.
|
with pretix' REST API, such as authentication, pagination and similar definitions.
|
||||||
|
|
||||||
.. _`rest-auth`:
|
Obtaining an API token
|
||||||
|
----------------------
|
||||||
|
|
||||||
|
To authenticate your API requests, you need to obtain an API token. You can create a
|
||||||
|
token in the pretix web interface on the level of organizer teams. Create a new team
|
||||||
|
or choose an existing team that has the level of permissions the token should have and
|
||||||
|
create a new token using the form below the list of team members:
|
||||||
|
|
||||||
|
.. image:: img/token_form.png
|
||||||
|
|
||||||
|
You can enter a description for the token to distinguish from other tokens later on.
|
||||||
|
Once you click "Add", you will be provided with an API token in the success message.
|
||||||
|
Copy this token, as you won't be able to retrieve it again.
|
||||||
|
|
||||||
|
.. image:: img/token_success.png
|
||||||
|
|
||||||
Authentication
|
Authentication
|
||||||
--------------
|
--------------
|
||||||
|
|
||||||
If you're building an application for end users, we strongly recommend that you use our
|
|
||||||
:ref:`OAuth-based authentication progress <rest-oauth>`. However, for simpler needs, you
|
|
||||||
can also go with static API tokens that you can create on a per-team basis (see below).
|
|
||||||
|
|
||||||
You need to include the API token with every request to pretix' API in the ``Authorization`` header
|
You need to include the API token with every request to pretix' API in the ``Authorization`` header
|
||||||
like the following:
|
like the following:
|
||||||
|
|
||||||
@@ -30,43 +40,6 @@ like the following:
|
|||||||
adding OAuth2 support in the future for user-level authentication. If you want
|
adding OAuth2 support in the future for user-level authentication. If you want
|
||||||
to use session authentication, be sure to comply with Django's `CSRF policies`_.
|
to use session authentication, be sure to comply with Django's `CSRF policies`_.
|
||||||
|
|
||||||
Obtaining an API token
|
|
||||||
----------------------
|
|
||||||
|
|
||||||
To authenticate your API requests, you need to obtain an API token. You can create a
|
|
||||||
token in the pretix web interface on the level of organizer teams. Create a new team
|
|
||||||
or choose an existing team that has the level of permissions the token should have and
|
|
||||||
create a new token using the form below the list of team members:
|
|
||||||
|
|
||||||
.. image:: img/token_form.png
|
|
||||||
:class: screenshot
|
|
||||||
|
|
||||||
You can enter a description for the token to distinguish from other tokens later on.
|
|
||||||
Once you click "Add", you will be provided with an API token in the success message.
|
|
||||||
Copy this token, as you won't be able to retrieve it again.
|
|
||||||
|
|
||||||
.. image:: img/token_success.png
|
|
||||||
:class: screenshot
|
|
||||||
|
|
||||||
Permissions
|
|
||||||
-----------
|
|
||||||
|
|
||||||
The API follows pretix team based permissions model. Each organizer can have several teams
|
|
||||||
each with it's own set of permissions. Each team can have any number of API keys attached.
|
|
||||||
|
|
||||||
To access a given endpoint the team the API key belongs to needs to have the corresponding
|
|
||||||
permission for the organizer/event being accessed.
|
|
||||||
|
|
||||||
Possible permissions are:
|
|
||||||
|
|
||||||
* Can create events
|
|
||||||
* Can change event settings
|
|
||||||
* Can change product settings
|
|
||||||
* Can view orders
|
|
||||||
* Can change orders
|
|
||||||
* Can view vouchers
|
|
||||||
* Can change vouchers
|
|
||||||
|
|
||||||
Compatibility
|
Compatibility
|
||||||
-------------
|
-------------
|
||||||
|
|
||||||
@@ -113,41 +86,6 @@ respective page.
|
|||||||
The field ``results`` contains a list of objects representing the first results. For most
|
The field ``results`` contains a list of objects representing the first results. For most
|
||||||
objects, every page contains 50 results.
|
objects, every page contains 50 results.
|
||||||
|
|
||||||
Conditional fetching
|
|
||||||
--------------------
|
|
||||||
|
|
||||||
If you pull object lists from pretix' APIs regularly, we ask you to implement conditional fetching
|
|
||||||
to avoid unnecessary data traffic. This is not supported on all resources and we currently implement
|
|
||||||
two different mechanisms for different resources, which is necessary because we can only obtain best
|
|
||||||
efficiency for resources that do not support deletion operations.
|
|
||||||
|
|
||||||
Object-level conditional fetching
|
|
||||||
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
||||||
|
|
||||||
The :ref:`rest-orders` resource list contains an HTTP header called ``X-Page-Generated`` containing the
|
|
||||||
current time on the server in ISO 8601 format. On your next request, you can pass this header
|
|
||||||
(as is, without any modifications necessary) as the ``modified_since`` query parameter and you will receive
|
|
||||||
a list containing only objects that have changed in the time since your last request.
|
|
||||||
|
|
||||||
List-level conditional fetching
|
|
||||||
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
||||||
|
|
||||||
If modification checks are not possible with this granularity, you can instead check for the full list.
|
|
||||||
In this case, the list of objects may contain a regular HTTP header ``Last-Modified`` with the date of the
|
|
||||||
last modification to any item of that resource. You can then pass this date back in your next request in the
|
|
||||||
``If-Modified-Since`` header. If the any object has changed in the meantime, you will receive back a full list
|
|
||||||
(if something it missing, this means the object has been deleted). If nothing happened, we'll send back a
|
|
||||||
``304 Not Modified`` return code.
|
|
||||||
|
|
||||||
This is currently implemented on the following resources:
|
|
||||||
|
|
||||||
* :ref:`rest-categories`
|
|
||||||
* :ref:`rest-items`
|
|
||||||
* :ref:`rest-questions`
|
|
||||||
* :ref:`rest-quotas`
|
|
||||||
* :ref:`rest-subevents`
|
|
||||||
* :ref:`rest-taxrules`
|
|
||||||
|
|
||||||
Errors
|
Errors
|
||||||
------
|
------
|
||||||
|
|
||||||
|
|||||||
@@ -14,5 +14,4 @@ in functionality over time.
|
|||||||
:maxdepth: 2
|
:maxdepth: 2
|
||||||
|
|
||||||
fundamentals
|
fundamentals
|
||||||
oauth
|
|
||||||
resources/index
|
resources/index
|
||||||
|
|||||||
@@ -1,171 +0,0 @@
|
|||||||
.. _`rest-oauth`:
|
|
||||||
|
|
||||||
OAuth support / "Connect with pretix"
|
|
||||||
=====================================
|
|
||||||
|
|
||||||
In addition to static tokens, pretix supports `OAuth2`_-based authentication starting with
|
|
||||||
pretix 1.16. This allows you to put a "Connect with pretix" button into your website or tool
|
|
||||||
that allows the user to easily set up a connection between the two systems.
|
|
||||||
|
|
||||||
If you haven't worked with OAuth before, have a look at the `OAuth2 Simplified`_ tutorial.
|
|
||||||
|
|
||||||
Registering an application
|
|
||||||
--------------------------
|
|
||||||
|
|
||||||
To use OAuth, you need to register your application with the pretix instance you want to connect to.
|
|
||||||
In order to do this, log in to your pretix account and go to your user settings. Click on "Authorized applications"
|
|
||||||
first and then on "Manage your own apps". From there, you can "Create a new application".
|
|
||||||
|
|
||||||
You should fill in a descriptive name of your application that allows users to recognize who you are. You also need to
|
|
||||||
give a list of fully-qualified URLs that users will be redirected to after a successful authorization. After you pressed
|
|
||||||
"Save", you will be presented with a client ID and a client secret. Please note them down and treat the client secret
|
|
||||||
like a password; it should not become available to your users.
|
|
||||||
|
|
||||||
Obtaining an authorization grant
|
|
||||||
--------------------------------
|
|
||||||
|
|
||||||
To authorize a new user, link or redirect them to the ``authorize`` endpoint, passing your client ID as a query
|
|
||||||
parameter. Additionally, you can pass a scope (currently either ``read``, ``write``, or ``read write``)
|
|
||||||
and an URL the user should be redirected to after successful or failed authorization. You also need to pass the
|
|
||||||
``response_type`` parameter with a value of ``code``. Example::
|
|
||||||
|
|
||||||
https://pretix.eu/api/v1/oauth/authorize?client_id=lsLi0hNL0vk53mEdYjNJxHUn1PcO1R6wVg81dLNT&response_type=code&scope=read+write&redirect_uri=https://pretalx.com
|
|
||||||
|
|
||||||
To prevent CSRF attacks, you can also optionally pass a ``state`` parameter with a random string. Later, when
|
|
||||||
redirecting back to your application, we will pass the same ``state`` parameter back to you, so you can compare if they
|
|
||||||
match.
|
|
||||||
|
|
||||||
After the user granted or denied access, they will be redirected back either to the ``redirect_url`` you passed in the
|
|
||||||
query or to the first redirect URL configured in your application settings.
|
|
||||||
|
|
||||||
On successful registration, we will append the query parameter ``code`` to the URL containing an authorization code.
|
|
||||||
For example, we might redirect the user to this URL::
|
|
||||||
|
|
||||||
https://pretalx.com/?code=eYBBf8gmeD4E01HLoj0XflqO4Lg3Cw&state=e3KCh9mfx07qxU4bRpXk
|
|
||||||
|
|
||||||
You will need this ``code`` parameter to perform the next step.
|
|
||||||
|
|
||||||
On a failed registration, a query string like ``?error=access_denied`` will be appended to the redirection URL.
|
|
||||||
|
|
||||||
.. note:: In this step, the user is allowed to restrict your access to certain organizer accounts. If you try to
|
|
||||||
re-authenticate the user later, the user might be instantly redirected back to you if authorization is already
|
|
||||||
given and would therefore be unable to review their organizer restriction settings. You can append the
|
|
||||||
``approval_prompt=force`` query parameter if you want to make sure the user actively needs to confirm the
|
|
||||||
authorization.
|
|
||||||
|
|
||||||
Getting an access token
|
|
||||||
-----------------------
|
|
||||||
|
|
||||||
Using the ``code`` value you obtained above and your client ID, you can now request an access token that actually gives
|
|
||||||
access to the API. The ``token`` endpoint expects you to authenticate using `HTTP Basic authentication`_ using your client
|
|
||||||
ID as a username and your client secret as a password. You are also required to again supply the same ``redirect_uri``
|
|
||||||
parameter that you used for the authorization.
|
|
||||||
|
|
||||||
.. http:get:: /api/v1/oauth/token
|
|
||||||
|
|
||||||
Request a new access token
|
|
||||||
|
|
||||||
**Example request**:
|
|
||||||
|
|
||||||
.. sourcecode:: http
|
|
||||||
|
|
||||||
POST /api/v1/oauth/token HTTP/1.1
|
|
||||||
Host: pretix.eu
|
|
||||||
Accept: application/json, text/javascript
|
|
||||||
Authorization: Basic bHNMaTBoTkwwdms1M21FZFlqTkp4SFVuMVBjTzFSNndWZzgxZExOVDplSmpzZVA0UjJMN0hMcjBiS0p1b3BmbnJtT2cyY3NDeTdYaFVVZ0FoalhUU0NhZHhRTjk3cVNvMkpPaXlWTFpQOEozaTVQd1FVdFIwNUNycG5ac2Z0bXJjdmNTbkZ1SkFmb2ZsUTdZUDRpSjZNTWFYTHIwQ0FpNlhIRFJjV1Awcg==
|
|
||||||
|
|
||||||
grant_type=authorization_code&code=eYBBf8gmeD4E01HLoj0XflqO4Lg3Cw&redirect_uri=https://pretalx.com
|
|
||||||
|
|
||||||
**Example response**:
|
|
||||||
|
|
||||||
.. sourcecode:: http
|
|
||||||
|
|
||||||
HTTP/1.1 200 OK
|
|
||||||
Vary: Accept
|
|
||||||
Content-Type: application/json
|
|
||||||
|
|
||||||
{
|
|
||||||
"access_token": "i3ytqTSRWsKp16fqjekHXa4tdM4qNC",
|
|
||||||
"expires_in": 86400,
|
|
||||||
"token_type": "Bearer",
|
|
||||||
"scope": "read write",
|
|
||||||
"refresh_token": "XBK0r8z4A4TTeR9LyMUyU2AM5rqpXp"
|
|
||||||
}
|
|
||||||
|
|
||||||
:statuscode 200: no error
|
|
||||||
:statuscode 401: Authentication failure
|
|
||||||
|
|
||||||
|
|
||||||
As you can see, you receive two types of tokens: One "access token", and one "refresh token". The access token is valid
|
|
||||||
for a day and can be used to actually access the API. The refresh token does not have an expiration date and can be used
|
|
||||||
to obtain a new access_token after a day, so you should make sure to store the access token safely if you need long-term
|
|
||||||
access.
|
|
||||||
|
|
||||||
Using the API with an access token
|
|
||||||
----------------------------------
|
|
||||||
|
|
||||||
You can supply a valid access token as a ``Bearer``-type token in the ``Authorization`` header to get API access.
|
|
||||||
|
|
||||||
.. sourcecode:: http
|
|
||||||
:emphasize-lines: 3
|
|
||||||
|
|
||||||
GET /api/v1/organizers/ HTTP/1.1
|
|
||||||
Host: pretix.eu
|
|
||||||
Authorization: Bearer i3ytqTSRWsKp16fqjekHXa4tdM4qNC
|
|
||||||
|
|
||||||
Refreshing an access token
|
|
||||||
--------------------------
|
|
||||||
|
|
||||||
You can obtain a new access token using your refresh token any time. This can be done using the same ``token`` endpoint
|
|
||||||
used to obtain the first access token above, but with a different set of parameters:
|
|
||||||
|
|
||||||
.. sourcecode:: http
|
|
||||||
|
|
||||||
POST /api/v1/oauth/token HTTP/1.1
|
|
||||||
Host: pretix.eu
|
|
||||||
Accept: application/json, text/javascript
|
|
||||||
Authorization: Basic bHNMaTBoTkwwdms1M21FZFlqTkp4SFVuMVBjTzFSNndWZzgxZExOVDplSmpzZVA0UjJMN0hMcjBiS0p1b3BmbnJtT2cyY3NDeTdYaFVVZ0FoalhUU0NhZHhRTjk3cVNvMkpPaXlWTFpQOEozaTVQd1FVdFIwNUNycG5ac2Z0bXJjdmNTbkZ1SkFmb2ZsUTdZUDRpSjZNTWFYTHIwQ0FpNlhIRFJjV1Awcg==
|
|
||||||
|
|
||||||
grant_type=refresh_token&refresh_token=XBK0r8z4A4TTeR9LyMUyU2AM5rqpXp
|
|
||||||
|
|
||||||
The previous access token will instantly become invalid.
|
|
||||||
|
|
||||||
Revoking a token
|
|
||||||
----------------
|
|
||||||
|
|
||||||
If you don't need a token any more or if you believe it may have been compromised, you can use the ``revoke_token``
|
|
||||||
endpoint to revoke it.
|
|
||||||
|
|
||||||
.. http:get:: /api/v1/oauth/revoke_token
|
|
||||||
|
|
||||||
Revoke an access or refresh token. If you revoke an access token, you can still create a new one using the refresh token. If you
|
|
||||||
revoke a refresh token, the connected access token will also be revoked.
|
|
||||||
|
|
||||||
**Example request**:
|
|
||||||
|
|
||||||
.. sourcecode:: http
|
|
||||||
|
|
||||||
POST /api/v1/oauth/revoke_token HTTP/1.1
|
|
||||||
Host: pretix.eu
|
|
||||||
Accept: application/json, text/javascript
|
|
||||||
Authorization: Basic bHNMaTBoTkwwdms1M21FZFlqTkp4SFVuMVBjTzFSNndWZzgxZExOVDplSmpzZVA0UjJMN0hMcjBiS0p1b3BmbnJtT2cyY3NDeTdYaFVVZ0FoalhUU0NhZHhRTjk3cVNvMkpPaXlWTFpQOEozaTVQd1FVdFIwNUNycG5ac2Z0bXJjdmNTbkZ1SkFmb2ZsUTdZUDRpSjZNTWFYTHIwQ0FpNlhIRFJjV1Awcg==
|
|
||||||
|
|
||||||
token=XBK0r8z4A4TTeR9LyMUyU2AM5rqpXp
|
|
||||||
|
|
||||||
**Example response**:
|
|
||||||
|
|
||||||
.. sourcecode:: http
|
|
||||||
|
|
||||||
HTTP/1.1 200 OK
|
|
||||||
Vary: Accept
|
|
||||||
Content-Type: application/json
|
|
||||||
|
|
||||||
:statuscode 200: no error
|
|
||||||
:statuscode 401: Authentication failure
|
|
||||||
|
|
||||||
If you want to revoke your client secret, you can generate a new one in the list of your managed applications in the
|
|
||||||
pretix user interface.
|
|
||||||
|
|
||||||
.. _OAuth2: https://en.wikipedia.org/wiki/OAuth
|
|
||||||
.. _OAuth2 Simplified: https://aaronparecki.com/oauth-2-simplified/
|
|
||||||
.. _HTTP Basic authentication: https://en.wikipedia.org/wiki/Basic_access_authentication
|
|
||||||
@@ -1,258 +0,0 @@
|
|||||||
.. _rest-carts:
|
|
||||||
|
|
||||||
Cart positions
|
|
||||||
==============
|
|
||||||
|
|
||||||
The API provides limited access to the cart position data model. This API currently only allows creating and deleting
|
|
||||||
cart positions to reserve quota.
|
|
||||||
|
|
||||||
Cart position resource
|
|
||||||
----------------------
|
|
||||||
|
|
||||||
The cart position resource contains the following public fields:
|
|
||||||
|
|
||||||
.. rst-class:: rest-resource-table
|
|
||||||
|
|
||||||
===================================== ========================== =======================================================
|
|
||||||
Field Type Description
|
|
||||||
===================================== ========================== =======================================================
|
|
||||||
id integer Internal ID of the cart position
|
|
||||||
cart_id string Identifier of the cart this belongs to. Needs to end
|
|
||||||
in "@api" for API-created positions.
|
|
||||||
datetime datetime Time of creation
|
|
||||||
expires datetime The cart position will expire at this time and no longer block quota
|
|
||||||
item integer ID of the item
|
|
||||||
variation integer ID of the variation (or ``null``)
|
|
||||||
price money (string) Price of this position
|
|
||||||
attendee_name string Specified attendee name for this position (or ``null``)
|
|
||||||
attendee_email string Specified attendee email address for this position (or ``null``)
|
|
||||||
voucher integer Internal ID of the voucher used for this position (or ``null``)
|
|
||||||
addon_to integer Internal ID of the position this position is an add-on for (or ``null``)
|
|
||||||
subevent integer ID of the date inside an event series this position belongs to (or ``null``).
|
|
||||||
answers list of objects Answers to user-defined questions
|
|
||||||
├ question integer Internal ID of the answered question
|
|
||||||
├ answer string Text representation of the answer
|
|
||||||
├ question_identifier string The question's ``identifier`` field
|
|
||||||
├ options list of integers Internal IDs of selected option(s)s (only for choice types)
|
|
||||||
└ option_identifiers list of strings The ``identifier`` fields of the selected option(s)s
|
|
||||||
===================================== ========================== =======================================================
|
|
||||||
|
|
||||||
.. versionchanged:: 1.17
|
|
||||||
|
|
||||||
This resource has been added.
|
|
||||||
|
|
||||||
|
|
||||||
Cart position endpoints
|
|
||||||
-----------------------
|
|
||||||
|
|
||||||
.. http:get:: /api/v1/organizers/(organizer)/events/(event)/cartpositions/
|
|
||||||
|
|
||||||
Returns a list of API-created cart positions.
|
|
||||||
|
|
||||||
**Example request**:
|
|
||||||
|
|
||||||
.. sourcecode:: http
|
|
||||||
|
|
||||||
GET /api/v1/organizers/bigevents/events/sampleconf/cartpositions/ HTTP/1.1
|
|
||||||
Host: pretix.eu
|
|
||||||
Accept: application/json, text/javascript
|
|
||||||
|
|
||||||
**Example response**:
|
|
||||||
|
|
||||||
.. sourcecode:: http
|
|
||||||
|
|
||||||
HTTP/1.1 200 OK
|
|
||||||
Vary: Accept
|
|
||||||
Content-Type: application/json
|
|
||||||
X-Page-Generated: 2017-12-01T10:00:00Z
|
|
||||||
|
|
||||||
{
|
|
||||||
"count": 1,
|
|
||||||
"next": null,
|
|
||||||
"previous": null,
|
|
||||||
"results": [
|
|
||||||
{
|
|
||||||
"id": 1,
|
|
||||||
"cart_id": "XwokV8FojQviD9jhtDzKvHFdlLRNMhlfo3cNjGbuK6MUTQDT@api",
|
|
||||||
"item": 1,
|
|
||||||
"variation": null,
|
|
||||||
"price": "23.00",
|
|
||||||
"attendee_name": null,
|
|
||||||
"attendee_email": null,
|
|
||||||
"voucher": null,
|
|
||||||
"addon_to": null,
|
|
||||||
"subevent": null,
|
|
||||||
"datetime": "2018-06-11T10:00:00Z",
|
|
||||||
"expires": "2018-06-11T10:00:00Z",
|
|
||||||
"includes_tax": true,
|
|
||||||
"answers": []
|
|
||||||
}
|
|
||||||
]
|
|
||||||
}
|
|
||||||
|
|
||||||
:query integer page: The page number in case of a multi-page result set, default is 1
|
|
||||||
:statuscode 200: no error
|
|
||||||
:statuscode 401: Authentication failure
|
|
||||||
:statuscode 403: The requested organizer/event does not exist **or** you have no permission to view this resource.
|
|
||||||
|
|
||||||
.. http:get:: /api/v1/organizers/(organizer)/events/(event)/cartpositions/(id)/
|
|
||||||
|
|
||||||
Returns information on one cart position, identified by its internal ID.
|
|
||||||
|
|
||||||
**Example request**:
|
|
||||||
|
|
||||||
.. sourcecode:: http
|
|
||||||
|
|
||||||
GET /api/v1/organizers/bigevents/events/sampleconf/cartpositions/1/ HTTP/1.1
|
|
||||||
Host: pretix.eu
|
|
||||||
Accept: application/json, text/javascript
|
|
||||||
|
|
||||||
**Example response**:
|
|
||||||
|
|
||||||
.. sourcecode:: http
|
|
||||||
|
|
||||||
HTTP/1.1 200 OK
|
|
||||||
Vary: Accept
|
|
||||||
Content-Type: application/json
|
|
||||||
|
|
||||||
{
|
|
||||||
"id": 1,
|
|
||||||
"cart_id": "XwokV8FojQviD9jhtDzKvHFdlLRNMhlfo3cNjGbuK6MUTQDT@api",
|
|
||||||
"item": 1,
|
|
||||||
"variation": null,
|
|
||||||
"price": "23.00",
|
|
||||||
"attendee_name": null,
|
|
||||||
"attendee_email": null,
|
|
||||||
"voucher": null,
|
|
||||||
"addon_to": null,
|
|
||||||
"subevent": null,
|
|
||||||
"datetime": "2018-06-11T10:00:00Z",
|
|
||||||
"expires": "2018-06-11T10:00:00Z",
|
|
||||||
"includes_tax": true,
|
|
||||||
"answers": []
|
|
||||||
}
|
|
||||||
|
|
||||||
:param organizer: The ``slug`` field of the organizer to fetch
|
|
||||||
:param event: The ``slug`` field of the event to fetch
|
|
||||||
:param id: The ``id`` field of the position to fetch
|
|
||||||
:statuscode 200: no error
|
|
||||||
:statuscode 401: Authentication failure
|
|
||||||
:statuscode 403: The requested organizer/event does not exist **or** you have no permission to view this resource.
|
|
||||||
:statuscode 404: The requested cart position does not exist.
|
|
||||||
|
|
||||||
.. http:post:: /api/v1/organizers/(organizer)/events/(event)/cartpositions/
|
|
||||||
|
|
||||||
Creates a new cart position.
|
|
||||||
|
|
||||||
.. warning:: This endpoint is considered **experimental**. It might change at any time without prior notice.
|
|
||||||
|
|
||||||
.. warning::
|
|
||||||
|
|
||||||
This endpoint is intended for advanced users. It is not designed to be used to build your own shop frontend.
|
|
||||||
There is a lot that it does not or can not do, and you will need to be careful using it.
|
|
||||||
It allows to bypass many of the restrictions imposed when creating a cart through the
|
|
||||||
regular shop.
|
|
||||||
|
|
||||||
Specifically, this endpoint currently
|
|
||||||
|
|
||||||
* does not validate if products are only to be sold in a specific time frame
|
|
||||||
|
|
||||||
* does not validate if the event's ticket sales are already over or haven't started
|
|
||||||
|
|
||||||
* does not support add-on products at the moment
|
|
||||||
|
|
||||||
* does not check or calculate prices but believes any prices you send
|
|
||||||
|
|
||||||
* does not support the redemption of vouchers
|
|
||||||
|
|
||||||
* does not prevent you from buying items that can only be bought with a voucher
|
|
||||||
|
|
||||||
* does not support file upload questions
|
|
||||||
|
|
||||||
You can supply the following fields of the resource:
|
|
||||||
|
|
||||||
* ``cart_id`` (optional, needs to end in ``@api``)
|
|
||||||
* ``item``
|
|
||||||
* ``variation`` (optional)
|
|
||||||
* ``price``
|
|
||||||
* ``attendee_name`` (optional)
|
|
||||||
* ``attendee_email`` (optional)
|
|
||||||
* ``subevent`` (optional)
|
|
||||||
* ``expires`` (optional)
|
|
||||||
* ``includes_tax`` (optional)
|
|
||||||
* ``answers``
|
|
||||||
|
|
||||||
* ``question``
|
|
||||||
* ``answer``
|
|
||||||
* ``options``
|
|
||||||
|
|
||||||
**Example request**:
|
|
||||||
|
|
||||||
.. sourcecode:: http
|
|
||||||
|
|
||||||
POST /api/v1/organizers/bigevents/events/sampleconf/cartpositions/ HTTP/1.1
|
|
||||||
Host: pretix.eu
|
|
||||||
Accept: application/json, text/javascript
|
|
||||||
Content: application/json
|
|
||||||
|
|
||||||
{
|
|
||||||
"item": 1,
|
|
||||||
"variation": null,
|
|
||||||
"price": "23.00",
|
|
||||||
"attendee_name": "Peter",
|
|
||||||
"attendee_email": null,
|
|
||||||
"answers": [
|
|
||||||
{
|
|
||||||
"question": 1,
|
|
||||||
"answer": "23",
|
|
||||||
"options": []
|
|
||||||
}
|
|
||||||
],
|
|
||||||
"subevent": null
|
|
||||||
}
|
|
||||||
|
|
||||||
**Example response**:
|
|
||||||
|
|
||||||
.. sourcecode:: http
|
|
||||||
|
|
||||||
HTTP/1.1 201 Created
|
|
||||||
Vary: Accept
|
|
||||||
Content-Type: application/json
|
|
||||||
|
|
||||||
(Full cart position resource, see above.)
|
|
||||||
|
|
||||||
:param organizer: The ``slug`` field of the organizer of the event to create a position for
|
|
||||||
:param event: The ``slug`` field of the event to create a position for
|
|
||||||
:statuscode 201: no error
|
|
||||||
:statuscode 400: The item could not be created due to invalid submitted data or lack of quota.
|
|
||||||
:statuscode 401: Authentication failure
|
|
||||||
:statuscode 403: The requested organizer/event does not exist **or** you have no permission to create this
|
|
||||||
order.
|
|
||||||
|
|
||||||
.. http:delete:: /api/v1/organizers/(organizer)/events/(event)/cartpositions/(id)/
|
|
||||||
|
|
||||||
Deletes a cart position, identified by its internal ID.
|
|
||||||
|
|
||||||
**Example request**:
|
|
||||||
|
|
||||||
.. sourcecode:: http
|
|
||||||
|
|
||||||
DELETE /api/v1/organizers/bigevents/events/sampleconf/cartpositions/1/ HTTP/1.1
|
|
||||||
Host: pretix.eu
|
|
||||||
Accept: application/json, text/javascript
|
|
||||||
|
|
||||||
**Example response**:
|
|
||||||
|
|
||||||
.. sourcecode:: http
|
|
||||||
|
|
||||||
HTTP/1.1 204 No Content
|
|
||||||
Vary: Accept
|
|
||||||
Content-Type: application/json
|
|
||||||
|
|
||||||
:param organizer: The ``slug`` field of the organizer to fetch
|
|
||||||
:param event: The ``slug`` field of the event to fetch
|
|
||||||
:param id: The ``id`` field of the position to delete
|
|
||||||
:statuscode 200: no error
|
|
||||||
:statuscode 401: Authentication failure
|
|
||||||
:statuscode 403: The requested organizer/event does not exist **or** you have no permission to view this resource.
|
|
||||||
:statuscode 404: The requested cart position does not exist.
|
|
||||||
@@ -1,5 +1,3 @@
|
|||||||
.. _`rest-categories`:
|
|
||||||
|
|
||||||
Item categories
|
Item categories
|
||||||
===============
|
===============
|
||||||
|
|
||||||
@@ -16,7 +14,6 @@ Field Type Description
|
|||||||
===================================== ========================== =======================================================
|
===================================== ========================== =======================================================
|
||||||
id integer Internal ID of the category
|
id integer Internal ID of the category
|
||||||
name multi-lingual string The category's visible name
|
name multi-lingual string The category's visible name
|
||||||
internal_name string An optional name that is only used in the backend
|
|
||||||
description multi-lingual string A public description (might include markdown, can
|
description multi-lingual string A public description (might include markdown, can
|
||||||
be ``null``)
|
be ``null``)
|
||||||
position integer An integer, used for sorting the categories
|
position integer An integer, used for sorting the categories
|
||||||
@@ -25,14 +22,6 @@ is_addon boolean If ``True``, it
|
|||||||
defining add-ons for other products.
|
defining add-ons for other products.
|
||||||
===================================== ========================== =======================================================
|
===================================== ========================== =======================================================
|
||||||
|
|
||||||
.. versionchanged:: 1.14
|
|
||||||
|
|
||||||
The operations POST, PATCH, PUT and DELETE have been added.
|
|
||||||
|
|
||||||
.. versionchanged:: 1.16
|
|
||||||
|
|
||||||
The field ``internal_name`` has been added.
|
|
||||||
|
|
||||||
|
|
||||||
Endpoints
|
Endpoints
|
||||||
---------
|
---------
|
||||||
@@ -55,7 +44,7 @@ Endpoints
|
|||||||
|
|
||||||
HTTP/1.1 200 OK
|
HTTP/1.1 200 OK
|
||||||
Vary: Accept
|
Vary: Accept
|
||||||
Content-Type: application/json
|
Content-Type: text/javascript
|
||||||
|
|
||||||
{
|
{
|
||||||
"count": 1,
|
"count": 1,
|
||||||
@@ -65,7 +54,6 @@ Endpoints
|
|||||||
{
|
{
|
||||||
"id": 1,
|
"id": 1,
|
||||||
"name": {"en": "Tickets"},
|
"name": {"en": "Tickets"},
|
||||||
"internal_name": "",
|
|
||||||
"description": {"en": "Tickets are what you need to get in."},
|
"description": {"en": "Tickets are what you need to get in."},
|
||||||
"position": 1,
|
"position": 1,
|
||||||
"is_addon": false
|
"is_addon": false
|
||||||
@@ -102,12 +90,11 @@ Endpoints
|
|||||||
|
|
||||||
HTTP/1.1 200 OK
|
HTTP/1.1 200 OK
|
||||||
Vary: Accept
|
Vary: Accept
|
||||||
Content-Type: application/json
|
Content-Type: text/javascript
|
||||||
|
|
||||||
{
|
{
|
||||||
"id": 1,
|
"id": 1,
|
||||||
"name": {"en": "Tickets"},
|
"name": {"en": "Tickets"},
|
||||||
"internal_name": "",
|
|
||||||
"description": {"en": "Tickets are what you need to get in."},
|
"description": {"en": "Tickets are what you need to get in."},
|
||||||
"position": 1,
|
"position": 1,
|
||||||
"is_addon": false
|
"is_addon": false
|
||||||
@@ -119,121 +106,3 @@ Endpoints
|
|||||||
:statuscode 200: no error
|
:statuscode 200: no error
|
||||||
:statuscode 401: Authentication failure
|
:statuscode 401: Authentication failure
|
||||||
:statuscode 403: The requested organizer/event does not exist **or** you have no permission to view this resource.
|
:statuscode 403: The requested organizer/event does not exist **or** you have no permission to view this resource.
|
||||||
|
|
||||||
.. http:post:: /api/v1/organizers/(organizer)/events/(event)/categories/
|
|
||||||
|
|
||||||
Creates a new category
|
|
||||||
|
|
||||||
**Example request**:
|
|
||||||
|
|
||||||
.. sourcecode:: http
|
|
||||||
|
|
||||||
POST /api/v1/organizers/bigevents/events/sampleconf/categories/ HTTP/1.1
|
|
||||||
Host: pretix.eu
|
|
||||||
Accept: application/json, text/javascript
|
|
||||||
Content: application/json
|
|
||||||
|
|
||||||
{
|
|
||||||
"name": {"en": "Tickets"},
|
|
||||||
"internal_name": "",
|
|
||||||
"description": {"en": "Tickets are what you need to get in."},
|
|
||||||
"position": 1,
|
|
||||||
"is_addon": false
|
|
||||||
}
|
|
||||||
|
|
||||||
**Example response**:
|
|
||||||
|
|
||||||
.. sourcecode:: http
|
|
||||||
|
|
||||||
HTTP/1.1 201 Created
|
|
||||||
Vary: Accept
|
|
||||||
Content-Type: application/json
|
|
||||||
|
|
||||||
{
|
|
||||||
"id": 1,
|
|
||||||
"name": {"en": "Tickets"},
|
|
||||||
"internal_name": "",
|
|
||||||
"description": {"en": "Tickets are what you need to get in."},
|
|
||||||
"position": 1,
|
|
||||||
"is_addon": false
|
|
||||||
}
|
|
||||||
|
|
||||||
:param organizer: The ``slug`` field of the organizer of the event to create a category for
|
|
||||||
:param event: The ``slug`` field of the event to create a category for
|
|
||||||
:statuscode 201: no error
|
|
||||||
:statuscode 400: The category could not be created due to invalid submitted data.
|
|
||||||
:statuscode 401: Authentication failure
|
|
||||||
:statuscode 403: The requested organizer/event does not exist **or** you have no permission to create this resource.
|
|
||||||
|
|
||||||
.. http:patch:: /api/v1/organizers/(organizer)/events/(event)/categories/(id)/
|
|
||||||
|
|
||||||
Update a category. 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 ``id`` field.
|
|
||||||
|
|
||||||
**Example request**:
|
|
||||||
|
|
||||||
.. sourcecode:: http
|
|
||||||
|
|
||||||
PATCH /api/v1/organizers/bigevents/events/sampleconf/categories/1/ HTTP/1.1
|
|
||||||
Host: pretix.eu
|
|
||||||
Accept: application/json, text/javascript
|
|
||||||
Content-Type: application/json
|
|
||||||
Content-Length: 94
|
|
||||||
|
|
||||||
{
|
|
||||||
"is_addon": true
|
|
||||||
}
|
|
||||||
|
|
||||||
**Example response**:
|
|
||||||
|
|
||||||
.. sourcecode:: http
|
|
||||||
|
|
||||||
HTTP/1.1 200 OK
|
|
||||||
Vary: Accept
|
|
||||||
Content-Type: application/json
|
|
||||||
|
|
||||||
{
|
|
||||||
"id": 1,
|
|
||||||
"name": {"en": "Tickets"},
|
|
||||||
"internal_name": "",
|
|
||||||
"description": {"en": "Tickets are what you need to get in."},
|
|
||||||
"position": 1,
|
|
||||||
"is_addon": true
|
|
||||||
}
|
|
||||||
|
|
||||||
:param organizer: The ``slug`` field of the organizer to modify
|
|
||||||
:param event: The ``slug`` field of the event to modify
|
|
||||||
:param id: The ``id`` field of the category to modify
|
|
||||||
:statuscode 200: no error
|
|
||||||
:statuscode 400: The category could not be modified due to invalid submitted data
|
|
||||||
:statuscode 401: Authentication failure
|
|
||||||
:statuscode 403: The requested organizer/event does not exist **or** you have no permission to change this resource.
|
|
||||||
|
|
||||||
.. http:delete:: /api/v1/organizers/(organizer)/events/(event)/category/(id)/
|
|
||||||
|
|
||||||
Delete a category.
|
|
||||||
|
|
||||||
**Example request**:
|
|
||||||
|
|
||||||
.. sourcecode:: http
|
|
||||||
|
|
||||||
DELETE /api/v1/organizers/bigevents/events/sampleconf/categories/1/ HTTP/1.1
|
|
||||||
Host: pretix.eu
|
|
||||||
Accept: application/json, text/javascript
|
|
||||||
|
|
||||||
**Example response**:
|
|
||||||
|
|
||||||
.. sourcecode:: http
|
|
||||||
|
|
||||||
HTTP/1.1 204 No Content
|
|
||||||
Vary: Accept
|
|
||||||
|
|
||||||
:param organizer: The ``slug`` field of the organizer to modify
|
|
||||||
:param event: The ``slug`` field of the event to modify
|
|
||||||
:param id: The ``id`` field of the category to delete
|
|
||||||
:statuscode 204: no error
|
|
||||||
:statuscode 401: Authentication failure
|
|
||||||
:statuscode 403: The requested organizer/event does not exist **or** you have no permission to delete this resource.
|
|
||||||
|
|||||||
@@ -1,624 +0,0 @@
|
|||||||
Check-in lists
|
|
||||||
==============
|
|
||||||
|
|
||||||
Resource description
|
|
||||||
--------------------
|
|
||||||
|
|
||||||
You can create check-in lists that you can use e.g. at the entrance of your event to track who is coming and if they
|
|
||||||
actually bought a ticket.
|
|
||||||
|
|
||||||
You can create multiple check-in lists to separate multiple parts of your event, for example if you have separate
|
|
||||||
entries for multiple ticket types. Different check-in lists are completely independent: If a ticket shows up on two
|
|
||||||
lists, it is valid once on every list. This might be useful if you run a festival with festival passes that allow
|
|
||||||
access to every or multiple performances as well as tickets only valid for single performances.
|
|
||||||
|
|
||||||
The check-in list resource contains the following public fields:
|
|
||||||
|
|
||||||
.. rst-class:: rest-resource-table
|
|
||||||
|
|
||||||
===================================== ========================== =======================================================
|
|
||||||
Field Type Description
|
|
||||||
===================================== ========================== =======================================================
|
|
||||||
id integer Internal ID of the check-in list
|
|
||||||
name string The internal name of the check-in list
|
|
||||||
all_products boolean If ``true``, the check-in lists contains tickets of all products in this event. The ``limit_products`` field is ignored in this case.
|
|
||||||
limit_products list of integers List of item IDs to include in this list.
|
|
||||||
subevent integer ID of the date inside an event series this list belongs to (or ``null``).
|
|
||||||
position_count integer Number of tickets that match this list (read-only).
|
|
||||||
checkin_count integer Number of check-ins performed on this list (read-only).
|
|
||||||
include_pending boolean If ``true``, the check-in list also contains tickets from orders in pending state.
|
|
||||||
===================================== ========================== =======================================================
|
|
||||||
|
|
||||||
.. versionchanged:: 1.10
|
|
||||||
|
|
||||||
This resource has been added.
|
|
||||||
|
|
||||||
.. versionchanged:: 1.11
|
|
||||||
|
|
||||||
The ``positions`` endpoints have been added.
|
|
||||||
|
|
||||||
.. versionchanged:: 1.13
|
|
||||||
|
|
||||||
The ``include_pending`` field has been added.
|
|
||||||
|
|
||||||
Endpoints
|
|
||||||
---------
|
|
||||||
|
|
||||||
.. versionchanged:: 1.15
|
|
||||||
|
|
||||||
The ``../status/`` detail endpoint has been added.
|
|
||||||
|
|
||||||
.. http:get:: /api/v1/organizers/(organizer)/events/(event)/checkinlists/
|
|
||||||
|
|
||||||
Returns a list of all check-in lists within a given event.
|
|
||||||
|
|
||||||
**Example request**:
|
|
||||||
|
|
||||||
.. sourcecode:: http
|
|
||||||
|
|
||||||
GET /api/v1/organizers/bigevents/events/sampleconf/checkinlists/ HTTP/1.1
|
|
||||||
Host: pretix.eu
|
|
||||||
Accept: application/json, text/javascript
|
|
||||||
|
|
||||||
**Example response**:
|
|
||||||
|
|
||||||
.. sourcecode:: http
|
|
||||||
|
|
||||||
HTTP/1.1 200 OK
|
|
||||||
Vary: Accept
|
|
||||||
Content-Type: application/json
|
|
||||||
|
|
||||||
{
|
|
||||||
"count": 1,
|
|
||||||
"next": null,
|
|
||||||
"previous": null,
|
|
||||||
"results": [
|
|
||||||
{
|
|
||||||
"id": 1,
|
|
||||||
"name": "Default list",
|
|
||||||
"checkin_count": 123,
|
|
||||||
"position_count": 456,
|
|
||||||
"all_products": true,
|
|
||||||
"limit_products": [],
|
|
||||||
"include_pending": false,
|
|
||||||
"subevent": null
|
|
||||||
}
|
|
||||||
]
|
|
||||||
}
|
|
||||||
|
|
||||||
:query integer page: The page number in case of a multi-page result set, default is 1
|
|
||||||
:query integer subevent: Only return check-in lists of the sub-event with the given ID
|
|
||||||
:param organizer: The ``slug`` field of the organizer to fetch
|
|
||||||
:param event: The ``slug`` field of the event to fetch
|
|
||||||
:statuscode 200: no error
|
|
||||||
:statuscode 401: Authentication failure
|
|
||||||
:statuscode 403: The requested organizer/event does not exist **or** you have no permission to view this resource.
|
|
||||||
|
|
||||||
.. http:get:: /api/v1/organizers/(organizer)/events/(event)/checkinlists/(id)/
|
|
||||||
|
|
||||||
Returns information on one check-in list, identified by its ID.
|
|
||||||
|
|
||||||
**Example request**:
|
|
||||||
|
|
||||||
.. sourcecode:: http
|
|
||||||
|
|
||||||
GET /api/v1/organizers/bigevents/events/sampleconf/checkinlists/1/ HTTP/1.1
|
|
||||||
Host: pretix.eu
|
|
||||||
Accept: application/json, text/javascript
|
|
||||||
|
|
||||||
**Example response**:
|
|
||||||
|
|
||||||
.. sourcecode:: http
|
|
||||||
|
|
||||||
HTTP/1.1 200 OK
|
|
||||||
Vary: Accept
|
|
||||||
Content-Type: application/json
|
|
||||||
|
|
||||||
{
|
|
||||||
"id": 1,
|
|
||||||
"name": "Default list",
|
|
||||||
"checkin_count": 123,
|
|
||||||
"position_count": 456,
|
|
||||||
"all_products": true,
|
|
||||||
"limit_products": [],
|
|
||||||
"include_pending": false,
|
|
||||||
"subevent": null
|
|
||||||
}
|
|
||||||
|
|
||||||
:param organizer: The ``slug`` field of the organizer to fetch
|
|
||||||
:param event: The ``slug`` field of the event to fetch
|
|
||||||
:param id: The ``id`` field of the check-in list to fetch
|
|
||||||
:statuscode 200: no error
|
|
||||||
:statuscode 401: Authentication failure
|
|
||||||
:statuscode 403: The requested organizer/event does not exist **or** you have no permission to view this resource.
|
|
||||||
|
|
||||||
.. http:get:: /api/v1/organizers/(organizer)/events/(event)/checkinlists/(id)/status/
|
|
||||||
|
|
||||||
Returns detailed status information on a check-in list, identified by its ID.
|
|
||||||
|
|
||||||
**Example request**:
|
|
||||||
|
|
||||||
.. sourcecode:: http
|
|
||||||
|
|
||||||
GET /api/v1/organizers/bigevents/events/sampleconf/checkinlists/1/status/ HTTP/1.1
|
|
||||||
Host: pretix.eu
|
|
||||||
Accept: application/json, text/javascript
|
|
||||||
|
|
||||||
**Example response**:
|
|
||||||
|
|
||||||
.. sourcecode:: http
|
|
||||||
|
|
||||||
HTTP/1.1 200 OK
|
|
||||||
Vary: Accept
|
|
||||||
Content-Type: application/json
|
|
||||||
|
|
||||||
{
|
|
||||||
"checkin_count": 17,
|
|
||||||
"position_count": 42,
|
|
||||||
"event": {
|
|
||||||
"name": "Demo Converence",
|
|
||||||
},
|
|
||||||
"items": [
|
|
||||||
{
|
|
||||||
"name": "T-Shirt",
|
|
||||||
"id": 1,
|
|
||||||
"checkin_count": 1,
|
|
||||||
"admission": False,
|
|
||||||
"position_count": 1,
|
|
||||||
"variations": [
|
|
||||||
{
|
|
||||||
"value": "Red",
|
|
||||||
"id": 1,
|
|
||||||
"checkin_count": 1,
|
|
||||||
"position_count": 12
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"value": "Blue",
|
|
||||||
"id": 2,
|
|
||||||
"checkin_count": 4,
|
|
||||||
"position_count": 8
|
|
||||||
}
|
|
||||||
]
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "Ticket",
|
|
||||||
"id": 2,
|
|
||||||
"checkin_count": 15,
|
|
||||||
"admission": True,
|
|
||||||
"position_count": 22,
|
|
||||||
"variations": []
|
|
||||||
}
|
|
||||||
]
|
|
||||||
}
|
|
||||||
|
|
||||||
:param organizer: The ``slug`` field of the organizer to fetch
|
|
||||||
:param event: The ``slug`` field of the event to fetch
|
|
||||||
:param id: The ``id`` field of the check-in list to fetch
|
|
||||||
:statuscode 200: no error
|
|
||||||
:statuscode 401: Authentication failure
|
|
||||||
:statuscode 403: The requested organizer/event does not exist **or** you have no permission to view this resource.
|
|
||||||
|
|
||||||
.. http:post:: /api/v1/organizers/(organizer)/events/(event)/checkinlists/
|
|
||||||
|
|
||||||
Creates a new check-in list.
|
|
||||||
|
|
||||||
**Example request**:
|
|
||||||
|
|
||||||
.. sourcecode:: http
|
|
||||||
|
|
||||||
POST /api/v1/organizers/bigevents/events/sampleconf/checkinlists/ HTTP/1.1
|
|
||||||
Host: pretix.eu
|
|
||||||
Accept: application/json, text/javascript
|
|
||||||
Content: application/json
|
|
||||||
|
|
||||||
{
|
|
||||||
"name": "VIP entry",
|
|
||||||
"all_products": false,
|
|
||||||
"limit_products": [1, 2],
|
|
||||||
"subevent": null
|
|
||||||
}
|
|
||||||
|
|
||||||
**Example response**:
|
|
||||||
|
|
||||||
.. sourcecode:: http
|
|
||||||
|
|
||||||
HTTP/1.1 200 OK
|
|
||||||
Vary: Accept
|
|
||||||
Content-Type: application/json
|
|
||||||
|
|
||||||
{
|
|
||||||
"id": 2,
|
|
||||||
"name": "VIP entry",
|
|
||||||
"checkin_count": 0,
|
|
||||||
"position_count": 0,
|
|
||||||
"all_products": false,
|
|
||||||
"limit_products": [1, 2],
|
|
||||||
"include_pending": false,
|
|
||||||
"subevent": null
|
|
||||||
}
|
|
||||||
|
|
||||||
:param organizer: The ``slug`` field of the organizer of the event/item to create a list for
|
|
||||||
:param event: The ``slug`` field of the event to create a list for
|
|
||||||
:statuscode 201: no error
|
|
||||||
:statuscode 400: The list could not be created due to invalid submitted data.
|
|
||||||
:statuscode 401: Authentication failure
|
|
||||||
:statuscode 403: The requested organizer/event does not exist **or** you have no permission to create this resource.
|
|
||||||
|
|
||||||
.. http:patch:: /api/v1/organizers/(organizer)/events/(event)/checkinlists/(id)/
|
|
||||||
|
|
||||||
Update a check-in list. 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 ``id`` field and the ``checkin_count`` and ``position_count``
|
|
||||||
fields.
|
|
||||||
|
|
||||||
**Example request**:
|
|
||||||
|
|
||||||
.. sourcecode:: http
|
|
||||||
|
|
||||||
PATCH /api/v1/organizers/bigevents/events/sampleconf/checkinlists/1/ HTTP/1.1
|
|
||||||
Host: pretix.eu
|
|
||||||
Accept: application/json, text/javascript
|
|
||||||
Content-Type: application/json
|
|
||||||
Content-Length: 94
|
|
||||||
|
|
||||||
{
|
|
||||||
"name": "Backstage",
|
|
||||||
}
|
|
||||||
|
|
||||||
**Example response**:
|
|
||||||
|
|
||||||
.. sourcecode:: http
|
|
||||||
|
|
||||||
HTTP/1.1 200 OK
|
|
||||||
Vary: Accept
|
|
||||||
Content-Type: application/json
|
|
||||||
|
|
||||||
{
|
|
||||||
"id": 2,
|
|
||||||
"name": "Backstage",
|
|
||||||
"checkin_count": 23,
|
|
||||||
"position_count": 42,
|
|
||||||
"all_products": false,
|
|
||||||
"limit_products": [1, 2],
|
|
||||||
"include_pending": false,
|
|
||||||
"subevent": null
|
|
||||||
}
|
|
||||||
|
|
||||||
:param organizer: The ``slug`` field of the organizer to modify
|
|
||||||
:param event: The ``slug`` field of the event to modify
|
|
||||||
:param id: The ``id`` field of the list to modify
|
|
||||||
:statuscode 200: no error
|
|
||||||
:statuscode 400: The list could not be modified due to invalid submitted data
|
|
||||||
:statuscode 401: Authentication failure
|
|
||||||
:statuscode 403: The requested organizer/event does not exist **or** you have no permission to change this resource.
|
|
||||||
|
|
||||||
.. http:delete:: /api/v1/organizers/(organizer)/events/(event)/checkinlist/(id)/
|
|
||||||
|
|
||||||
Delete a check-in list. Note that this also deletes the information on all check-ins performed via this list.
|
|
||||||
|
|
||||||
**Example request**:
|
|
||||||
|
|
||||||
.. sourcecode:: http
|
|
||||||
|
|
||||||
DELETE /api/v1/organizers/bigevents/events/sampleconf/checkinlist/1/ HTTP/1.1
|
|
||||||
Host: pretix.eu
|
|
||||||
Accept: application/json, text/javascript
|
|
||||||
|
|
||||||
**Example response**:
|
|
||||||
|
|
||||||
.. sourcecode:: http
|
|
||||||
|
|
||||||
HTTP/1.1 204 No Content
|
|
||||||
Vary: Accept
|
|
||||||
|
|
||||||
:param organizer: The ``slug`` field of the organizer to modify
|
|
||||||
:param event: The ``slug`` field of the event to modify
|
|
||||||
:param id: The ``id`` field of the check-in list to delete
|
|
||||||
:statuscode 204: no error
|
|
||||||
:statuscode 401: Authentication failure
|
|
||||||
:statuscode 403: The requested organizer/event does not exist **or** you have no permission to delete this resource.
|
|
||||||
|
|
||||||
|
|
||||||
Order position endpoints
|
|
||||||
------------------------
|
|
||||||
|
|
||||||
.. versionchanged:: 1.15
|
|
||||||
|
|
||||||
The order positions endpoint has been extended by the filter queries ``item__in``, ``variation__in``,
|
|
||||||
``order__status__in``, ``subevent__in``, ``addon_to__in``, and ``search``. The search for attendee names and order
|
|
||||||
codes is now case-insensitive.
|
|
||||||
|
|
||||||
The ``.../redeem/`` endpoint has been added.
|
|
||||||
|
|
||||||
.. http:get:: /api/v1/organizers/(organizer)/events/(event)/checkinlists/(list)/positions/
|
|
||||||
|
|
||||||
Returns a list of all order positions within a given event. The result is the same as
|
|
||||||
the :ref:`order-position-resource`, with one important difference: the ``checkins`` value will only include
|
|
||||||
check-ins for the selected list.
|
|
||||||
|
|
||||||
**Example request**:
|
|
||||||
|
|
||||||
.. sourcecode:: http
|
|
||||||
|
|
||||||
GET /api/v1/organizers/bigevents/events/sampleconf/checkinlists/1/positions/ HTTP/1.1
|
|
||||||
Host: pretix.eu
|
|
||||||
Accept: application/json, text/javascript
|
|
||||||
|
|
||||||
**Example response**:
|
|
||||||
|
|
||||||
.. sourcecode:: http
|
|
||||||
|
|
||||||
HTTP/1.1 200 OK
|
|
||||||
Vary: Accept
|
|
||||||
Content-Type: application/json
|
|
||||||
|
|
||||||
{
|
|
||||||
"count": 1,
|
|
||||||
"next": null,
|
|
||||||
"previous": null,
|
|
||||||
"results": [
|
|
||||||
{
|
|
||||||
"id": 23442,
|
|
||||||
"order": "ABC12",
|
|
||||||
"positionid": 1,
|
|
||||||
"item": 1345,
|
|
||||||
"variation": null,
|
|
||||||
"price": "23.00",
|
|
||||||
"attendee_name": "Peter",
|
|
||||||
"attendee_email": null,
|
|
||||||
"voucher": null,
|
|
||||||
"tax_rate": "0.00",
|
|
||||||
"tax_rule": null,
|
|
||||||
"tax_value": "0.00",
|
|
||||||
"secret": "z3fsn8jyufm5kpk768q69gkbyr5f4h6w",
|
|
||||||
"addon_to": null,
|
|
||||||
"subevent": null,
|
|
||||||
"pseudonymization_id": "MQLJvANO3B",
|
|
||||||
"checkins": [
|
|
||||||
{
|
|
||||||
"list": 1,
|
|
||||||
"datetime": "2017-12-25T12:45:23Z"
|
|
||||||
}
|
|
||||||
],
|
|
||||||
"answers": [
|
|
||||||
{
|
|
||||||
"question": 12,
|
|
||||||
"answer": "Foo",
|
|
||||||
"options": []
|
|
||||||
}
|
|
||||||
],
|
|
||||||
"downloads": [
|
|
||||||
{
|
|
||||||
"output": "pdf",
|
|
||||||
"url": "https://pretix.eu/api/v1/organizers/bigevents/events/sampleconf/orderpositions/23442/download/pdf/"
|
|
||||||
}
|
|
||||||
]
|
|
||||||
}
|
|
||||||
]
|
|
||||||
}
|
|
||||||
|
|
||||||
:query integer page: The page number in case of a multi-page result set, default is 1
|
|
||||||
:query string ordering: Manually set the ordering of results. Valid fields to be used are ``order__code``,
|
|
||||||
``order__datetime``, ``positionid``, ``attendee_name``, ``last_checked_in`` and ``order__email``. Default:
|
|
||||||
``attendee_name,positionid``
|
|
||||||
:query string order: Only return positions of the order with the given order code
|
|
||||||
:query string search: Fuzzy search matching the attendee name, order code, invoice address name as well as to the beginning of the secret.
|
|
||||||
:query integer item: Only return positions with the purchased item matching the given ID.
|
|
||||||
:query integer item__in: Only return positions with the purchased item matching one of the given comma-separated IDs.
|
|
||||||
:query integer variation: Only return positions with the purchased item variation matching the given ID.
|
|
||||||
:query integer variation__in: Only return positions with one of the purchased item variation matching the given
|
|
||||||
comma-separated IDs.
|
|
||||||
:query string attendee_name: Only return positions with the given value in the attendee_name field. Also, add-on
|
|
||||||
products positions are shown if they refer to an attendee with the given name.
|
|
||||||
:query string secret: Only return positions with the given ticket secret.
|
|
||||||
:query string order__status: Only return positions with the given order status.
|
|
||||||
:query string order__status__in: Only return positions with one the given comma-separated order status.
|
|
||||||
:query boolean has_checkin: If set to ``true`` or ``false``, only return positions that have or have not been
|
|
||||||
checked in already.
|
|
||||||
:query integer subevent: Only return positions of the sub-event with the given ID
|
|
||||||
:query integer subevent__in: Only return positions of one of the sub-events with the given comma-separated IDs
|
|
||||||
:query integer addon_to: Only return positions that are add-ons to the position with the given ID.
|
|
||||||
:query integer addon_to__in: Only return positions that are add-ons to one of the positions with the given
|
|
||||||
comma-separated IDs.
|
|
||||||
:param organizer: The ``slug`` field of the organizer to fetch
|
|
||||||
:param event: The ``slug`` field of the event to fetch
|
|
||||||
:param list: The ID of the check-in list to look for
|
|
||||||
:statuscode 200: no error
|
|
||||||
:statuscode 401: Authentication failure
|
|
||||||
:statuscode 403: The requested organizer/event does not exist **or** you have no permission to view this resource.
|
|
||||||
:statuscode 404: The requested check-in list does not exist.
|
|
||||||
|
|
||||||
.. http:get:: /api/v1/organizers/(organizer)/events/(event)/checkinlists/(list)/positions/(id)/
|
|
||||||
|
|
||||||
Returns information on one order position, identified by its internal ID.
|
|
||||||
The result format is the same as the :ref:`order-position-resource`, with one important difference: the
|
|
||||||
``checkins`` value will only include check-ins for the selected list.
|
|
||||||
|
|
||||||
**Example request**:
|
|
||||||
|
|
||||||
.. sourcecode:: http
|
|
||||||
|
|
||||||
GET /api/v1/organizers/bigevents/events/sampleconf/checkinlists/1/positions/23442/ HTTP/1.1
|
|
||||||
Host: pretix.eu
|
|
||||||
Accept: application/json, text/javascript
|
|
||||||
|
|
||||||
**Example response**:
|
|
||||||
|
|
||||||
.. sourcecode:: http
|
|
||||||
|
|
||||||
HTTP/1.1 200 OK
|
|
||||||
Vary: Accept
|
|
||||||
Content-Type: application/json
|
|
||||||
|
|
||||||
{
|
|
||||||
"id": 23442,
|
|
||||||
"order": "ABC12",
|
|
||||||
"positionid": 1,
|
|
||||||
"item": 1345,
|
|
||||||
"variation": null,
|
|
||||||
"price": "23.00",
|
|
||||||
"attendee_name": "Peter",
|
|
||||||
"attendee_email": null,
|
|
||||||
"voucher": null,
|
|
||||||
"tax_rate": "0.00",
|
|
||||||
"tax_rule": null,
|
|
||||||
"tax_value": "0.00",
|
|
||||||
"secret": "z3fsn8jyufm5kpk768q69gkbyr5f4h6w",
|
|
||||||
"addon_to": null,
|
|
||||||
"subevent": null,
|
|
||||||
"pseudonymization_id": "MQLJvANO3B",
|
|
||||||
"checkins": [
|
|
||||||
{
|
|
||||||
"list": 1,
|
|
||||||
"datetime": "2017-12-25T12:45:23Z"
|
|
||||||
}
|
|
||||||
],
|
|
||||||
"answers": [
|
|
||||||
{
|
|
||||||
"question": 12,
|
|
||||||
"answer": "Foo",
|
|
||||||
"options": []
|
|
||||||
}
|
|
||||||
],
|
|
||||||
"downloads": [
|
|
||||||
{
|
|
||||||
"output": "pdf",
|
|
||||||
"url": "https://pretix.eu/api/v1/organizers/bigevents/events/sampleconf/orderpositions/23442/download/pdf/"
|
|
||||||
}
|
|
||||||
]
|
|
||||||
}
|
|
||||||
|
|
||||||
:param organizer: The ``slug`` field of the organizer to fetch
|
|
||||||
:param event: The ``slug`` field of the event to fetch
|
|
||||||
:param list: The ID of the check-in list to look for
|
|
||||||
:param id: The ``id`` field of the order position to fetch
|
|
||||||
:statuscode 200: no error
|
|
||||||
:statuscode 401: Authentication failure
|
|
||||||
:statuscode 403: The requested organizer/event does not exist **or** you have no permission to view this resource.
|
|
||||||
:statuscode 404: The requested order position or check-in list does not exist.
|
|
||||||
|
|
||||||
.. http:post:: /api/v1/organizers/(organizer)/events/(event)/checkinlists/(list)/positions/(id)/redeem/
|
|
||||||
|
|
||||||
Tries to redeem an order position, identified by its internal ID, i.e. checks the attendee in. This endpoint
|
|
||||||
accepts a number of optional requests in the body.
|
|
||||||
|
|
||||||
:<json boolean questions_supported: When this parameter is set to ``true``, handling of questions is supported. If
|
|
||||||
you do not implement question handling in your user interface, you **must**
|
|
||||||
set this to ``false``. In that case, questions will just be ignored. Defaults
|
|
||||||
to ``true``.
|
|
||||||
:<json datetime datetime: Specifies the datetime of the check-in. If not supplied, the current time will be used.
|
|
||||||
:<json boolean force: Specifies that the check-in should succeed regardless of previous check-ins or required
|
|
||||||
questions that have not been filled. Defaults to ``false``.
|
|
||||||
:<json boolean ignore_unpaid: Specifies that the check-in should succeed even if the order is in pending state.
|
|
||||||
Defaults to ``false``.
|
|
||||||
:<json string nonce: You can set this parameter to a unique random value to identify this check-in. If you're sending
|
|
||||||
this request twice with the same nonce, the second request will also succeed but will always
|
|
||||||
create only one check-in object even when the previous request was successful as well. This
|
|
||||||
allows for a certain level of idempotency and enables you to re-try after a connection failure.
|
|
||||||
:<json object answers: If questions are supported/required, you may/must supply a mapping of question IDs to their
|
|
||||||
respective answers. The answers should always be strings. In case of (multiple-)choice-type
|
|
||||||
answers, the string should contain the (comma-separated) IDs of the selected options.
|
|
||||||
|
|
||||||
**Example request**:
|
|
||||||
|
|
||||||
.. sourcecode:: http
|
|
||||||
|
|
||||||
POST /api/v1/organizers/bigevents/events/sampleconf/checkinlists/1/positions/234/redeem/ HTTP/1.1
|
|
||||||
Host: pretix.eu
|
|
||||||
Accept: application/json, text/javascript
|
|
||||||
|
|
||||||
{
|
|
||||||
"force": false,
|
|
||||||
"ignore_unpaid": false,
|
|
||||||
"nonce": "Pvrk50vUzQd0DhdpNRL4I4OcXsvg70uA",
|
|
||||||
"datetime": null,
|
|
||||||
"questions_supported": true,
|
|
||||||
"answers": {
|
|
||||||
"4": "XS"
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
**Example successful response**:
|
|
||||||
|
|
||||||
.. sourcecode:: http
|
|
||||||
|
|
||||||
HTTP/1.1 201 Created
|
|
||||||
Vary: Accept
|
|
||||||
Content-Type: application/json
|
|
||||||
|
|
||||||
{
|
|
||||||
"status": "ok"
|
|
||||||
}
|
|
||||||
|
|
||||||
**Example response with required questions**:
|
|
||||||
|
|
||||||
.. sourcecode:: http
|
|
||||||
|
|
||||||
HTTP/1.1 400 Bad Request
|
|
||||||
Content-Type: text/json
|
|
||||||
|
|
||||||
{
|
|
||||||
"status": "incomplete"
|
|
||||||
"questions": [
|
|
||||||
{
|
|
||||||
"id": 1,
|
|
||||||
"question": {"en": "T-Shirt size"},
|
|
||||||
"type": "C",
|
|
||||||
"required": false,
|
|
||||||
"items": [1, 2],
|
|
||||||
"position": 1,
|
|
||||||
"identifier": "WY3TP9SL",
|
|
||||||
"ask_during_checkin": true,
|
|
||||||
"options": [
|
|
||||||
{
|
|
||||||
"id": 1,
|
|
||||||
"identifier": "LVETRWVU",
|
|
||||||
"position": 0,
|
|
||||||
"answer": {"en": "S"}
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"id": 2,
|
|
||||||
"identifier": "DFEMJWMJ",
|
|
||||||
"position": 1,
|
|
||||||
"answer": {"en": "M"}
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"id": 3,
|
|
||||||
"identifier": "W9AH7RDE",
|
|
||||||
"position": 2,
|
|
||||||
"answer": {"en": "L"}
|
|
||||||
}
|
|
||||||
]
|
|
||||||
}
|
|
||||||
]
|
|
||||||
}
|
|
||||||
|
|
||||||
**Example error response**:
|
|
||||||
|
|
||||||
.. sourcecode:: http
|
|
||||||
|
|
||||||
HTTP/1.1 200 OK
|
|
||||||
Content-Type: text/json
|
|
||||||
|
|
||||||
{
|
|
||||||
"status": "error",
|
|
||||||
"reason": "unpaid",
|
|
||||||
}
|
|
||||||
|
|
||||||
Possible error reasons:
|
|
||||||
|
|
||||||
* ``unpaid`` - Ticket is not paid for or has been refunded
|
|
||||||
* ``already_redeemed`` - Ticket already has been redeemed
|
|
||||||
* ``product`` - Tickets with this product may not be scanned at this device
|
|
||||||
|
|
||||||
:param organizer: The ``slug`` field of the organizer to fetch
|
|
||||||
:param event: The ``slug`` field of the event to fetch
|
|
||||||
:param list: The ID of the check-in list to look for
|
|
||||||
:param id: The ``id`` field of the order position to fetch
|
|
||||||
:statuscode 201: no error
|
|
||||||
:statuscode 400: Invalid or incomplete request, see above
|
|
||||||
:statuscode 401: Authentication failure
|
|
||||||
:statuscode 403: The requested organizer/event does not exist **or** you have no permission to view this resource.
|
|
||||||
:statuscode 404: The requested order position or check-in list does not exist.
|
|
||||||
@@ -24,23 +24,9 @@ is_public boolean If ``true``, th
|
|||||||
presale_start datetime The date at which the ticket shop opens (or ``null``)
|
presale_start datetime The date at which the ticket shop opens (or ``null``)
|
||||||
presale_end datetime The date at which the ticket shop closes (or ``null``)
|
presale_end datetime The date at which the ticket shop closes (or ``null``)
|
||||||
location multi-lingual string The event location (or ``null``)
|
location multi-lingual string The event location (or ``null``)
|
||||||
has_subevents boolean ``True`` if the event series feature is active for this
|
|
||||||
event. Cannot change after event is created.
|
|
||||||
meta_data dict Values set for organizer-specific meta data parameters.
|
|
||||||
plugins list A list of package names of the enabled plugins for this
|
|
||||||
event.
|
|
||||||
===================================== ========================== =======================================================
|
===================================== ========================== =======================================================
|
||||||
|
|
||||||
|
|
||||||
.. versionchanged:: 1.7
|
|
||||||
|
|
||||||
The ``meta_data`` field has been added.
|
|
||||||
|
|
||||||
.. versionchanged:: 1.15
|
|
||||||
|
|
||||||
The ``plugins`` field has been added.
|
|
||||||
The operations POST, PATCH, PUT and DELETE have been added.
|
|
||||||
|
|
||||||
Endpoints
|
Endpoints
|
||||||
---------
|
---------
|
||||||
|
|
||||||
@@ -48,8 +34,6 @@ Endpoints
|
|||||||
|
|
||||||
Returns a list of all events within a given organizer the authenticated user/token has access to.
|
Returns a list of all events within a given organizer the authenticated user/token has access to.
|
||||||
|
|
||||||
Permission required: "Can change event settings"
|
|
||||||
|
|
||||||
**Example request**:
|
**Example request**:
|
||||||
|
|
||||||
.. sourcecode:: http
|
.. sourcecode:: http
|
||||||
@@ -64,7 +48,7 @@ Endpoints
|
|||||||
|
|
||||||
HTTP/1.1 200 OK
|
HTTP/1.1 200 OK
|
||||||
Vary: Accept
|
Vary: Accept
|
||||||
Content-Type: application/json
|
Content-Type: text/javascript
|
||||||
|
|
||||||
{
|
{
|
||||||
"count": 1,
|
"count": 1,
|
||||||
@@ -83,14 +67,6 @@ Endpoints
|
|||||||
"presale_start": null,
|
"presale_start": null,
|
||||||
"presale_end": null,
|
"presale_end": null,
|
||||||
"location": null,
|
"location": null,
|
||||||
"has_subevents": false,
|
|
||||||
"meta_data": {},
|
|
||||||
"plugins": [
|
|
||||||
"pretix.plugins.banktransfer"
|
|
||||||
"pretix.plugins.stripe"
|
|
||||||
"pretix.plugins.paypal"
|
|
||||||
"pretix.plugins.ticketoutputpdf"
|
|
||||||
]
|
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
@@ -105,8 +81,6 @@ Endpoints
|
|||||||
|
|
||||||
Returns information on one event, identified by its slug.
|
Returns information on one event, identified by its slug.
|
||||||
|
|
||||||
Permission required: "Can change event settings"
|
|
||||||
|
|
||||||
**Example request**:
|
**Example request**:
|
||||||
|
|
||||||
.. sourcecode:: http
|
.. sourcecode:: http
|
||||||
@@ -121,7 +95,7 @@ Endpoints
|
|||||||
|
|
||||||
HTTP/1.1 200 OK
|
HTTP/1.1 200 OK
|
||||||
Vary: Accept
|
Vary: Accept
|
||||||
Content-Type: application/json
|
Content-Type: text/javascript
|
||||||
|
|
||||||
{
|
{
|
||||||
"name": {"en": "Sample Conference"},
|
"name": {"en": "Sample Conference"},
|
||||||
@@ -135,14 +109,6 @@ Endpoints
|
|||||||
"presale_start": null,
|
"presale_start": null,
|
||||||
"presale_end": null,
|
"presale_end": null,
|
||||||
"location": null,
|
"location": null,
|
||||||
"has_subevents": false,
|
|
||||||
"meta_data": {},
|
|
||||||
"plugins": [
|
|
||||||
"pretix.plugins.banktransfer"
|
|
||||||
"pretix.plugins.stripe"
|
|
||||||
"pretix.plugins.paypal"
|
|
||||||
"pretix.plugins.ticketoutputpdf"
|
|
||||||
]
|
|
||||||
}
|
}
|
||||||
|
|
||||||
:param organizer: The ``slug`` field of the organizer to fetch
|
:param organizer: The ``slug`` field of the organizer to fetch
|
||||||
@@ -150,242 +116,3 @@ Endpoints
|
|||||||
:statuscode 200: no error
|
:statuscode 200: no error
|
||||||
:statuscode 401: Authentication failure
|
:statuscode 401: Authentication failure
|
||||||
:statuscode 403: The requested organizer/event does not exist **or** you have no permission to view it.
|
:statuscode 403: The requested organizer/event does not exist **or** you have no permission to view it.
|
||||||
|
|
||||||
.. http:post:: /api/v1/organizers/(organizer)/events/
|
|
||||||
|
|
||||||
Creates a new event
|
|
||||||
|
|
||||||
Please note that events cannot be created as 'live' using this endpoint. Quotas and payment must be added to the
|
|
||||||
event before sales can go live.
|
|
||||||
|
|
||||||
Permission required: "Can create events"
|
|
||||||
|
|
||||||
**Example request**:
|
|
||||||
|
|
||||||
.. sourcecode:: http
|
|
||||||
|
|
||||||
POST /api/v1/organizers/bigevents/events/ HTTP/1.1
|
|
||||||
Host: pretix.eu
|
|
||||||
Accept: application/json, text/javascript
|
|
||||||
Content: application/json
|
|
||||||
|
|
||||||
{
|
|
||||||
"name": {"en": "Sample Conference"},
|
|
||||||
"slug": "sampleconf",
|
|
||||||
"live": false,
|
|
||||||
"currency": "EUR",
|
|
||||||
"date_from": "2017-12-27T10:00:00Z",
|
|
||||||
"date_to": null,
|
|
||||||
"date_admission": null,
|
|
||||||
"is_public": false,
|
|
||||||
"presale_start": null,
|
|
||||||
"presale_end": null,
|
|
||||||
"location": null,
|
|
||||||
"has_subevents": false,
|
|
||||||
"meta_data": {},
|
|
||||||
"plugins": [
|
|
||||||
"pretix.plugins.stripe",
|
|
||||||
"pretix.plugins.paypal"
|
|
||||||
]
|
|
||||||
}
|
|
||||||
|
|
||||||
**Example response**:
|
|
||||||
|
|
||||||
.. sourcecode:: http
|
|
||||||
|
|
||||||
HTTP/1.1 201 Created
|
|
||||||
Vary: Accept
|
|
||||||
Content-Type: application/json
|
|
||||||
|
|
||||||
{
|
|
||||||
"name": {"en": "Sample Conference"},
|
|
||||||
"slug": "sampleconf",
|
|
||||||
"live": false,
|
|
||||||
"currency": "EUR",
|
|
||||||
"date_from": "2017-12-27T10:00:00Z",
|
|
||||||
"date_to": null,
|
|
||||||
"date_admission": null,
|
|
||||||
"is_public": false,
|
|
||||||
"presale_start": null,
|
|
||||||
"presale_end": null,
|
|
||||||
"location": null,
|
|
||||||
"has_subevents": false,
|
|
||||||
"meta_data": {},
|
|
||||||
"plugins": [
|
|
||||||
"pretix.plugins.stripe",
|
|
||||||
"pretix.plugins.paypal"
|
|
||||||
]
|
|
||||||
}
|
|
||||||
|
|
||||||
:param organizer: The ``slug`` field of the organizer of the event to create.
|
|
||||||
:statuscode 201: no error
|
|
||||||
:statuscode 400: The event could not be created due to invalid submitted data.
|
|
||||||
:statuscode 401: Authentication failure
|
|
||||||
:statuscode 403: The requested organizer does not exist **or** you have no permission to create this resource.
|
|
||||||
|
|
||||||
|
|
||||||
.. http:post:: /api/v1/organizers/(organizer)/events/(event)/clone/
|
|
||||||
|
|
||||||
Creates a new event with properties as set in the request body. The properties that are copied are: 'is_public',
|
|
||||||
settings, plugin settings, items, variations, add-ons, quotas, categories, tax rules, questions.
|
|
||||||
|
|
||||||
If the 'plugins' and/or 'is_public' fields are present in the post body this will determine their value. Otherwise
|
|
||||||
their value will be copied from the existing event.
|
|
||||||
|
|
||||||
Please note that you can only copy from events under the same organizer.
|
|
||||||
|
|
||||||
Permission required: "Can create events"
|
|
||||||
|
|
||||||
**Example request**:
|
|
||||||
|
|
||||||
.. sourcecode:: http
|
|
||||||
|
|
||||||
POST /api/v1/organizers/bigevents/events/sampleconf/clone/ HTTP/1.1
|
|
||||||
Host: pretix.eu
|
|
||||||
Accept: application/json, text/javascript
|
|
||||||
Content: application/json
|
|
||||||
|
|
||||||
{
|
|
||||||
"name": {"en": "Sample Conference"},
|
|
||||||
"slug": "sampleconf",
|
|
||||||
"live": false,
|
|
||||||
"currency": "EUR",
|
|
||||||
"date_from": "2017-12-27T10:00:00Z",
|
|
||||||
"date_to": null,
|
|
||||||
"date_admission": null,
|
|
||||||
"is_public": false,
|
|
||||||
"presale_start": null,
|
|
||||||
"presale_end": null,
|
|
||||||
"location": null,
|
|
||||||
"has_subevents": false,
|
|
||||||
"meta_data": {},
|
|
||||||
"plugins": [
|
|
||||||
"pretix.plugins.stripe",
|
|
||||||
"pretix.plugins.paypal"
|
|
||||||
]
|
|
||||||
}
|
|
||||||
|
|
||||||
**Example response**:
|
|
||||||
|
|
||||||
.. sourcecode:: http
|
|
||||||
|
|
||||||
HTTP/1.1 201 Created
|
|
||||||
Vary: Accept
|
|
||||||
Content-Type: application/json
|
|
||||||
|
|
||||||
{
|
|
||||||
"name": {"en": "Sample Conference"},
|
|
||||||
"slug": "sampleconf",
|
|
||||||
"live": false,
|
|
||||||
"currency": "EUR",
|
|
||||||
"date_from": "2017-12-27T10:00:00Z",
|
|
||||||
"date_to": null,
|
|
||||||
"date_admission": null,
|
|
||||||
"is_public": false,
|
|
||||||
"presale_start": null,
|
|
||||||
"presale_end": null,
|
|
||||||
"location": null,
|
|
||||||
"has_subevents": false,
|
|
||||||
"meta_data": {},
|
|
||||||
"plugins": [
|
|
||||||
"pretix.plugins.stripe",
|
|
||||||
"pretix.plugins.paypal"
|
|
||||||
]
|
|
||||||
}
|
|
||||||
|
|
||||||
:param organizer: The ``slug`` field of the organizer of the event to create.
|
|
||||||
:param event: The ``slug`` field of the event to copy settings and items from.
|
|
||||||
:statuscode 201: no error
|
|
||||||
:statuscode 400: The event could not be created due to invalid submitted data.
|
|
||||||
:statuscode 401: Authentication failure
|
|
||||||
:statuscode 403: The requested organizer does not exist **or** you have no permission to create this resource.
|
|
||||||
|
|
||||||
|
|
||||||
.. http:patch:: /api/v1/organizers/(organizer)/events/(event)/
|
|
||||||
|
|
||||||
Updates an event
|
|
||||||
|
|
||||||
Permission required: "Can change event settings"
|
|
||||||
|
|
||||||
**Example request**:
|
|
||||||
|
|
||||||
.. sourcecode:: http
|
|
||||||
|
|
||||||
PATCH /api/v1/organizers/bigevents/events/sampleconf/ HTTP/1.1
|
|
||||||
Host: pretix.eu
|
|
||||||
Accept: application/json, text/javascript
|
|
||||||
Content: application/json
|
|
||||||
|
|
||||||
{
|
|
||||||
"plugins": [
|
|
||||||
"pretix.plugins.banktransfer",
|
|
||||||
"pretix.plugins.stripe",
|
|
||||||
"pretix.plugins.paypal",
|
|
||||||
"pretix.plugins.pretixdroid"
|
|
||||||
]
|
|
||||||
}
|
|
||||||
|
|
||||||
**Example response**:
|
|
||||||
|
|
||||||
.. sourcecode:: http
|
|
||||||
|
|
||||||
HTTP/1.1 200 OK
|
|
||||||
Vary: Accept
|
|
||||||
Content-Type: application/json
|
|
||||||
|
|
||||||
{
|
|
||||||
"name": {"en": "Sample Conference"},
|
|
||||||
"slug": "sampleconf",
|
|
||||||
"live": false,
|
|
||||||
"currency": "EUR",
|
|
||||||
"date_from": "2017-12-27T10:00:00Z",
|
|
||||||
"date_to": null,
|
|
||||||
"date_admission": null,
|
|
||||||
"is_public": false,
|
|
||||||
"presale_start": null,
|
|
||||||
"presale_end": null,
|
|
||||||
"location": null,
|
|
||||||
"has_subevents": false,
|
|
||||||
"meta_data": {},
|
|
||||||
"plugins": [
|
|
||||||
"pretix.plugins.banktransfer",
|
|
||||||
"pretix.plugins.stripe",
|
|
||||||
"pretix.plugins.paypal",
|
|
||||||
"pretix.plugins.pretixdroid"
|
|
||||||
]
|
|
||||||
}
|
|
||||||
|
|
||||||
:param organizer: The ``slug`` field of the organizer of the event to update
|
|
||||||
:param event: The ``slug`` field of the event to update
|
|
||||||
:statuscode 201: no error
|
|
||||||
:statuscode 400: The event could not be created due to invalid submitted data.
|
|
||||||
:statuscode 401: Authentication failure
|
|
||||||
:statuscode 403: The requested organizer/event does not exist **or** you have no permission to create this resource.
|
|
||||||
|
|
||||||
|
|
||||||
.. http:delete:: /api/v1/organizers/(organizer)/events/(event)/items/(id)/
|
|
||||||
|
|
||||||
Delete an event. Note that events with orders cannot be deleted to ensure data integrity.
|
|
||||||
|
|
||||||
Permission required: "Can change event settings"
|
|
||||||
|
|
||||||
**Example request**:
|
|
||||||
|
|
||||||
.. sourcecode:: http
|
|
||||||
|
|
||||||
DELETE /api/v1/organizers/bigevents/events/sampleconf/ HTTP/1.1
|
|
||||||
Host: pretix.eu
|
|
||||||
Accept: application/json, text/javascript
|
|
||||||
|
|
||||||
**Example response**:
|
|
||||||
|
|
||||||
.. sourcecode:: http
|
|
||||||
|
|
||||||
HTTP/1.1 204 No Content
|
|
||||||
Vary: Accept
|
|
||||||
|
|
||||||
:param organizer: The ``slug`` field of the organizer to modify
|
|
||||||
:param event: The ``slug`` field of the event to delete
|
|
||||||
:statuscode 204: no error
|
|
||||||
:statuscode 401: Authentication failure
|
|
||||||
:statuscode 403: The requested organizer/event does not exist **or** you have no permission to delete this resource.
|
|
||||||
|
|||||||
@@ -6,18 +6,11 @@ Resources and endpoints
|
|||||||
|
|
||||||
organizers
|
organizers
|
||||||
events
|
events
|
||||||
subevents
|
|
||||||
taxrules
|
|
||||||
categories
|
categories
|
||||||
items
|
items
|
||||||
item_variations
|
|
||||||
item_add-ons
|
|
||||||
questions
|
questions
|
||||||
question_options
|
|
||||||
quotas
|
quotas
|
||||||
orders
|
orders
|
||||||
invoices
|
invoices
|
||||||
vouchers
|
vouchers
|
||||||
checkinlists
|
|
||||||
waitinglist
|
waitinglist
|
||||||
carts
|
|
||||||
|
|||||||
@@ -11,7 +11,7 @@ The invoice resource contains the following public fields:
|
|||||||
===================================== ========================== =======================================================
|
===================================== ========================== =======================================================
|
||||||
Field Type Description
|
Field Type Description
|
||||||
===================================== ========================== =======================================================
|
===================================== ========================== =======================================================
|
||||||
number string Invoice number (with prefix)
|
invoice_no string Invoice number (without prefix)
|
||||||
order string Order code of the order this invoice belongs to
|
order string Order code of the order this invoice belongs to
|
||||||
is_cancellation boolean ``True``, if this invoice is the cancellation of a
|
is_cancellation boolean ``True``, if this invoice is the cancellation of a
|
||||||
different invoice.
|
different invoice.
|
||||||
@@ -29,40 +29,12 @@ payment_provider_text string Text to be prin
|
|||||||
footer_text string Text to be printed in the page footer area
|
footer_text string Text to be printed in the page footer area
|
||||||
lines list of objects The actual invoice contents
|
lines list of objects The actual invoice contents
|
||||||
├ description string Text representing the invoice line (e.g. product name)
|
├ description string Text representing the invoice line (e.g. product name)
|
||||||
├ gross_value money (string) Price including taxes
|
├ gross_value money (string) Price including VAT
|
||||||
├ tax_value money (string) Tax amount included
|
├ tax_value money (string) VAT amount
|
||||||
├ tax_name string Name of used tax rate (e.g. "VAT")
|
└ tax_rate decimal (string) Used VAT rate
|
||||||
└ tax_rate decimal (string) Used tax rate
|
|
||||||
foreign_currency_display string If the invoice should also show the total and tax
|
|
||||||
amount in a different currency, this contains the
|
|
||||||
currency code (``null`` otherwise).
|
|
||||||
foreign_currency_rate decimal (string) If ``foreign_currency_rate`` is set and the system
|
|
||||||
knows the exchange rate to the event currency at
|
|
||||||
invoicing time, it is stored here.
|
|
||||||
foreign_currency_rate_date date If ``foreign_currency_rate`` is set, this signifies the
|
|
||||||
date at which the currency rate was obtained.
|
|
||||||
internal_reference string Customer's reference to be printed on the invoice.
|
|
||||||
===================================== ========================== =======================================================
|
===================================== ========================== =======================================================
|
||||||
|
|
||||||
|
|
||||||
.. versionchanged:: 1.6
|
|
||||||
|
|
||||||
The attribute ``invoice_no`` has been dropped in favor of ``number`` which includes the number including the prefix,
|
|
||||||
since the prefix can now vary. Also, invoices now need to be identified by their ``number`` instead of the raw
|
|
||||||
number.
|
|
||||||
|
|
||||||
|
|
||||||
.. versionchanged:: 1.7
|
|
||||||
|
|
||||||
The attributes ``lines.tax_name``, ``foreign_currency_display``, ``foreign_currency_rate``, and
|
|
||||||
``foreign_currency_rate_date`` have been added.
|
|
||||||
|
|
||||||
|
|
||||||
.. versionchanged:: 1.9
|
|
||||||
|
|
||||||
The attribute ``internal_reference`` has been added.
|
|
||||||
|
|
||||||
|
|
||||||
Endpoints
|
Endpoints
|
||||||
---------
|
---------
|
||||||
|
|
||||||
@@ -84,7 +56,7 @@ Endpoints
|
|||||||
|
|
||||||
HTTP/1.1 200 OK
|
HTTP/1.1 200 OK
|
||||||
Vary: Accept
|
Vary: Accept
|
||||||
Content-Type: application/json
|
Content-Type: text/javascript
|
||||||
|
|
||||||
{
|
{
|
||||||
"count": 1,
|
"count": 1,
|
||||||
@@ -92,7 +64,7 @@ Endpoints
|
|||||||
"previous": null,
|
"previous": null,
|
||||||
"results": [
|
"results": [
|
||||||
{
|
{
|
||||||
"number": "SAMPLECONF-00001",
|
"invoice_no": "00001",
|
||||||
"order": "ABC12",
|
"order": "ABC12",
|
||||||
"is_cancellation": false,
|
"is_cancellation": false,
|
||||||
"invoice_from": "Big Events LLC\nDemo street 12\nDemo town",
|
"invoice_from": "Big Events LLC\nDemo street 12\nDemo town",
|
||||||
@@ -101,7 +73,6 @@ Endpoints
|
|||||||
"refers": null,
|
"refers": null,
|
||||||
"locale": "en",
|
"locale": "en",
|
||||||
"introductory_text": "thank you for your purchase of the following items:",
|
"introductory_text": "thank you for your purchase of the following items:",
|
||||||
"internal_reference": "",
|
|
||||||
"additional_text": "We are looking forward to see you on our conference!",
|
"additional_text": "We are looking forward to see you on our conference!",
|
||||||
"payment_provider_text": "Please transfer the money to our account ABC…",
|
"payment_provider_text": "Please transfer the money to our account ABC…",
|
||||||
"footer_text": "Big Events LLC - Registration No. 123456 - VAT ID: EU0987654321",
|
"footer_text": "Big Events LLC - Registration No. 123456 - VAT ID: EU0987654321",
|
||||||
@@ -110,13 +81,9 @@ Endpoints
|
|||||||
"description": "Budget Ticket",
|
"description": "Budget Ticket",
|
||||||
"gross_value": "23.00",
|
"gross_value": "23.00",
|
||||||
"tax_value": "0.00",
|
"tax_value": "0.00",
|
||||||
"tax_name": "VAT",
|
|
||||||
"tax_rate": "0.00"
|
"tax_rate": "0.00"
|
||||||
}
|
}
|
||||||
],
|
]
|
||||||
"foreign_currency_display": "PLN",
|
|
||||||
"foreign_currency_rate": "4.2408",
|
|
||||||
"foreign_currency_rate_date": "2017-07-24"
|
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
@@ -125,17 +92,17 @@ Endpoints
|
|||||||
:query boolean is_cancellation: If set to ``true`` or ``false``, only invoices with this value for the field
|
:query boolean is_cancellation: If set to ``true`` or ``false``, only invoices with this value for the field
|
||||||
``is_cancellation`` will be returned.
|
``is_cancellation`` will be returned.
|
||||||
:query string order: If set, only invoices belonging to the order with the given order code will be returned.
|
:query string order: If set, only invoices belonging to the order with the given order code will be returned.
|
||||||
:query string refers: If set, only invoices referring to the given invoice will be returned.
|
:query string refers: If set, only invoices refering to the given invoice will be returned.
|
||||||
:query string locale: If set, only invoices with the given locale will be returned.
|
:query string locale: If set, only invoices with the given locale will be returned.
|
||||||
:query string ordering: Manually set the ordering of results. Valid fields to be used are ``date`` and
|
:query string ordering: Manually set the ordering of results. Valid fields to be used are ``date`` and
|
||||||
``nr`` (equals to ``number``). Default: ``nr``
|
``invoice_no``. Default: ``invoice_no``
|
||||||
:param organizer: The ``slug`` field of the organizer to fetch
|
:param organizer: The ``slug`` field of the organizer to fetch
|
||||||
:param event: The ``slug`` field of the event to fetch
|
:param event: The ``slug`` field of the event to fetch
|
||||||
:statuscode 200: no error
|
:statuscode 200: no error
|
||||||
:statuscode 401: Authentication failure
|
:statuscode 401: Authentication failure
|
||||||
:statuscode 403: The requested organizer/event does not exist **or** you have no permission to view this resource.
|
:statuscode 403: The requested organizer/event does not exist **or** you have no permission to view this resource.
|
||||||
|
|
||||||
.. http:get:: /api/v1/organizers/(organizer)/events/(event)/invoices/(number)/
|
.. http:get:: /api/v1/organizers/(organizer)/events/(event)/invoices/(invoice_no)/
|
||||||
|
|
||||||
Returns information on one invoice, identified by its invoice number.
|
Returns information on one invoice, identified by its invoice number.
|
||||||
|
|
||||||
@@ -143,7 +110,7 @@ Endpoints
|
|||||||
|
|
||||||
.. sourcecode:: http
|
.. sourcecode:: http
|
||||||
|
|
||||||
GET /api/v1/organizers/bigevents/events/sampleconf/invoices/SAMPLECONF-00001/ HTTP/1.1
|
GET /api/v1/organizers/bigevents/events/sampleconf/invoices/00001/ HTTP/1.1
|
||||||
Host: pretix.eu
|
Host: pretix.eu
|
||||||
Accept: application/json, text/javascript
|
Accept: application/json, text/javascript
|
||||||
|
|
||||||
@@ -153,10 +120,10 @@ Endpoints
|
|||||||
|
|
||||||
HTTP/1.1 200 OK
|
HTTP/1.1 200 OK
|
||||||
Vary: Accept
|
Vary: Accept
|
||||||
Content-Type: application/json
|
Content-Type: text/javascript
|
||||||
|
|
||||||
{
|
{
|
||||||
"number": "SAMPLECONF-00001",
|
"invoice_no": "00001",
|
||||||
"order": "ABC12",
|
"order": "ABC12",
|
||||||
"is_cancellation": false,
|
"is_cancellation": false,
|
||||||
"invoice_from": "Big Events LLC\nDemo street 12\nDemo town",
|
"invoice_from": "Big Events LLC\nDemo street 12\nDemo town",
|
||||||
@@ -165,7 +132,6 @@ Endpoints
|
|||||||
"refers": null,
|
"refers": null,
|
||||||
"locale": "en",
|
"locale": "en",
|
||||||
"introductory_text": "thank you for your purchase of the following items:",
|
"introductory_text": "thank you for your purchase of the following items:",
|
||||||
"internal_reference": "",
|
|
||||||
"additional_text": "We are looking forward to see you on our conference!",
|
"additional_text": "We are looking forward to see you on our conference!",
|
||||||
"payment_provider_text": "Please transfer the money to our account ABC…",
|
"payment_provider_text": "Please transfer the money to our account ABC…",
|
||||||
"footer_text": "Big Events LLC - Registration No. 123456 - VAT ID: EU0987654321",
|
"footer_text": "Big Events LLC - Registration No. 123456 - VAT ID: EU0987654321",
|
||||||
@@ -174,13 +140,9 @@ Endpoints
|
|||||||
"description": "Budget Ticket",
|
"description": "Budget Ticket",
|
||||||
"gross_value": "23.00",
|
"gross_value": "23.00",
|
||||||
"tax_value": "0.00",
|
"tax_value": "0.00",
|
||||||
"tax_name": "VAT",
|
|
||||||
"tax_rate": "0.00"
|
"tax_rate": "0.00"
|
||||||
}
|
}
|
||||||
],
|
]
|
||||||
"foreign_currency_display": "PLN",
|
|
||||||
"foreign_currency_rate": "4.2408",
|
|
||||||
"foreign_currency_rate_date": "2017-07-24"
|
|
||||||
}
|
}
|
||||||
|
|
||||||
:param organizer: The ``slug`` field of the organizer to fetch
|
:param organizer: The ``slug`` field of the organizer to fetch
|
||||||
@@ -221,61 +183,5 @@ Endpoints
|
|||||||
:statuscode 200: no error
|
:statuscode 200: no error
|
||||||
:statuscode 401: Authentication failure
|
:statuscode 401: Authentication failure
|
||||||
:statuscode 403: The requested organizer/event does not exist **or** you have no permission to view this resource.
|
:statuscode 403: The requested organizer/event does not exist **or** you have no permission to view this resource.
|
||||||
:statuscode 409: The file is not yet ready and will now be prepared. Retry the request after waiting for a few
|
:statuscode 409: The file is not yet ready and will now be prepared. Retry the request after waiting vor a few
|
||||||
seconds.
|
seconds.
|
||||||
|
|
||||||
.. http:post:: /api/v1/organizers/(organizer)/events/(event)/invoices/(invoice_no)/reissue/
|
|
||||||
|
|
||||||
Cancels the invoice and creates a new one.
|
|
||||||
|
|
||||||
**Example request**:
|
|
||||||
|
|
||||||
.. sourcecode:: http
|
|
||||||
|
|
||||||
GET /api/v1/organizers/bigevents/events/sampleconf/invoices/00001/reissue/ HTTP/1.1
|
|
||||||
Host: pretix.eu
|
|
||||||
Accept: application/json, text/javascript
|
|
||||||
|
|
||||||
**Example response**:
|
|
||||||
|
|
||||||
.. sourcecode:: http
|
|
||||||
|
|
||||||
HTTP/1.1 204 No Content
|
|
||||||
Vary: Accept
|
|
||||||
Content-Type: application/pdf
|
|
||||||
|
|
||||||
:param organizer: The ``slug`` field of the organizer to fetch
|
|
||||||
:param event: The ``slug`` field of the event to fetch
|
|
||||||
:param invoice_no: The ``invoice_no`` field of the invoice to reissue
|
|
||||||
:statuscode 200: no error
|
|
||||||
:statuscode 400: The invoice has already been canceled
|
|
||||||
:statuscode 401: Authentication failure
|
|
||||||
:statuscode 403: The requested organizer/event does not exist **or** you have no permission to change this resource.
|
|
||||||
|
|
||||||
.. http:post:: /api/v1/organizers/(organizer)/events/(event)/invoices/(invoice_no)/regenerate/
|
|
||||||
|
|
||||||
Re-generates the invoice from order data.
|
|
||||||
|
|
||||||
**Example request**:
|
|
||||||
|
|
||||||
.. sourcecode:: http
|
|
||||||
|
|
||||||
GET /api/v1/organizers/bigevents/events/sampleconf/invoices/00001/regenerate/ HTTP/1.1
|
|
||||||
Host: pretix.eu
|
|
||||||
Accept: application/json, text/javascript
|
|
||||||
|
|
||||||
**Example response**:
|
|
||||||
|
|
||||||
.. sourcecode:: http
|
|
||||||
|
|
||||||
HTTP/1.1 204 No Content
|
|
||||||
Vary: Accept
|
|
||||||
Content-Type: application/pdf
|
|
||||||
|
|
||||||
:param organizer: The ``slug`` field of the organizer to fetch
|
|
||||||
:param event: The ``slug`` field of the event to fetch
|
|
||||||
:param invoice_no: The ``invoice_no`` field of the invoice to regenerate
|
|
||||||
:statuscode 200: no error
|
|
||||||
:statuscode 400: The invoice has already been canceled
|
|
||||||
:statuscode 401: Authentication failure
|
|
||||||
:statuscode 403: The requested organizer/event does not exist **or** you have no permission to change this resource.
|
|
||||||
|
|||||||
@@ -1,246 +0,0 @@
|
|||||||
Item add-ons
|
|
||||||
============
|
|
||||||
|
|
||||||
Resource description
|
|
||||||
--------------------
|
|
||||||
|
|
||||||
With add-ons, you can specify products that can be bought as an addition to this specific product. For example, if you
|
|
||||||
host a conference with a base conference ticket and a number of workshops, you could define the workshops as add-ons to
|
|
||||||
the conference ticket. With this configuration, the workshops cannot be bought on their own but only in combination with
|
|
||||||
a conference ticket. You can here specify categories of products that can be used as add-ons to this product. You can
|
|
||||||
also specify the minimum and maximum number of add-ons of the given category that can or need to be chosen. The user can
|
|
||||||
buy every add-on from the category at most once. If an add-on product has multiple variations, only one of them can be
|
|
||||||
bought.
|
|
||||||
The add-ons resource contains the following public fields:
|
|
||||||
|
|
||||||
.. rst-class:: rest-resource-table
|
|
||||||
|
|
||||||
===================================== ========================== =======================================================
|
|
||||||
Field Type Description
|
|
||||||
===================================== ========================== =======================================================
|
|
||||||
id integer Internal ID of the add-on
|
|
||||||
addon_category integer Internal ID of the item category the add-on can be
|
|
||||||
chosen from.
|
|
||||||
min_count integer The minimal number of add-ons that need to be chosen.
|
|
||||||
max_count integer The maximal number of add-ons that can be chosen.
|
|
||||||
position integer An integer, used for sorting
|
|
||||||
price_included boolean Adding this add-on to the item is free
|
|
||||||
===================================== ========================== =======================================================
|
|
||||||
|
|
||||||
.. versionchanged:: 1.12
|
|
||||||
|
|
||||||
This resource has been added.
|
|
||||||
|
|
||||||
Endpoints
|
|
||||||
---------
|
|
||||||
|
|
||||||
.. http:get:: /api/v1/organizers/(organizer)/events/(event)/items/(item)/addons/
|
|
||||||
|
|
||||||
Returns a list of all add-ons for a given item.
|
|
||||||
|
|
||||||
**Example request**:
|
|
||||||
|
|
||||||
.. sourcecode:: http
|
|
||||||
|
|
||||||
GET /api/v1/organizers/bigevents/events/sampleconf/items/11/addons/ HTTP/1.1
|
|
||||||
Host: pretix.eu
|
|
||||||
Accept: application/json, text/javascript
|
|
||||||
|
|
||||||
**Example response**:
|
|
||||||
|
|
||||||
.. sourcecode:: http
|
|
||||||
|
|
||||||
HTTP/1.1 200 OK
|
|
||||||
Vary: Accept
|
|
||||||
Content-Type: application/json
|
|
||||||
|
|
||||||
{
|
|
||||||
"count": 2,
|
|
||||||
"next": null,
|
|
||||||
"previous": null,
|
|
||||||
"results": [
|
|
||||||
{
|
|
||||||
"id": 3,
|
|
||||||
"addon_category": 1,
|
|
||||||
"min_count": 0,
|
|
||||||
"max_count": 10,
|
|
||||||
"position": 0,
|
|
||||||
"price_included": true
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"id": 4,
|
|
||||||
"addon_category": 2,
|
|
||||||
"min_count": 0,
|
|
||||||
"max_count": 10,
|
|
||||||
"position": 1,
|
|
||||||
"price_included": true
|
|
||||||
}
|
|
||||||
]
|
|
||||||
}
|
|
||||||
|
|
||||||
:query integer page: The page number in case of a multi-page result set, default is 1
|
|
||||||
:param organizer: The ``slug`` field of the organizer to fetch
|
|
||||||
:param event: The ``slug`` field of the event to fetch
|
|
||||||
:param item: The ``id`` field of the item to fetch
|
|
||||||
:statuscode 200: no error
|
|
||||||
:statuscode 401: Authentication failure
|
|
||||||
:statuscode 403: The requested organizer/event/item does not exist **or** you have no permission to view this resource.
|
|
||||||
|
|
||||||
.. http:get:: /api/v1/organizers/(organizer)/events/(event)/items/(item)/addons/(id)/
|
|
||||||
|
|
||||||
Returns information on one add-on, identified by its ID.
|
|
||||||
|
|
||||||
**Example request**:
|
|
||||||
|
|
||||||
.. sourcecode:: http
|
|
||||||
|
|
||||||
GET /api/v1/organizers/bigevents/events/sampleconf/items/1/addons/1/ HTTP/1.1
|
|
||||||
Host: pretix.eu
|
|
||||||
Accept: application/json, text/javascript
|
|
||||||
|
|
||||||
**Example response**:
|
|
||||||
|
|
||||||
.. sourcecode:: http
|
|
||||||
|
|
||||||
HTTP/1.1 200 OK
|
|
||||||
Vary: Accept
|
|
||||||
Content-Type: application/json
|
|
||||||
|
|
||||||
{
|
|
||||||
"id": 3,
|
|
||||||
"addon_category": 1,
|
|
||||||
"min_count": 0,
|
|
||||||
"max_count": 10,
|
|
||||||
"position": 1,
|
|
||||||
"price_included": true
|
|
||||||
}
|
|
||||||
|
|
||||||
:param organizer: The ``slug`` field of the organizer to fetch
|
|
||||||
:param event: The ``slug`` field of the event to fetch
|
|
||||||
:param item: The ``id`` field of the item to fetch
|
|
||||||
:param id: The ``id`` field of the add-on to fetch
|
|
||||||
:statuscode 200: no error
|
|
||||||
:statuscode 401: Authentication failure
|
|
||||||
:statuscode 403: The requested organizer/event does not exist **or** you have no permission to view this resource.
|
|
||||||
|
|
||||||
.. http:post:: /api/v1/organizers/bigevents/events/sampleconf/items/1/addons/
|
|
||||||
|
|
||||||
Creates a new add-on
|
|
||||||
|
|
||||||
**Example request**:
|
|
||||||
|
|
||||||
.. sourcecode:: http
|
|
||||||
|
|
||||||
POST /api/v1/organizers/(organizer)/events/(event)/items/(item)/addons/ HTTP/1.1
|
|
||||||
Host: pretix.eu
|
|
||||||
Accept: application/json, text/javascript
|
|
||||||
Content: application/json
|
|
||||||
|
|
||||||
{
|
|
||||||
"addon_category": 1,
|
|
||||||
"min_count": 0,
|
|
||||||
"max_count": 10,
|
|
||||||
"position": 1,
|
|
||||||
"price_included": true
|
|
||||||
}
|
|
||||||
|
|
||||||
**Example response**:
|
|
||||||
|
|
||||||
.. sourcecode:: http
|
|
||||||
|
|
||||||
HTTP/1.1 201 Created
|
|
||||||
Vary: Accept
|
|
||||||
Content-Type: application/json
|
|
||||||
|
|
||||||
{
|
|
||||||
"id": 3,
|
|
||||||
"addon_category": 1,
|
|
||||||
"min_count": 0,
|
|
||||||
"max_count": 10,
|
|
||||||
"position": 1,
|
|
||||||
"price_included": true
|
|
||||||
}
|
|
||||||
|
|
||||||
:param organizer: The ``slug`` field of the organizer of the event/item to create a add-on for
|
|
||||||
:param event: The ``slug`` field of the event to create a add-on for
|
|
||||||
:param item: The ``id`` field of the item to create a add-on for
|
|
||||||
:statuscode 201: no error
|
|
||||||
:statuscode 400: The add-on could not be created due to invalid submitted data.
|
|
||||||
:statuscode 401: Authentication failure
|
|
||||||
:statuscode 403: The requested organizer/event does not exist **or** you have no permission to create this resource.
|
|
||||||
|
|
||||||
.. http:patch:: /api/v1/organizers/(organizer)/events/(event)/items/(item)/addon/(id)/
|
|
||||||
|
|
||||||
Update an add-on. 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 ``id`` field.
|
|
||||||
|
|
||||||
**Example request**:
|
|
||||||
|
|
||||||
.. sourcecode:: http
|
|
||||||
|
|
||||||
PATCH /api/v1/organizers/bigevents/events/sampleconf/items/1/addons/3/ HTTP/1.1
|
|
||||||
Host: pretix.eu
|
|
||||||
Accept: application/json, text/javascript
|
|
||||||
Content-Type: application/json
|
|
||||||
Content-Length: 94
|
|
||||||
|
|
||||||
{
|
|
||||||
"min_count": 0,
|
|
||||||
"max_count": 10,
|
|
||||||
}
|
|
||||||
|
|
||||||
**Example response**:
|
|
||||||
|
|
||||||
.. sourcecode:: http
|
|
||||||
|
|
||||||
HTTP/1.1 200 OK
|
|
||||||
Vary: Accept
|
|
||||||
Content-Type: application/json
|
|
||||||
|
|
||||||
{
|
|
||||||
"id": 3,
|
|
||||||
"addon_category": 1,
|
|
||||||
"min_count": 0,
|
|
||||||
"max_count": 10,
|
|
||||||
"position": 1,
|
|
||||||
"price_included": true
|
|
||||||
}
|
|
||||||
|
|
||||||
:param organizer: The ``slug`` field of the organizer to modify
|
|
||||||
:param event: The ``slug`` field of the event to modify
|
|
||||||
:param item: The ``id`` field of the item to modify
|
|
||||||
:param id: The ``id`` field of the add-on to modify
|
|
||||||
:statuscode 200: no error
|
|
||||||
:statuscode 400: The add-on could not be modified due to invalid submitted data
|
|
||||||
:statuscode 401: Authentication failure
|
|
||||||
:statuscode 403: The requested organizer/event does not exist **or** you have no permission to change this resource.
|
|
||||||
|
|
||||||
.. http:delete:: /api/v1/organizers/(organizer)/events/(event)/items/(id)/addons/(id)/
|
|
||||||
|
|
||||||
Delete an add-on.
|
|
||||||
|
|
||||||
**Example request**:
|
|
||||||
|
|
||||||
.. sourcecode:: http
|
|
||||||
|
|
||||||
DELETE /api/v1/organizers/bigevents/events/sampleconf/items/1/addons/1/ HTTP/1.1
|
|
||||||
Host: pretix.eu
|
|
||||||
Accept: application/json, text/javascript
|
|
||||||
|
|
||||||
**Example response**:
|
|
||||||
|
|
||||||
.. sourcecode:: http
|
|
||||||
|
|
||||||
HTTP/1.1 204 No Content
|
|
||||||
Vary: Accept
|
|
||||||
|
|
||||||
:param organizer: The ``slug`` field of the organizer to modify
|
|
||||||
:param event: The ``slug`` field of the event to modify
|
|
||||||
:param id: The ``id`` field of the item to modify
|
|
||||||
:param id: The ``id`` field of the add-on to delete
|
|
||||||
:statuscode 204: no error
|
|
||||||
:statuscode 401: Authentication failure
|
|
||||||
:statuscode 403: The requested organizer/event does not exist **or** you have no permission to delete this resource.
|
|
||||||
@@ -1,258 +0,0 @@
|
|||||||
Item variations
|
|
||||||
===============
|
|
||||||
|
|
||||||
Resource description
|
|
||||||
--------------------
|
|
||||||
|
|
||||||
Variations of items can be use for products (items) that are available in different sizes, colors or other variations
|
|
||||||
of the same product.
|
|
||||||
The variations resource contains the following public fields:
|
|
||||||
|
|
||||||
.. rst-class:: rest-resource-table
|
|
||||||
|
|
||||||
===================================== ========================== =======================================================
|
|
||||||
Field Type Description
|
|
||||||
===================================== ========================== =======================================================
|
|
||||||
id integer Internal ID of the variation
|
|
||||||
default_price money (string) The price set directly for this variation or ``null``
|
|
||||||
price money (string) The price used for this variation. This is either the
|
|
||||||
same as ``default_price`` if that value is set or equal
|
|
||||||
to the item's ``default_price`` (read-only).
|
|
||||||
active boolean If ``False``, this variation will not be sold or shown.
|
|
||||||
description multi-lingual string A public description of the variation. May contain
|
|
||||||
Markdown syntax or can be ``null``.
|
|
||||||
position integer An integer, used for sorting
|
|
||||||
===================================== ========================== =======================================================
|
|
||||||
|
|
||||||
.. versionchanged:: 1.12
|
|
||||||
|
|
||||||
This resource has been added.
|
|
||||||
|
|
||||||
Endpoints
|
|
||||||
---------
|
|
||||||
|
|
||||||
.. http:get:: /api/v1/organizers/(organizer)/events/(event)/items/(item)/variations/
|
|
||||||
|
|
||||||
Returns a list of all variations for a given item.
|
|
||||||
|
|
||||||
**Example request**:
|
|
||||||
|
|
||||||
.. sourcecode:: http
|
|
||||||
|
|
||||||
GET /api/v1/organizers/bigevents/events/sampleconf/items/11/variations/ HTTP/1.1
|
|
||||||
Host: pretix.eu
|
|
||||||
Accept: application/json, text/javascript
|
|
||||||
|
|
||||||
**Example response**:
|
|
||||||
|
|
||||||
.. sourcecode:: http
|
|
||||||
|
|
||||||
HTTP/1.1 200 OK
|
|
||||||
Vary: Accept
|
|
||||||
Content-Type: application/json
|
|
||||||
|
|
||||||
{
|
|
||||||
"count": 2,
|
|
||||||
"next": null,
|
|
||||||
"previous": null,
|
|
||||||
"results": [
|
|
||||||
{
|
|
||||||
"id": 1,
|
|
||||||
"value": {
|
|
||||||
"en": "S"
|
|
||||||
},
|
|
||||||
"active": true,
|
|
||||||
"description": {
|
|
||||||
"en": "Test2"
|
|
||||||
},
|
|
||||||
"position": 0,
|
|
||||||
"default_price": "223.00",
|
|
||||||
"price": 223.0
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"id": 3,
|
|
||||||
"value": {
|
|
||||||
"en": "L"
|
|
||||||
},
|
|
||||||
"active": true,
|
|
||||||
"description": {},
|
|
||||||
"position": 1,
|
|
||||||
"default_price": null,
|
|
||||||
"price": 15.0
|
|
||||||
}
|
|
||||||
]
|
|
||||||
}
|
|
||||||
|
|
||||||
:query integer page: The page number in case of a multi-page result set, default is 1
|
|
||||||
:query boolean active: If set to ``true`` or ``false``, only items with this value for the field ``active`` will be
|
|
||||||
returned.
|
|
||||||
:param organizer: The ``slug`` field of the organizer to fetch
|
|
||||||
:param event: The ``slug`` field of the event to fetch
|
|
||||||
:param item: The ``id`` field of the item to fetch
|
|
||||||
:statuscode 200: no error
|
|
||||||
:statuscode 401: Authentication failure
|
|
||||||
:statuscode 403: The requested organizer/event/item does not exist **or** you have no permission to view this resource.
|
|
||||||
|
|
||||||
.. http:get:: /api/v1/organizers/(organizer)/events/(event)/items/(item)/variations/(id)/
|
|
||||||
|
|
||||||
Returns information on one variation, identified by its ID.
|
|
||||||
|
|
||||||
**Example request**:
|
|
||||||
|
|
||||||
.. sourcecode:: http
|
|
||||||
|
|
||||||
GET /api/v1/organizers/bigevents/events/sampleconf/items/1/variations/1/ HTTP/1.1
|
|
||||||
Host: pretix.eu
|
|
||||||
Accept: application/json, text/javascript
|
|
||||||
|
|
||||||
**Example response**:
|
|
||||||
|
|
||||||
.. sourcecode:: http
|
|
||||||
|
|
||||||
HTTP/1.1 200 OK
|
|
||||||
Vary: Accept
|
|
||||||
Content-Type: application/json
|
|
||||||
|
|
||||||
{
|
|
||||||
"id": 3,
|
|
||||||
"value": {
|
|
||||||
"en": "Student"
|
|
||||||
},
|
|
||||||
"default_price": "10.00",
|
|
||||||
"price": "10.00",
|
|
||||||
"active": true,
|
|
||||||
"description": null,
|
|
||||||
"position": 0
|
|
||||||
}
|
|
||||||
|
|
||||||
:param organizer: The ``slug`` field of the organizer to fetch
|
|
||||||
:param event: The ``slug`` field of the event to fetch
|
|
||||||
:param item: The ``id`` field of the item to fetch
|
|
||||||
:param id: The ``id`` field of the variation to fetch
|
|
||||||
:statuscode 200: no error
|
|
||||||
:statuscode 401: Authentication failure
|
|
||||||
:statuscode 403: The requested organizer/event does not exist **or** you have no permission to view this resource.
|
|
||||||
|
|
||||||
.. http:post:: /api/v1/organizers/(organizer)/events/(event)/items/(item)/variations/
|
|
||||||
|
|
||||||
Creates a new variation
|
|
||||||
|
|
||||||
**Example request**:
|
|
||||||
|
|
||||||
.. sourcecode:: http
|
|
||||||
|
|
||||||
POST /api/v1/organizers/bigevents/events/sampleconf/items/1/variations/ HTTP/1.1
|
|
||||||
Host: pretix.eu
|
|
||||||
Accept: application/json, text/javascript
|
|
||||||
Content: application/json
|
|
||||||
|
|
||||||
{
|
|
||||||
"value": {"en": "Student"},
|
|
||||||
"default_price": "10.00",
|
|
||||||
"active": true,
|
|
||||||
"description": null,
|
|
||||||
"position": 0
|
|
||||||
}
|
|
||||||
|
|
||||||
**Example response**:
|
|
||||||
|
|
||||||
.. sourcecode:: http
|
|
||||||
|
|
||||||
HTTP/1.1 201 Created
|
|
||||||
Vary: Accept
|
|
||||||
Content-Type: application/json
|
|
||||||
|
|
||||||
{
|
|
||||||
"id": 1,
|
|
||||||
"value": {"en": "Student"},
|
|
||||||
"default_price": "10.00",
|
|
||||||
"price": "10.00",
|
|
||||||
"active": true,
|
|
||||||
"description": null,
|
|
||||||
"position": 0
|
|
||||||
}
|
|
||||||
|
|
||||||
:param organizer: The ``slug`` field of the organizer of the event/item to create a variation for
|
|
||||||
:param event: The ``slug`` field of the event to create a variation for
|
|
||||||
:param item: The ``id`` field of the item to create a variation for
|
|
||||||
:statuscode 201: no error
|
|
||||||
:statuscode 400: The variation could not be created due to invalid submitted data.
|
|
||||||
:statuscode 401: Authentication failure
|
|
||||||
:statuscode 403: The requested organizer/event does not exist **or** you have no permission to create this resource.
|
|
||||||
|
|
||||||
.. http:patch:: /api/v1/organizers/(organizer)/events/(event)/items/(item)/variations/(id)/
|
|
||||||
|
|
||||||
Update a variation. 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 ``id`` and the ``price`` field.
|
|
||||||
|
|
||||||
**Example request**:
|
|
||||||
|
|
||||||
.. sourcecode:: http
|
|
||||||
|
|
||||||
PATCH /api/v1/organizers/bigevents/events/sampleconf/items/1/variations/1/ HTTP/1.1
|
|
||||||
Host: pretix.eu
|
|
||||||
Accept: application/json, text/javascript
|
|
||||||
Content-Type: application/json
|
|
||||||
Content-Length: 94
|
|
||||||
|
|
||||||
{
|
|
||||||
"active": false,
|
|
||||||
"position": 1
|
|
||||||
}
|
|
||||||
|
|
||||||
**Example response**:
|
|
||||||
|
|
||||||
.. sourcecode:: http
|
|
||||||
|
|
||||||
HTTP/1.1 200 OK
|
|
||||||
Vary: Accept
|
|
||||||
Content-Type: application/json
|
|
||||||
|
|
||||||
{
|
|
||||||
"id": 1,
|
|
||||||
"value": {"en": "Student"},
|
|
||||||
"default_price": "10.00",
|
|
||||||
"price": "10.00",
|
|
||||||
"active": false,
|
|
||||||
"description": null,
|
|
||||||
"position": 1
|
|
||||||
}
|
|
||||||
|
|
||||||
:param organizer: The ``slug`` field of the organizer to modify
|
|
||||||
:param event: The ``slug`` field of the event to modify
|
|
||||||
:param id: The ``id`` field of the item to modify
|
|
||||||
:param id: The ``id`` field of the variation to modify
|
|
||||||
:statuscode 200: no error
|
|
||||||
:statuscode 400: The variation could not be modified due to invalid submitted data
|
|
||||||
:statuscode 401: Authentication failure
|
|
||||||
:statuscode 403: The requested organizer/event does not exist **or** you have no permission to change this resource.
|
|
||||||
|
|
||||||
.. http:delete:: /api/v1/organizers/(organizer)/events/(event)/items/(id)/variations/(id)/
|
|
||||||
|
|
||||||
Delete a variation.
|
|
||||||
|
|
||||||
**Example request**:
|
|
||||||
|
|
||||||
.. sourcecode:: http
|
|
||||||
|
|
||||||
DELETE /api/v1/organizers/bigevents/events/sampleconf/items/1/variations/1/ HTTP/1.1
|
|
||||||
Host: pretix.eu
|
|
||||||
Accept: application/json, text/javascript
|
|
||||||
|
|
||||||
**Example response**:
|
|
||||||
|
|
||||||
.. sourcecode:: http
|
|
||||||
|
|
||||||
HTTP/1.1 204 No Content
|
|
||||||
Vary: Accept
|
|
||||||
|
|
||||||
:param organizer: The ``slug`` field of the organizer to modify
|
|
||||||
:param event: The ``slug`` field of the event to modify
|
|
||||||
:param id: The ``id`` field of the item to modify
|
|
||||||
:param id: The ``id`` field of the variation to delete
|
|
||||||
:statuscode 204: no error
|
|
||||||
:statuscode 401: Authentication failure
|
|
||||||
:statuscode 403: The requested organizer/event does not exist **or** you have no permission to delete this resource.
|
|
||||||
@@ -1,5 +1,3 @@
|
|||||||
.. _rest-items:
|
|
||||||
|
|
||||||
Items
|
Items
|
||||||
=====
|
=====
|
||||||
|
|
||||||
@@ -16,7 +14,6 @@ Field Type Description
|
|||||||
===================================== ========================== =======================================================
|
===================================== ========================== =======================================================
|
||||||
id integer Internal ID of the item
|
id integer Internal ID of the item
|
||||||
name multi-lingual string The item's visible name
|
name multi-lingual string The item's visible name
|
||||||
internal_name string An optional name that is only used in the backend
|
|
||||||
default_price money (string) The item price that is applied if the price is not
|
default_price money (string) The item price that is applied if the price is not
|
||||||
overwritten by variations or other options.
|
overwritten by variations or other options.
|
||||||
category integer The ID of the category this item belongs to
|
category integer The ID of the category this item belongs to
|
||||||
@@ -30,13 +27,11 @@ free_price boolean If ``True``, cu
|
|||||||
lower than the price defined by ``default_price`` or
|
lower than the price defined by ``default_price`` or
|
||||||
otherwise).
|
otherwise).
|
||||||
tax_rate decimal (string) The VAT rate to be applied for this item.
|
tax_rate decimal (string) The VAT rate to be applied for this item.
|
||||||
tax_rule integer The internal ID of the applied tax rule (or ``null``).
|
|
||||||
admission boolean ``True`` for items that grant admission to the event
|
admission boolean ``True`` for items that grant admission to the event
|
||||||
(such as primary tickets) and ``False`` for others
|
(such as primary tickets) and ``False`` for others
|
||||||
(such as add-ons or merchandise).
|
(such as add-ons or merchandise).
|
||||||
position integer An integer, used for sorting
|
position integer An integer, used for sorting
|
||||||
picture string A product picture to be displayed in the shop
|
picture string A product picture to be displayed in the shop
|
||||||
(read-only).
|
|
||||||
available_from datetime The first date time at which this item can be bought
|
available_from datetime The first date time at which this item can be bought
|
||||||
(or ``null``).
|
(or ``null``).
|
||||||
available_until datetime The last date time at which this item can be bought
|
available_until datetime The last date time at which this item can be bought
|
||||||
@@ -54,17 +49,11 @@ min_per_order integer This product ca
|
|||||||
max_per_order integer This product can only be bought if it is included at
|
max_per_order integer This product can only be bought if it is included at
|
||||||
most this many times in the order (or ``null`` for no
|
most this many times in the order (or ``null`` for no
|
||||||
limitation).
|
limitation).
|
||||||
checkin_attention boolean If ``True``, the check-in app should show a warning
|
has_variations boolean Shows whether or not this item has variations
|
||||||
that this ticket requires special attention if such
|
(read-only).
|
||||||
a product is being scanned.
|
|
||||||
original_price money (string) An original price, shown for comparison, not used
|
|
||||||
for price calculations.
|
|
||||||
has_variations boolean Shows whether or not this item has variations.
|
|
||||||
variations list of objects A list with one object for each variation of this item.
|
variations list of objects A list with one object for each variation of this item.
|
||||||
Can be empty. Only writable during creation,
|
Can be empty.
|
||||||
use separate endpoint to modify this later.
|
|
||||||
├ id integer Internal ID of the variation
|
├ id integer Internal ID of the variation
|
||||||
├ value multi-lingual string The "name" of the variation
|
|
||||||
├ default_price money (string) The price set directly for this variation or ``null``
|
├ default_price money (string) The price set directly for this variation or ``null``
|
||||||
├ price money (string) The price used for this variation. This is either the
|
├ price money (string) The price used for this variation. This is either the
|
||||||
same as ``default_price`` if that value is set or equal
|
same as ``default_price`` if that value is set or equal
|
||||||
@@ -73,40 +62,14 @@ variations list of objects A list with one
|
|||||||
├ description multi-lingual string A public description of the variation. May contain
|
├ description multi-lingual string A public description of the variation. May contain
|
||||||
Markdown syntax or can be ``null``.
|
Markdown syntax or can be ``null``.
|
||||||
└ position integer An integer, used for sorting
|
└ position integer An integer, used for sorting
|
||||||
addons list of objects Definition of add-ons that can be chosen for this item.
|
addons list of objects Definition of add-ons that can be chosen for this item
|
||||||
Only writable during creation,
|
|
||||||
use separate endpoint to modify this later.
|
|
||||||
├ addon_category integer Internal ID of the item category the add-on can be
|
├ addon_category integer Internal ID of the item category the add-on can be
|
||||||
chosen from.
|
chosen from.
|
||||||
├ min_count integer The minimal number of add-ons that need to be chosen.
|
├ min_count integer The minimal number of add-ons that need to be chosen.
|
||||||
├ max_count integer The maximal number of add-ons that can be chosen.
|
├ max_count integer The maxima number of add-ons that can be chosen.
|
||||||
└ position integer An integer, used for sorting
|
└ position integer An integer, used for sorting
|
||||||
└ price_included boolean Adding this add-on to the item is free
|
|
||||||
===================================== ========================== =======================================================
|
===================================== ========================== =======================================================
|
||||||
|
|
||||||
.. versionchanged:: 1.7
|
|
||||||
|
|
||||||
The attribute ``tax_rule`` has been added. ``tax_rate`` is kept for compatibility. The attribute
|
|
||||||
``checkin_attention`` has been added.
|
|
||||||
|
|
||||||
.. versionchanged:: 1.12
|
|
||||||
|
|
||||||
The write operations ``POST``, ``PATCH``, ``PUT``, and ``DELETE`` have been added.
|
|
||||||
The attribute ``price_included`` has been added to ``addons``.
|
|
||||||
|
|
||||||
.. versionchanged:: 1.16
|
|
||||||
|
|
||||||
The field ``internal_name`` and ``original_price`` fields have been added.
|
|
||||||
|
|
||||||
Notes
|
|
||||||
-----
|
|
||||||
Please note that an item either always has variations or never has. Once created with variations the item can never
|
|
||||||
change to an item without and vice versa. To create an item with variations ensure that you POST an item with at least
|
|
||||||
one variation.
|
|
||||||
|
|
||||||
Also note that ``variations`` and ``addons`` are only supported on ``POST``. To update/delete variations and add-ons please
|
|
||||||
use the dedicated nested endpoints. By design this endpoint does not support ``PATCH`` and ``PUT`` with nested
|
|
||||||
``variations`` and/or ``addons``.
|
|
||||||
|
|
||||||
Endpoints
|
Endpoints
|
||||||
---------
|
---------
|
||||||
@@ -129,7 +92,7 @@ Endpoints
|
|||||||
|
|
||||||
HTTP/1.1 200 OK
|
HTTP/1.1 200 OK
|
||||||
Vary: Accept
|
Vary: Accept
|
||||||
Content-Type: application/json
|
Content-Type: text/javascript
|
||||||
|
|
||||||
{
|
{
|
||||||
"count": 1,
|
"count": 1,
|
||||||
@@ -139,15 +102,12 @@ Endpoints
|
|||||||
{
|
{
|
||||||
"id": 1,
|
"id": 1,
|
||||||
"name": {"en": "Standard ticket"},
|
"name": {"en": "Standard ticket"},
|
||||||
"internal_name": "",
|
|
||||||
"default_price": "23.00",
|
"default_price": "23.00",
|
||||||
"original_price": null,
|
|
||||||
"category": null,
|
"category": null,
|
||||||
"active": true,
|
"active": true,
|
||||||
"description": null,
|
"description": null,
|
||||||
"free_price": false,
|
"free_price": false,
|
||||||
"tax_rate": "0.00",
|
"tax_rate": "0.00",
|
||||||
"tax_rule": 1,
|
|
||||||
"admission": false,
|
"admission": false,
|
||||||
"position": 0,
|
"position": 0,
|
||||||
"picture": null,
|
"picture": null,
|
||||||
@@ -158,7 +118,6 @@ Endpoints
|
|||||||
"allow_cancel": true,
|
"allow_cancel": true,
|
||||||
"min_per_order": null,
|
"min_per_order": null,
|
||||||
"max_per_order": null,
|
"max_per_order": null,
|
||||||
"checkin_attention": false,
|
|
||||||
"has_variations": false,
|
"has_variations": false,
|
||||||
"variations": [
|
"variations": [
|
||||||
{
|
{
|
||||||
@@ -218,20 +177,17 @@ Endpoints
|
|||||||
|
|
||||||
HTTP/1.1 200 OK
|
HTTP/1.1 200 OK
|
||||||
Vary: Accept
|
Vary: Accept
|
||||||
Content-Type: application/json
|
Content-Type: text/javascript
|
||||||
|
|
||||||
{
|
{
|
||||||
"id": 1,
|
"id": 1,
|
||||||
"name": {"en": "Standard ticket"},
|
"name": {"en": "Standard ticket"},
|
||||||
"internal_name": "",
|
|
||||||
"default_price": "23.00",
|
"default_price": "23.00",
|
||||||
"original_price": null,
|
|
||||||
"category": null,
|
"category": null,
|
||||||
"active": true,
|
"active": true,
|
||||||
"description": null,
|
"description": null,
|
||||||
"free_price": false,
|
"free_price": false,
|
||||||
"tax_rate": "0.00",
|
"tax_rate": "0.00",
|
||||||
"tax_rule": 1,
|
|
||||||
"admission": false,
|
"admission": false,
|
||||||
"position": 0,
|
"position": 0,
|
||||||
"picture": null,
|
"picture": null,
|
||||||
@@ -242,7 +198,6 @@ Endpoints
|
|||||||
"allow_cancel": true,
|
"allow_cancel": true,
|
||||||
"min_per_order": null,
|
"min_per_order": null,
|
||||||
"max_per_order": null,
|
"max_per_order": null,
|
||||||
"checkin_attention": false,
|
|
||||||
"has_variations": false,
|
"has_variations": false,
|
||||||
"variations": [
|
"variations": [
|
||||||
{
|
{
|
||||||
@@ -271,232 +226,3 @@ Endpoints
|
|||||||
:statuscode 200: no error
|
:statuscode 200: no error
|
||||||
:statuscode 401: Authentication failure
|
:statuscode 401: Authentication failure
|
||||||
:statuscode 403: The requested organizer/event does not exist **or** you have no permission to view this resource.
|
:statuscode 403: The requested organizer/event does not exist **or** you have no permission to view this resource.
|
||||||
|
|
||||||
.. http:post:: /api/v1/organizers/(organizer)/events/(event)/items/
|
|
||||||
|
|
||||||
Creates a new item
|
|
||||||
|
|
||||||
**Example request**:
|
|
||||||
|
|
||||||
.. sourcecode:: http
|
|
||||||
|
|
||||||
POST /api/v1/organizers/bigevents/events/sampleconf/items/ HTTP/1.1
|
|
||||||
Host: pretix.eu
|
|
||||||
Accept: application/json, text/javascript
|
|
||||||
Content: application/json
|
|
||||||
|
|
||||||
{
|
|
||||||
"id": 1,
|
|
||||||
"name": {"en": "Standard ticket"},
|
|
||||||
"internal_name": "",
|
|
||||||
"default_price": "23.00",
|
|
||||||
"original_price": null,
|
|
||||||
"category": null,
|
|
||||||
"active": true,
|
|
||||||
"description": null,
|
|
||||||
"free_price": false,
|
|
||||||
"tax_rate": "0.00",
|
|
||||||
"tax_rule": 1,
|
|
||||||
"admission": false,
|
|
||||||
"position": 0,
|
|
||||||
"picture": null,
|
|
||||||
"available_from": null,
|
|
||||||
"available_until": null,
|
|
||||||
"require_voucher": false,
|
|
||||||
"hide_without_voucher": false,
|
|
||||||
"allow_cancel": true,
|
|
||||||
"min_per_order": null,
|
|
||||||
"max_per_order": null,
|
|
||||||
"checkin_attention": false,
|
|
||||||
"variations": [
|
|
||||||
{
|
|
||||||
"value": {"en": "Student"},
|
|
||||||
"default_price": "10.00",
|
|
||||||
"price": "10.00",
|
|
||||||
"active": true,
|
|
||||||
"description": null,
|
|
||||||
"position": 0
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"value": {"en": "Regular"},
|
|
||||||
"default_price": null,
|
|
||||||
"price": "23.00",
|
|
||||||
"active": true,
|
|
||||||
"description": null,
|
|
||||||
"position": 1
|
|
||||||
}
|
|
||||||
],
|
|
||||||
"addons": []
|
|
||||||
}
|
|
||||||
|
|
||||||
**Example response**:
|
|
||||||
|
|
||||||
.. sourcecode:: http
|
|
||||||
|
|
||||||
HTTP/1.1 201 Created
|
|
||||||
Vary: Accept
|
|
||||||
Content-Type: application/json
|
|
||||||
|
|
||||||
{
|
|
||||||
"id": 1,
|
|
||||||
"name": {"en": "Standard ticket"},
|
|
||||||
"internal_name": "",
|
|
||||||
"default_price": "23.00",
|
|
||||||
"original_price": null,
|
|
||||||
"category": null,
|
|
||||||
"active": true,
|
|
||||||
"description": null,
|
|
||||||
"free_price": false,
|
|
||||||
"tax_rate": "0.00",
|
|
||||||
"tax_rule": 1,
|
|
||||||
"admission": false,
|
|
||||||
"position": 0,
|
|
||||||
"picture": null,
|
|
||||||
"available_from": null,
|
|
||||||
"available_until": null,
|
|
||||||
"require_voucher": false,
|
|
||||||
"hide_without_voucher": false,
|
|
||||||
"allow_cancel": true,
|
|
||||||
"min_per_order": null,
|
|
||||||
"max_per_order": null,
|
|
||||||
"checkin_attention": false,
|
|
||||||
"has_variations": true,
|
|
||||||
"variations": [
|
|
||||||
{
|
|
||||||
"value": {"en": "Student"},
|
|
||||||
"default_price": "10.00",
|
|
||||||
"price": "10.00",
|
|
||||||
"active": true,
|
|
||||||
"description": null,
|
|
||||||
"position": 0
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"value": {"en": "Regular"},
|
|
||||||
"default_price": null,
|
|
||||||
"price": "23.00",
|
|
||||||
"active": true,
|
|
||||||
"description": null,
|
|
||||||
"position": 1
|
|
||||||
}
|
|
||||||
],
|
|
||||||
"addons": []
|
|
||||||
}
|
|
||||||
|
|
||||||
:param organizer: The ``slug`` field of the organizer of the event to create an item for
|
|
||||||
:param event: The ``slug`` field of the event to create an item for
|
|
||||||
:statuscode 201: no error
|
|
||||||
:statuscode 400: The item could not be created due to invalid submitted data.
|
|
||||||
:statuscode 401: Authentication failure
|
|
||||||
:statuscode 403: The requested organizer/event does not exist **or** you have no permission to create this resource.
|
|
||||||
|
|
||||||
.. http:patch:: /api/v1/organizers/(organizer)/events/(event)/items/(id)/
|
|
||||||
|
|
||||||
Update an item. 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 ``has_variations``, ``variations`` and the ``addon`` field. If
|
|
||||||
you need to update/delete variations or add-ons please use the nested dedicated endpoints.
|
|
||||||
|
|
||||||
**Example request**:
|
|
||||||
|
|
||||||
.. sourcecode:: http
|
|
||||||
|
|
||||||
PATCH /api/v1/organizers/bigevents/events/sampleconf/items/1/ HTTP/1.1
|
|
||||||
Host: pretix.eu
|
|
||||||
Accept: application/json, text/javascript
|
|
||||||
Content-Type: application/json
|
|
||||||
Content-Length: 94
|
|
||||||
|
|
||||||
{
|
|
||||||
"name": {"en": "Ticket"},
|
|
||||||
"default_price": "25.00"
|
|
||||||
}
|
|
||||||
|
|
||||||
**Example response**:
|
|
||||||
|
|
||||||
.. sourcecode:: http
|
|
||||||
|
|
||||||
HTTP/1.1 200 OK
|
|
||||||
Vary: Accept
|
|
||||||
Content-Type: application/json
|
|
||||||
|
|
||||||
{
|
|
||||||
"id": 1,
|
|
||||||
"name": {"en": "Ticket"},
|
|
||||||
"internal_name": "",
|
|
||||||
"default_price": "25.00",
|
|
||||||
"original_price": null,
|
|
||||||
"category": null,
|
|
||||||
"active": true,
|
|
||||||
"description": null,
|
|
||||||
"free_price": false,
|
|
||||||
"tax_rate": "0.00",
|
|
||||||
"tax_rule": 1,
|
|
||||||
"admission": false,
|
|
||||||
"position": 0,
|
|
||||||
"picture": null,
|
|
||||||
"available_from": null,
|
|
||||||
"available_until": null,
|
|
||||||
"require_voucher": false,
|
|
||||||
"hide_without_voucher": false,
|
|
||||||
"allow_cancel": true,
|
|
||||||
"min_per_order": null,
|
|
||||||
"max_per_order": null,
|
|
||||||
"checkin_attention": false,
|
|
||||||
"has_variations": true,
|
|
||||||
"variations": [
|
|
||||||
{
|
|
||||||
"value": {"en": "Student"},
|
|
||||||
"default_price": "10.00",
|
|
||||||
"price": "10.00",
|
|
||||||
"active": true,
|
|
||||||
"description": null,
|
|
||||||
"position": 0
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"value": {"en": "Regular"},
|
|
||||||
"default_price": null,
|
|
||||||
"price": "23.00",
|
|
||||||
"active": true,
|
|
||||||
"description": null,
|
|
||||||
"position": 1
|
|
||||||
}
|
|
||||||
],
|
|
||||||
"addons": []
|
|
||||||
}
|
|
||||||
|
|
||||||
:param organizer: The ``slug`` field of the organizer to modify
|
|
||||||
:param event: The ``slug`` field of the event to modify
|
|
||||||
:param id: The ``id`` field of the item to modify
|
|
||||||
:statuscode 200: no error
|
|
||||||
:statuscode 400: The item could not be modified due to invalid submitted data
|
|
||||||
:statuscode 401: Authentication failure
|
|
||||||
:statuscode 403: The requested organizer/event does not exist **or** you have no permission to change this resource.
|
|
||||||
|
|
||||||
.. http:delete:: /api/v1/organizers/(organizer)/events/(event)/items/(id)/
|
|
||||||
|
|
||||||
Delete an item.
|
|
||||||
|
|
||||||
**Example request**:
|
|
||||||
|
|
||||||
.. sourcecode:: http
|
|
||||||
|
|
||||||
DELETE /api/v1/organizers/bigevents/events/sampleconf/items/1/ HTTP/1.1
|
|
||||||
Host: pretix.eu
|
|
||||||
Accept: application/json, text/javascript
|
|
||||||
|
|
||||||
**Example response**:
|
|
||||||
|
|
||||||
.. sourcecode:: http
|
|
||||||
|
|
||||||
HTTP/1.1 204 No Content
|
|
||||||
Vary: Accept
|
|
||||||
|
|
||||||
:param organizer: The ``slug`` field of the organizer to modify
|
|
||||||
:param event: The ``slug`` field of the event to modify
|
|
||||||
:param id: The ``id`` field of the item to delete
|
|
||||||
:statuscode 204: no error
|
|
||||||
:statuscode 401: Authentication failure
|
|
||||||
:statuscode 403: The requested organizer/event does not exist **or** you have no permission to delete this resource.
|
|
||||||
|
|
||||||
|
|||||||
@@ -1,11 +1,3 @@
|
|||||||
.. spelling::
|
|
||||||
|
|
||||||
checkins
|
|
||||||
pdf
|
|
||||||
|
|
||||||
|
|
||||||
.. _rest-orders:
|
|
||||||
|
|
||||||
Orders
|
Orders
|
||||||
======
|
======
|
||||||
|
|
||||||
@@ -32,41 +24,23 @@ email string The customer em
|
|||||||
locale string The locale used for communication with this customer
|
locale string The locale used for communication with this customer
|
||||||
datetime datetime Time of order creation
|
datetime datetime Time of order creation
|
||||||
expires datetime The order will expire, if it is still pending by this time
|
expires datetime The order will expire, if it is still pending by this time
|
||||||
payment_date date Date of payment receipt
|
payment_date date Date of payment receival
|
||||||
payment_provider string Payment provider used for this order
|
payment_provider string Payment provider used for this order
|
||||||
|
payment_fee money (string) Payment fee included in this order's total
|
||||||
|
payment_fee_tax_rate decimal (string) VAT rate applied to the payment fee
|
||||||
|
payment_fee_tax_value money (string) VAT value included in the payment fee
|
||||||
total money (string) Total value of this order
|
total money (string) Total value of this order
|
||||||
comment string Internal comment on this order
|
comment string Internal comment on this order
|
||||||
checkin_attention boolean If ``True``, the check-in app should show a warning
|
|
||||||
that this ticket requires special attention if a ticket
|
|
||||||
of this order is scanned.
|
|
||||||
invoice_address object Invoice address information (can be ``null``)
|
invoice_address object Invoice address information (can be ``null``)
|
||||||
├ last_modified datetime Last modification date of the address
|
├ last_modified datetime Last modification date of the address
|
||||||
├ company string Customer company name
|
├ company string Customer company name
|
||||||
├ is_business boolean Business or individual customers (always ``False``
|
|
||||||
for orders created before pretix 1.7, do not rely on
|
|
||||||
it).
|
|
||||||
├ name string Customer name
|
├ name string Customer name
|
||||||
├ street string Customer street
|
├ street string Customer street
|
||||||
├ zipcode string Customer ZIP code
|
├ zipcode string Customer ZIP code
|
||||||
├ city string Customer city
|
├ city string Customer city
|
||||||
├ country string Customer country
|
├ country string Customer country
|
||||||
├ internal_reference string Customer's internal reference to be printed on the invoice
|
└ vat_id string Customer VAT ID
|
||||||
├ vat_id string Customer VAT ID
|
position list of objects List of order positions (see below)
|
||||||
└ vat_id_validated string ``True``, if the VAT ID has been validated against the
|
|
||||||
EU VAT service and validation was successful. This only
|
|
||||||
happens in rare cases.
|
|
||||||
positions list of objects List of order positions (see below)
|
|
||||||
fees list of objects List of fees included in the order total (i.e.
|
|
||||||
payment fees)
|
|
||||||
├ fee_type string Type of fee (currently ``payment``, ``passbook``,
|
|
||||||
``other``)
|
|
||||||
├ value money (string) Fee amount
|
|
||||||
├ description string Human-readable string with more details (can be empty)
|
|
||||||
├ internal_type string Internal string (i.e. ID of the payment provider),
|
|
||||||
can be empty
|
|
||||||
├ tax_rate decimal (string) VAT rate applied for this fee
|
|
||||||
├ tax_value money (string) VAT included in this fee
|
|
||||||
└ tax_rule integer The ID of the used tax rule (or ``null``)
|
|
||||||
downloads list of objects List of ticket download options for order-wise ticket
|
downloads list of objects List of ticket download options for order-wise ticket
|
||||||
downloading. This might be a multi-page PDF or a ZIP
|
downloading. This might be a multi-page PDF or a ZIP
|
||||||
file of tickets for outputs that do not support
|
file of tickets for outputs that do not support
|
||||||
@@ -74,42 +48,8 @@ downloads list of objects List of ticket
|
|||||||
download options.
|
download options.
|
||||||
├ output string Ticket output provider (e.g. ``pdf``, ``passbook``)
|
├ output string Ticket output provider (e.g. ``pdf``, ``passbook``)
|
||||||
└ url string Download URL
|
└ url string Download URL
|
||||||
last_modified datetime Last modification of this object
|
|
||||||
===================================== ========================== =======================================================
|
===================================== ========================== =======================================================
|
||||||
|
|
||||||
|
|
||||||
.. versionchanged:: 1.6
|
|
||||||
|
|
||||||
The ``invoice_address.country`` attribute contains a two-letter country code for all new orders. For old orders,
|
|
||||||
a custom text might still be returned.
|
|
||||||
|
|
||||||
.. versionchanged:: 1.7
|
|
||||||
|
|
||||||
The attributes ``invoice_address.vat_id_validated`` and ``invoice_address.is_business`` have been added.
|
|
||||||
The attributes ``order.payment_fee``, ``order.payment_fee_tax_rate`` and ``order.payment_fee_tax_value`` have been
|
|
||||||
deprecated in favor of the new ``fees`` attribute but will still be served and removed in 1.9.
|
|
||||||
|
|
||||||
.. versionchanged:: 1.9
|
|
||||||
|
|
||||||
First write operations (``…/mark_paid/``, ``…/mark_pending/``, ``…/mark_canceled/``, ``…/mark_expired/``) have been added.
|
|
||||||
The attribute ``invoice_address.internal_reference`` has been added.
|
|
||||||
|
|
||||||
.. versionchanged:: 1.13
|
|
||||||
|
|
||||||
The field ``checkin_attention`` has been added.
|
|
||||||
|
|
||||||
.. versionchanged:: 1.15
|
|
||||||
|
|
||||||
The attributes ``order.payment_fee``, ``order.payment_fee_tax_rate``, ``order.payment_fee_tax_value`` and
|
|
||||||
``order.payment_fee_tax_rule`` have finally been removed.
|
|
||||||
|
|
||||||
.. versionchanged:: 1.16
|
|
||||||
|
|
||||||
The attributes ``order.last_modified`` as well as the corresponding filters to the resource have been added.
|
|
||||||
An endpoint for order creation as well as ``…/mark_refunded/`` has been added.
|
|
||||||
|
|
||||||
.. _order-position-resource:
|
|
||||||
|
|
||||||
Order position resource
|
Order position resource
|
||||||
-----------------------
|
-----------------------
|
||||||
|
|
||||||
@@ -118,8 +58,8 @@ Order position resource
|
|||||||
===================================== ========================== =======================================================
|
===================================== ========================== =======================================================
|
||||||
Field Type Description
|
Field Type Description
|
||||||
===================================== ========================== =======================================================
|
===================================== ========================== =======================================================
|
||||||
id integer Internal ID of the order position
|
id integer Internal ID of the order positon
|
||||||
order string Order code of the order the position belongs to
|
code string Order code of the order the position belongs to
|
||||||
positionid integer Number of the position within the order
|
positionid integer Number of the position within the order
|
||||||
item integer ID of the purchased item
|
item integer ID of the purchased item
|
||||||
variation integer ID of the purchased variation (or ``null``)
|
variation integer ID of the purchased variation (or ``null``)
|
||||||
@@ -129,13 +69,9 @@ attendee_email string Specified atten
|
|||||||
voucher integer Internal ID of the voucher used for this position (or ``null``)
|
voucher integer Internal ID of the voucher used for this position (or ``null``)
|
||||||
tax_rate decimal (string) VAT rate applied for this position
|
tax_rate decimal (string) VAT rate applied for this position
|
||||||
tax_value money (string) VAT included in this position
|
tax_value money (string) VAT included in this position
|
||||||
tax_rule integer The ID of the used tax rule (or ``null``)
|
|
||||||
secret string Secret code printed on the tickets for validation
|
secret string Secret code printed on the tickets for validation
|
||||||
addon_to integer Internal ID of the position this position is an add-on for (or ``null``)
|
addon_to integer Internal ID of the position this position is an add-on for (or ``null``)
|
||||||
subevent integer ID of the date inside an event series this position belongs to (or ``null``).
|
|
||||||
pseudonymization_id string A random ID, e.g. for use in lead scanning apps
|
|
||||||
checkins list of objects List of check-ins with this ticket
|
checkins list of objects List of check-ins with this ticket
|
||||||
├ list integer Internal ID of the check-in list
|
|
||||||
└ datetime datetime Time of check-in
|
└ datetime datetime Time of check-in
|
||||||
downloads list of objects List of ticket download options
|
downloads list of objects List of ticket download options
|
||||||
├ output string Ticket output provider (e.g. ``pdf``, ``passbook``)
|
├ output string Ticket output provider (e.g. ``pdf``, ``passbook``)
|
||||||
@@ -143,38 +79,13 @@ downloads list of objects List of ticket
|
|||||||
answers list of objects Answers to user-defined questions
|
answers list of objects Answers to user-defined questions
|
||||||
├ question integer Internal ID of the answered question
|
├ question integer Internal ID of the answered question
|
||||||
├ answer string Text representation of the answer
|
├ answer string Text representation of the answer
|
||||||
├ question_identifier string The question's ``identifier`` field
|
└ options list of integers Internal IDs of selected option(s)s (only for choice types)
|
||||||
├ options list of integers Internal IDs of selected option(s)s (only for choice types)
|
|
||||||
└ option_identifiers list of strings The ``identifier`` fields of the selected option(s)s
|
|
||||||
pdf_data object Data object required for ticket PDF generation. By default,
|
|
||||||
this field is missing. It will be added only if you add the
|
|
||||||
``pdf_data=true`` query parameter to your request.
|
|
||||||
===================================== ========================== =======================================================
|
===================================== ========================== =======================================================
|
||||||
|
|
||||||
.. versionchanged:: 1.7
|
|
||||||
|
|
||||||
The attribute ``tax_rule`` has been added.
|
|
||||||
|
|
||||||
.. versionchanged:: 1.11
|
|
||||||
|
|
||||||
The attribute ``checkins.list`` has been added.
|
|
||||||
|
|
||||||
.. versionchanged:: 1.14
|
|
||||||
|
|
||||||
The attributes ``answers.question_identifier`` and ``answers.option_identifiers`` have been added.
|
|
||||||
|
|
||||||
.. versionchanged:: 1.16
|
|
||||||
|
|
||||||
The attributes ``pseudonymization_id`` and ``pdf_data`` have been added.
|
|
||||||
|
|
||||||
|
|
||||||
Order endpoints
|
Order endpoints
|
||||||
---------------
|
---------------
|
||||||
|
|
||||||
.. versionchanged:: 1.15
|
|
||||||
|
|
||||||
Filtering for emails or order codes is now case-insensitive.
|
|
||||||
|
|
||||||
.. http:get:: /api/v1/organizers/(organizer)/events/(event)/orders/
|
.. http:get:: /api/v1/organizers/(organizer)/events/(event)/orders/
|
||||||
|
|
||||||
Returns a list of all orders within a given event.
|
Returns a list of all orders within a given event.
|
||||||
@@ -193,8 +104,7 @@ Order endpoints
|
|||||||
|
|
||||||
HTTP/1.1 200 OK
|
HTTP/1.1 200 OK
|
||||||
Vary: Accept
|
Vary: Accept
|
||||||
Content-Type: application/json
|
Content-Type: text/javascript
|
||||||
X-Page-Generated: 2017-12-01T10:00:00Z
|
|
||||||
|
|
||||||
{
|
{
|
||||||
"count": 1,
|
"count": 1,
|
||||||
@@ -209,25 +119,22 @@ Order endpoints
|
|||||||
"locale": "en",
|
"locale": "en",
|
||||||
"datetime": "2017-12-01T10:00:00Z",
|
"datetime": "2017-12-01T10:00:00Z",
|
||||||
"expires": "2017-12-10T10:00:00Z",
|
"expires": "2017-12-10T10:00:00Z",
|
||||||
"last_modified": "2017-12-01T10:00:00Z",
|
|
||||||
"payment_date": "2017-12-05",
|
"payment_date": "2017-12-05",
|
||||||
"payment_provider": "banktransfer",
|
"payment_provider": "banktransfer",
|
||||||
"fees": [],
|
"payment_fee": "0.00",
|
||||||
|
"payment_fee_tax_rate": "0.00",
|
||||||
|
"payment_fee_tax_value": "0.00",
|
||||||
"total": "23.00",
|
"total": "23.00",
|
||||||
"comment": "",
|
"comment": "",
|
||||||
"checkin_attention": false,
|
|
||||||
"invoice_address": {
|
"invoice_address": {
|
||||||
"last_modified": "2017-12-01T10:00:00Z",
|
"last_modified": "2017-12-01T10:00:00Z",
|
||||||
"is_business": True,
|
|
||||||
"company": "Sample company",
|
"company": "Sample company",
|
||||||
"name": "John Doe",
|
"name": "John Doe",
|
||||||
"street": "Test street 12",
|
"street": "Test street 12",
|
||||||
"zipcode": "12345",
|
"zipcode": "12345",
|
||||||
"city": "Testington",
|
"city": "Testington",
|
||||||
"country": "Testikistan",
|
"country": "Testikistan",
|
||||||
"internal_reference": "",
|
"vat_id": "EU123456789"
|
||||||
"vat_id": "EU123456789",
|
|
||||||
"vat_id_validated": False
|
|
||||||
},
|
},
|
||||||
"positions": [
|
"positions": [
|
||||||
{
|
{
|
||||||
@@ -242,23 +149,17 @@ Order endpoints
|
|||||||
"voucher": null,
|
"voucher": null,
|
||||||
"tax_rate": "0.00",
|
"tax_rate": "0.00",
|
||||||
"tax_value": "0.00",
|
"tax_value": "0.00",
|
||||||
"tax_rule": null,
|
|
||||||
"secret": "z3fsn8jyufm5kpk768q69gkbyr5f4h6w",
|
"secret": "z3fsn8jyufm5kpk768q69gkbyr5f4h6w",
|
||||||
"addon_to": null,
|
"addon_to": null,
|
||||||
"subevent": null,
|
|
||||||
"pseudonymization_id": "MQLJvANO3B",
|
|
||||||
"checkins": [
|
"checkins": [
|
||||||
{
|
{
|
||||||
"list": 44,
|
|
||||||
"datetime": "2017-12-25T12:45:23Z"
|
"datetime": "2017-12-25T12:45:23Z"
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
"answers": [
|
"answers": [
|
||||||
{
|
{
|
||||||
"question": 12,
|
"question": 12,
|
||||||
"question_identifier": "WY3TP9SL",
|
|
||||||
"answer": "Foo",
|
"answer": "Foo",
|
||||||
"option_idenfiters": [],
|
|
||||||
"options": []
|
"options": []
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
@@ -287,11 +188,8 @@ Order endpoints
|
|||||||
:query string status: Only return orders in the given order status (see above)
|
:query string status: Only return orders in the given order status (see above)
|
||||||
:query string email: Only return orders created with the given email address
|
:query string email: Only return orders created with the given email address
|
||||||
:query string locale: Only return orders with the given customer locale
|
:query string locale: Only return orders with the given customer locale
|
||||||
:query datetime modified_since: Only return orders that have changed since the given date
|
|
||||||
:param organizer: The ``slug`` field of the organizer to fetch
|
:param organizer: The ``slug`` field of the organizer to fetch
|
||||||
:param event: The ``slug`` field of the event to fetch
|
:param event: The ``slug`` field of the event to fetch
|
||||||
:resheader X-Page-Generated: The server time at the beginning of the operation. If you're using this API to fetch
|
|
||||||
differences, this is the value you want to use as ``modified_since`` in your next call.
|
|
||||||
:statuscode 200: no error
|
:statuscode 200: no error
|
||||||
:statuscode 401: Authentication failure
|
:statuscode 401: Authentication failure
|
||||||
:statuscode 403: The requested organizer/event does not exist **or** you have no permission to view this resource.
|
:statuscode 403: The requested organizer/event does not exist **or** you have no permission to view this resource.
|
||||||
@@ -314,7 +212,7 @@ Order endpoints
|
|||||||
|
|
||||||
HTTP/1.1 200 OK
|
HTTP/1.1 200 OK
|
||||||
Vary: Accept
|
Vary: Accept
|
||||||
Content-Type: application/json
|
Content-Type: text/javascript
|
||||||
|
|
||||||
{
|
{
|
||||||
"code": "ABC12",
|
"code": "ABC12",
|
||||||
@@ -324,25 +222,22 @@ Order endpoints
|
|||||||
"locale": "en",
|
"locale": "en",
|
||||||
"datetime": "2017-12-01T10:00:00Z",
|
"datetime": "2017-12-01T10:00:00Z",
|
||||||
"expires": "2017-12-10T10:00:00Z",
|
"expires": "2017-12-10T10:00:00Z",
|
||||||
"last_modified": "2017-12-01T10:00:00Z",
|
|
||||||
"payment_date": "2017-12-05",
|
"payment_date": "2017-12-05",
|
||||||
"payment_provider": "banktransfer",
|
"payment_provider": "banktransfer",
|
||||||
"fees": [],
|
"payment_fee": "0.00",
|
||||||
|
"payment_fee_tax_rate": "0.00",
|
||||||
|
"payment_fee_tax_value": "0.00",
|
||||||
"total": "23.00",
|
"total": "23.00",
|
||||||
"comment": "",
|
"comment": "",
|
||||||
"checkin_attention": false,
|
|
||||||
"invoice_address": {
|
"invoice_address": {
|
||||||
"last_modified": "2017-12-01T10:00:00Z",
|
"last_modified": "2017-12-01T10:00:00Z",
|
||||||
"company": "Sample company",
|
"company": "Sample company",
|
||||||
"is_business": True,
|
|
||||||
"name": "John Doe",
|
"name": "John Doe",
|
||||||
"street": "Test street 12",
|
"street": "Test street 12",
|
||||||
"zipcode": "12345",
|
"zipcode": "12345",
|
||||||
"city": "Testington",
|
"city": "Testington",
|
||||||
"country": "Testikistan",
|
"country": "Testikistan",
|
||||||
"internal_reference": "",
|
"vat_id": "EU123456789"
|
||||||
"vat_id": "EU123456789",
|
|
||||||
"vat_id_validated": False
|
|
||||||
},
|
},
|
||||||
"positions": [
|
"positions": [
|
||||||
{
|
{
|
||||||
@@ -356,24 +251,18 @@ Order endpoints
|
|||||||
"attendee_email": null,
|
"attendee_email": null,
|
||||||
"voucher": null,
|
"voucher": null,
|
||||||
"tax_rate": "0.00",
|
"tax_rate": "0.00",
|
||||||
"tax_rule": null,
|
|
||||||
"tax_value": "0.00",
|
"tax_value": "0.00",
|
||||||
"secret": "z3fsn8jyufm5kpk768q69gkbyr5f4h6w",
|
"secret": "z3fsn8jyufm5kpk768q69gkbyr5f4h6w",
|
||||||
"addon_to": null,
|
"addon_to": null,
|
||||||
"subevent": null,
|
|
||||||
"pseudonymization_id": "MQLJvANO3B",
|
|
||||||
"checkins": [
|
"checkins": [
|
||||||
{
|
{
|
||||||
"list": 44,
|
|
||||||
"datetime": "2017-12-25T12:45:23Z"
|
"datetime": "2017-12-25T12:45:23Z"
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
"answers": [
|
"answers": [
|
||||||
{
|
{
|
||||||
"question": 12,
|
"question": 12,
|
||||||
"question_identifier": "WY3TP9SL",
|
|
||||||
"answer": "Foo",
|
"answer": "Foo",
|
||||||
"option_idenfiters": [],
|
|
||||||
"options": []
|
"options": []
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
@@ -399,13 +288,12 @@ Order endpoints
|
|||||||
:statuscode 200: no error
|
:statuscode 200: no error
|
||||||
:statuscode 401: Authentication failure
|
:statuscode 401: Authentication failure
|
||||||
:statuscode 403: The requested organizer/event does not exist **or** you have no permission to view this resource.
|
:statuscode 403: The requested organizer/event does not exist **or** you have no permission to view this resource.
|
||||||
:statuscode 404: The requested order does not exist.
|
|
||||||
|
|
||||||
.. http:get:: /api/v1/organizers/(organizer)/events/(event)/orders/(code)/download/(output)/
|
.. http:get:: /api/v1/organizers/(organizer)/events/(event)/orders/(code)/download/(output)/
|
||||||
|
|
||||||
Download tickets for an order, identified by its order code. Depending on the chosen output, the response might
|
Download tickets for an order, identified by its order code. Depending on the chosen output, the response might
|
||||||
be a ZIP file, PDF file or something else. The order details response contains a list of output options for this
|
be a ZIP file, PDF file or something else. The order details response contains a list of output options for this
|
||||||
particular order.
|
partictular order.
|
||||||
|
|
||||||
Tickets can be only downloaded if the order is paid and if ticket downloads are active. Note that in some cases the
|
Tickets can be only downloaded if the order is paid and if ticket downloads are active. Note that in some cases the
|
||||||
ticket file might not yet have been created. In that case, you will receive a status code :http:statuscode:`409` and
|
ticket file might not yet have been created. In that case, you will receive a status code :http:statuscode:`409` and
|
||||||
@@ -436,432 +324,15 @@ Order endpoints
|
|||||||
:statuscode 200: no error
|
:statuscode 200: no error
|
||||||
:statuscode 401: Authentication failure
|
:statuscode 401: Authentication failure
|
||||||
:statuscode 403: The requested organizer/event does not exist **or** you have no permission to view this resource
|
:statuscode 403: The requested organizer/event does not exist **or** you have no permission to view this resource
|
||||||
**or** downloads are not available for this order at this time. The response content will
|
**or** downlodas are not available for this order at this time. The response content will
|
||||||
contain more details.
|
contain more details.
|
||||||
:statuscode 404: The requested order or output provider does not exist.
|
:statuscode 409: The file is not yet ready and will now be prepared. Retry the request after waiting vor a few
|
||||||
:statuscode 409: The file is not yet ready and will now be prepared. Retry the request after waiting for a few
|
|
||||||
seconds.
|
seconds.
|
||||||
|
|
||||||
.. http:post:: /api/v1/organizers/(organizer)/events/(event)/orders/
|
|
||||||
|
|
||||||
Creates a new order.
|
|
||||||
|
|
||||||
.. warning:: This endpoint is considered **experimental**. It might change at any time without prior notice.
|
|
||||||
|
|
||||||
.. warning::
|
|
||||||
|
|
||||||
This endpoint is intended for advanced users. It is not designed to be used to build your own shop frontend,
|
|
||||||
it's rather intended to import attendees from external sources etc.
|
|
||||||
There is a lot that it does not or can not do, and you will need to be careful using it.
|
|
||||||
It allows to bypass many of the restrictions imposed when creating an order through the
|
|
||||||
regular shop.
|
|
||||||
|
|
||||||
Specifically, this endpoint currently
|
|
||||||
|
|
||||||
* does not validate if products are only to be sold in a specific time frame
|
|
||||||
|
|
||||||
* does not validate if the event's ticket sales are already over or haven't started
|
|
||||||
|
|
||||||
* does not validate the number of items per order or the number of times an item can be included in an order
|
|
||||||
|
|
||||||
* does not validate any requirements related to add-on products
|
|
||||||
|
|
||||||
* does not check or calculate prices but believes any prices you send
|
|
||||||
|
|
||||||
* does not support the redemption of vouchers
|
|
||||||
|
|
||||||
* does not prevent you from buying items that can only be bought with a voucher
|
|
||||||
|
|
||||||
* does not calculate fees
|
|
||||||
|
|
||||||
* does not allow to pass data to plugins and will therefore cause issues with some plugins like the shipping
|
|
||||||
module
|
|
||||||
|
|
||||||
* does not send order confirmations via email
|
|
||||||
|
|
||||||
* does not support reverse charge taxation
|
|
||||||
|
|
||||||
* does not support file upload questions
|
|
||||||
|
|
||||||
You can supply the following fields of the resource:
|
|
||||||
|
|
||||||
* ``code`` (optional)
|
|
||||||
* ``status`` (optional) – Defaults to pending for non-free orders and paid for free orders. You can only set this to
|
|
||||||
``"n"`` for pending or ``"p"`` for paid. If you create a paid order, the ``order_paid`` signal will **not** be
|
|
||||||
sent out to plugins and no email will be sent. If you want that behavior, create an unpaid order and then call
|
|
||||||
the ``mark_paid`` API method.
|
|
||||||
* ``consume_carts`` (optional) – A list of cart IDs. All cart positions with these IDs will be deleted if the
|
|
||||||
order creation is successful. Any quotas that become free by this operation will be credited to your order
|
|
||||||
creation.
|
|
||||||
* ``email``
|
|
||||||
* ``locale``
|
|
||||||
* ``payment_provider`` – The identifier of the payment provider set for this order. This needs to be an existing
|
|
||||||
payment provider. You should use ``"free"`` for free orders.
|
|
||||||
* ``payment_info`` (optional) – You can pass a nested JSON object that will be set as the internal ``payment_info``
|
|
||||||
value of the order. How this value is handled is up to the payment provider and you should only use this if you
|
|
||||||
know the specific payment provider in detail. Please keep in mind that the payment provider will not be called
|
|
||||||
to do anything about this (i.e. if you pass a bank account to a debit provider, *no* charge will be created),
|
|
||||||
this is just informative in case you *handled the payment already*.
|
|
||||||
* ``comment`` (optional)
|
|
||||||
* ``checkin_attention`` (optional)
|
|
||||||
* ``invoice_address`` (optional)
|
|
||||||
|
|
||||||
* ``company``
|
|
||||||
* ``is_business``
|
|
||||||
* ``name``
|
|
||||||
* ``street``
|
|
||||||
* ``zipcode``
|
|
||||||
* ``city``
|
|
||||||
* ``country``
|
|
||||||
* ``internal_reference``
|
|
||||||
* ``vat_id``
|
|
||||||
|
|
||||||
* ``positions``
|
|
||||||
|
|
||||||
* ``positionid`` (optional, see below)
|
|
||||||
* ``item``
|
|
||||||
* ``variation``
|
|
||||||
* ``price``
|
|
||||||
* ``attendee_name``
|
|
||||||
* ``attendee_email``
|
|
||||||
* ``secret`` (optional)
|
|
||||||
* ``addon_to`` (optional, see below)
|
|
||||||
* ``subevent``
|
|
||||||
* ``answers``
|
|
||||||
|
|
||||||
* ``question``
|
|
||||||
* ``answer``
|
|
||||||
* ``options``
|
|
||||||
|
|
||||||
* ``fees``
|
|
||||||
|
|
||||||
* ``fee_type``
|
|
||||||
* ``value``
|
|
||||||
* ``description``
|
|
||||||
* ``internal_type``
|
|
||||||
* ``tax_rule``
|
|
||||||
|
|
||||||
If you want to use add-on products, you need to set the ``positionid`` fields of all positions manually
|
|
||||||
to incrementing integers starting with ``1``. Then, you can reference one of these
|
|
||||||
IDs in the ``addon_to`` field of another position. Note that all add_ons for a specific position need to come
|
|
||||||
immediately after the position itself.
|
|
||||||
|
|
||||||
**Example request**:
|
|
||||||
|
|
||||||
.. sourcecode:: http
|
|
||||||
|
|
||||||
POST /api/v1/organizers/bigevents/events/sampleconf/orders/ HTTP/1.1
|
|
||||||
Host: pretix.eu
|
|
||||||
Accept: application/json, text/javascript
|
|
||||||
Content: application/json
|
|
||||||
|
|
||||||
{
|
|
||||||
"email": "dummy@example.org",
|
|
||||||
"locale": "en",
|
|
||||||
"fees": [
|
|
||||||
{
|
|
||||||
"fee_type": "payment",
|
|
||||||
"value": "0.25",
|
|
||||||
"description": "",
|
|
||||||
"internal_type": "",
|
|
||||||
"tax_rule": 2
|
|
||||||
}
|
|
||||||
],
|
|
||||||
"payment_provider": "banktransfer",
|
|
||||||
"invoice_address": {
|
|
||||||
"is_business": False,
|
|
||||||
"company": "Sample company",
|
|
||||||
"name": "John Doe",
|
|
||||||
"street": "Sesam Street 12",
|
|
||||||
"zipcode": "12345",
|
|
||||||
"city": "Sample City",
|
|
||||||
"country": "UK",
|
|
||||||
"internal_reference": "",
|
|
||||||
"vat_id": ""
|
|
||||||
},
|
|
||||||
"positions": [
|
|
||||||
{
|
|
||||||
"positionid": 1,
|
|
||||||
"item": 1,
|
|
||||||
"variation": null,
|
|
||||||
"price": "23.00",
|
|
||||||
"attendee_name": "Peter",
|
|
||||||
"attendee_email": null,
|
|
||||||
"addon_to": null,
|
|
||||||
"answers": [
|
|
||||||
{
|
|
||||||
"question": 1,
|
|
||||||
"answer": "23",
|
|
||||||
"options": []
|
|
||||||
}
|
|
||||||
],
|
|
||||||
"subevent": null
|
|
||||||
}
|
|
||||||
],
|
|
||||||
}
|
|
||||||
|
|
||||||
**Example response**:
|
|
||||||
|
|
||||||
.. sourcecode:: http
|
|
||||||
|
|
||||||
HTTP/1.1 201 Created
|
|
||||||
Vary: Accept
|
|
||||||
Content-Type: application/json
|
|
||||||
|
|
||||||
(Full order resource, see above.)
|
|
||||||
|
|
||||||
:param organizer: The ``slug`` field of the organizer of the event to create an item for
|
|
||||||
:param event: The ``slug`` field of the event to create an item for
|
|
||||||
:statuscode 201: no error
|
|
||||||
:statuscode 400: The item could not be created due to invalid submitted data or lack of quota.
|
|
||||||
:statuscode 401: Authentication failure
|
|
||||||
:statuscode 403: The requested organizer/event does not exist **or** you have no permission to create this
|
|
||||||
order.
|
|
||||||
|
|
||||||
.. http:post:: /api/v1/organizers/(organizer)/events/(event)/orders/(code)/mark_paid/
|
|
||||||
|
|
||||||
Marks a pending or expired order as successfully paid.
|
|
||||||
|
|
||||||
**Example request**:
|
|
||||||
|
|
||||||
.. sourcecode:: http
|
|
||||||
|
|
||||||
POST /api/v1/organizers/bigevents/events/sampleconf/orders/ABC12/mark_paid/ HTTP/1.1
|
|
||||||
Host: pretix.eu
|
|
||||||
Accept: application/json, text/javascript
|
|
||||||
|
|
||||||
**Example response**:
|
|
||||||
|
|
||||||
.. sourcecode:: http
|
|
||||||
|
|
||||||
HTTP/1.1 200 OK
|
|
||||||
Vary: Accept
|
|
||||||
Content-Type: application/json
|
|
||||||
|
|
||||||
{
|
|
||||||
"code": "ABC12",
|
|
||||||
"status": "p",
|
|
||||||
...
|
|
||||||
}
|
|
||||||
|
|
||||||
:param organizer: The ``slug`` field of the organizer to modify
|
|
||||||
:param event: The ``slug`` field of the event to modify
|
|
||||||
:param code: The ``code`` field of the order to modify
|
|
||||||
:statuscode 200: no error
|
|
||||||
:statuscode 400: The order cannot be marked as paid, either because the current order status does not allow it or because no quota is left to perform the operation.
|
|
||||||
:statuscode 401: Authentication failure
|
|
||||||
:statuscode 403: The requested organizer/event does not exist **or** you have no permission to view this resource.
|
|
||||||
:statuscode 404: The requested order does not exist.
|
|
||||||
:statuscode 409: The server was unable to acquire a lock and could not process your request. You can try again after a short waiting period.
|
|
||||||
|
|
||||||
.. http:post:: /api/v1/organizers/(organizer)/events/(event)/orders/(code)/mark_canceled/
|
|
||||||
|
|
||||||
Marks a pending order as canceled.
|
|
||||||
|
|
||||||
**Example request**:
|
|
||||||
|
|
||||||
.. sourcecode:: http
|
|
||||||
|
|
||||||
POST /api/v1/organizers/bigevents/events/sampleconf/orders/ABC12/mark_canceled/ HTTP/1.1
|
|
||||||
Host: pretix.eu
|
|
||||||
Accept: application/json, text/javascript
|
|
||||||
Content-Type: text/json
|
|
||||||
|
|
||||||
{
|
|
||||||
"send_email": true
|
|
||||||
}
|
|
||||||
|
|
||||||
**Example response**:
|
|
||||||
|
|
||||||
.. sourcecode:: http
|
|
||||||
|
|
||||||
HTTP/1.1 200 OK
|
|
||||||
Vary: Accept
|
|
||||||
Content-Type: application/json
|
|
||||||
|
|
||||||
{
|
|
||||||
"code": "ABC12",
|
|
||||||
"status": "c",
|
|
||||||
...
|
|
||||||
}
|
|
||||||
|
|
||||||
:param organizer: The ``slug`` field of the organizer to modify
|
|
||||||
:param event: The ``slug`` field of the event to modify
|
|
||||||
:param code: The ``code`` field of the order to modify
|
|
||||||
:statuscode 200: no error
|
|
||||||
:statuscode 400: The order cannot be marked as canceled since the current order status does not allow it.
|
|
||||||
:statuscode 401: Authentication failure
|
|
||||||
:statuscode 403: The requested organizer/event does not exist **or** you have no permission to view this resource.
|
|
||||||
:statuscode 404: The requested order does not exist.
|
|
||||||
|
|
||||||
.. http:post:: /api/v1/organizers/(organizer)/events/(event)/orders/(code)/mark_pending/
|
|
||||||
|
|
||||||
Marks a paid order as unpaid.
|
|
||||||
|
|
||||||
**Example request**:
|
|
||||||
|
|
||||||
.. sourcecode:: http
|
|
||||||
|
|
||||||
POST /api/v1/organizers/bigevents/events/sampleconf/orders/ABC12/mark_pending/ HTTP/1.1
|
|
||||||
Host: pretix.eu
|
|
||||||
Accept: application/json, text/javascript
|
|
||||||
|
|
||||||
**Example response**:
|
|
||||||
|
|
||||||
.. sourcecode:: http
|
|
||||||
|
|
||||||
HTTP/1.1 200 OK
|
|
||||||
Vary: Accept
|
|
||||||
Content-Type: application/json
|
|
||||||
|
|
||||||
{
|
|
||||||
"code": "ABC12",
|
|
||||||
"status": "n",
|
|
||||||
...
|
|
||||||
}
|
|
||||||
|
|
||||||
:param organizer: The ``slug`` field of the organizer to modify
|
|
||||||
:param event: The ``slug`` field of the event to modify
|
|
||||||
:param code: The ``code`` field of the order to modify
|
|
||||||
:statuscode 200: no error
|
|
||||||
:statuscode 400: The order cannot be marked as unpaid since the current order status does not allow it.
|
|
||||||
:statuscode 401: Authentication failure
|
|
||||||
:statuscode 403: The requested organizer/event does not exist **or** you have no permission to view this resource.
|
|
||||||
:statuscode 404: The requested order does not exist.
|
|
||||||
|
|
||||||
.. http:post:: /api/v1/organizers/(organizer)/events/(event)/orders/(code)/mark_refunded/
|
|
||||||
|
|
||||||
Marks a paid order as refunded.
|
|
||||||
|
|
||||||
.. warning:: In the current implementation, this will **bypass** the payment provider, i.e. the money will **not** be
|
|
||||||
transferred back to the user automatically, the order will only be *marked* as refunded within pretix.
|
|
||||||
|
|
||||||
**Example request**:
|
|
||||||
|
|
||||||
.. sourcecode:: http
|
|
||||||
|
|
||||||
POST /api/v1/organizers/bigevents/events/sampleconf/orders/ABC12/mark_expired/ HTTP/1.1
|
|
||||||
Host: pretix.eu
|
|
||||||
Accept: application/json, text/javascript
|
|
||||||
|
|
||||||
**Example response**:
|
|
||||||
|
|
||||||
.. sourcecode:: http
|
|
||||||
|
|
||||||
HTTP/1.1 200 OK
|
|
||||||
Vary: Accept
|
|
||||||
Content-Type: application/json
|
|
||||||
|
|
||||||
{
|
|
||||||
"code": "ABC12",
|
|
||||||
"status": "r",
|
|
||||||
...
|
|
||||||
}
|
|
||||||
|
|
||||||
:param organizer: The ``slug`` field of the organizer to modify
|
|
||||||
:param event: The ``slug`` field of the event to modify
|
|
||||||
:param code: The ``code`` field of the order to modify
|
|
||||||
:statuscode 200: no error
|
|
||||||
:statuscode 400: The order cannot be marked as expired since the current order status does not allow it.
|
|
||||||
:statuscode 401: Authentication failure
|
|
||||||
:statuscode 403: The requested organizer/event does not exist **or** you have no permission to view this resource.
|
|
||||||
:statuscode 404: The requested order does not exist.
|
|
||||||
|
|
||||||
.. http:post:: /api/v1/organizers/(organizer)/events/(event)/orders/(code)/mark_expired/
|
|
||||||
|
|
||||||
Marks a unpaid order as expired.
|
|
||||||
|
|
||||||
**Example request**:
|
|
||||||
|
|
||||||
.. sourcecode:: http
|
|
||||||
|
|
||||||
POST /api/v1/organizers/bigevents/events/sampleconf/orders/ABC12/mark_expired/ HTTP/1.1
|
|
||||||
Host: pretix.eu
|
|
||||||
Accept: application/json, text/javascript
|
|
||||||
|
|
||||||
**Example response**:
|
|
||||||
|
|
||||||
.. sourcecode:: http
|
|
||||||
|
|
||||||
HTTP/1.1 200 OK
|
|
||||||
Vary: Accept
|
|
||||||
Content-Type: application/json
|
|
||||||
|
|
||||||
{
|
|
||||||
"code": "ABC12",
|
|
||||||
"status": "e",
|
|
||||||
...
|
|
||||||
}
|
|
||||||
|
|
||||||
:param organizer: The ``slug`` field of the organizer to modify
|
|
||||||
:param event: The ``slug`` field of the event to modify
|
|
||||||
:param code: The ``code`` field of the order to modify
|
|
||||||
:statuscode 200: no error
|
|
||||||
:statuscode 400: The order cannot be marked as expired since the current order status does not allow it.
|
|
||||||
:statuscode 401: Authentication failure
|
|
||||||
:statuscode 403: The requested organizer/event does not exist **or** you have no permission to view this resource.
|
|
||||||
:statuscode 404: The requested order does not exist.
|
|
||||||
|
|
||||||
.. http:post:: /api/v1/organizers/(organizer)/events/(event)/orders/(code)/extend/
|
|
||||||
|
|
||||||
Extends the payment deadline of a pending order. If the order is already expired and quota is still
|
|
||||||
available, its state will be changed to pending.
|
|
||||||
|
|
||||||
The only required parameter of this operation is ``expires``, which should contain a date in the future.
|
|
||||||
Note that only a date is expected, not a datetime, since pretix will always set the deadline to the end of the
|
|
||||||
day in the event's timezone.
|
|
||||||
|
|
||||||
You can pass the optional parameter ``force``. If it is set to ``true``, the operation will be performed even if
|
|
||||||
it leads to an overbooked quota because the order was expired and the tickets have been sold again.
|
|
||||||
|
|
||||||
**Example request**:
|
|
||||||
|
|
||||||
.. sourcecode:: http
|
|
||||||
|
|
||||||
POST /api/v1/organizers/bigevents/events/sampleconf/orders/ABC12/extend/ HTTP/1.1
|
|
||||||
Host: pretix.eu
|
|
||||||
Accept: application/json, text/javascript
|
|
||||||
Content-Type: text/json
|
|
||||||
|
|
||||||
{
|
|
||||||
"expires": "2017-10-28",
|
|
||||||
"force": false
|
|
||||||
}
|
|
||||||
|
|
||||||
**Example response**:
|
|
||||||
|
|
||||||
.. sourcecode:: http
|
|
||||||
|
|
||||||
HTTP/1.1 200 OK
|
|
||||||
Vary: Accept
|
|
||||||
Content-Type: application/json
|
|
||||||
|
|
||||||
{
|
|
||||||
"code": "ABC12",
|
|
||||||
"status": "n",
|
|
||||||
"expires": "2017-10-28T23:59:59Z",
|
|
||||||
...
|
|
||||||
}
|
|
||||||
|
|
||||||
:param organizer: The ``slug`` field of the organizer to modify
|
|
||||||
:param event: The ``slug`` field of the event to modify
|
|
||||||
:param code: The ``code`` field of the order to modify
|
|
||||||
:statuscode 200: no error
|
|
||||||
:statuscode 400: The order cannot be extended since the current order status does not allow it or no quota is available or the submitted date is invalid.
|
|
||||||
:statuscode 401: Authentication failure
|
|
||||||
:statuscode 403: The requested organizer/event does not exist **or** you have no permission to view this resource.
|
|
||||||
:statuscode 404: The requested order does not exist.
|
|
||||||
|
|
||||||
|
|
||||||
Order position endpoints
|
Order position endpoints
|
||||||
------------------------
|
------------------------
|
||||||
|
|
||||||
.. versionchanged:: 1.15
|
|
||||||
|
|
||||||
The order positions endpoint has been extended by the filter queries ``item__in``, ``variation__in``,
|
|
||||||
``order__status__in``, ``subevent__in``, ``addon_to__in`` and ``search``. The search for attendee names and order
|
|
||||||
codes is now case-insensitive.
|
|
||||||
|
|
||||||
.. http:get:: /api/v1/organizers/(organizer)/events/(event)/orderpositions/
|
.. http:get:: /api/v1/organizers/(organizer)/events/(event)/orderpositions/
|
||||||
|
|
||||||
Returns a list of all order positions within a given event.
|
Returns a list of all order positions within a given event.
|
||||||
@@ -880,7 +351,7 @@ Order position endpoints
|
|||||||
|
|
||||||
HTTP/1.1 200 OK
|
HTTP/1.1 200 OK
|
||||||
Vary: Accept
|
Vary: Accept
|
||||||
Content-Type: application/json
|
Content-Type: text/javascript
|
||||||
|
|
||||||
{
|
{
|
||||||
"count": 1,
|
"count": 1,
|
||||||
@@ -898,24 +369,18 @@ Order position endpoints
|
|||||||
"attendee_email": null,
|
"attendee_email": null,
|
||||||
"voucher": null,
|
"voucher": null,
|
||||||
"tax_rate": "0.00",
|
"tax_rate": "0.00",
|
||||||
"tax_rule": null,
|
|
||||||
"tax_value": "0.00",
|
"tax_value": "0.00",
|
||||||
"secret": "z3fsn8jyufm5kpk768q69gkbyr5f4h6w",
|
"secret": "z3fsn8jyufm5kpk768q69gkbyr5f4h6w",
|
||||||
"pseudonymization_id": "MQLJvANO3B",
|
|
||||||
"addon_to": null,
|
"addon_to": null,
|
||||||
"subevent": null,
|
|
||||||
"checkins": [
|
"checkins": [
|
||||||
{
|
{
|
||||||
"list": 44,
|
|
||||||
"datetime": "2017-12-25T12:45:23Z"
|
"datetime": "2017-12-25T12:45:23Z"
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
"answers": [
|
"answers": [
|
||||||
{
|
{
|
||||||
"question": 12,
|
"question": 12,
|
||||||
"question_identifier": "WY3TP9SL",
|
|
||||||
"answer": "Foo",
|
"answer": "Foo",
|
||||||
"option_idenfiters": [],
|
|
||||||
"options": []
|
"options": []
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
@@ -934,24 +399,15 @@ Order position endpoints
|
|||||||
``order__datetime``, ``positionid``, ``attendee_name``, and ``order__status``. Default:
|
``order__datetime``, ``positionid``, ``attendee_name``, and ``order__status``. Default:
|
||||||
``order__datetime,positionid``
|
``order__datetime,positionid``
|
||||||
:query string order: Only return positions of the order with the given order code
|
:query string order: Only return positions of the order with the given order code
|
||||||
:query string search: Fuzzy search matching the attendee name, order code, invoice address name as well as to the beginning of the secret.
|
|
||||||
:query integer item: Only return positions with the purchased item matching the given ID.
|
:query integer item: Only return positions with the purchased item matching the given ID.
|
||||||
:query integer item__in: Only return positions with the purchased item matching one of the given comma-separated IDs.
|
|
||||||
:query integer variation: Only return positions with the purchased item variation matching the given ID.
|
:query integer variation: Only return positions with the purchased item variation matching the given ID.
|
||||||
:query integer variation__in: Only return positions with one of the purchased item variation matching the given
|
|
||||||
comma-separated IDs.
|
|
||||||
:query string attendee_name: Only return positions with the given value in the attendee_name field. Also, add-on
|
:query string attendee_name: Only return positions with the given value in the attendee_name field. Also, add-on
|
||||||
products positions are shown if they refer to an attendee with the given name.
|
products positions are shown if they refer to an attendee with the given name.
|
||||||
:query string secret: Only return positions with the given ticket secret.
|
:query string secret: Only return positions with the given ticket secret.
|
||||||
:query string order__status: Only return positions with the given order status.
|
:query string order__status: Only return positions with the given order status.
|
||||||
:query string order__status__in: Only return positions with one the given comma-separated order status.
|
:query bollean has_checkin: If set to ``true`` or ``false``, only return positions that have or have not been
|
||||||
:query boolean has_checkin: If set to ``true`` or ``false``, only return positions that have or have not been
|
|
||||||
checked in already.
|
checked in already.
|
||||||
:query integer subevent: Only return positions of the sub-event with the given ID
|
|
||||||
:query integer subevent__in: Only return positions of one of the sub-events with the given comma-separated IDs
|
|
||||||
:query integer addon_to: Only return positions that are add-ons to the position with the given ID.
|
:query integer addon_to: Only return positions that are add-ons to the position with the given ID.
|
||||||
:query integer addon_to__in: Only return positions that are add-ons to one of the positions with the given
|
|
||||||
comma-separated IDs.
|
|
||||||
:param organizer: The ``slug`` field of the organizer to fetch
|
:param organizer: The ``slug`` field of the organizer to fetch
|
||||||
:param event: The ``slug`` field of the event to fetch
|
:param event: The ``slug`` field of the event to fetch
|
||||||
:statuscode 200: no error
|
:statuscode 200: no error
|
||||||
@@ -976,7 +432,7 @@ Order position endpoints
|
|||||||
|
|
||||||
HTTP/1.1 200 OK
|
HTTP/1.1 200 OK
|
||||||
Vary: Accept
|
Vary: Accept
|
||||||
Content-Type: application/json
|
Content-Type: text/javascript
|
||||||
|
|
||||||
{
|
{
|
||||||
"id": 23442,
|
"id": 23442,
|
||||||
@@ -989,24 +445,18 @@ Order position endpoints
|
|||||||
"attendee_email": null,
|
"attendee_email": null,
|
||||||
"voucher": null,
|
"voucher": null,
|
||||||
"tax_rate": "0.00",
|
"tax_rate": "0.00",
|
||||||
"tax_rule": null,
|
|
||||||
"tax_value": "0.00",
|
"tax_value": "0.00",
|
||||||
"secret": "z3fsn8jyufm5kpk768q69gkbyr5f4h6w",
|
"secret": "z3fsn8jyufm5kpk768q69gkbyr5f4h6w",
|
||||||
"addon_to": null,
|
"addon_to": null,
|
||||||
"subevent": null,
|
|
||||||
"pseudonymization_id": "MQLJvANO3B",
|
|
||||||
"checkins": [
|
"checkins": [
|
||||||
{
|
{
|
||||||
"list": 44,
|
|
||||||
"datetime": "2017-12-25T12:45:23Z"
|
"datetime": "2017-12-25T12:45:23Z"
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
"answers": [
|
"answers": [
|
||||||
{
|
{
|
||||||
"question": 12,
|
"question": 12,
|
||||||
"question_identifier": "WY3TP9SL",
|
|
||||||
"answer": "Foo",
|
"answer": "Foo",
|
||||||
"option_idenfiters": [],
|
|
||||||
"options": []
|
"options": []
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
@@ -1024,13 +474,12 @@ Order position endpoints
|
|||||||
:statuscode 200: no error
|
:statuscode 200: no error
|
||||||
:statuscode 401: Authentication failure
|
:statuscode 401: Authentication failure
|
||||||
:statuscode 403: The requested organizer/event does not exist **or** you have no permission to view this resource.
|
:statuscode 403: The requested organizer/event does not exist **or** you have no permission to view this resource.
|
||||||
:statuscode 404: The requested order position does not exist.
|
|
||||||
|
|
||||||
.. http:get:: /api/v1/organizers/(organizer)/events/(event)/orderpositions/(id)/download/(output)/
|
.. http:get:: /api/v1/organizers/(organizer)/events/(event)/orderpositions/(id)/download/(output)/
|
||||||
|
|
||||||
Download tickets for one order position, identified by its internal ID.
|
Download tickets for one order position, identified by its internal ID.
|
||||||
Depending on the chosen output, the response might be a ZIP file, PDF file or something else. The order details
|
Depending on the chosen output, the response might be a ZIP file, PDF file or something else. The order details
|
||||||
response contains a list of output options for this particular order position.
|
response contains a list of output options for this partictular order position.
|
||||||
|
|
||||||
Tickets can be only downloaded if the order is paid and if ticket downloads are active. Also, depending on event
|
Tickets can be only downloaded if the order is paid and if ticket downloads are active. Also, depending on event
|
||||||
configuration downloads might be only unavailable for add-on products or non-admission products.
|
configuration downloads might be only unavailable for add-on products or non-admission products.
|
||||||
@@ -1062,8 +511,7 @@ Order position endpoints
|
|||||||
:statuscode 200: no error
|
:statuscode 200: no error
|
||||||
:statuscode 401: Authentication failure
|
:statuscode 401: Authentication failure
|
||||||
:statuscode 403: The requested organizer/event does not exist **or** you have no permission to view this resource
|
:statuscode 403: The requested organizer/event does not exist **or** you have no permission to view this resource
|
||||||
**or** downloads are not available for this order position at this time. The response content will
|
**or** downlodas are not available for this order position at this time. The response content will
|
||||||
contain more details.
|
contain more details.
|
||||||
:statuscode 404: The requested order position or download provider does not exist.
|
:statuscode 409: The file is not yet ready and will now be prepared. Retry the request after waiting vor a few
|
||||||
:statuscode 409: The file is not yet ready and will now be prepared. Retry the request after waiting for a few
|
|
||||||
seconds.
|
seconds.
|
||||||
|
|||||||
@@ -41,7 +41,7 @@ Endpoints
|
|||||||
|
|
||||||
HTTP/1.1 200 OK
|
HTTP/1.1 200 OK
|
||||||
Vary: Accept
|
Vary: Accept
|
||||||
Content-Type: application/json
|
Content-Type: text/javascript
|
||||||
|
|
||||||
{
|
{
|
||||||
"count": 1,
|
"count": 1,
|
||||||
@@ -77,7 +77,7 @@ Endpoints
|
|||||||
|
|
||||||
HTTP/1.1 200 OK
|
HTTP/1.1 200 OK
|
||||||
Vary: Accept
|
Vary: Accept
|
||||||
Content-Type: application/json
|
Content-Type: text/javascript
|
||||||
|
|
||||||
{
|
{
|
||||||
"name": "Big Events LLC",
|
"name": "Big Events LLC",
|
||||||
|
|||||||
@@ -1,233 +0,0 @@
|
|||||||
Question options
|
|
||||||
================
|
|
||||||
|
|
||||||
Resource description
|
|
||||||
--------------------
|
|
||||||
|
|
||||||
Questions of type "choice" or "multiple choice" can have different options attached.
|
|
||||||
The options resource contains the following public fields:
|
|
||||||
|
|
||||||
.. rst-class:: rest-resource-table
|
|
||||||
|
|
||||||
===================================== ========================== =======================================================
|
|
||||||
Field Type Description
|
|
||||||
===================================== ========================== =======================================================
|
|
||||||
id integer Internal ID of the option
|
|
||||||
position integer An integer, used for sorting
|
|
||||||
identifier string An arbitrary string that can be used for matching with
|
|
||||||
other sources.
|
|
||||||
answer multi-lingual string The displayed value of this option
|
|
||||||
===================================== ========================== =======================================================
|
|
||||||
|
|
||||||
.. versionchanged:: 1.12
|
|
||||||
|
|
||||||
This resource has been added.
|
|
||||||
|
|
||||||
Endpoints
|
|
||||||
---------
|
|
||||||
|
|
||||||
.. http:get:: /api/v1/organizers/(organizer)/events/(event)/questions/(question)/options/
|
|
||||||
|
|
||||||
Returns a list of all options for a given question.
|
|
||||||
|
|
||||||
**Example request**:
|
|
||||||
|
|
||||||
.. sourcecode:: http
|
|
||||||
|
|
||||||
GET /api/v1/organizers/bigevents/events/sampleconf/questions/11/options/ HTTP/1.1
|
|
||||||
Host: pretix.eu
|
|
||||||
Accept: application/json, text/javascript
|
|
||||||
|
|
||||||
**Example response**:
|
|
||||||
|
|
||||||
.. sourcecode:: http
|
|
||||||
|
|
||||||
HTTP/1.1 200 OK
|
|
||||||
Vary: Accept
|
|
||||||
Content-Type: application/json
|
|
||||||
|
|
||||||
{
|
|
||||||
"count": 2,
|
|
||||||
"next": null,
|
|
||||||
"previous": null,
|
|
||||||
"results": [
|
|
||||||
{
|
|
||||||
"id": 1,
|
|
||||||
"identifier": "LVETRWVU",
|
|
||||||
"position": 1,
|
|
||||||
"answer": {"en": "S"}
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"id": 2,
|
|
||||||
"identifier": "DFEMJWMJ",
|
|
||||||
"position": 2,
|
|
||||||
"answer": {"en": "M"}
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"id": 3,
|
|
||||||
"identifier": "W9AH7RDE",
|
|
||||||
"position": 3,
|
|
||||||
"answer": {"en": "L"}
|
|
||||||
}
|
|
||||||
]
|
|
||||||
}
|
|
||||||
|
|
||||||
:query integer page: The page number in case of a multi-page result set, default is 1
|
|
||||||
:query boolean active: If set to ``true`` or ``false``, only questions with this value for the field ``active`` will be
|
|
||||||
returned.
|
|
||||||
:param organizer: The ``slug`` field of the organizer to fetch
|
|
||||||
:param event: The ``slug`` field of the event to fetch
|
|
||||||
:param question: The ``id`` field of the question to fetch
|
|
||||||
:statuscode 200: no error
|
|
||||||
:statuscode 401: Authentication failure
|
|
||||||
:statuscode 403: The requested organizer/event/question does not exist **or** you have no permission to view this resource.
|
|
||||||
|
|
||||||
.. http:get:: /api/v1/organizers/(organizer)/events/(event)/questions/(question)/options/(id)/
|
|
||||||
|
|
||||||
Returns information on one option, identified by its ID.
|
|
||||||
|
|
||||||
**Example request**:
|
|
||||||
|
|
||||||
.. sourcecode:: http
|
|
||||||
|
|
||||||
GET /api/v1/organizers/bigevents/events/sampleconf/questions/1/options/1/ HTTP/1.1
|
|
||||||
Host: pretix.eu
|
|
||||||
Accept: application/json, text/javascript
|
|
||||||
|
|
||||||
**Example response**:
|
|
||||||
|
|
||||||
.. sourcecode:: http
|
|
||||||
|
|
||||||
HTTP/1.1 200 OK
|
|
||||||
Vary: Accept
|
|
||||||
Content-Type: application/json
|
|
||||||
|
|
||||||
{
|
|
||||||
"id": 1,
|
|
||||||
"identifier": "LVETRWVU",
|
|
||||||
"position": 1,
|
|
||||||
"answer": {"en": "S"}
|
|
||||||
}
|
|
||||||
|
|
||||||
:param organizer: The ``slug`` field of the organizer to fetch
|
|
||||||
:param event: The ``slug`` field of the event to fetch
|
|
||||||
:param question: The ``id`` field of the question to fetch
|
|
||||||
:param id: The ``id`` field of the option to fetch
|
|
||||||
:statuscode 200: no error
|
|
||||||
:statuscode 401: Authentication failure
|
|
||||||
:statuscode 403: The requested organizer/event does not exist **or** you have no permission to view this resource.
|
|
||||||
|
|
||||||
.. http:post:: /api/v1/organizers/(organizer)/events/(event)/questions/(question)/options/
|
|
||||||
|
|
||||||
Creates a new option
|
|
||||||
|
|
||||||
**Example request**:
|
|
||||||
|
|
||||||
.. sourcecode:: http
|
|
||||||
|
|
||||||
POST /api/v1/organizers/bigevents/events/sampleconf/questions/1/options/ HTTP/1.1
|
|
||||||
Host: pretix.eu
|
|
||||||
Accept: application/json, text/javascript
|
|
||||||
Content: application/json
|
|
||||||
|
|
||||||
{
|
|
||||||
"identifier": "LVETRWVU",
|
|
||||||
"position": 1,
|
|
||||||
"answer": {"en": "S"}
|
|
||||||
}
|
|
||||||
|
|
||||||
**Example response**:
|
|
||||||
|
|
||||||
.. sourcecode:: http
|
|
||||||
|
|
||||||
HTTP/1.1 201 Created
|
|
||||||
Vary: Accept
|
|
||||||
Content-Type: application/json
|
|
||||||
|
|
||||||
{
|
|
||||||
"id": 1,
|
|
||||||
"identifier": "LVETRWVU",
|
|
||||||
"position": 1,
|
|
||||||
"answer": {"en": "S"}
|
|
||||||
}
|
|
||||||
|
|
||||||
:param organizer: The ``slug`` field of the organizer of the event/question to create a option for
|
|
||||||
:param event: The ``slug`` field of the event to create a option for
|
|
||||||
:param question: The ``id`` field of the question to create a option for
|
|
||||||
:statuscode 201: no error
|
|
||||||
:statuscode 400: The option could not be created due to invalid submitted data.
|
|
||||||
:statuscode 401: Authentication failure
|
|
||||||
:statuscode 403: The requested organizer/event does not exist **or** you have no permission to create this resource.
|
|
||||||
|
|
||||||
.. http:patch:: /api/v1/organizers/(organizer)/events/(event)/questions/(question)/options/(id)/
|
|
||||||
|
|
||||||
Update an option. 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 ``id`` field.
|
|
||||||
|
|
||||||
**Example request**:
|
|
||||||
|
|
||||||
.. sourcecode:: http
|
|
||||||
|
|
||||||
PATCH /api/v1/organizers/bigevents/events/sampleconf/questions/1/options/1/ HTTP/1.1
|
|
||||||
Host: pretix.eu
|
|
||||||
Accept: application/json, text/javascript
|
|
||||||
Content-Type: application/json
|
|
||||||
Content-Length: 94
|
|
||||||
|
|
||||||
{
|
|
||||||
"position": 3
|
|
||||||
}
|
|
||||||
|
|
||||||
**Example response**:
|
|
||||||
|
|
||||||
.. sourcecode:: http
|
|
||||||
|
|
||||||
HTTP/1.1 200 OK
|
|
||||||
Vary: Accept
|
|
||||||
Content-Type: application/json
|
|
||||||
|
|
||||||
{
|
|
||||||
"id": 1,
|
|
||||||
"identifier": "LVETRWVU",
|
|
||||||
"position": 1,
|
|
||||||
"answer": {"en": "S"}
|
|
||||||
}
|
|
||||||
|
|
||||||
:param organizer: The ``slug`` field of the organizer to modify
|
|
||||||
:param event: The ``slug`` field of the event to modify
|
|
||||||
:param id: The ``id`` field of the question to modify
|
|
||||||
:param id: The ``id`` field of the option to modify
|
|
||||||
:statuscode 200: no error
|
|
||||||
:statuscode 400: The option could not be modified due to invalid submitted data
|
|
||||||
:statuscode 401: Authentication failure
|
|
||||||
:statuscode 403: The requested organizer/event does not exist **or** you have no permission to change this resource.
|
|
||||||
|
|
||||||
.. http:delete:: /api/v1/organizers/(organizer)/events/(event)/questions/(id)/options/(id)/
|
|
||||||
|
|
||||||
Delete an option.
|
|
||||||
|
|
||||||
**Example request**:
|
|
||||||
|
|
||||||
.. sourcecode:: http
|
|
||||||
|
|
||||||
DELETE /api/v1/organizers/bigevents/events/sampleconf/questions/1/options/1/ HTTP/1.1
|
|
||||||
Host: pretix.eu
|
|
||||||
Accept: application/json, text/javascript
|
|
||||||
|
|
||||||
**Example response**:
|
|
||||||
|
|
||||||
.. sourcecode:: http
|
|
||||||
|
|
||||||
HTTP/1.1 204 No Content
|
|
||||||
Vary: Accept
|
|
||||||
|
|
||||||
:param organizer: The ``slug`` field of the organizer to modify
|
|
||||||
:param event: The ``slug`` field of the event to modify
|
|
||||||
:param id: The ``id`` field of the question to modify
|
|
||||||
:param id: The ``id`` field of the option to delete
|
|
||||||
:statuscode 204: no error
|
|
||||||
:statuscode 401: Authentication failure
|
|
||||||
:statuscode 403: The requested organizer/event does not exist **or** you have no permission to delete this resource.
|
|
||||||
@@ -1,7 +1,3 @@
|
|||||||
.. spelling:: checkin
|
|
||||||
|
|
||||||
.. _rest-questions:
|
|
||||||
|
|
||||||
Questions
|
Questions
|
||||||
=========
|
=========
|
||||||
|
|
||||||
@@ -26,46 +22,19 @@ type string The expected ty
|
|||||||
* ``B`` – boolean
|
* ``B`` – boolean
|
||||||
* ``C`` – choice from a list
|
* ``C`` – choice from a list
|
||||||
* ``M`` – multiple choice from a list
|
* ``M`` – multiple choice from a list
|
||||||
* ``F`` – file upload
|
|
||||||
* ``D`` – date
|
|
||||||
* ``H`` – time
|
|
||||||
* ``W`` – date and time
|
|
||||||
required boolean If ``True``, the question needs to be filled out.
|
required boolean If ``True``, the question needs to be filled out.
|
||||||
position integer An integer, used for sorting
|
position integer An integer, used for sorting
|
||||||
items list of integers List of item IDs this question is assigned to.
|
items list of integers List of item IDs this question is assigned to.
|
||||||
identifier string An arbitrary string that can be used for matching with
|
|
||||||
other sources.
|
|
||||||
ask_during_checkin boolean If ``True``, this question will not be asked while
|
|
||||||
buying the ticket, but will show up when redeeming
|
|
||||||
the ticket instead.
|
|
||||||
options list of objects In case of question type ``C`` or ``M``, this lists the
|
options list of objects In case of question type ``C`` or ``M``, this lists the
|
||||||
available objects. Only writable during creation,
|
available objects.
|
||||||
use separate endpoint to modify this later.
|
|
||||||
├ id integer Internal ID of the option
|
├ id integer Internal ID of the option
|
||||||
├ position integer An integer, used for sorting
|
|
||||||
├ identifier string An arbitrary string that can be used for matching with
|
|
||||||
other sources.
|
|
||||||
└ answer multi-lingual string The displayed value of this option
|
└ answer multi-lingual string The displayed value of this option
|
||||||
===================================== ========================== =======================================================
|
===================================== ========================== =======================================================
|
||||||
|
|
||||||
.. versionchanged:: 1.12
|
|
||||||
|
|
||||||
The values ``D``, ``H``, and ``W`` for the field ``type`` are now allowed and the ``ask_during_checkin`` field has
|
|
||||||
been added.
|
|
||||||
|
|
||||||
.. versionchanged:: 1.14
|
|
||||||
|
|
||||||
Write methods have been added. The attribute ``identifier`` has been added to both the resource itself and the
|
|
||||||
options resource. The ``position`` attribute has been added to the options resource.
|
|
||||||
|
|
||||||
Endpoints
|
Endpoints
|
||||||
---------
|
---------
|
||||||
|
|
||||||
.. versionchanged:: 1.15
|
|
||||||
|
|
||||||
The questions endpoint has been extended by the filter queries ``ask_during_checkin``, ``requred``, and
|
|
||||||
``identifier``.
|
|
||||||
|
|
||||||
.. http:get:: /api/v1/organizers/(organizer)/events/(event)/questions/
|
.. http:get:: /api/v1/organizers/(organizer)/events/(event)/questions/
|
||||||
|
|
||||||
Returns a list of all questions within a given event.
|
Returns a list of all questions within a given event.
|
||||||
@@ -84,7 +53,7 @@ Endpoints
|
|||||||
|
|
||||||
HTTP/1.1 200 OK
|
HTTP/1.1 200 OK
|
||||||
Vary: Accept
|
Vary: Accept
|
||||||
Content-Type: application/json
|
Content-Type: text/javascript
|
||||||
|
|
||||||
{
|
{
|
||||||
"count": 1,
|
"count": 1,
|
||||||
@@ -98,25 +67,17 @@ Endpoints
|
|||||||
"required": false,
|
"required": false,
|
||||||
"items": [1, 2],
|
"items": [1, 2],
|
||||||
"position": 1,
|
"position": 1,
|
||||||
"identifier": "WY3TP9SL",
|
|
||||||
"ask_during_checkin": false,
|
|
||||||
"options": [
|
"options": [
|
||||||
{
|
{
|
||||||
"id": 1,
|
"id": 1,
|
||||||
"identifier": "LVETRWVU",
|
|
||||||
"position": 0,
|
|
||||||
"answer": {"en": "S"}
|
"answer": {"en": "S"}
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"id": 2,
|
"id": 2,
|
||||||
"identifier": "DFEMJWMJ",
|
|
||||||
"position": 1,
|
|
||||||
"answer": {"en": "M"}
|
"answer": {"en": "M"}
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"id": 3,
|
"id": 3,
|
||||||
"identifier": "W9AH7RDE",
|
|
||||||
"position": 2,
|
|
||||||
"answer": {"en": "L"}
|
"answer": {"en": "L"}
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
@@ -127,9 +88,6 @@ Endpoints
|
|||||||
:query integer page: The page number in case of a multi-page result set, default is 1
|
:query integer page: The page number in case of a multi-page result set, default is 1
|
||||||
:query string ordering: Manually set the ordering of results. Valid fields to be used are ``id`` and ``position``.
|
:query string ordering: Manually set the ordering of results. Valid fields to be used are ``id`` and ``position``.
|
||||||
Default: ``position``
|
Default: ``position``
|
||||||
:query string identifier: Only return questions with the given identifier string
|
|
||||||
:query boolean ask_during_checkin: Only return questions that are or are not to be asked during check-in
|
|
||||||
:query boolean required: Only return questions that are or are not required to fill in
|
|
||||||
:param organizer: The ``slug`` field of the organizer to fetch
|
:param organizer: The ``slug`` field of the organizer to fetch
|
||||||
:param event: The ``slug`` field of the event to fetch
|
:param event: The ``slug`` field of the event to fetch
|
||||||
:statuscode 200: no error
|
:statuscode 200: no error
|
||||||
@@ -154,7 +112,7 @@ Endpoints
|
|||||||
|
|
||||||
HTTP/1.1 200 OK
|
HTTP/1.1 200 OK
|
||||||
Vary: Accept
|
Vary: Accept
|
||||||
Content-Type: application/json
|
Content-Type: text/javascript
|
||||||
|
|
||||||
{
|
{
|
||||||
"id": 1,
|
"id": 1,
|
||||||
@@ -163,25 +121,17 @@ Endpoints
|
|||||||
"required": false,
|
"required": false,
|
||||||
"items": [1, 2],
|
"items": [1, 2],
|
||||||
"position": 1,
|
"position": 1,
|
||||||
"identifier": "WY3TP9SL",
|
|
||||||
"ask_during_checkin": false,
|
|
||||||
"options": [
|
"options": [
|
||||||
{
|
{
|
||||||
"id": 1,
|
"id": 1,
|
||||||
"identifier": "LVETRWVU",
|
|
||||||
"position": 1,
|
|
||||||
"answer": {"en": "S"}
|
"answer": {"en": "S"}
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"id": 2,
|
"id": 2,
|
||||||
"identifier": "DFEMJWMJ",
|
|
||||||
"position": 2,
|
|
||||||
"answer": {"en": "M"}
|
"answer": {"en": "M"}
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"id": 3,
|
"id": 3,
|
||||||
"identifier": "W9AH7RDE",
|
|
||||||
"position": 3,
|
|
||||||
"answer": {"en": "L"}
|
"answer": {"en": "L"}
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
@@ -193,179 +143,3 @@ Endpoints
|
|||||||
:statuscode 200: no error
|
:statuscode 200: no error
|
||||||
:statuscode 401: Authentication failure
|
:statuscode 401: Authentication failure
|
||||||
:statuscode 403: The requested organizer/event does not exist **or** you have no permission to view this resource.
|
:statuscode 403: The requested organizer/event does not exist **or** you have no permission to view this resource.
|
||||||
|
|
||||||
.. http:post:: /api/v1/organizers/(organizer)/events/(event)/questions/
|
|
||||||
|
|
||||||
Creates a new question
|
|
||||||
|
|
||||||
**Example request**:
|
|
||||||
|
|
||||||
.. sourcecode:: http
|
|
||||||
|
|
||||||
POST /api/v1/organizers/bigevents/events/sampleconf/questions/ HTTP/1.1
|
|
||||||
Host: pretix.eu
|
|
||||||
Accept: application/json, text/javascript
|
|
||||||
Content: application/json
|
|
||||||
|
|
||||||
{
|
|
||||||
"question": {"en": "T-Shirt size"},
|
|
||||||
"type": "C",
|
|
||||||
"required": false,
|
|
||||||
"items": [1, 2],
|
|
||||||
"position": 1,
|
|
||||||
"ask_during_checkin": false,
|
|
||||||
"options": [
|
|
||||||
{
|
|
||||||
"answer": {"en": "S"}
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"answer": {"en": "M"}
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"answer": {"en": "L"}
|
|
||||||
}
|
|
||||||
]
|
|
||||||
}
|
|
||||||
|
|
||||||
**Example response**:
|
|
||||||
|
|
||||||
.. sourcecode:: http
|
|
||||||
|
|
||||||
HTTP/1.1 201 Created
|
|
||||||
Vary: Accept
|
|
||||||
Content-Type: application/json
|
|
||||||
|
|
||||||
|
|
||||||
{
|
|
||||||
"id": 1,
|
|
||||||
"question": {"en": "T-Shirt size"},
|
|
||||||
"type": "C",
|
|
||||||
"required": false,
|
|
||||||
"items": [1, 2],
|
|
||||||
"position": 1,
|
|
||||||
"identifier": "WY3TP9SL",
|
|
||||||
"ask_during_checkin": false,
|
|
||||||
"options": [
|
|
||||||
{
|
|
||||||
"id": 1,
|
|
||||||
"identifier": "LVETRWVU",
|
|
||||||
"position": 1,
|
|
||||||
"answer": {"en": "S"}
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"id": 2,
|
|
||||||
"identifier": "DFEMJWMJ",
|
|
||||||
"position": 2,
|
|
||||||
"answer": {"en": "M"}
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"id": 3,
|
|
||||||
"identifier": "W9AH7RDE",
|
|
||||||
"position": 3,
|
|
||||||
"answer": {"en": "L"}
|
|
||||||
}
|
|
||||||
]
|
|
||||||
}
|
|
||||||
|
|
||||||
:param organizer: The ``slug`` field of the organizer of the event to create an item for
|
|
||||||
:param event: The ``slug`` field of the event to create an item for
|
|
||||||
:statuscode 201: no error
|
|
||||||
:statuscode 400: The item could not be created due to invalid submitted data.
|
|
||||||
:statuscode 401: Authentication failure
|
|
||||||
:statuscode 403: The requested organizer/event does not exist **or** you have no permission to create this resource.
|
|
||||||
|
|
||||||
.. http:patch:: /api/v1/organizers/(organizer)/events/(event)/questions/(id)/
|
|
||||||
|
|
||||||
Update a question. 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 ``options`` field. If
|
|
||||||
you need to update/delete options please use the nested dedicated endpoints.
|
|
||||||
|
|
||||||
**Example request**:
|
|
||||||
|
|
||||||
.. sourcecode:: http
|
|
||||||
|
|
||||||
PATCH /api/v1/organizers/bigevents/events/sampleconf/items/1/ HTTP/1.1
|
|
||||||
Host: pretix.eu
|
|
||||||
Accept: application/json, text/javascript
|
|
||||||
Content-Type: application/json
|
|
||||||
Content-Length: 94
|
|
||||||
|
|
||||||
{
|
|
||||||
"position": 2
|
|
||||||
}
|
|
||||||
|
|
||||||
**Example response**:
|
|
||||||
|
|
||||||
.. sourcecode:: http
|
|
||||||
|
|
||||||
HTTP/1.1 200 OK
|
|
||||||
Vary: Accept
|
|
||||||
Content-Type: application/json
|
|
||||||
|
|
||||||
{
|
|
||||||
"id": 1,
|
|
||||||
"question": {"en": "T-Shirt size"},
|
|
||||||
"type": "C",
|
|
||||||
"required": false,
|
|
||||||
"items": [1, 2],
|
|
||||||
"position": 2,
|
|
||||||
"identifier": "WY3TP9SL",
|
|
||||||
"ask_during_checkin": false,
|
|
||||||
"options": [
|
|
||||||
{
|
|
||||||
"id": 1,
|
|
||||||
"identifier": "LVETRWVU",
|
|
||||||
"position": 1,
|
|
||||||
"answer": {"en": "S"}
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"id": 2,
|
|
||||||
"identifier": "DFEMJWMJ",
|
|
||||||
"position": 2,
|
|
||||||
"answer": {"en": "M"}
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"id": 3,
|
|
||||||
"identifier": "W9AH7RDE",
|
|
||||||
"position": 3,
|
|
||||||
"answer": {"en": "L"}
|
|
||||||
}
|
|
||||||
]
|
|
||||||
}
|
|
||||||
|
|
||||||
:param organizer: The ``slug`` field of the organizer to modify
|
|
||||||
:param event: The ``slug`` field of the event to modify
|
|
||||||
:param id: The ``id`` field of the question to modify
|
|
||||||
:statuscode 200: no error
|
|
||||||
:statuscode 400: The item could not be modified due to invalid submitted data
|
|
||||||
:statuscode 401: Authentication failure
|
|
||||||
:statuscode 403: The requested organizer/event does not exist **or** you have no permission to change this resource.
|
|
||||||
|
|
||||||
.. http:delete:: /api/v1/organizers/(organizer)/events/(event)/questions/(id)/
|
|
||||||
|
|
||||||
Delete a question.
|
|
||||||
|
|
||||||
**Example request**:
|
|
||||||
|
|
||||||
.. sourcecode:: http
|
|
||||||
|
|
||||||
DELETE /api/v1/organizers/bigevents/events/sampleconf/items/1/ HTTP/1.1
|
|
||||||
Host: pretix.eu
|
|
||||||
Accept: application/json, text/javascript
|
|
||||||
|
|
||||||
**Example response**:
|
|
||||||
|
|
||||||
.. sourcecode:: http
|
|
||||||
|
|
||||||
HTTP/1.1 204 No Content
|
|
||||||
Vary: Accept
|
|
||||||
|
|
||||||
:param organizer: The ``slug`` field of the organizer to modify
|
|
||||||
:param event: The ``slug`` field of the event to modify
|
|
||||||
:param id: The ``id`` field of the item to delete
|
|
||||||
:statuscode 204: no error
|
|
||||||
:statuscode 401: Authentication failure
|
|
||||||
:statuscode 403: The requested organizer/event does not exist **or** you have no permission to delete this resource.
|
|
||||||
|
|||||||
@@ -1,12 +1,10 @@
|
|||||||
.. _rest-quotas:
|
|
||||||
|
|
||||||
Quotas
|
Quotas
|
||||||
======
|
======
|
||||||
|
|
||||||
Resource description
|
Resource description
|
||||||
--------------------
|
--------------------
|
||||||
|
|
||||||
Quotas define how many times an item can be sold.
|
Questions define how many times an item can be sold.
|
||||||
The quota resource contains the following public fields:
|
The quota resource contains the following public fields:
|
||||||
|
|
||||||
.. rst-class:: rest-resource-table
|
.. rst-class:: rest-resource-table
|
||||||
@@ -19,13 +17,8 @@ name string The internal na
|
|||||||
size integer The size of the quota or ``null`` for unlimited
|
size integer The size of the quota or ``null`` for unlimited
|
||||||
items list of integers List of item IDs this quota acts on.
|
items list of integers List of item IDs this quota acts on.
|
||||||
variations list of integers List of item variation IDs this quota acts on.
|
variations list of integers List of item variation IDs this quota acts on.
|
||||||
subevent integer ID of the date inside an event series this quota belongs to (or ``null``).
|
|
||||||
===================================== ========================== =======================================================
|
===================================== ========================== =======================================================
|
||||||
|
|
||||||
.. versionchanged:: 1.10
|
|
||||||
|
|
||||||
The write operations ``POST``, ``PATCH``, ``PUT``, and ``DELETE`` have been added.
|
|
||||||
|
|
||||||
|
|
||||||
Endpoints
|
Endpoints
|
||||||
---------
|
---------
|
||||||
@@ -48,7 +41,7 @@ Endpoints
|
|||||||
|
|
||||||
HTTP/1.1 200 OK
|
HTTP/1.1 200 OK
|
||||||
Vary: Accept
|
Vary: Accept
|
||||||
Content-Type: application/json
|
Content-Type: text/javascript
|
||||||
|
|
||||||
{
|
{
|
||||||
"count": 1,
|
"count": 1,
|
||||||
@@ -60,8 +53,7 @@ Endpoints
|
|||||||
"name": "Ticket Quota",
|
"name": "Ticket Quota",
|
||||||
"size": 200,
|
"size": 200,
|
||||||
"items": [1, 2],
|
"items": [1, 2],
|
||||||
"variations": [1, 4, 5, 7],
|
"variations": [1, 4, 5, 7]
|
||||||
"subevent": null
|
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
@@ -69,7 +61,6 @@ Endpoints
|
|||||||
:query integer page: The page number in case of a multi-page result set, default is 1
|
:query integer page: The page number in case of a multi-page result set, default is 1
|
||||||
:query string ordering: Manually set the ordering of results. Valid fields to be used are ``id`` and ``position``.
|
:query string ordering: Manually set the ordering of results. Valid fields to be used are ``id`` and ``position``.
|
||||||
Default: ``position``
|
Default: ``position``
|
||||||
:query integer subevent: Only return quotas of the sub-event with the given ID
|
|
||||||
:param organizer: The ``slug`` field of the organizer to fetch
|
:param organizer: The ``slug`` field of the organizer to fetch
|
||||||
:param event: The ``slug`` field of the event to fetch
|
:param event: The ``slug`` field of the event to fetch
|
||||||
:statuscode 200: no error
|
:statuscode 200: no error
|
||||||
@@ -94,15 +85,14 @@ Endpoints
|
|||||||
|
|
||||||
HTTP/1.1 200 OK
|
HTTP/1.1 200 OK
|
||||||
Vary: Accept
|
Vary: Accept
|
||||||
Content-Type: application/json
|
Content-Type: text/javascript
|
||||||
|
|
||||||
{
|
{
|
||||||
"id": 1,
|
"id": 1,
|
||||||
"name": "Ticket Quota",
|
"name": "Ticket Quota",
|
||||||
"size": 200,
|
"size": 200,
|
||||||
"items": [1, 2],
|
"items": [1, 2],
|
||||||
"variations": [1, 4, 5, 7],
|
"variations": [1, 4, 5, 7]
|
||||||
"subevent": null
|
|
||||||
}
|
}
|
||||||
|
|
||||||
:param organizer: The ``slug`` field of the organizer to fetch
|
:param organizer: The ``slug`` field of the organizer to fetch
|
||||||
@@ -112,131 +102,6 @@ Endpoints
|
|||||||
:statuscode 401: Authentication failure
|
:statuscode 401: Authentication failure
|
||||||
:statuscode 403: The requested organizer/event does not exist **or** you have no permission to view this resource.
|
:statuscode 403: The requested organizer/event does not exist **or** you have no permission to view this resource.
|
||||||
|
|
||||||
.. http:post:: /api/v1/organizers/(organizer)/events/(event)/quotas/
|
|
||||||
|
|
||||||
Creates a new quota
|
|
||||||
|
|
||||||
**Example request**:
|
|
||||||
|
|
||||||
.. sourcecode:: http
|
|
||||||
|
|
||||||
POST /api/v1/organizers/bigevents/events/sampleconf/quotas/ HTTP/1.1
|
|
||||||
Host: pretix.eu
|
|
||||||
Accept: application/json, text/javascript
|
|
||||||
Content: application/json
|
|
||||||
|
|
||||||
{
|
|
||||||
"name": "Ticket Quota",
|
|
||||||
"size": 200,
|
|
||||||
"items": [1, 2],
|
|
||||||
"variations": [1, 4, 5, 7],
|
|
||||||
"subevent": null
|
|
||||||
}
|
|
||||||
|
|
||||||
**Example response**:
|
|
||||||
|
|
||||||
.. sourcecode:: http
|
|
||||||
|
|
||||||
HTTP/1.1 201 Created
|
|
||||||
Vary: Accept
|
|
||||||
Content-Type: application/json
|
|
||||||
|
|
||||||
{
|
|
||||||
"id": 1,
|
|
||||||
"name": "Ticket Quota",
|
|
||||||
"size": 200,
|
|
||||||
"items": [1, 2],
|
|
||||||
"variations": [1, 4, 5, 7],
|
|
||||||
"subevent": null
|
|
||||||
}
|
|
||||||
|
|
||||||
:param organizer: The ``slug`` field of the organizer of the event/item to create a quota for
|
|
||||||
:param event: The ``slug`` field of the event to create a quota for
|
|
||||||
:statuscode 201: no error
|
|
||||||
:statuscode 400: The quota could not be created due to invalid submitted data.
|
|
||||||
:statuscode 401: Authentication failure
|
|
||||||
:statuscode 403: The requested organizer/event does not exist **or** you have no permission to create this resource.
|
|
||||||
|
|
||||||
.. http:patch:: /api/v1/organizers/(organizer)/events/(event)/quotas/(id)/
|
|
||||||
|
|
||||||
Update a quota. 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 ``id`` field.
|
|
||||||
|
|
||||||
**Example request**:
|
|
||||||
|
|
||||||
.. sourcecode:: http
|
|
||||||
|
|
||||||
PATCH /api/v1/organizers/bigevents/events/sampleconf/quotas/1/ HTTP/1.1
|
|
||||||
Host: pretix.eu
|
|
||||||
Accept: application/json, text/javascript
|
|
||||||
Content-Type: application/json
|
|
||||||
Content-Length: 94
|
|
||||||
|
|
||||||
{
|
|
||||||
"name": "New Ticket Quota",
|
|
||||||
"size": 100,
|
|
||||||
}
|
|
||||||
|
|
||||||
**Example response**:
|
|
||||||
|
|
||||||
.. sourcecode:: http
|
|
||||||
|
|
||||||
HTTP/1.1 200 OK
|
|
||||||
Vary: Accept
|
|
||||||
Content-Type: application/json
|
|
||||||
|
|
||||||
{
|
|
||||||
"id": 2,
|
|
||||||
"name": "New Ticket Quota",
|
|
||||||
"size": 100,
|
|
||||||
"items": [
|
|
||||||
1,
|
|
||||||
2
|
|
||||||
],
|
|
||||||
"variations": [
|
|
||||||
1,
|
|
||||||
2
|
|
||||||
],
|
|
||||||
"subevent": null
|
|
||||||
}
|
|
||||||
|
|
||||||
:param organizer: The ``slug`` field of the organizer to modify
|
|
||||||
:param event: The ``slug`` field of the event to modify
|
|
||||||
:param id: The ``id`` field of the quota rule to modify
|
|
||||||
:statuscode 200: no error
|
|
||||||
:statuscode 400: The quota could not be modified due to invalid submitted data
|
|
||||||
:statuscode 401: Authentication failure
|
|
||||||
:statuscode 403: The requested organizer/event does not exist **or** you have no permission to change this resource.
|
|
||||||
|
|
||||||
.. http:delete:: /api/v1/organizers/(organizer)/events/(event)/quota/(id)/
|
|
||||||
|
|
||||||
Delete a quota. Note that if you delete a quota the items the quota acts on might no longer be available for sale.
|
|
||||||
|
|
||||||
**Example request**:
|
|
||||||
|
|
||||||
.. sourcecode:: http
|
|
||||||
|
|
||||||
DELETE /api/v1/organizers/bigevents/events/sampleconf/quotas/1/ HTTP/1.1
|
|
||||||
Host: pretix.eu
|
|
||||||
Accept: application/json, text/javascript
|
|
||||||
|
|
||||||
**Example response**:
|
|
||||||
|
|
||||||
.. sourcecode:: http
|
|
||||||
|
|
||||||
HTTP/1.1 204 No Content
|
|
||||||
Vary: Accept
|
|
||||||
|
|
||||||
:param organizer: The ``slug`` field of the organizer to modify
|
|
||||||
:param event: The ``slug`` field of the event to modify
|
|
||||||
:param id: The ``id`` field of the quotas to delete
|
|
||||||
:statuscode 204: no error
|
|
||||||
:statuscode 401: Authentication failure
|
|
||||||
:statuscode 403: The requested organizer/event does not exist **or** you have no permission to delete this resource.
|
|
||||||
|
|
||||||
.. http:get:: /api/v1/organizers/(organizer)/events/(event)/quotas/(id)/availability/
|
.. http:get:: /api/v1/organizers/(organizer)/events/(event)/quotas/(id)/availability/
|
||||||
|
|
||||||
Returns availability information on one quota, identified by its ID.
|
Returns availability information on one quota, identified by its ID.
|
||||||
@@ -255,7 +120,7 @@ Endpoints
|
|||||||
|
|
||||||
HTTP/1.1 200 OK
|
HTTP/1.1 200 OK
|
||||||
Vary: Accept
|
Vary: Accept
|
||||||
Content-Type: application/json
|
Content-Type: text/javascript
|
||||||
|
|
||||||
{
|
{
|
||||||
"available": true,
|
"available": true,
|
||||||
|
|||||||
@@ -1,146 +0,0 @@
|
|||||||
.. _rest-subevents:
|
|
||||||
|
|
||||||
Event series dates / Sub-events
|
|
||||||
===============================
|
|
||||||
|
|
||||||
Resource description
|
|
||||||
--------------------
|
|
||||||
|
|
||||||
Events can represent whole event series if the ``has_subevents`` property of the event is active.
|
|
||||||
In this case, many other resources are additionally connected to an event date (also called sub-event).
|
|
||||||
The sub-event resource contains the following public fields:
|
|
||||||
|
|
||||||
.. rst-class:: rest-resource-table
|
|
||||||
|
|
||||||
===================================== ========================== =======================================================
|
|
||||||
Field Type Description
|
|
||||||
===================================== ========================== =======================================================
|
|
||||||
id integer Internal ID of the sub-event
|
|
||||||
name multi-lingual string The sub-event's full name
|
|
||||||
active boolean If ``true``, the sub-event ticket shop is publicly
|
|
||||||
available.
|
|
||||||
date_from datetime The sub-event's start date
|
|
||||||
date_to datetime The sub-event's end date (or ``null``)
|
|
||||||
date_admission datetime The sub-event's admission date (or ``null``)
|
|
||||||
presale_start datetime The sub-date at which the ticket shop opens (or ``null``)
|
|
||||||
presale_end datetime The sub-date at which the ticket shop closes (or ``null``)
|
|
||||||
location multi-lingual string The sub-event location (or ``null``)
|
|
||||||
item_price_overrides list of objects List of items for which this sub-event overrides the
|
|
||||||
default price
|
|
||||||
├ item integer The internal item ID
|
|
||||||
└ price money (string) The price or ``null`` for the default price
|
|
||||||
variation_price_overrides list of objects List of variations for which this sub-event overrides
|
|
||||||
the default price
|
|
||||||
├ variation integer The internal variation ID
|
|
||||||
└ price money (string) The price or ``null`` for the default price
|
|
||||||
meta_data dict Values set for organizer-specific meta data parameters.
|
|
||||||
===================================== ========================== =======================================================
|
|
||||||
|
|
||||||
.. versionchanged:: 1.7
|
|
||||||
|
|
||||||
The ``meta_data`` field has been added.
|
|
||||||
|
|
||||||
|
|
||||||
Endpoints
|
|
||||||
---------
|
|
||||||
|
|
||||||
.. http:get:: /api/v1/organizers/(organizer)/events/(event)/subevents/
|
|
||||||
|
|
||||||
Returns a list of all sub-events of an event.
|
|
||||||
|
|
||||||
**Example request**:
|
|
||||||
|
|
||||||
.. sourcecode:: http
|
|
||||||
|
|
||||||
GET /api/v1/organizers/bigevents/events/sampleconf/subevents/ HTTP/1.1
|
|
||||||
Host: pretix.eu
|
|
||||||
Accept: application/json, text/javascript
|
|
||||||
|
|
||||||
**Example response**:
|
|
||||||
|
|
||||||
.. sourcecode:: http
|
|
||||||
|
|
||||||
HTTP/1.1 200 OK
|
|
||||||
Vary: Accept
|
|
||||||
Content-Type: application/json
|
|
||||||
|
|
||||||
{
|
|
||||||
"count": 1,
|
|
||||||
"next": null,
|
|
||||||
"previous": null,
|
|
||||||
"results": [
|
|
||||||
{
|
|
||||||
"id": 1,
|
|
||||||
"name": {"en": "First Sample Conference"},
|
|
||||||
"active": false,
|
|
||||||
"date_from": "2017-12-27T10:00:00Z",
|
|
||||||
"date_to": null,
|
|
||||||
"date_admission": null,
|
|
||||||
"presale_start": null,
|
|
||||||
"presale_end": null,
|
|
||||||
"location": null,
|
|
||||||
"item_price_overrides": [
|
|
||||||
{
|
|
||||||
"item": 2,
|
|
||||||
"price": "12.00"
|
|
||||||
}
|
|
||||||
],
|
|
||||||
"variation_price_overrides": [],
|
|
||||||
"meta_data": {}
|
|
||||||
}
|
|
||||||
]
|
|
||||||
}
|
|
||||||
|
|
||||||
:query page: The page number in case of a multi-page result set, default is 1
|
|
||||||
:param organizer: The ``slug`` field of a valid organizer
|
|
||||||
:param event: The ``slug`` field of the event to fetch
|
|
||||||
:statuscode 200: no error
|
|
||||||
:statuscode 401: Authentication failure
|
|
||||||
:statuscode 403: The requested organizer does not exist **or** you have no permission to view it.
|
|
||||||
|
|
||||||
.. http:get:: /api/v1/organizers/(organizer)/events/(event)/subevents/(id)/
|
|
||||||
|
|
||||||
Returns information on one sub-event, identified by its ID.
|
|
||||||
|
|
||||||
**Example request**:
|
|
||||||
|
|
||||||
.. sourcecode:: http
|
|
||||||
|
|
||||||
GET /api/v1/organizers/bigevents/events/sampleconf/subevents/1/ HTTP/1.1
|
|
||||||
Host: pretix.eu
|
|
||||||
Accept: application/json, text/javascript
|
|
||||||
|
|
||||||
**Example response**:
|
|
||||||
|
|
||||||
.. sourcecode:: http
|
|
||||||
|
|
||||||
HTTP/1.1 200 OK
|
|
||||||
Vary: Accept
|
|
||||||
Content-Type: application/json
|
|
||||||
|
|
||||||
{
|
|
||||||
"id": 1,
|
|
||||||
"name": {"en": "First Sample Conference"},
|
|
||||||
"active": false,
|
|
||||||
"date_from": "2017-12-27T10:00:00Z",
|
|
||||||
"date_to": null,
|
|
||||||
"date_admission": null,
|
|
||||||
"presale_start": null,
|
|
||||||
"presale_end": null,
|
|
||||||
"location": null,
|
|
||||||
"item_price_overrides": [
|
|
||||||
{
|
|
||||||
"item": 2,
|
|
||||||
"price": "12.00"
|
|
||||||
}
|
|
||||||
],
|
|
||||||
"variation_price_overrides": [],
|
|
||||||
"meta_data": {}
|
|
||||||
}
|
|
||||||
|
|
||||||
:param organizer: The ``slug`` field of the organizer to fetch
|
|
||||||
:param event: The ``slug`` field of the event to fetch
|
|
||||||
:param id: The ``slug`` field of the sub-event to fetch
|
|
||||||
:statuscode 200: no error
|
|
||||||
:statuscode 401: Authentication failure
|
|
||||||
:statuscode 403: The requested organizer/event does not exist **or** you have no permission to view it.
|
|
||||||
@@ -1,237 +0,0 @@
|
|||||||
.. _rest-taxrules:
|
|
||||||
|
|
||||||
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.
|
|
||||||
|
|
||||||
.. rst-class:: rest-resource-table
|
|
||||||
|
|
||||||
===================================== ========================== =======================================================
|
|
||||||
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
|
|
||||||
===================================== ========================== =======================================================
|
|
||||||
|
|
||||||
.. versionchanged:: 1.7
|
|
||||||
|
|
||||||
This resource has been added.
|
|
||||||
|
|
||||||
.. versionchanged:: 1.9
|
|
||||||
|
|
||||||
The write operations ``POST``, ``PATCH``, ``PUT``, and ``DELETE`` have been added.
|
|
||||||
|
|
||||||
|
|
||||||
Endpoints
|
|
||||||
---------
|
|
||||||
|
|
||||||
.. http:get:: /api/v1/organizers/(organizer)/events/(event)/taxrules/
|
|
||||||
|
|
||||||
Returns a list of all tax rules configured for an event.
|
|
||||||
|
|
||||||
**Example request**:
|
|
||||||
|
|
||||||
.. sourcecode:: http
|
|
||||||
|
|
||||||
GET /api/v1/organizers/bigevents/events/sampleconf/taxrules/ HTTP/1.1
|
|
||||||
Host: pretix.eu
|
|
||||||
Accept: application/json, text/javascript
|
|
||||||
|
|
||||||
**Example response**:
|
|
||||||
|
|
||||||
.. sourcecode:: http
|
|
||||||
|
|
||||||
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 page: The page number in case of a multi-page result set, default is 1
|
|
||||||
:param organizer: The ``slug`` field of a valid organizer
|
|
||||||
:param event: The ``slug`` field of the event to fetch
|
|
||||||
:statuscode 200: no error
|
|
||||||
:statuscode 401: Authentication failure
|
|
||||||
:statuscode 403: The requested organizer does not exist **or** you have no permission to view it.
|
|
||||||
|
|
||||||
.. http:get:: /api/v1/organizers/(organizer)/events/(event)/taxrules/(id)/
|
|
||||||
|
|
||||||
Returns information on one tax rule, identified by its ID.
|
|
||||||
|
|
||||||
**Example request**:
|
|
||||||
|
|
||||||
.. sourcecode:: http
|
|
||||||
|
|
||||||
GET /api/v1/organizers/bigevents/events/sampleconf/taxrules/1/ HTTP/1.1
|
|
||||||
Host: pretix.eu
|
|
||||||
Accept: application/json, text/javascript
|
|
||||||
|
|
||||||
**Example response**:
|
|
||||||
|
|
||||||
.. sourcecode:: http
|
|
||||||
|
|
||||||
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"
|
|
||||||
}
|
|
||||||
|
|
||||||
:param organizer: The ``slug`` field of the organizer to fetch
|
|
||||||
:param event: The ``slug`` field of the event to fetch
|
|
||||||
:param id: The ``id`` field of the tax rule to fetch
|
|
||||||
:statuscode 200: no error
|
|
||||||
:statuscode 401: Authentication failure
|
|
||||||
:statuscode 403: The requested organizer/event/rule does not exist **or** you have no permission to view it.
|
|
||||||
|
|
||||||
.. http:post:: /api/v1/organizers/(organizer)/events/(event)/taxrules/
|
|
||||||
|
|
||||||
Create a new tax rule.
|
|
||||||
|
|
||||||
**Example request**:
|
|
||||||
|
|
||||||
.. sourcecode:: http
|
|
||||||
|
|
||||||
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**:
|
|
||||||
|
|
||||||
.. sourcecode:: http
|
|
||||||
|
|
||||||
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"
|
|
||||||
}
|
|
||||||
|
|
||||||
:param organizer: The ``slug`` field of the organizer to create a tax rule for
|
|
||||||
:param event: The ``slug`` field of the event to create a tax rule for
|
|
||||||
:statuscode 201: no error
|
|
||||||
:statuscode 400: The tax rule could not be created due to invalid submitted data.
|
|
||||||
:statuscode 401: Authentication failure
|
|
||||||
:statuscode 403: The requested organizer/event does not exist **or** you have no permission to create tax rules.
|
|
||||||
|
|
||||||
|
|
||||||
.. http: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**:
|
|
||||||
|
|
||||||
.. sourcecode:: http
|
|
||||||
|
|
||||||
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**:
|
|
||||||
|
|
||||||
.. sourcecode:: http
|
|
||||||
|
|
||||||
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"
|
|
||||||
}
|
|
||||||
|
|
||||||
:param organizer: The ``slug`` field of the organizer to modify
|
|
||||||
:param event: The ``slug`` field of the event to modify
|
|
||||||
:param id: The ``id`` field of the tax rule to modify
|
|
||||||
:statuscode 200: no error
|
|
||||||
:statuscode 400: The tax rule could not be modified due to invalid submitted data.
|
|
||||||
:statuscode 401: Authentication failure
|
|
||||||
:statuscode 403: The requested organizer/event/rule does not exist **or** you have no permission to change it.
|
|
||||||
|
|
||||||
|
|
||||||
.. http: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**:
|
|
||||||
|
|
||||||
.. sourcecode:: http
|
|
||||||
|
|
||||||
DELETE /api/v1/organizers/bigevents/events/sampleconf/taxrules/1/ HTTP/1.1
|
|
||||||
Host: pretix.eu
|
|
||||||
Accept: application/json, text/javascript
|
|
||||||
|
|
||||||
**Example response**:
|
|
||||||
|
|
||||||
.. sourcecode:: http
|
|
||||||
|
|
||||||
HTTP/1.1 204 No Content
|
|
||||||
Vary: Accept
|
|
||||||
|
|
||||||
:param organizer: The ``slug`` field of the organizer to modify
|
|
||||||
:param event: The ``slug`` field of the event to modify
|
|
||||||
:param id: The ``id`` field of the tax rule to delete
|
|
||||||
:statuscode 204: no error
|
|
||||||
:statuscode 401: Authentication failure
|
|
||||||
:statuscode 403: 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.
|
|
||||||
@@ -40,14 +40,9 @@ quota integer An ID of a quot
|
|||||||
for all items without restriction.
|
for all items without restriction.
|
||||||
tag string A string that is used for grouping vouchers
|
tag string A string that is used for grouping vouchers
|
||||||
comment string An internal comment on the voucher
|
comment string An internal comment on the voucher
|
||||||
subevent integer ID of the date inside an event series this voucher belongs to (or ``null``).
|
|
||||||
===================================== ========================== =======================================================
|
===================================== ========================== =======================================================
|
||||||
|
|
||||||
|
|
||||||
.. versionchanged:: 1.9
|
|
||||||
|
|
||||||
The write operations ``POST``, ``PATCH``, ``PUT``, and ``DELETE`` have been added.
|
|
||||||
|
|
||||||
Endpoints
|
Endpoints
|
||||||
---------
|
---------
|
||||||
|
|
||||||
@@ -69,7 +64,7 @@ Endpoints
|
|||||||
|
|
||||||
HTTP/1.1 200 OK
|
HTTP/1.1 200 OK
|
||||||
Vary: Accept
|
Vary: Accept
|
||||||
Content-Type: application/json
|
Content-Type: text/javascript
|
||||||
|
|
||||||
{
|
{
|
||||||
"count": 1,
|
"count": 1,
|
||||||
@@ -90,8 +85,7 @@ Endpoints
|
|||||||
"variation": null,
|
"variation": null,
|
||||||
"quota": null,
|
"quota": null,
|
||||||
"tag": "testvoucher",
|
"tag": "testvoucher",
|
||||||
"comment": "",
|
"comment": ""
|
||||||
"subevent": null
|
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
@@ -113,7 +107,6 @@ Endpoints
|
|||||||
:query integer variation: If set, only vouchers attached to the variation with the given ID will be shown.
|
:query integer variation: If set, only vouchers attached to the variation with the given ID will be shown.
|
||||||
:query integer quota: If set, only vouchers attached to the quota with the given ID will be shown.
|
:query integer quota: If set, only vouchers attached to the quota with the given ID will be shown.
|
||||||
:query string tag: If set, only vouchers with the given tag will be shown.
|
:query string tag: If set, only vouchers with the given tag will be shown.
|
||||||
:query integer subevent: Only return vouchers of the sub-event with the given ID
|
|
||||||
:query string ordering: Manually set the ordering of results. Valid fields to be used are ``id``, ``code``,
|
:query string ordering: Manually set the ordering of results. Valid fields to be used are ``id``, ``code``,
|
||||||
``max_usages``, ``valid_until``, and ``value``. Default: ``id``
|
``max_usages``, ``valid_until``, and ``value``. Default: ``id``
|
||||||
:param organizer: The ``slug`` field of the organizer to fetch
|
:param organizer: The ``slug`` field of the organizer to fetch
|
||||||
@@ -140,7 +133,7 @@ Endpoints
|
|||||||
|
|
||||||
HTTP/1.1 200 OK
|
HTTP/1.1 200 OK
|
||||||
Vary: Accept
|
Vary: Accept
|
||||||
Content-Type: application/json
|
Content-Type: text/javascript
|
||||||
|
|
||||||
{
|
{
|
||||||
"id": 1,
|
"id": 1,
|
||||||
@@ -156,8 +149,7 @@ Endpoints
|
|||||||
"variation": null,
|
"variation": null,
|
||||||
"quota": null,
|
"quota": null,
|
||||||
"tag": "testvoucher",
|
"tag": "testvoucher",
|
||||||
"comment": "",
|
"comment": ""
|
||||||
"subevent": null
|
|
||||||
}
|
}
|
||||||
|
|
||||||
:param organizer: The ``slug`` field of the organizer to fetch
|
:param organizer: The ``slug`` field of the organizer to fetch
|
||||||
@@ -166,151 +158,3 @@ Endpoints
|
|||||||
:statuscode 200: no error
|
:statuscode 200: no error
|
||||||
:statuscode 401: Authentication failure
|
:statuscode 401: Authentication failure
|
||||||
:statuscode 403: The requested organizer/event does not exist **or** you have no permission to view this resource.
|
:statuscode 403: The requested organizer/event does not exist **or** you have no permission to view this resource.
|
||||||
|
|
||||||
.. http:post:: /api/v1/organizers/(organizer)/events/(event)/vouchers/
|
|
||||||
|
|
||||||
Create a new voucher.
|
|
||||||
|
|
||||||
**Example request**:
|
|
||||||
|
|
||||||
.. sourcecode:: http
|
|
||||||
|
|
||||||
POST /api/v1/organizers/bigevents/events/sampleconf/vouchers/ HTTP/1.1
|
|
||||||
Host: pretix.eu
|
|
||||||
Accept: application/json, text/javascript
|
|
||||||
Content-Type: application/json
|
|
||||||
Content-Length: 408
|
|
||||||
|
|
||||||
{
|
|
||||||
"code": "43K6LKM37FBVR2YG",
|
|
||||||
"max_usages": 1,
|
|
||||||
"valid_until": null,
|
|
||||||
"block_quota": false,
|
|
||||||
"allow_ignore_quota": false,
|
|
||||||
"price_mode": "set",
|
|
||||||
"value": "12.00",
|
|
||||||
"item": 1,
|
|
||||||
"variation": null,
|
|
||||||
"quota": null,
|
|
||||||
"tag": "testvoucher",
|
|
||||||
"comment": "",
|
|
||||||
"subevent": null
|
|
||||||
}
|
|
||||||
|
|
||||||
**Example response**:
|
|
||||||
|
|
||||||
.. sourcecode:: http
|
|
||||||
|
|
||||||
HTTP/1.1 201 Created
|
|
||||||
Vary: Accept
|
|
||||||
Content-Type: application/json
|
|
||||||
|
|
||||||
{
|
|
||||||
"id": 1,
|
|
||||||
"code": "43K6LKM37FBVR2YG",
|
|
||||||
"max_usages": 1,
|
|
||||||
"redeemed": 0,
|
|
||||||
"valid_until": null,
|
|
||||||
"block_quota": false,
|
|
||||||
"allow_ignore_quota": false,
|
|
||||||
"price_mode": "set",
|
|
||||||
"value": "12.00",
|
|
||||||
"item": 1,
|
|
||||||
"variation": null,
|
|
||||||
"quota": null,
|
|
||||||
"tag": "testvoucher",
|
|
||||||
"comment": "",
|
|
||||||
"subevent": null
|
|
||||||
}
|
|
||||||
|
|
||||||
:param organizer: The ``slug`` field of the organizer to create a voucher for
|
|
||||||
:param event: The ``slug`` field of the event to create a voucher for
|
|
||||||
:statuscode 201: no error
|
|
||||||
:statuscode 400: The voucher could not be created due to invalid submitted data.
|
|
||||||
:statuscode 401: Authentication failure
|
|
||||||
:statuscode 403: The requested organizer/event does not exist **or** you have no permission to create this resource.
|
|
||||||
:statuscode 409: The server was unable to acquire a lock and could not process your request. You can try again after a short waiting period.
|
|
||||||
|
|
||||||
.. http:patch:: /api/v1/organizers/(organizer)/events/(event)/vouchers/(id)/
|
|
||||||
|
|
||||||
Update a voucher. 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 ``id`` and ``redeemed`` fields.
|
|
||||||
|
|
||||||
**Example request**:
|
|
||||||
|
|
||||||
.. sourcecode:: http
|
|
||||||
|
|
||||||
PATCH /api/v1/organizers/bigevents/events/sampleconf/vouchers/1/ HTTP/1.1
|
|
||||||
Host: pretix.eu
|
|
||||||
Accept: application/json, text/javascript
|
|
||||||
Content-Type: application/json
|
|
||||||
Content-Length: 408
|
|
||||||
|
|
||||||
{
|
|
||||||
"price_mode": "set",
|
|
||||||
"value": "24.00"
|
|
||||||
}
|
|
||||||
|
|
||||||
**Example response**:
|
|
||||||
|
|
||||||
.. sourcecode:: http
|
|
||||||
|
|
||||||
HTTP/1.1 200 OK
|
|
||||||
Vary: Accept
|
|
||||||
Content-Type: application/json
|
|
||||||
|
|
||||||
{
|
|
||||||
"id": 1,
|
|
||||||
"code": "43K6LKM37FBVR2YG",
|
|
||||||
"max_usages": 1,
|
|
||||||
"redeemed": 0,
|
|
||||||
"valid_until": null,
|
|
||||||
"block_quota": false,
|
|
||||||
"allow_ignore_quota": false,
|
|
||||||
"price_mode": "set",
|
|
||||||
"value": "24.00",
|
|
||||||
"item": 1,
|
|
||||||
"variation": null,
|
|
||||||
"quota": null,
|
|
||||||
"tag": "testvoucher",
|
|
||||||
"comment": "",
|
|
||||||
"subevent": null
|
|
||||||
}
|
|
||||||
|
|
||||||
:param organizer: The ``slug`` field of the organizer to modify
|
|
||||||
:param event: The ``slug`` field of the event to modify
|
|
||||||
:param id: The ``id`` field of the voucher to modify
|
|
||||||
:statuscode 200: no error
|
|
||||||
:statuscode 400: The voucher could not be modified due to invalid submitted data
|
|
||||||
:statuscode 401: Authentication failure
|
|
||||||
:statuscode 403: The requested organizer/event does not exist **or** you have no permission to change this resource.
|
|
||||||
:statuscode 409: The server was unable to acquire a lock and could not process your request. You can try again after a short waiting period.
|
|
||||||
|
|
||||||
.. http:delete:: /api/v1/organizers/(organizer)/events/(event)/vouchers/(id)/
|
|
||||||
|
|
||||||
Delete a voucher. Note that you cannot delete a voucher if it already has been redeemed.
|
|
||||||
|
|
||||||
**Example request**:
|
|
||||||
|
|
||||||
.. sourcecode:: http
|
|
||||||
|
|
||||||
DELETE /api/v1/organizers/bigevents/events/sampleconf/vouchers/1/ HTTP/1.1
|
|
||||||
Host: pretix.eu
|
|
||||||
Accept: application/json, text/javascript
|
|
||||||
|
|
||||||
**Example response**:
|
|
||||||
|
|
||||||
.. sourcecode:: http
|
|
||||||
|
|
||||||
HTTP/1.1 204 No Content
|
|
||||||
Vary: Accept
|
|
||||||
|
|
||||||
:param organizer: The ``slug`` field of the organizer to modify
|
|
||||||
:param event: The ``slug`` field of the event to modify
|
|
||||||
:param id: The ``id`` field of the voucher to delete
|
|
||||||
:statuscode 204: no error
|
|
||||||
:statuscode 401: Authentication failure
|
|
||||||
:statuscode 403: The requested organizer/event does not exist **or** you have no permission to delete this resource.
|
|
||||||
|
|||||||
@@ -23,16 +23,9 @@ item integer An ID of an ite
|
|||||||
variation integer An ID of a variation the user is waiting to be
|
variation integer An ID of a variation the user is waiting to be
|
||||||
available again (or ``null``)
|
available again (or ``null``)
|
||||||
locale string Locale of the waiting user
|
locale string Locale of the waiting user
|
||||||
subevent integer ID of the date inside an event series this entry belongs to (or ``null``).
|
|
||||||
===================================== ========================== =======================================================
|
===================================== ========================== =======================================================
|
||||||
|
|
||||||
|
|
||||||
.. versionchanged:: 1.15
|
|
||||||
|
|
||||||
The write operations ``POST``, ``PATCH``, ``PUT``, and ``DELETE`` have been added as well as a method to send out
|
|
||||||
vouchers.
|
|
||||||
|
|
||||||
|
|
||||||
Endpoints
|
Endpoints
|
||||||
---------
|
---------
|
||||||
|
|
||||||
@@ -54,7 +47,7 @@ Endpoints
|
|||||||
|
|
||||||
HTTP/1.1 200 OK
|
HTTP/1.1 200 OK
|
||||||
Vary: Accept
|
Vary: Accept
|
||||||
Content-Type: application/json
|
Content-Type: text/javascript
|
||||||
|
|
||||||
{
|
{
|
||||||
"count": 1,
|
"count": 1,
|
||||||
@@ -68,8 +61,7 @@ Endpoints
|
|||||||
"voucher": null,
|
"voucher": null,
|
||||||
"item": 2,
|
"item": 2,
|
||||||
"variation": null,
|
"variation": null,
|
||||||
"locale": "en",
|
"locale": "en"
|
||||||
"subevent": null
|
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
@@ -81,7 +73,6 @@ Endpoints
|
|||||||
have not been sent a voucher.
|
have not been sent a voucher.
|
||||||
:query integer item: If set, only entries of users waiting for the item with the given ID will be shown.
|
:query integer item: If set, only entries of users waiting for the item with the given ID will be shown.
|
||||||
:query integer variation: If set, only entries of users waiting for the variation with the given ID will be shown.
|
:query integer variation: If set, only entries of users waiting for the variation with the given ID will be shown.
|
||||||
:query integer subevent: Only return entries of the sub-event with the given ID
|
|
||||||
:query string ordering: Manually set the ordering of results. Valid fields to be used are ``id``, ``created``,
|
:query string ordering: Manually set the ordering of results. Valid fields to be used are ``id``, ``created``,
|
||||||
``email``, ``item``. Default: ``created``
|
``email``, ``item``. Default: ``created``
|
||||||
:param organizer: The ``slug`` field of the organizer to fetch
|
:param organizer: The ``slug`` field of the organizer to fetch
|
||||||
@@ -108,7 +99,7 @@ Endpoints
|
|||||||
|
|
||||||
HTTP/1.1 200 OK
|
HTTP/1.1 200 OK
|
||||||
Vary: Accept
|
Vary: Accept
|
||||||
Content-Type: application/json
|
Content-Type: text/javascript
|
||||||
|
|
||||||
{
|
{
|
||||||
"id": 1,
|
"id": 1,
|
||||||
@@ -117,8 +108,7 @@ Endpoints
|
|||||||
"voucher": null,
|
"voucher": null,
|
||||||
"item": 2,
|
"item": 2,
|
||||||
"variation": null,
|
"variation": null,
|
||||||
"locale": "en",
|
"locale": "en"
|
||||||
"subevent": null
|
|
||||||
}
|
}
|
||||||
|
|
||||||
:param organizer: The ``slug`` field of the organizer to fetch
|
:param organizer: The ``slug`` field of the organizer to fetch
|
||||||
@@ -127,161 +117,3 @@ Endpoints
|
|||||||
:statuscode 200: no error
|
:statuscode 200: no error
|
||||||
:statuscode 401: Authentication failure
|
:statuscode 401: Authentication failure
|
||||||
:statuscode 403: The requested organizer/event does not exist **or** you have no permission to view this resource.
|
:statuscode 403: The requested organizer/event does not exist **or** you have no permission to view this resource.
|
||||||
|
|
||||||
.. http:post:: /api/v1/organizers/(organizer)/events/(event)/waitinglistentries/
|
|
||||||
|
|
||||||
Create a new entry.
|
|
||||||
|
|
||||||
**Example request**:
|
|
||||||
|
|
||||||
.. sourcecode:: http
|
|
||||||
|
|
||||||
POST /api/v1/organizers/bigevents/events/sampleconf/waitinglistentries/ HTTP/1.1
|
|
||||||
Host: pretix.eu
|
|
||||||
Accept: application/json, text/javascript
|
|
||||||
Content-Type: application/json
|
|
||||||
Content-Length: 408
|
|
||||||
|
|
||||||
{
|
|
||||||
"email": "waiting@example.org",
|
|
||||||
"item": 3,
|
|
||||||
"variation": null,
|
|
||||||
"locale": "de",
|
|
||||||
"subevent": null
|
|
||||||
}
|
|
||||||
|
|
||||||
**Example response**:
|
|
||||||
|
|
||||||
.. sourcecode:: http
|
|
||||||
|
|
||||||
HTTP/1.1 201 Created
|
|
||||||
Vary: Accept
|
|
||||||
Content-Type: application/json
|
|
||||||
|
|
||||||
{
|
|
||||||
"id": 1,
|
|
||||||
"created": "2017-12-01T10:00:00Z",
|
|
||||||
"email": "waiting@example.org",
|
|
||||||
"voucher": null,
|
|
||||||
"item": 3,
|
|
||||||
"variation": null,
|
|
||||||
"locale": "de",
|
|
||||||
"subevent": null
|
|
||||||
}
|
|
||||||
|
|
||||||
:param organizer: The ``slug`` field of the organizer to create an entry for
|
|
||||||
:param event: The ``slug`` field of the event to create an entry for
|
|
||||||
:statuscode 201: no error
|
|
||||||
:statuscode 400: The voucher could not be created due to invalid submitted data.
|
|
||||||
:statuscode 401: Authentication failure
|
|
||||||
:statuscode 403: The requested organizer/event does not exist **or** you have no permission to create this
|
|
||||||
resource **or** entries cannot be created for this item at this time.
|
|
||||||
|
|
||||||
.. http:patch:: /api/v1/organizers/(organizer)/events/(event)/waitinglistentries/(id)/
|
|
||||||
|
|
||||||
Update an entry. 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 ``id``, ``voucher`` and ``created`` fields. You can only change
|
|
||||||
an entry as long as no ``voucher`` is set.
|
|
||||||
|
|
||||||
**Example request**:
|
|
||||||
|
|
||||||
.. sourcecode:: http
|
|
||||||
|
|
||||||
PATCH /api/v1/organizers/bigevents/events/sampleconf/waitinglistentries/1/ HTTP/1.1
|
|
||||||
Host: pretix.eu
|
|
||||||
Accept: application/json, text/javascript
|
|
||||||
Content-Type: application/json
|
|
||||||
Content-Length: 408
|
|
||||||
|
|
||||||
{
|
|
||||||
"item": 4
|
|
||||||
}
|
|
||||||
|
|
||||||
**Example response**:
|
|
||||||
|
|
||||||
.. sourcecode:: http
|
|
||||||
|
|
||||||
HTTP/1.1 200 OK
|
|
||||||
Vary: Accept
|
|
||||||
Content-Type: application/json
|
|
||||||
|
|
||||||
{
|
|
||||||
"id": 1,
|
|
||||||
"created": "2017-12-01T10:00:00Z",
|
|
||||||
"email": "waiting@example.org",
|
|
||||||
"voucher": null,
|
|
||||||
"item": 4,
|
|
||||||
"variation": null,
|
|
||||||
"locale": "de",
|
|
||||||
"subevent": null
|
|
||||||
}
|
|
||||||
|
|
||||||
:param organizer: The ``slug`` field of the organizer to modify
|
|
||||||
:param event: The ``slug`` field of the event to modify
|
|
||||||
:param id: The ``id`` field of the entry to modify
|
|
||||||
:statuscode 200: no error
|
|
||||||
:statuscode 400: The entry could not be modified due to invalid submitted data
|
|
||||||
:statuscode 401: Authentication failure
|
|
||||||
:statuscode 403: The requested organizer/event does not exist **or** you have no permission to create this
|
|
||||||
resource **or** entries cannot be created for this item at this time **or** this entry already
|
|
||||||
has a voucher assigned
|
|
||||||
|
|
||||||
.. http:post:: /api/v1/organizers/(organizer)/events/(event)/waitinglistentries/(id)/send_voucher/
|
|
||||||
|
|
||||||
Manually sends a voucher to someone on the waiting list
|
|
||||||
|
|
||||||
**Example request**:
|
|
||||||
|
|
||||||
.. sourcecode:: http
|
|
||||||
|
|
||||||
POST /api/v1/organizers/bigevents/events/sampleconf/waitinglistentries/1/send_voucher/ HTTP/1.1
|
|
||||||
Host: pretix.eu
|
|
||||||
Accept: application/json, text/javascript
|
|
||||||
Content-Type: application/json
|
|
||||||
Content-Length: 0
|
|
||||||
|
|
||||||
**Example response**:
|
|
||||||
|
|
||||||
.. sourcecode:: http
|
|
||||||
|
|
||||||
HTTP/1.1 204 No Content
|
|
||||||
Vary: Accept
|
|
||||||
|
|
||||||
:param organizer: The ``slug`` field of the organizer to modify
|
|
||||||
:param event: The ``slug`` field of the event to modify
|
|
||||||
:param id: The ``id`` field of the entry to modify
|
|
||||||
:statuscode 204: no error
|
|
||||||
:statuscode 400: The voucher could not be sent out, see body for details (e.g. voucher has already been sent or
|
|
||||||
item is not available).
|
|
||||||
:statuscode 401: Authentication failure
|
|
||||||
:statuscode 403: The requested organizer/event does not exist **or** you have no permission to do this
|
|
||||||
|
|
||||||
.. http:delete:: /api/v1/organizers/(organizer)/events/(event)/waitinglistentries/(id)/
|
|
||||||
|
|
||||||
Delete an entry. Note that you cannot delete an entry once it is assigned a voucher.
|
|
||||||
|
|
||||||
**Example request**:
|
|
||||||
|
|
||||||
.. sourcecode:: http
|
|
||||||
|
|
||||||
DELETE /api/v1/organizers/bigevents/events/sampleconf/waitinglistentries/1/ HTTP/1.1
|
|
||||||
Host: pretix.eu
|
|
||||||
Accept: application/json, text/javascript
|
|
||||||
|
|
||||||
**Example response**:
|
|
||||||
|
|
||||||
.. sourcecode:: http
|
|
||||||
|
|
||||||
HTTP/1.1 204 No Content
|
|
||||||
Vary: Accept
|
|
||||||
|
|
||||||
:param organizer: The ``slug`` field of the organizer to modify
|
|
||||||
:param event: The ``slug`` field of the event to modify
|
|
||||||
:param id: The ``id`` field of the entry to delete
|
|
||||||
:statuscode 204: no error
|
|
||||||
:statuscode 401: Authentication failure
|
|
||||||
:statuscode 403: The requested organizer/event does not exist **or** you have no permission to delete this
|
|
||||||
resource **or** this entry already has a voucher assigned.
|
|
||||||
|
|||||||
@@ -1,11 +0,0 @@
|
|||||||
from enchant.tokenize import get_tokenizer, Filter, unit_tokenize
|
|
||||||
|
|
||||||
class CheckinFilter(Filter):
|
|
||||||
""" If a word looks like checkin_count, it refers to a so-called variable in
|
|
||||||
the code, and is treated as being spelled right."""
|
|
||||||
|
|
||||||
def _split(self, word):
|
|
||||||
if word[:8] == "checkin_":
|
|
||||||
return unit_tokenize(word[8:])
|
|
||||||
|
|
||||||
return unit_tokenize(word)
|
|
||||||
43
doc/conf.py
@@ -13,10 +13,6 @@
|
|||||||
# All configuration values have a default; values that are commented out
|
# All configuration values have a default; values that are commented out
|
||||||
# serve to show the default.
|
# serve to show the default.
|
||||||
|
|
||||||
from docutils.parsers.rst.directives.admonitions import BaseAdmonition
|
|
||||||
from sphinx.util import compat
|
|
||||||
compat.make_admonition = BaseAdmonition # See https://github.com/spinus/sphinxcontrib-images/issues/41
|
|
||||||
|
|
||||||
import sys
|
import sys
|
||||||
import os
|
import os
|
||||||
|
|
||||||
@@ -31,13 +27,6 @@ import django
|
|||||||
os.environ.setdefault("DJANGO_SETTINGS_MODULE", "pretix.testutils.settings")
|
os.environ.setdefault("DJANGO_SETTINGS_MODULE", "pretix.testutils.settings")
|
||||||
django.setup()
|
django.setup()
|
||||||
|
|
||||||
|
|
||||||
try:
|
|
||||||
import enchant
|
|
||||||
HAS_PYENCHANT = True
|
|
||||||
except:
|
|
||||||
HAS_PYENCHANT = False
|
|
||||||
|
|
||||||
# -- General configuration ------------------------------------------------
|
# -- General configuration ------------------------------------------------
|
||||||
|
|
||||||
# If your documentation needs a minimal Sphinx version, state it here.
|
# If your documentation needs a minimal Sphinx version, state it here.
|
||||||
@@ -49,12 +38,10 @@ except:
|
|||||||
extensions = [
|
extensions = [
|
||||||
'sphinx.ext.autodoc',
|
'sphinx.ext.autodoc',
|
||||||
'sphinx.ext.doctest',
|
'sphinx.ext.doctest',
|
||||||
|
'sphinx.ext.todo',
|
||||||
'sphinx.ext.coverage',
|
'sphinx.ext.coverage',
|
||||||
'sphinxcontrib.httpdomain',
|
'sphinxcontrib.httpdomain',
|
||||||
'sphinxcontrib.images',
|
|
||||||
]
|
]
|
||||||
if HAS_PYENCHANT:
|
|
||||||
extensions.append('sphinxcontrib.spelling')
|
|
||||||
|
|
||||||
# Add any paths that contain templates here, relative to this directory.
|
# Add any paths that contain templates here, relative to this directory.
|
||||||
templates_path = ['_templates']
|
templates_path = ['_templates']
|
||||||
@@ -294,31 +281,3 @@ texinfo_documents = [
|
|||||||
|
|
||||||
# If true, do not generate a @detailmenu in the "Top" node's menu.
|
# If true, do not generate a @detailmenu in the "Top" node's menu.
|
||||||
#texinfo_no_detailmenu = False
|
#texinfo_no_detailmenu = False
|
||||||
|
|
||||||
|
|
||||||
images_config = {
|
|
||||||
'default_image_width': '250px'
|
|
||||||
}
|
|
||||||
|
|
||||||
linkcheck_ignore = [
|
|
||||||
r'http://localhost.*', r'.*yourdomain.*', r'https://en.wikipedia.org', 'https://pretix.eu/',
|
|
||||||
]
|
|
||||||
|
|
||||||
# -- Options for Spelling output ------------------------------------------
|
|
||||||
if HAS_PYENCHANT:
|
|
||||||
# String specifying the language, as understood by PyEnchant and enchant.
|
|
||||||
# Defaults to en_US for US English.
|
|
||||||
spelling_lang = 'en_US'
|
|
||||||
|
|
||||||
# String specifying a file containing a list of words known to be spelled
|
|
||||||
# correctly but that do not appear in the language dictionary selected by
|
|
||||||
# spelling_lang. The file should contain one word per line.
|
|
||||||
spelling_word_list_filename='spelling_wordlist.txt'
|
|
||||||
|
|
||||||
# Boolean controlling whether suggestions for misspelled words are printed.
|
|
||||||
# Defaults to False.
|
|
||||||
spelling_show_suggestions=True
|
|
||||||
|
|
||||||
# List of filter classes to be added to the tokenizer that produces words to be checked.
|
|
||||||
from checkin_filter import CheckinFilter
|
|
||||||
spelling_filters=[CheckinFilter]
|
|
||||||
|
|||||||
@@ -25,7 +25,7 @@ If you want to add a custom view to the control area of an event, just register
|
|||||||
views.admin_view, name='backend'),
|
views.admin_view, name='backend'),
|
||||||
]
|
]
|
||||||
|
|
||||||
It is required that your URL parameters are called ``organizer`` and ``event``. If you want to
|
It is required that your URL paramaters are called ``organizer`` and ``event``. If you want to
|
||||||
install a view on organizer level, you can leave out the ``event``.
|
install a view on organizer level, you can leave out the ``event``.
|
||||||
|
|
||||||
You can then implement the view as you would normally do. Our middleware will automatically
|
You can then implement the view as you would normally do. Our middleware will automatically
|
||||||
@@ -60,85 +60,7 @@ your views::
|
|||||||
def admin_view(request, organizer, event):
|
def admin_view(request, organizer, event):
|
||||||
...
|
...
|
||||||
|
|
||||||
Similarly, there is ``organizer_permission_required`` and ``OrganizerPermissionRequiredMixin``. In case of
|
Similarly, there is ``organizer_permission_required`` and ``OrganizerPermissionRequiredMixin``.
|
||||||
event-related views, there is also a signal that allows you to add the view to the event navigation like this::
|
|
||||||
|
|
||||||
|
|
||||||
from django.core.urlresolvers import resolve, reverse
|
|
||||||
from django.dispatch import receiver
|
|
||||||
from django.utils.translation import ugettext_lazy as _
|
|
||||||
from pretix.control.signals import nav_event
|
|
||||||
|
|
||||||
|
|
||||||
@receiver(nav_event, dispatch_uid='friends_tickets_nav')
|
|
||||||
def navbar_info(sender, request, **kwargs):
|
|
||||||
url = resolve(request.path_info)
|
|
||||||
if not request.user.has_event_permission(request.organizer, request.event, 'can_change_vouchers'):
|
|
||||||
return []
|
|
||||||
return [{
|
|
||||||
'label': _('My plugin view'),
|
|
||||||
'icon': 'heart',
|
|
||||||
'url': reverse('plugins:myplugin:index', kwargs={
|
|
||||||
'event': request.event.slug,
|
|
||||||
'organizer': request.organizer.slug,
|
|
||||||
}),
|
|
||||||
'active': url.namespace == 'plugins:myplugin' and url.url_name == 'review',
|
|
||||||
}]
|
|
||||||
|
|
||||||
|
|
||||||
Event settings view
|
|
||||||
-------------------
|
|
||||||
|
|
||||||
A special case of a control panel view is a view hooked into the event settings page. For this case, there is a
|
|
||||||
special navigation signal::
|
|
||||||
|
|
||||||
@receiver(nav_event_settings, dispatch_uid='friends_tickets_nav_settings')
|
|
||||||
def navbar_settings(sender, request, **kwargs):
|
|
||||||
url = resolve(request.path_info)
|
|
||||||
return [{
|
|
||||||
'label': _('My settings'),
|
|
||||||
'url': reverse('plugins:myplugin:settings', kwargs={
|
|
||||||
'event': request.event.slug,
|
|
||||||
'organizer': request.organizer.slug,
|
|
||||||
}),
|
|
||||||
'active': url.namespace == 'plugins:myplugin' and url.url_name == 'settings',
|
|
||||||
}]
|
|
||||||
|
|
||||||
Also, your view should inherit from ``EventSettingsViewMixin`` and your template from ``pretixcontrol/event/settings_base.html``
|
|
||||||
for good integration. If you just want to display a form, you could do it like the following::
|
|
||||||
|
|
||||||
class MySettingsView(EventSettingsViewMixin, EventSettingsFormView):
|
|
||||||
model = Event
|
|
||||||
permission = 'can_change_settings'
|
|
||||||
form_class = MySettingsForm
|
|
||||||
template_name = 'my_plugin/settings.html'
|
|
||||||
|
|
||||||
def get_success_url(self, **kwargs):
|
|
||||||
return reverse('plugins:myplugin:settings', kwargs={
|
|
||||||
'organizer': self.request.event.organizer.slug,
|
|
||||||
'event': self.request.event.slug,
|
|
||||||
})
|
|
||||||
|
|
||||||
With this template::
|
|
||||||
|
|
||||||
{% extends "pretixcontrol/event/settings_base.html" %}
|
|
||||||
{% load i18n %}
|
|
||||||
{% load bootstrap3 %}
|
|
||||||
{% block title %} {% trans "Friends Tickets Settings" %} {% endblock %}
|
|
||||||
{% block inside %}
|
|
||||||
<form action="" method="post" class="form-horizontal">
|
|
||||||
{% csrf_token %}
|
|
||||||
<fieldset>
|
|
||||||
<legend>{% trans "Friends Tickets Settings" %}</legend>
|
|
||||||
{% bootstrap_form form layout="horizontal" %}
|
|
||||||
</fieldset>
|
|
||||||
<div class="form-group submit-group">
|
|
||||||
<button type="submit" class="btn btn-primary btn-save">
|
|
||||||
{% trans "Save" %}
|
|
||||||
</button>
|
|
||||||
</div>
|
|
||||||
</form>
|
|
||||||
{% endblock %}
|
|
||||||
|
|
||||||
Frontend views
|
Frontend views
|
||||||
--------------
|
--------------
|
||||||
@@ -146,34 +68,35 @@ Frontend views
|
|||||||
Including a custom view into the participant-facing frontend is a little bit different as there is
|
Including a custom view into the participant-facing frontend is a little bit different as there is
|
||||||
no path prefix like ``control/``.
|
no path prefix like ``control/``.
|
||||||
|
|
||||||
First, define your URL in your ``urls.py``, but this time in the ``event_patterns`` section and wrapped by
|
First, define your URL in your ``urls.py``, but this time in the ``event_patterns`` section::
|
||||||
``event_url``::
|
|
||||||
|
|
||||||
from pretix.multidomain import event_url
|
from django.conf.urls import url
|
||||||
|
|
||||||
from . import views
|
from . import views
|
||||||
|
|
||||||
event_patterns = [
|
event_patterns = [
|
||||||
event_url(r'^mypluginname/', views.frontend_view, name='frontend'),
|
url(r'^mypluginname/', views.frontend_view, name='frontend'),
|
||||||
]
|
]
|
||||||
|
|
||||||
You can then implement a view as you would normally do. It will be automatically ensured that:
|
You can then implement a view as you would normally do, but you need to apply a decorator to your
|
||||||
|
view if you want pretix's default behavior::
|
||||||
|
|
||||||
|
from pretix.presale.utils import event_view
|
||||||
|
|
||||||
|
@event_view
|
||||||
|
def some_event_view(request, *args, **kwargs):
|
||||||
|
...
|
||||||
|
|
||||||
|
This decorator will check the URL arguments for their ``event`` and ``organizer`` parameters and
|
||||||
|
correctly ensure that:
|
||||||
|
|
||||||
* The requested event exists
|
* The requested event exists
|
||||||
* The requested event is active (you can disable this check using ``event_url(…, require_live=True)``)
|
* The requested event is activated (can be overridden by decorating with ``@event_view(require_live=False)``)
|
||||||
* The event is accessed via the domain it should be accessed
|
* The event is accessed via the domain it should be accessed
|
||||||
* The ``request.event`` attribute contains the correct ``Event`` object
|
* The ``request.event`` attribute contains the correct ``Event`` object
|
||||||
* The ``request.organizer`` attribute contains the correct ``Organizer`` object
|
* The ``request.organizer`` attribute contains the correct ``Organizer`` object
|
||||||
* Your plugin is enabled
|
|
||||||
* The locale is set correctly
|
* The locale is set correctly
|
||||||
|
|
||||||
.. versionchanged:: 1.7
|
|
||||||
|
|
||||||
The ``event_url()`` wrapper has been added in 1.7 to replace the former ``@event_view`` decorator. The
|
|
||||||
``event_url()`` wrapper is optional and using ``url()`` still works, but you will not be able to set the
|
|
||||||
``require_live`` setting any more via the decorator. The ``@event_view`` decorator is now deprecated and
|
|
||||||
does nothing.
|
|
||||||
|
|
||||||
REST API viewsets
|
REST API viewsets
|
||||||
-----------------
|
-----------------
|
||||||
|
|
||||||
|
|||||||
@@ -21,10 +21,10 @@ that we'll provide in this plugin::
|
|||||||
|
|
||||||
from django.dispatch import receiver
|
from django.dispatch import receiver
|
||||||
|
|
||||||
from pretix.base.signals import register_data_exporters
|
from pretix.base.signals import register_data_exporter
|
||||||
|
|
||||||
|
|
||||||
@receiver(register_data_exporters, dispatch_uid="exporter_myexporter")
|
@receiver(register_data_exporter, dispatch_uid="exporter_myexporter")
|
||||||
def register_data_exporter(sender, **kwargs):
|
def register_data_exporter(sender, **kwargs):
|
||||||
from .exporter import MyExporter
|
from .exporter import MyExporter
|
||||||
return MyExporter
|
return MyExporter
|
||||||
|
|||||||
@@ -11,8 +11,7 @@ Core
|
|||||||
----
|
----
|
||||||
|
|
||||||
.. automodule:: pretix.base.signals
|
.. automodule:: pretix.base.signals
|
||||||
:members: periodic_task, event_live_issues, event_copy_data, email_filter, register_notification_types,
|
:members: periodic_task, event_live_issues, event_copy_data
|
||||||
item_copy_data
|
|
||||||
|
|
||||||
Order events
|
Order events
|
||||||
""""""""""""
|
""""""""""""
|
||||||
@@ -20,13 +19,13 @@ Order events
|
|||||||
There are multiple signals that will be sent out in the ordering cycle:
|
There are multiple signals that will be sent out in the ordering cycle:
|
||||||
|
|
||||||
.. automodule:: pretix.base.signals
|
.. automodule:: pretix.base.signals
|
||||||
:members: validate_cart, order_fee_calculation, order_paid, order_placed, order_fee_type_name, allow_ticket_download
|
:members: validate_cart, order_paid, order_placed
|
||||||
|
|
||||||
Frontend
|
Frontend
|
||||||
--------
|
--------
|
||||||
|
|
||||||
.. automodule:: pretix.presale.signals
|
.. automodule:: pretix.presale.signals
|
||||||
:members: html_head, html_footer, footer_links, front_page_top, front_page_bottom, fee_calculation_for_cart, contact_form_fields, question_form_fields, checkout_confirm_messages, checkout_confirm_page_content
|
:members: html_head, html_footer, footer_links, front_page_top, front_page_bottom, contact_form_fields, checkout_confirm_messages
|
||||||
|
|
||||||
|
|
||||||
.. automodule:: pretix.presale.signals
|
.. automodule:: pretix.presale.signals
|
||||||
@@ -48,32 +47,20 @@ Backend
|
|||||||
-------
|
-------
|
||||||
|
|
||||||
.. automodule:: pretix.control.signals
|
.. automodule:: pretix.control.signals
|
||||||
:members: nav_event, html_head, quota_detail_html, nav_topbar, nav_global, nav_organizer, nav_event_settings, order_info, event_settings_widget, oauth_application_registered
|
:members: nav_event, html_head, quota_detail_html, nav_topbar, nav_global, nav_organizer
|
||||||
|
|
||||||
|
|
||||||
.. automodule:: pretix.base.signals
|
.. automodule:: pretix.base.signals
|
||||||
:members: logentry_display, logentry_object_link, requiredaction_display
|
:members: logentry_display, requiredaction_display
|
||||||
|
|
||||||
Vouchers
|
Vouchers
|
||||||
""""""""
|
""""""""
|
||||||
|
|
||||||
.. automodule:: pretix.control.signals
|
.. automodule:: pretix.control.signals
|
||||||
:members: item_forms
|
:members: voucher_form_class, voucher_form_html
|
||||||
|
|
||||||
Vouchers
|
|
||||||
""""""""
|
|
||||||
|
|
||||||
.. automodule:: pretix.control.signals
|
|
||||||
:members: voucher_form_class, voucher_form_html, voucher_form_validation
|
|
||||||
|
|
||||||
Dashboards
|
Dashboards
|
||||||
""""""""""
|
""""""""""
|
||||||
|
|
||||||
.. automodule:: pretix.control.signals
|
.. automodule:: pretix.control.signals
|
||||||
:members: event_dashboard_widgets, user_dashboard_widgets
|
:members: event_dashboard_widgets, user_dashboard_widgets
|
||||||
|
|
||||||
Ticket designs
|
|
||||||
""""""""""""""
|
|
||||||
|
|
||||||
.. automodule:: pretix.base.signals
|
|
||||||
:members: layout_text_variables
|
|
||||||
|
|||||||
@@ -10,8 +10,5 @@ Contents:
|
|||||||
exporter
|
exporter
|
||||||
ticketoutput
|
ticketoutput
|
||||||
payment
|
payment
|
||||||
invoice
|
|
||||||
shredder
|
|
||||||
customview
|
customview
|
||||||
general
|
general
|
||||||
quality
|
|
||||||
|
|||||||
@@ -1,95 +0,0 @@
|
|||||||
.. highlight:: python
|
|
||||||
:linenothreshold: 5
|
|
||||||
|
|
||||||
Writing an invoice renderer plugin
|
|
||||||
==================================
|
|
||||||
|
|
||||||
An invoice renderer controls how invoice files are built.
|
|
||||||
The creation of such a plugin is very similar to creating an export output.
|
|
||||||
|
|
||||||
Please read :ref:`Creating a plugin <pluginsetup>` first, if you haven't already.
|
|
||||||
|
|
||||||
Output registration
|
|
||||||
-------------------
|
|
||||||
|
|
||||||
The invoice renderer API does not make a lot of usage from signals, however, it
|
|
||||||
does use a signal to get a list of all available invoice renderers. Your plugin
|
|
||||||
should listen for this signal and return the subclass of ``pretix.base.invoice.BaseInvoiceRenderer``
|
|
||||||
that we'll provide in this plugin::
|
|
||||||
|
|
||||||
from django.dispatch import receiver
|
|
||||||
|
|
||||||
from pretix.base.signals import register_invoice_renderers
|
|
||||||
|
|
||||||
|
|
||||||
@receiver(register_invoice_renderers, dispatch_uid="output_custom")
|
|
||||||
def register_infoice_renderers(sender, **kwargs):
|
|
||||||
from .invoice import MyInvoiceRenderer
|
|
||||||
return MyInvoiceRenderer
|
|
||||||
|
|
||||||
|
|
||||||
The renderer class
|
|
||||||
------------------
|
|
||||||
|
|
||||||
.. class:: pretix.base.invoice.BaseInvoiceRenderer
|
|
||||||
|
|
||||||
The central object of each invoice renderer is the subclass of ``BaseInvoiceRenderer``.
|
|
||||||
|
|
||||||
.. py:attribute:: BaseInvoiceRenderer.event
|
|
||||||
|
|
||||||
The default constructor sets this property to the event we are currently
|
|
||||||
working for.
|
|
||||||
|
|
||||||
.. autoattribute:: identifier
|
|
||||||
|
|
||||||
This is an abstract attribute, you **must** override this!
|
|
||||||
|
|
||||||
.. autoattribute:: verbose_name
|
|
||||||
|
|
||||||
This is an abstract attribute, you **must** override this!
|
|
||||||
|
|
||||||
.. automethod:: generate
|
|
||||||
|
|
||||||
Helper class for reportlab-base renderers
|
|
||||||
-----------------------------------------
|
|
||||||
|
|
||||||
All PDF rendering that ships with pretix is based on reportlab. We recommend to read the
|
|
||||||
`reportlab User Guide`_ to understand all the concepts used here.
|
|
||||||
|
|
||||||
If you want to implement a renderer that also uses report lab, this helper class might be
|
|
||||||
convenient to you:
|
|
||||||
|
|
||||||
|
|
||||||
.. class:: pretix.base.invoice.BaseReportlabInvoiceRenderer
|
|
||||||
|
|
||||||
.. py:attribute:: BaseReportlabInvoiceRenderer.pagesize
|
|
||||||
|
|
||||||
.. py:attribute:: BaseReportlabInvoiceRenderer.left_margin
|
|
||||||
|
|
||||||
.. py:attribute:: BaseReportlabInvoiceRenderer.right_margin
|
|
||||||
|
|
||||||
.. py:attribute:: BaseReportlabInvoiceRenderer.top_margin
|
|
||||||
|
|
||||||
.. py:attribute:: BaseReportlabInvoiceRenderer.bottom_margin
|
|
||||||
|
|
||||||
.. py:attribute:: BaseReportlabInvoiceRenderer.doc_template_class
|
|
||||||
|
|
||||||
.. py:attribute:: BaseReportlabInvoiceRenderer.invoice
|
|
||||||
|
|
||||||
.. automethod:: _init
|
|
||||||
|
|
||||||
.. automethod:: _get_stylesheet
|
|
||||||
|
|
||||||
.. automethod:: _register_fonts
|
|
||||||
|
|
||||||
.. automethod:: _on_first_page
|
|
||||||
|
|
||||||
.. automethod:: _on_other_page
|
|
||||||
|
|
||||||
.. automethod:: _get_first_page_frames
|
|
||||||
|
|
||||||
.. automethod:: _get_other_page_frames
|
|
||||||
|
|
||||||
.. automethod:: _build_doc
|
|
||||||
|
|
||||||
.. _reportlab User Guide: https://www.reportlab.com/docs/reportlab-userguide.pdf
|
|
||||||
@@ -102,10 +102,6 @@ The provider class
|
|||||||
|
|
||||||
.. automethod:: order_control_refund_perform
|
.. automethod:: order_control_refund_perform
|
||||||
|
|
||||||
.. automethod:: is_implicit
|
|
||||||
|
|
||||||
.. automethod:: shred_payment_info
|
|
||||||
|
|
||||||
|
|
||||||
Additional views
|
Additional views
|
||||||
----------------
|
----------------
|
||||||
|
|||||||
@@ -114,19 +114,6 @@ method to make your receivers available::
|
|||||||
def ready(self):
|
def ready(self):
|
||||||
from . import signals # NOQA
|
from . import signals # NOQA
|
||||||
|
|
||||||
You can optionally specify code that is executed when your plugin is activated for an event
|
|
||||||
in the ``installed`` method::
|
|
||||||
|
|
||||||
class PaypalApp(AppConfig):
|
|
||||||
…
|
|
||||||
|
|
||||||
def installed(self, event):
|
|
||||||
pass # Your code here
|
|
||||||
|
|
||||||
|
|
||||||
Note that ``installed`` will *not* be called if the plugin in indirectly activated for an event
|
|
||||||
because the event is created with settings copied from another event.
|
|
||||||
|
|
||||||
Views
|
Views
|
||||||
-----
|
-----
|
||||||
|
|
||||||
@@ -142,5 +129,5 @@ your Django app label.
|
|||||||
.. _Django app: https://docs.djangoproject.com/en/1.7/ref/applications/
|
.. _Django app: https://docs.djangoproject.com/en/1.7/ref/applications/
|
||||||
.. _signal dispatcher: https://docs.djangoproject.com/en/1.7/topics/signals/
|
.. _signal dispatcher: https://docs.djangoproject.com/en/1.7/topics/signals/
|
||||||
.. _namespace packages: http://legacy.python.org/dev/peps/pep-0420/
|
.. _namespace packages: http://legacy.python.org/dev/peps/pep-0420/
|
||||||
.. _entry point: https://setuptools.readthedocs.io/en/latest/pkg_resources.html#locating-plugins
|
.. _entry point: https://pythonhosted.org/setuptools/setuptools.html#dynamic-discovery-of-services-and-plugins
|
||||||
.. _cookiecutter: https://cookiecutter.readthedocs.io/en/latest/
|
.. _cookiecutter: https://cookiecutter.readthedocs.io/en/latest/
|
||||||
|
|||||||
@@ -1,125 +0,0 @@
|
|||||||
.. highlight:: python
|
|
||||||
:linenothreshold: 5
|
|
||||||
|
|
||||||
.. _`pluginquality`:
|
|
||||||
|
|
||||||
Plugin quality checklist
|
|
||||||
========================
|
|
||||||
|
|
||||||
If you want to write a high-quality pretix plugin, this is a list of things you should check before
|
|
||||||
you publish it. This is also a list of things that we check, if we consider installing an externally
|
|
||||||
developed plugin on our hosted infrastructure.
|
|
||||||
|
|
||||||
A. Meta
|
|
||||||
-------
|
|
||||||
|
|
||||||
#. The plugin is clearly licensed under an appropriate license.
|
|
||||||
|
|
||||||
#. The plugin has an unambiguous name, description, and author metadata.
|
|
||||||
|
|
||||||
#. The plugin has a clear versioning scheme and the latest version of the plugin is kept compatible to the latest
|
|
||||||
stable version of pretix.
|
|
||||||
|
|
||||||
#. The plugin is properly packaged using standard Python packaging tools.
|
|
||||||
|
|
||||||
#. The plugin correctly declares its external dependencies.
|
|
||||||
|
|
||||||
#. A contact address is provided in case of security issues.
|
|
||||||
|
|
||||||
B. Isolation
|
|
||||||
------------
|
|
||||||
|
|
||||||
#. If any signal receivers use the `dispatch_uid`_ feature, the UIDs are prefixed by the plugin's name and do not
|
|
||||||
clash with other plugins.
|
|
||||||
|
|
||||||
#. If any templates or static files are shipped, they are located in subdirectories with the name of the plugin and do
|
|
||||||
not clash with other plugins or core files.
|
|
||||||
|
|
||||||
#. Any keys stored to the settings store are prefixed with the plugin's name and do not clash with other plugins or
|
|
||||||
core.
|
|
||||||
|
|
||||||
#. Any keys stored to the user session are prefixed with the plugin's name and do not clash with other plugins or
|
|
||||||
core.
|
|
||||||
|
|
||||||
#. Any registered URLs are unlikely to clash with other plugins or future core URLs.
|
|
||||||
|
|
||||||
C. Security
|
|
||||||
-----------
|
|
||||||
|
|
||||||
#. All important actions are logged to the :ref:`shared log storage <logging>` and a signal receiver is registered to
|
|
||||||
provide a human-readable representation of the log entry.
|
|
||||||
|
|
||||||
#. All views require appropriate permissions and use the ``event_urls`` mechanism if appropriate.
|
|
||||||
:ref:`Read more <customview>`
|
|
||||||
|
|
||||||
#. Any session data for customers is stored in the cart session system if appropriate.
|
|
||||||
|
|
||||||
#. If the plugin is a payment provider:
|
|
||||||
|
|
||||||
#. No credit card numbers may be stored within pretix.
|
|
||||||
|
|
||||||
#. A notification/webhook system is implemented to notify pretix of any refunds.
|
|
||||||
|
|
||||||
#. If such a webhook system is implemented, contents of incoming webhooks are either verified using a cryptographic
|
|
||||||
signature or are not being trusted and all data is fetched from an API instead.
|
|
||||||
|
|
||||||
D. Privacy
|
|
||||||
----------
|
|
||||||
|
|
||||||
#. No personal data is stored that is not required for the plugin's functionality.
|
|
||||||
|
|
||||||
#. For any personal data that is saved to the database, an appropriate :ref:`data shredder <shredder>` is provided
|
|
||||||
that offers the data for download and then removes it from the database (including log entries).
|
|
||||||
|
|
||||||
E. Internationalization
|
|
||||||
-----------------------
|
|
||||||
|
|
||||||
#. All user-facing strings in templates, Python code, and templates are wrapped in `gettext calls`_.
|
|
||||||
|
|
||||||
#. No languages, time zones, date formats, or time formats are hardcoded.
|
|
||||||
|
|
||||||
#. Installing the plugin automatically compiles ``.po`` files to ``.mo`` files. This is fulfilled automatically if
|
|
||||||
you use the ``setup.py`` file form our plugin cookiecutter.
|
|
||||||
|
|
||||||
F. Functionality
|
|
||||||
----------------
|
|
||||||
|
|
||||||
#. If the plugin adds any database models or relationships from the settings storage to database models, it registers
|
|
||||||
a receiver to the :py:attr:`pretix.base.signals.event_copy_data` or :py:attr:`pretix.base.signals.item_copy_data`
|
|
||||||
signals.
|
|
||||||
|
|
||||||
#. If the plugin is a payment provider:
|
|
||||||
|
|
||||||
#. A webhook-like system is implemented if payment confirmations are not sent instantly.
|
|
||||||
|
|
||||||
#. Refunds are implemented, if possible.
|
|
||||||
|
|
||||||
#. In case of overpayment or external refunds, a "required action" is created to notify the event organizer.
|
|
||||||
|
|
||||||
#. If the plugin adds steps to the checkout process, it has been tested in combination with the pretix widget.
|
|
||||||
|
|
||||||
G. Code quality
|
|
||||||
---------------
|
|
||||||
|
|
||||||
#. `isort`_ and `flake8`_ are used to ensure consistent code styling.
|
|
||||||
|
|
||||||
#. Unit tests are provided for important pieces of business logic.
|
|
||||||
|
|
||||||
#. Functional tests are provided for important interface parts.
|
|
||||||
|
|
||||||
#. Tests are provided to check that permission checks are working.
|
|
||||||
|
|
||||||
#. Continuous Integration is set up to check that tests are passing and styling is consistent.
|
|
||||||
|
|
||||||
H. Specific to pretix.eu
|
|
||||||
------------------------
|
|
||||||
|
|
||||||
#. pretix.eu integrates the data stored by this plugin with its data report features.
|
|
||||||
|
|
||||||
#. pretix.eu integrates this plugin in its generated privacy statements, if necessary.
|
|
||||||
|
|
||||||
|
|
||||||
.. _isort: https://www.google.de/search?q=isort&oq=isort&aqs=chrome..69i57j0j69i59j69i60l2j69i59.599j0j4&sourceid=chrome&ie=UTF-8
|
|
||||||
.. _flake8: http://flake8.pycqa.org/en/latest/
|
|
||||||
.. _gettext calls: https://docs.djangoproject.com/en/2.0/topics/i18n/translation/
|
|
||||||
.. _dispatch_uid: https://docs.djangoproject.com/en/2.0/topics/signals/#django.dispatch.Signal.connect
|
|
||||||
@@ -1,94 +0,0 @@
|
|||||||
.. highlight:: python
|
|
||||||
:linenothreshold: 5
|
|
||||||
|
|
||||||
.. _`shredder`:
|
|
||||||
|
|
||||||
Writing a data shredder
|
|
||||||
=======================
|
|
||||||
|
|
||||||
If your plugin adds the ability to store personal data within pretix, you should also implement a "data shredder"
|
|
||||||
to anonymize or pseudonymize the data later.
|
|
||||||
|
|
||||||
Shredder registration
|
|
||||||
---------------------
|
|
||||||
|
|
||||||
The data shredder API does not make a lot of usage from signals, however, it
|
|
||||||
does use a signal to get a list of all available data shredders. Your plugin
|
|
||||||
should listen for this signal and return the subclass of ``pretix.base.shredder.BaseDataShredder``
|
|
||||||
that we'll provide in this plugin:
|
|
||||||
|
|
||||||
.. sourcecode:: python
|
|
||||||
|
|
||||||
from django.dispatch import receiver
|
|
||||||
|
|
||||||
from pretix.base.signals import register_data_shredders
|
|
||||||
|
|
||||||
|
|
||||||
@receiver(register_data_shredders, dispatch_uid="custom_data_shredders")
|
|
||||||
def register_shredder(sender, **kwargs):
|
|
||||||
return [
|
|
||||||
PluginDataShredder,
|
|
||||||
]
|
|
||||||
|
|
||||||
The shredder class
|
|
||||||
------------------
|
|
||||||
|
|
||||||
.. class:: pretix.base.shredder.BaseDataShredder
|
|
||||||
|
|
||||||
The central object of each invoice renderer is the subclass of ``BaseInvoiceRenderer``.
|
|
||||||
|
|
||||||
.. py:attribute:: BaseInvoiceRenderer.event
|
|
||||||
|
|
||||||
The default constructor sets this property to the event we are currently
|
|
||||||
working for.
|
|
||||||
|
|
||||||
.. autoattribute:: identifier
|
|
||||||
|
|
||||||
This is an abstract attribute, you **must** override this!
|
|
||||||
|
|
||||||
.. autoattribute:: verbose_name
|
|
||||||
|
|
||||||
This is an abstract attribute, you **must** override this!
|
|
||||||
|
|
||||||
.. autoattribute:: description
|
|
||||||
|
|
||||||
This is an abstract attribute, you **must** override this!
|
|
||||||
|
|
||||||
.. automethod:: generate_files
|
|
||||||
|
|
||||||
.. automethod:: shred_data
|
|
||||||
|
|
||||||
Example
|
|
||||||
-------
|
|
||||||
|
|
||||||
For example, the core data shredder responsible for removing invoice address information including their history
|
|
||||||
looks like this:
|
|
||||||
|
|
||||||
.. sourcecode:: python
|
|
||||||
|
|
||||||
class InvoiceAddressShredder(BaseDataShredder):
|
|
||||||
verbose_name = _('Invoice addresses')
|
|
||||||
identifier = 'invoice_addresses'
|
|
||||||
description = _('This will remove all invoice addresses from orders, '
|
|
||||||
'as well as logged changes to them.')
|
|
||||||
|
|
||||||
def generate_files(self) -> List[Tuple[str, str, str]]:
|
|
||||||
yield 'invoice-addresses.json', 'application/json', json.dumps({
|
|
||||||
ia.order.code: InvoiceAdddressSerializer(ia).data
|
|
||||||
for ia in InvoiceAddress.objects.filter(order__event=self.event)
|
|
||||||
}, indent=4)
|
|
||||||
|
|
||||||
@transaction.atomic
|
|
||||||
def shred_data(self):
|
|
||||||
InvoiceAddress.objects.filter(order__event=self.event).delete()
|
|
||||||
|
|
||||||
for le in self.event.logentry_set.filter(action_type="pretix.event.order.modified"):
|
|
||||||
d = le.parsed_data
|
|
||||||
if 'invoice_data' in d and not isinstance(d['invoice_data'], bool):
|
|
||||||
for field in d['invoice_data']:
|
|
||||||
if d['invoice_data'][field]:
|
|
||||||
d['invoice_data'][field] = '█'
|
|
||||||
le.data = json.dumps(d)
|
|
||||||
le.shredded = True
|
|
||||||
le.save(update_fields=['data', 'shredded'])
|
|
||||||
|
|
||||||
@@ -58,8 +58,6 @@ The output class
|
|||||||
|
|
||||||
.. autoattribute:: is_enabled
|
.. autoattribute:: is_enabled
|
||||||
|
|
||||||
.. autoattribute:: multi_download_enabled
|
|
||||||
|
|
||||||
.. autoattribute:: settings_form_fields
|
.. autoattribute:: settings_form_fields
|
||||||
|
|
||||||
.. automethod:: settings_content_render
|
.. automethod:: settings_content_render
|
||||||
|
|||||||
@@ -59,7 +59,7 @@ If an item is assigned to multiple quotas, it can only be bought if *all of them
|
|||||||
If multiple items are assigned to the same quota, the quota will be counted as sold out as soon as the
|
If multiple items are assigned to the same quota, the quota will be counted as sold out as soon as the
|
||||||
*sum* of the two items exceeds the quota limit.
|
*sum* of the two items exceeds the quota limit.
|
||||||
|
|
||||||
The availability of a quota is currently calculated by subtracting the following numbers from the quota
|
The availability of a quota is currently calculated by substracting the following numbers from the quota
|
||||||
limit:
|
limit:
|
||||||
|
|
||||||
* The number of orders placed for an item that are either already paid or within their granted payment period
|
* The number of orders placed for an item that are either already paid or within their granted payment period
|
||||||
|
|||||||
@@ -77,6 +77,6 @@ Attribution
|
|||||||
-----------
|
-----------
|
||||||
|
|
||||||
This Code of Conduct is adapted from the `Contributor Covenant`_, version 1.4,
|
This Code of Conduct is adapted from the `Contributor Covenant`_, version 1.4,
|
||||||
available at https://www.contributor-covenant.org/version/1/4/
|
available at http://contributor-covenant.org/version/1/4/
|
||||||
|
|
||||||
.. _Contributor Covenant: https://www.contributor-covenant.org
|
.. _Contributor Covenant: http://contributor-covenant.org
|
||||||
|
|||||||
@@ -24,7 +24,7 @@ Coding style and quality
|
|||||||
``Fix #123 -- Problems with order creation`` or ``Refs #123 -- Fix this part of that bug``.
|
``Fix #123 -- Problems with order creation`` or ``Refs #123 -- Fix this part of that bug``.
|
||||||
|
|
||||||
|
|
||||||
.. _PEP 8: https://legacy.python.org/dev/peps/pep-0008/
|
.. _PEP 8: http://legacy.python.org/dev/peps/pep-0008/
|
||||||
.. _flake8: https://pypi.python.org/pypi/flake8
|
.. _flake8: https://pypi.python.org/pypi/flake8
|
||||||
.. _Django Coding Style: https://docs.djangoproject.com/en/dev/internals/contributing/writing-code/coding-style/
|
.. _Django Coding Style: https://docs.djangoproject.com/en/dev/internals/contributing/writing-code/coding-style/
|
||||||
.. _translation: https://docs.djangoproject.com/en/1.11/topics/i18n/translation/
|
.. _translation: https://docs.djangoproject.com/en/1.11/topics/i18n/translation/
|
||||||
|
|||||||
@@ -14,7 +14,7 @@ Implementing a task
|
|||||||
A common pattern for implementing asynchronous tasks can be seen a lot in ``pretix.base.services``
|
A common pattern for implementing asynchronous tasks can be seen a lot in ``pretix.base.services``
|
||||||
and looks like this::
|
and looks like this::
|
||||||
|
|
||||||
from pretix.celery_app import app
|
from pretix.celery import app
|
||||||
|
|
||||||
@app.task
|
@app.task
|
||||||
def my_task(argument1, argument2):
|
def my_task(argument1, argument2):
|
||||||
|
|||||||
@@ -2,9 +2,6 @@ Sending Email
|
|||||||
=============
|
=============
|
||||||
|
|
||||||
pretix allows event organizers to configure how they want to send emails to their users in multiple ways.
|
pretix allows event organizers to configure how they want to send emails to their users in multiple ways.
|
||||||
Therefore, all emails should be sent through the following function.
|
Therefore, all emails should be sent through the following function:
|
||||||
|
|
||||||
If the email you send is related to an order, you should also take a look at the
|
|
||||||
:py:meth:`~pretix.base.models.Order.send_mail` of the order model.
|
|
||||||
|
|
||||||
.. autofunction:: pretix.base.services.mail.mail
|
.. autofunction:: pretix.base.services.mail.mail
|
||||||
|
|||||||
@@ -16,5 +16,4 @@ Contents:
|
|||||||
settings
|
settings
|
||||||
background
|
background
|
||||||
email
|
email
|
||||||
permissions
|
|
||||||
logging
|
logging
|
||||||
|
|||||||
@@ -1,11 +1,9 @@
|
|||||||
Logging and notifications
|
Logging
|
||||||
=========================
|
=======
|
||||||
|
|
||||||
As pretix is handling monetary transactions, we are very careful to make it possible to review all changes
|
As pretix is handling monetary transactions, we are very careful to make it possible to review all changes
|
||||||
in the system that lead to the current state.
|
in the system that lead to the current state.
|
||||||
|
|
||||||
.. _`logging`:
|
|
||||||
|
|
||||||
Logging changes
|
Logging changes
|
||||||
---------------
|
---------------
|
||||||
|
|
||||||
@@ -21,7 +19,7 @@ To actually log an action, you can just call the ``log_action`` method on your o
|
|||||||
order.log_action('pretix.event.order.canceled', user=user, data={})
|
order.log_action('pretix.event.order.canceled', user=user, data={})
|
||||||
|
|
||||||
The positional ``action`` argument should represent the type of action and should be globally unique, we
|
The positional ``action`` argument should represent the type of action and should be globally unique, we
|
||||||
recommend to prefix it with your package name, e.g. ``paypal.payment.rejected``. The ``user`` argument is
|
recomment do prefix it with your packagename, e.g. ``paypal.payment.rejected``. The ``user`` argument is
|
||||||
optional and may contain the user who performed the action. The optional ``data`` argument can contain
|
optional and may contain the user who performed the action. The optional ``data`` argument can contain
|
||||||
additional information about this action.
|
additional information about this action.
|
||||||
|
|
||||||
@@ -83,61 +81,6 @@ implementation could look like::
|
|||||||
if logentry.action_type in plains:
|
if logentry.action_type in plains:
|
||||||
return plains[logentry.action_type]
|
return plains[logentry.action_type]
|
||||||
|
|
||||||
Sending notifications
|
|
||||||
---------------------
|
|
||||||
|
|
||||||
If you think that the logged information might be important or urgent enough to send out a notification to interested
|
|
||||||
organizers. In this case, you should listen for the :py:attr:`pretix.base.signals.register_notification_types` signal
|
|
||||||
to register a notification type::
|
|
||||||
|
|
||||||
@receiver(register_notification_types)
|
|
||||||
def register_my_notification_types(sender, **kwargs):
|
|
||||||
return [MyNotificationType(sender)]
|
|
||||||
|
|
||||||
Note that this event is different than other events send out by pretix: ``sender`` may be an event or ``None``. The
|
|
||||||
latter case is required to let the user define global notification preferences for all events.
|
|
||||||
|
|
||||||
You also need to implement a custom class that specifies how notifications should be handled for your notification type.
|
|
||||||
You should subclass the base ``NotificationType`` class and implement all its members:
|
|
||||||
|
|
||||||
.. autoclass:: pretix.base.notifications.NotificationType
|
|
||||||
:members: action_type, verbose_name, required_permission, build_notification
|
|
||||||
|
|
||||||
A simple implementation could look like this::
|
|
||||||
|
|
||||||
class MyNotificationType(NotificationType):
|
|
||||||
required_permission = "can_view_orders"
|
|
||||||
action_type = "pretix.event.order.paid"
|
|
||||||
verbose_name = _("Order has been paid")
|
|
||||||
|
|
||||||
def build_notification(self, logentry: LogEntry):
|
|
||||||
order = logentry.content_object
|
|
||||||
|
|
||||||
order_url = build_absolute_uri(
|
|
||||||
'control:event.order',
|
|
||||||
kwargs={
|
|
||||||
'organizer': logentry.event.organizer.slug,
|
|
||||||
'event': logentry.event.slug,
|
|
||||||
'code': order.code
|
|
||||||
}
|
|
||||||
)
|
|
||||||
|
|
||||||
n = Notification(
|
|
||||||
event=logentry.event,
|
|
||||||
title=_('Order {code} has been marked as paid').format(code=order.code),
|
|
||||||
url=order_url
|
|
||||||
)
|
|
||||||
n.add_attribute(_('Order code'), order.code)
|
|
||||||
n.add_action(_('View order details'), order_url)
|
|
||||||
return n
|
|
||||||
|
|
||||||
As you can see, the relevant code is in the ``build_notification`` method that is supposed to create a ``Notification``
|
|
||||||
method that has a title, description, URL, attributes, and actions. The full definition of ``Notification`` is the
|
|
||||||
following:
|
|
||||||
|
|
||||||
.. autoclass:: pretix.base.notifications.Notification
|
|
||||||
:members: add_action, add_attribute
|
|
||||||
|
|
||||||
|
|
||||||
Logging technical information
|
Logging technical information
|
||||||
-----------------------------
|
-----------------------------
|
||||||
|
|||||||
@@ -1,8 +1,6 @@
|
|||||||
.. highlight:: python
|
.. highlight:: python
|
||||||
:linenothreshold: 5
|
:linenothreshold: 5
|
||||||
|
|
||||||
.. spelling:: answ contrib
|
|
||||||
|
|
||||||
Data model
|
Data model
|
||||||
==========
|
==========
|
||||||
|
|
||||||
@@ -23,29 +21,14 @@ Organizers and events
|
|||||||
:members:
|
:members:
|
||||||
|
|
||||||
.. autoclass:: pretix.base.models.Event
|
.. autoclass:: pretix.base.models.Event
|
||||||
:members: get_date_from_display, get_time_from_display, get_date_to_display, get_date_range_display, presale_has_ended, presale_is_running, cache, lock, get_plugins, get_mail_backend, payment_term_last, get_payment_providers, get_invoice_renderers, active_subevents, invoice_renderer, settings
|
:members:
|
||||||
|
|
||||||
.. autoclass:: pretix.base.models.SubEvent
|
|
||||||
:members: get_date_from_display, get_time_from_display, get_date_to_display, get_date_range_display, presale_has_ended, presale_is_running
|
|
||||||
|
|
||||||
.. autoclass:: pretix.base.models.Team
|
.. autoclass:: pretix.base.models.Team
|
||||||
:members:
|
:members:
|
||||||
|
|
||||||
.. autoclass:: pretix.base.models.TeamAPIToken
|
|
||||||
:members:
|
|
||||||
|
|
||||||
.. autoclass:: pretix.base.models.RequiredAction
|
.. autoclass:: pretix.base.models.RequiredAction
|
||||||
:members:
|
:members:
|
||||||
|
|
||||||
.. autoclass:: pretix.base.models.EventMetaProperty
|
|
||||||
:members:
|
|
||||||
|
|
||||||
.. autoclass:: pretix.base.models.EventMetaValue
|
|
||||||
:members:
|
|
||||||
|
|
||||||
.. autoclass:: pretix.base.models.SubEventMetaValue
|
|
||||||
:members:
|
|
||||||
|
|
||||||
|
|
||||||
Items
|
Items
|
||||||
-----
|
-----
|
||||||
@@ -59,15 +42,6 @@ Items
|
|||||||
.. autoclass:: pretix.base.models.ItemVariation
|
.. autoclass:: pretix.base.models.ItemVariation
|
||||||
:members:
|
:members:
|
||||||
|
|
||||||
.. autoclass:: pretix.base.models.SubEventItem
|
|
||||||
:members:
|
|
||||||
|
|
||||||
.. autoclass:: pretix.base.models.SubEventItemVariation
|
|
||||||
:members:
|
|
||||||
|
|
||||||
.. autoclass:: pretix.base.models.ItemAddOn
|
|
||||||
:members:
|
|
||||||
|
|
||||||
.. autoclass:: pretix.base.models.Question
|
.. autoclass:: pretix.base.models.Question
|
||||||
:members:
|
:members:
|
||||||
|
|
||||||
|
|||||||
@@ -1,194 +0,0 @@
|
|||||||
Permissions
|
|
||||||
===========
|
|
||||||
|
|
||||||
pretix uses a fine-grained permission system to control who is allowed to control what parts of the system.
|
|
||||||
The central concept here is the concept of *Teams*. You can read more on `configuring teams and permissions <user-teams>`_
|
|
||||||
and the :class:`pretix.base.models.Team` model in the respective parts of the documentation. The basic digest is:
|
|
||||||
An organizer account can have any number of teams, and any number of users can be part of a team. A team can be
|
|
||||||
assigned a set of permissions and connected to some or all of the events of the organizer.
|
|
||||||
|
|
||||||
A second way to access pretix is via the REST API, which allows authentication via tokens that are bound to a team,
|
|
||||||
but not to a user. You can read more at :class:`pretix.base.models.TeamAPIToken`. This page will show you how to
|
|
||||||
work with permissions in plugins and within the pretix code base.
|
|
||||||
|
|
||||||
Requiring permissions for a view
|
|
||||||
--------------------------------
|
|
||||||
|
|
||||||
pretix provides a number of useful mixins and decorators that allow you to specify that a user needs a certain
|
|
||||||
permission level to access a view::
|
|
||||||
|
|
||||||
from pretix.control.permissions import (
|
|
||||||
OrganizerPermissionRequiredMixin, organizer_permission_required
|
|
||||||
)
|
|
||||||
|
|
||||||
|
|
||||||
class MyOrgaView(OrganizerPermissionRequiredMixin, View):
|
|
||||||
permission = 'can_change_organizer_settings'
|
|
||||||
# Only users with the permission ``can_change_organizer_settings`` on
|
|
||||||
# this organizer can access this
|
|
||||||
|
|
||||||
|
|
||||||
class MyOtherOrgaView(OrganizerPermissionRequiredMixin, View):
|
|
||||||
permission = None
|
|
||||||
# Only users with *any* permission on this organizer can access this
|
|
||||||
|
|
||||||
|
|
||||||
@organizer_permission_required('can_change_organizer_settings')
|
|
||||||
def my_orga_view(request, organizer, **kwargs):
|
|
||||||
# Only users with the permission ``can_change_organizer_settings`` on
|
|
||||||
# this organizer can access this
|
|
||||||
|
|
||||||
|
|
||||||
@organizer_permission_required()
|
|
||||||
def my_other_orga_view(request, organizer, **kwargs):
|
|
||||||
# Only users with *any* permission on this organizer can access this
|
|
||||||
|
|
||||||
|
|
||||||
Of course, the same is available on event level::
|
|
||||||
|
|
||||||
from pretix.control.permissions import (
|
|
||||||
EventPermissionRequiredMixin, event_permission_required
|
|
||||||
)
|
|
||||||
|
|
||||||
|
|
||||||
class MyEventView(EventPermissionRequiredMixin, View):
|
|
||||||
permission = 'can_change_event_settings'
|
|
||||||
# Only users with the permission ``can_change_event_settings`` on
|
|
||||||
# this event can access this
|
|
||||||
|
|
||||||
|
|
||||||
class MyOtherEventView(EventPermissionRequiredMixin, View):
|
|
||||||
permission = None
|
|
||||||
# Only users with *any* permission on this event can access this
|
|
||||||
|
|
||||||
|
|
||||||
@event_permission_required('can_change_event_settings')
|
|
||||||
def my_event_view(request, organizer, **kwargs):
|
|
||||||
# Only users with the permission ``can_change_event_settings`` on
|
|
||||||
# this event can access this
|
|
||||||
|
|
||||||
|
|
||||||
@event_permission_required()
|
|
||||||
def my_other_event_view(request, organizer, **kwargs):
|
|
||||||
# Only users with *any* permission on this event can access this
|
|
||||||
|
|
||||||
You can also require that this view is only accessible by system administrators with an active "admin session"
|
|
||||||
(see below for what this means)::
|
|
||||||
|
|
||||||
from pretix.control.permissions import (
|
|
||||||
AdministratorPermissionRequiredMixin, administrator_permission_required
|
|
||||||
)
|
|
||||||
|
|
||||||
|
|
||||||
class MyGlobalView(AdministratorPermissionRequiredMixin, View):
|
|
||||||
# ...
|
|
||||||
|
|
||||||
|
|
||||||
@administrator_permission_required
|
|
||||||
def my_global_view(request, organizer, **kwargs):
|
|
||||||
# ...
|
|
||||||
|
|
||||||
In rare cases it might also be useful to expose a feature only to people who have a staff account but do not
|
|
||||||
necessarily have an active admin session::
|
|
||||||
|
|
||||||
from pretix.control.permissions import (
|
|
||||||
StaffMemberRequiredMixin, staff_member_required
|
|
||||||
)
|
|
||||||
|
|
||||||
|
|
||||||
class MyGlobalView(StaffMemberRequiredMixin, View):
|
|
||||||
# ...
|
|
||||||
|
|
||||||
|
|
||||||
@staff_member_required
|
|
||||||
def my_global_view(request, organizer, **kwargs):
|
|
||||||
# ...
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
Requiring permissions in the REST API
|
|
||||||
-------------------------------------
|
|
||||||
|
|
||||||
When creating your own ``viewset`` using Django REST framework, you just need to set the ``permission`` attribute
|
|
||||||
and pretix will check it automatically for you::
|
|
||||||
|
|
||||||
class MyModelViewSet(viewsets.ReadOnlyModelViewSet):
|
|
||||||
permission = 'can_view_orders'
|
|
||||||
|
|
||||||
Checking permission in code
|
|
||||||
---------------------------
|
|
||||||
|
|
||||||
If you need to work with permissions manually, there are a couple of useful helper methods on the :class:`pretix.base.models.Event`,
|
|
||||||
:class:`pretix.base.models.User` and :class:`pretix.base.models.TeamAPIToken` classes. Here's a quick overview.
|
|
||||||
|
|
||||||
Return all users that are in any team that is connected to this event::
|
|
||||||
|
|
||||||
>>> event.get_users_with_any_permission()
|
|
||||||
<QuerySet: …>
|
|
||||||
|
|
||||||
Return all users that are in a team with a specific permission for this event::
|
|
||||||
|
|
||||||
>>> event.get_users_with_permission('can_change_event_settings')
|
|
||||||
<QuerySet: …>
|
|
||||||
|
|
||||||
Determine if a user has a certain permission for a specific event::
|
|
||||||
|
|
||||||
>>> user.has_event_permission(organizer, event, 'can_change_event_settings', request=request)
|
|
||||||
True
|
|
||||||
|
|
||||||
Determine if a user has any permission for a specific event::
|
|
||||||
|
|
||||||
>>> user.has_event_permission(organizer, event, request=request)
|
|
||||||
True
|
|
||||||
|
|
||||||
In the two previous commands, the ``request`` argument is optional, but required to support staff sessions (see below).
|
|
||||||
|
|
||||||
The same method exists for organizer-level permissions::
|
|
||||||
|
|
||||||
>>> user.has_organizer_permission(organizer, 'can_change_event_settings', request=request)
|
|
||||||
True
|
|
||||||
|
|
||||||
Sometimes, it might be more useful to get the set of permissions at once::
|
|
||||||
|
|
||||||
>>> user.get_event_permission_set(organizer, event)
|
|
||||||
{'can_change_event_settings', 'can_view_orders', 'can_change_orders'}
|
|
||||||
|
|
||||||
>>> user.get_organizer_permission_set(organizer, event)
|
|
||||||
{'can_change_organizer_settings', 'can_create_events'}
|
|
||||||
|
|
||||||
Within a view on the ``/control`` subpath, the results of these two methods are already available in the
|
|
||||||
``request.eventpermset`` and ``request.orgapermset`` properties. This makes it convenient to query them in templates::
|
|
||||||
|
|
||||||
{% if "can_change_orders" in request.eventpermset %}
|
|
||||||
…
|
|
||||||
{% endif %}
|
|
||||||
|
|
||||||
You can also do the reverse to get any events a user has access to::
|
|
||||||
|
|
||||||
>>> user.get_events_with_permission('can_change_event_settings', request=request)
|
|
||||||
<QuerySet: …>
|
|
||||||
|
|
||||||
>>> user.get_events_with_any_permission(request=request)
|
|
||||||
<QuerySet: …>
|
|
||||||
|
|
||||||
Most of these methods work identically on :class:`pretix.base.models.TeamAPIToken`.
|
|
||||||
|
|
||||||
Staff sessions
|
|
||||||
--------------
|
|
||||||
|
|
||||||
.. versionchanged:: 1.14
|
|
||||||
|
|
||||||
In 1.14, the ``User.is_superuser`` attribute has been deprecated and statically set to return ``False``. Staff
|
|
||||||
sessions have been newly introduced.
|
|
||||||
|
|
||||||
System administrators of a pretix instance are identified by the ``is_staff`` attribute on the user model. By default,
|
|
||||||
the regular permission rules apply for users with ``is_staff = True``. The only difference is that such users can
|
|
||||||
temporarily turn on "staff mode" via a button in the user interface that grants them **all permissions** as long as
|
|
||||||
staff mode is active. You can check if a user is in staff mode using their session key:
|
|
||||||
|
|
||||||
>>> user.has_active_staff_session(request.session.session_key)
|
|
||||||
False
|
|
||||||
|
|
||||||
Staff mode has a hard time limit and during staff mode, a middleware will log all requests made by that user. Later,
|
|
||||||
the user is able to also save a message to comment on what they did in their administrative session. This feature is
|
|
||||||
intended to help compliance with data protection rules as imposed e.g. by GDPR.
|
|
||||||
@@ -35,7 +35,7 @@ Forms
|
|||||||
-----
|
-----
|
||||||
|
|
||||||
Hierarkey also provides a base class for forms that allow the modification of settings. pretix contains a
|
Hierarkey also provides a base class for forms that allow the modification of settings. pretix contains a
|
||||||
subclass that also adds support for internationalized fields:
|
subclass that also adds suport for internationalized fields:
|
||||||
|
|
||||||
.. autoclass:: pretix.base.forms.SettingsForm
|
.. autoclass:: pretix.base.forms.SettingsForm
|
||||||
|
|
||||||
@@ -65,4 +65,4 @@ Plugins can add custom hardcoded defaults in the following way::
|
|||||||
Make sure that you include this code in a module that is imported at app loading time.
|
Make sure that you include this code in a module that is imported at app loading time.
|
||||||
|
|
||||||
.. _django-hierarkey: https://github.com/raphaelm/django-hierarkey
|
.. _django-hierarkey: https://github.com/raphaelm/django-hierarkey
|
||||||
.. _documentation: https://django-hierarkey.readthedocs.io/en/latest/
|
.. _documentation: https://django-hierarkey.readthedocs.io/en/latest/
|
||||||
@@ -67,7 +67,7 @@ available as ``plugins:sendmail:send``.
|
|||||||
Generating a URL for the frontend is a complicated task, because you need to know whether the event's
|
Generating a URL for the frontend is a complicated task, because you need to know whether the event's
|
||||||
organizer uses a custom URL or not and then generate the URL with a different domain and different
|
organizer uses a custom URL or not and then generate the URL with a different domain and different
|
||||||
arguments based on this information. pretix provides some helpers to make this easier. The first helper
|
arguments based on this information. pretix provides some helpers to make this easier. The first helper
|
||||||
is a python method that emulates a behavior similar to ``reverse``:
|
is a python method that emulates a behaviour similar to ``reverse``:
|
||||||
|
|
||||||
.. autofunction:: pretix.multidomain.urlreverse.eventreverse
|
.. autofunction:: pretix.multidomain.urlreverse.eventreverse
|
||||||
|
|
||||||
@@ -82,5 +82,5 @@ Implementation details
|
|||||||
----------------------
|
----------------------
|
||||||
|
|
||||||
There are some other caveats when using a design like this, e.g. you have to care about cookie domains
|
There are some other caveats when using a design like this, e.g. you have to care about cookie domains
|
||||||
and referrer verification yourself. If you want to see how we built this, look into the ``pretix/multidomain/``
|
and referer verification yourself. If you want to see how we built this, look into the ``pretix/multidomain/``
|
||||||
sub-tree.
|
sub-tree.
|
||||||
|
|||||||
@@ -8,6 +8,8 @@ Developer documentation
|
|||||||
setup
|
setup
|
||||||
contribution/index
|
contribution/index
|
||||||
implementation/index
|
implementation/index
|
||||||
translation/index
|
|
||||||
api/index
|
api/index
|
||||||
structure
|
structure
|
||||||
|
|
||||||
|
.. TODO::
|
||||||
|
Document settings objects, ItemVariation objects, form fields.
|
||||||
|
|||||||
@@ -20,6 +20,7 @@ Your should install the following on your system:
|
|||||||
|
|
||||||
* Python 3.4 or newer
|
* Python 3.4 or newer
|
||||||
* ``pip`` for Python 3 (Debian package: ``python3-pip``)
|
* ``pip`` for Python 3 (Debian package: ``python3-pip``)
|
||||||
|
* ``pyvenv`` for Python 3 (Debian package: ``python3-venv``)
|
||||||
* ``python-dev`` for Python 3 (Debian package: ``python3-dev``)
|
* ``python-dev`` for Python 3 (Debian package: ``python3-dev``)
|
||||||
* ``libffi`` (Debian package: ``libffi-dev``)
|
* ``libffi`` (Debian package: ``libffi-dev``)
|
||||||
* ``libssl`` (Debian package: ``libssl-dev``)
|
* ``libssl`` (Debian package: ``libssl-dev``)
|
||||||
@@ -36,7 +37,7 @@ Please execute ``python -V`` or ``python3 -V`` to make sure you have Python 3.4
|
|||||||
execute ``pip3 -V`` to check. Then use Python's internal tools to create a virtual
|
execute ``pip3 -V`` to check. Then use Python's internal tools to create a virtual
|
||||||
environment and activate it for your current session::
|
environment and activate it for your current session::
|
||||||
|
|
||||||
python3 -m venv env
|
pyvenv env
|
||||||
source env/bin/activate
|
source env/bin/activate
|
||||||
|
|
||||||
You should now see a ``(env)`` prepended to your shell prompt. You have to do this
|
You should now see a ``(env)`` prepended to your shell prompt. You have to do this
|
||||||
@@ -86,7 +87,7 @@ and head to http://localhost:8000/
|
|||||||
|
|
||||||
As we did not implement an overall front page yet, you need to go directly to
|
As we did not implement an overall front page yet, you need to go directly to
|
||||||
http://localhost:8000/control/ for the admin view or, if you imported the test
|
http://localhost:8000/control/ for the admin view or, if you imported the test
|
||||||
data as suggested above, to the event page at http://localhost:8000/bigevents/2019/
|
data as suggested above, to the event page at http://localhost:8000/bigevents/2018/
|
||||||
|
|
||||||
.. note:: If you want the development server to listen on a different interface or
|
.. note:: If you want the development server to listen on a different interface or
|
||||||
port (for example because you develop on `pretixdroid`_), you can check
|
port (for example because you develop on `pretixdroid`_), you can check
|
||||||
@@ -106,7 +107,7 @@ Execute the following commands to check for code style errors::
|
|||||||
isort -c -rc .
|
isort -c -rc .
|
||||||
python manage.py check
|
python manage.py check
|
||||||
|
|
||||||
Execute the following command to run pretix' test suite (might take a couple of minutes)::
|
Execute the following command to run pretix' test suite (might take a coumple of minutes)::
|
||||||
|
|
||||||
py.test
|
py.test
|
||||||
|
|
||||||
@@ -115,23 +116,14 @@ Execute the following command to run pretix' test suite (might take a couple of
|
|||||||
``NUM`` being the number of threads you want to use.
|
``NUM`` being the number of threads you want to use.
|
||||||
|
|
||||||
It is a good idea to put this command into your git hook ``.git/hooks/pre-commit``,
|
It is a good idea to put this command into your git hook ``.git/hooks/pre-commit``,
|
||||||
for example, to check for any errors in any staged files when committing::
|
for example::
|
||||||
|
|
||||||
#!/bin/bash
|
#!/bin/sh
|
||||||
cd $GIT_DIR/../src
|
cd $GIT_DIR/../src
|
||||||
export GIT_WORK_TREE=../
|
flake8 . || exit 1
|
||||||
export GIT_DIR=../.git
|
isort -q -rc -c . || exit 1
|
||||||
source ../env/bin/activate # Adjust to however you activate your virtual environment
|
|
||||||
for file in $(git diff --cached --name-only | grep -E '\.py$' | grep -Ev "migrations|mt940\.py|pretix/settings\.py|make_testdata\.py|testutils/settings\.py|tests/settings\.py|pretix/base/models/__init__\.py")
|
|
||||||
do
|
|
||||||
echo $file
|
|
||||||
git show ":$file" | flake8 - --stdin-display-name="$file" || exit 1 # we only want to lint the staged changes, not any un-staged changes
|
|
||||||
git show ":$file" | isort -df --check-only - | grep ERROR && exit 1 || true
|
|
||||||
done
|
|
||||||
|
|
||||||
|
This keeps you from accidentally creating commits violating the sdtyle guide.
|
||||||
|
|
||||||
This keeps you from accidentally creating commits violating the style guide.
|
|
||||||
|
|
||||||
Working with mails
|
Working with mails
|
||||||
^^^^^^^^^^^^^^^^^^
|
^^^^^^^^^^^^^^^^^^
|
||||||
@@ -154,10 +146,6 @@ and update the ``*.po`` files accordingly::
|
|||||||
|
|
||||||
make localegen
|
make localegen
|
||||||
|
|
||||||
However, most of the time you don't need to care about this. Just create your pull request
|
|
||||||
with functionality and English strings only, and we'll push the new translation strings
|
|
||||||
to our translation platform after the merge.
|
|
||||||
|
|
||||||
To actually see pretix in your language, you have to compile the ``*.po`` files to their
|
To actually see pretix in your language, you have to compile the ``*.po`` files to their
|
||||||
optimized binary ``*.mo`` counterparts::
|
optimized binary ``*.mo`` counterparts::
|
||||||
|
|
||||||
|
|||||||
|
Before Width: | Height: | Size: 28 KiB |
|
Before Width: | Height: | Size: 45 KiB |
|
Before Width: | Height: | Size: 61 KiB |
|
Before Width: | Height: | Size: 89 KiB |
|
Before Width: | Height: | Size: 64 KiB |
|
Before Width: | Height: | Size: 83 KiB |
@@ -1,88 +0,0 @@
|
|||||||
Translating pretix
|
|
||||||
==================
|
|
||||||
|
|
||||||
pretix has been designed for multi-language capabilities from its start. Organizers can enter their event information
|
|
||||||
in multiple languages at the same time. However, the software interface of pretix also needs to be translated for
|
|
||||||
this to be useful.
|
|
||||||
|
|
||||||
Since we (the developers of pretix) only speak a very limited number of languages, we need help from the community
|
|
||||||
to achieve this goal. To make translating pretix easy not only for software developers, we set up a translation
|
|
||||||
platform at `translate.pretix.eu`_.
|
|
||||||
|
|
||||||
Official and inofficial languages
|
|
||||||
---------------------------------
|
|
||||||
|
|
||||||
In the pretix project, there are three types of languages:
|
|
||||||
|
|
||||||
Official languages
|
|
||||||
are translated and maintained by the core team behind pretix or as part of long-term partnerships. We are
|
|
||||||
committed to keeping these translations up-to-date with new features or changes in pretix and try to offer
|
|
||||||
support in this language.
|
|
||||||
|
|
||||||
Inofficial languages
|
|
||||||
are contributed and maintained by the Community. We ship them with pretix so you can use them, but we can not
|
|
||||||
guarantee that new or changed features in pretix will be translated in time.
|
|
||||||
|
|
||||||
Incubating languages
|
|
||||||
are currently in the process of being translated. They can not yet be selected in pretix by end users on
|
|
||||||
production installations and are only available in development mode for testing.
|
|
||||||
|
|
||||||
Please contact translate@pretix.eu if you think an incubated language should be promoted to an inofficial one or if
|
|
||||||
you are interested in a partnership to make your language official.
|
|
||||||
|
|
||||||
The current translation status of various languages is:
|
|
||||||
|
|
||||||
.. image:: https://translate.pretix.eu/widgets/pretix/-/multi-blue.svg
|
|
||||||
:target: https://translate.pretix.eu/engage/pretix/?utm_source=widget
|
|
||||||
|
|
||||||
|
|
||||||
Using our translation platform
|
|
||||||
------------------------------
|
|
||||||
|
|
||||||
If you visit `translate.pretix.eu`_ for the first time, it admittedly looks pretty bare.
|
|
||||||
|
|
||||||
.. image:: img/weblate1.png
|
|
||||||
:class: screenshot
|
|
||||||
|
|
||||||
It gets better if you create an account, which you will need to contribute translations. Click on "Register" in the
|
|
||||||
top-right corner to get started:
|
|
||||||
|
|
||||||
.. image:: img/weblate2.png
|
|
||||||
:class: screenshot
|
|
||||||
|
|
||||||
You can either create an account or choose to log in with your GitHub account, whichever you like more.
|
|
||||||
After creating and activating your account, we recommend that you change your profile and select which languages you
|
|
||||||
can translate to and which languages you understand. You can find your profile settings by clicking on your name in
|
|
||||||
the top-right corner.
|
|
||||||
|
|
||||||
.. image:: img/weblate3.png
|
|
||||||
:class: screenshot
|
|
||||||
|
|
||||||
Going back to the dashboard by clicking on the logo in the top-left corner, you can select between different lists
|
|
||||||
of translation projects. You can either filter by projects that already have a translation in your language, or you
|
|
||||||
go to the `pretix project page`_ where you can select specific components.
|
|
||||||
|
|
||||||
.. note::
|
|
||||||
|
|
||||||
If you want to translate pretix to a new language that is not yet listed here, you are very welcome to do so!
|
|
||||||
While you technically can add the language to the portal yourself, we ask you to drop us a short mail to
|
|
||||||
translate@pretix.eu so we can add it to all components at once and also make it selectable in pretix itself.
|
|
||||||
|
|
||||||
.. image:: img/weblate4.png
|
|
||||||
:class: screenshot
|
|
||||||
|
|
||||||
Once you selected a component of a language, you can start going through strings to translate. You can start of by
|
|
||||||
clicking the "Strings needing action" line in this view:
|
|
||||||
|
|
||||||
.. image:: img/weblate5.png
|
|
||||||
:class: screenshot
|
|
||||||
|
|
||||||
In the translate view, you can input your translation for a given source string. If you're unsure about your
|
|
||||||
translation, you can also just "Suggest" it or mark it as "Needs editing". If you have no idea, just "Skip". If you
|
|
||||||
scroll down, there is also a "Comments" section to discuss any questions with fellow translators or us developers.
|
|
||||||
|
|
||||||
.. image:: img/weblate6.png
|
|
||||||
:class: screenshot
|
|
||||||
|
|
||||||
.. _translate.pretix.eu: https://translate.pretix.eu
|
|
||||||
.. _pretix project page: https://translate.pretix.eu/projects/pretix/
|
|
||||||
@@ -1,110 +0,0 @@
|
|||||||
Badges
|
|
||||||
======
|
|
||||||
|
|
||||||
The badges plugin provides a HTTP API that exposes the various layouts used to generate PDF badges.
|
|
||||||
|
|
||||||
Resource description
|
|
||||||
--------------------
|
|
||||||
|
|
||||||
The badge layout resource contains the following public fields:
|
|
||||||
|
|
||||||
.. rst-class:: rest-resource-table
|
|
||||||
|
|
||||||
===================================== ========================== =======================================================
|
|
||||||
Field Type Description
|
|
||||||
===================================== ========================== =======================================================
|
|
||||||
id integer Internal layout ID
|
|
||||||
name string Internal layout description
|
|
||||||
default boolean ``true`` if this is the default layout
|
|
||||||
layout object Layout specification for libpretixprint
|
|
||||||
background URL Background PDF file
|
|
||||||
item_assignments list of objects Products this layout is assigned to
|
|
||||||
└ item integer Item ID
|
|
||||||
===================================== ========================== =======================================================
|
|
||||||
|
|
||||||
.. versionchanged:: 1.16
|
|
||||||
|
|
||||||
This resource has been added.
|
|
||||||
|
|
||||||
|
|
||||||
Endpoints
|
|
||||||
---------
|
|
||||||
|
|
||||||
.. http:get:: /api/v1/organizers/(organizer)/events/(event)/badgelayouts/
|
|
||||||
|
|
||||||
Returns a list of all badge layouts
|
|
||||||
|
|
||||||
**Example request**:
|
|
||||||
|
|
||||||
.. sourcecode:: http
|
|
||||||
|
|
||||||
GET /api/v1/organizers/bigevents/events/democon/badgelayouts/ HTTP/1.1
|
|
||||||
Host: pretix.eu
|
|
||||||
Accept: application/json, text/javascript
|
|
||||||
|
|
||||||
**Example response**:
|
|
||||||
|
|
||||||
.. sourcecode:: http
|
|
||||||
|
|
||||||
HTTP/1.1 200 OK
|
|
||||||
Vary: Accept
|
|
||||||
Content-Type: text/javascript
|
|
||||||
|
|
||||||
{
|
|
||||||
"count": 1,
|
|
||||||
"next": null,
|
|
||||||
"previous": null,
|
|
||||||
"results": [
|
|
||||||
{
|
|
||||||
"id": 1,
|
|
||||||
"name": "Default layout",
|
|
||||||
"default": true,
|
|
||||||
"layout": {…},
|
|
||||||
"background": {},
|
|
||||||
"item_assignments": []
|
|
||||||
}
|
|
||||||
]
|
|
||||||
}
|
|
||||||
|
|
||||||
:query page: The page number in case of a multi-page result set, default is 1
|
|
||||||
:param organizer: The ``slug`` field of a valid organizer
|
|
||||||
:param event: The ``slug`` field of a valid event
|
|
||||||
:statuscode 200: no error
|
|
||||||
:statuscode 401: Authentication failure
|
|
||||||
:statuscode 403: The requested organizer does not exist **or** you have no permission to view it.
|
|
||||||
|
|
||||||
.. http:get:: /api/v1/organizers/(organizer)/events/(event)/badgelayouts/(id)/
|
|
||||||
|
|
||||||
Returns information on layout.
|
|
||||||
|
|
||||||
**Example request**:
|
|
||||||
|
|
||||||
.. sourcecode:: http
|
|
||||||
|
|
||||||
GET /api/v1/organizers/bigevents/events/democon/layoutsbadge/1/ HTTP/1.1
|
|
||||||
Host: pretix.eu
|
|
||||||
Accept: application/json, text/javascript
|
|
||||||
|
|
||||||
**Example response**:
|
|
||||||
|
|
||||||
.. sourcecode:: http
|
|
||||||
|
|
||||||
HTTP/1.1 200 OK
|
|
||||||
Vary: Accept
|
|
||||||
Content-Type: text/javascript
|
|
||||||
|
|
||||||
{
|
|
||||||
"id": 1,
|
|
||||||
"name": "Default layout",
|
|
||||||
"default": true,
|
|
||||||
"layout": {…},
|
|
||||||
"background": {},
|
|
||||||
"item_assignments": []
|
|
||||||
}
|
|
||||||
|
|
||||||
:param organizer: The ``slug`` field of the organizer to fetch
|
|
||||||
:param event: The ``slug`` field of the event to fetch
|
|
||||||
:param id: The ``id`` field of the layout to fetch
|
|
||||||
:statuscode 200: no error
|
|
||||||
:statuscode 401: Authentication failure
|
|
||||||
:statuscode 403: The requested organizer/event does not exist **or** you have no permission to view it.
|
|
||||||
@@ -12,5 +12,3 @@ If you want to **create** a plugin, please go to the
|
|||||||
list
|
list
|
||||||
pretixdroid
|
pretixdroid
|
||||||
banktransfer
|
banktransfer
|
||||||
ticketoutputpdf
|
|
||||||
badges
|
|
||||||
|
|||||||
@@ -1,10 +1,48 @@
|
|||||||
.. spelling::
|
|
||||||
Analytics
|
|
||||||
|
|
||||||
List of plugins
|
List of plugins
|
||||||
===============
|
===============
|
||||||
|
|
||||||
A detailed list of plugins that are available for pretix can be found on the
|
The following plugins are shipped with pretix and are supported in the same
|
||||||
`project website`_.
|
ways that pretix itself is:
|
||||||
|
|
||||||
.. _project website: https://pretix.eu/about/en/plugins
|
* Bank transfer
|
||||||
|
* PayPal
|
||||||
|
* Stripe
|
||||||
|
* Check-in lists
|
||||||
|
* pretixdroid
|
||||||
|
* Report exporter
|
||||||
|
* Send out emails
|
||||||
|
* Statistics
|
||||||
|
* PDF ticket output
|
||||||
|
|
||||||
|
The following plugins are not shipped with pretix but are maintained by the
|
||||||
|
same team. We update them regularly to make them compatible with the latest
|
||||||
|
pretix releases:
|
||||||
|
|
||||||
|
* `SEPA direct debit`_
|
||||||
|
* `Pages`_
|
||||||
|
* `Passbook/Wallet ticket output`_
|
||||||
|
* `Cartshare`_
|
||||||
|
* `Fontpack Free fonts`_
|
||||||
|
|
||||||
|
The following closed-source plugins are available to customers of the hosted pretix.eu platform.
|
||||||
|
Please get in touch with the pretix team if you want to have them for your self-hosted
|
||||||
|
pretix installation:
|
||||||
|
|
||||||
|
* Campaign tracking
|
||||||
|
* Integration with Google Analytics and Facebook Pixel
|
||||||
|
* Integration with Slack
|
||||||
|
* Integration with MailChimp
|
||||||
|
|
||||||
|
The following plugins are from independent third-party authors, so we can make
|
||||||
|
no statements about their stability or compatibility:
|
||||||
|
|
||||||
|
* `esPass ticket output`_
|
||||||
|
* `IcePay integration`_
|
||||||
|
|
||||||
|
.. _SEPA direct debit: https://github.com/pretix/pretix-sepadebit
|
||||||
|
.. _Passbook/Wallet ticket output: https://github.com/pretix/pretix-passbook
|
||||||
|
.. _Cartshare: https://github.com/pretix/pretix-cartshare
|
||||||
|
.. _Pages: https://github.com/pretix/pretix-pages
|
||||||
|
.. _esPass ticket output: https://github.com/esPass/pretix-espass
|
||||||
|
.. _IcePay integration: https://github.com/chotee/pretix-icepay
|
||||||
|
.. _Fontpack Free fonts: https://github.com/pretix/pretix-fontpack-free
|
||||||
|
|||||||
@@ -4,21 +4,10 @@ pretixdroid HTTP API
|
|||||||
The pretixdroid plugin provides a HTTP API that the `pretixdroid Android app`_
|
The pretixdroid plugin provides a HTTP API that the `pretixdroid Android app`_
|
||||||
uses to communicate with the pretix server.
|
uses to communicate with the pretix server.
|
||||||
|
|
||||||
.. warning:: This API is **DEPRECATED** and will probably go away soon. It is used **only** to serve the pretixdroid
|
.. warning:: This API is intended **only** to serve the pretixdroid Android app. There are no backwards compatibility
|
||||||
Android app. There are no backwards compatibility guarantees on this API. We will not add features that
|
guarantees on this API. We will not add features that are not required for the Android App. There is a
|
||||||
are not required for the Android App. There is a general-purpose :ref:`rest-api` that provides all
|
general-purpose :ref:`rest-api` that not yet provides all features that this API provides, but will do
|
||||||
features that you need to check in.
|
so in the future.
|
||||||
|
|
||||||
.. versionchanged:: 1.12
|
|
||||||
|
|
||||||
Support for check-in-time questions has been added. The new API features are fully backwards-compatible and
|
|
||||||
negotiated live, so clients which do not need this feature can ignore the change. For this reason, the API version
|
|
||||||
has not been increased and is still set to 3.
|
|
||||||
|
|
||||||
.. versionchanged:: 1.13
|
|
||||||
|
|
||||||
Support for checking in unpaid tickets has been added.
|
|
||||||
|
|
||||||
|
|
||||||
.. http:post:: /pretixdroid/api/(organizer)/(event)/redeem/
|
.. http:post:: /pretixdroid/api/(organizer)/(event)/redeem/
|
||||||
|
|
||||||
@@ -33,33 +22,18 @@ uses to communicate with the pretix server.
|
|||||||
Accept: application/json, text/javascript
|
Accept: application/json, text/javascript
|
||||||
Content-Type: application/x-www-form-urlencoded
|
Content-Type: application/x-www-form-urlencoded
|
||||||
|
|
||||||
secret=az9u4mymhqktrbupmwkvv6xmgds5dk3&questions_supported=true
|
secret=az9u4mymhqktrbupmwkvv6xmgds5dk3
|
||||||
|
|
||||||
You **must** set the parameter secret.
|
You can optionally include the additional parameter ``datetime`` in the body containing an ISO8601-encoded
|
||||||
|
datetime of the entry attempt. If you don't, the current date and time will be used.
|
||||||
|
|
||||||
You **must** set the parameter ``questions_supported`` to ``true`` **if** you support asking questions
|
You can optionally include the additional parameter ``force`` to indicate that the request should be logged
|
||||||
back to the app operator. You **must not** set it if you do not support this feature. In that case, questions
|
|
||||||
will just be ignored.
|
|
||||||
|
|
||||||
You **may** set the additional parameter ``datetime`` in the body containing an ISO8601-encoded
|
|
||||||
datetime of the entry attempt. If you don"t, the current date and time will be used.
|
|
||||||
|
|
||||||
You **may** set the additional parameter ``force`` to indicate that the request should be logged
|
|
||||||
regardless of previous check-ins for the same ticket. This might be useful if you made the entry decision offline.
|
regardless of previous check-ins for the same ticket. This might be useful if you made the entry decision offline.
|
||||||
Questions will also always be ignored in this case (i.e. supplied answers will be saved, but no error will be
|
|
||||||
thrown if they are missing or invalid).
|
|
||||||
|
|
||||||
You **may** set the additional parameter ``nonce`` with a globally unique random value to identify this
|
You can optionally include the additional parameter ``nonce`` with a globally unique random value to identify this
|
||||||
check-in. This is meant to be used to prevent duplicate check-ins when you are just retrying after a connection
|
check-in. This is meant to be used to prevent duplicate check-ins when you are just retrying after a connection
|
||||||
failure.
|
failure.
|
||||||
|
|
||||||
You **may** set the additional parameter ``ignore_unpaid`` to indicate that the check-in should be performed even
|
|
||||||
if the order is in pending state.
|
|
||||||
|
|
||||||
If questions are supported and required, you will receive a dictionary ``questions`` containing details on the
|
|
||||||
particular questions to ask. To answer them, just re-send your redemption request with additional parameters of
|
|
||||||
the form ``answer_<question>=<answer>``, e.g. ``answer_12=24``.
|
|
||||||
|
|
||||||
**Example successful response**:
|
**Example successful response**:
|
||||||
|
|
||||||
.. sourcecode:: http
|
.. sourcecode:: http
|
||||||
@@ -69,70 +43,10 @@ uses to communicate with the pretix server.
|
|||||||
|
|
||||||
{
|
{
|
||||||
"status": "ok"
|
"status": "ok"
|
||||||
"version": 3,
|
"version": 2
|
||||||
"data": {
|
|
||||||
"secret": "az9u4mymhqktrbupmwkvv6xmgds5dk3",
|
|
||||||
"order": "ABCDE",
|
|
||||||
"item": "Standard ticket",
|
|
||||||
"item_id": 1,
|
|
||||||
"variation": null,
|
|
||||||
"variation_id": null,
|
|
||||||
"attendee_name": "Peter Higgs",
|
|
||||||
"attention": false,
|
|
||||||
"redeemed": true,
|
|
||||||
"checkin_allowed": true,
|
|
||||||
"addons_text": "Parking spot",
|
|
||||||
"paid": true
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
**Example response with required questions**:
|
**Example error response**:
|
||||||
|
|
||||||
.. sourcecode:: http
|
|
||||||
|
|
||||||
HTTP/1.1 200 OK
|
|
||||||
Content-Type: text/json
|
|
||||||
|
|
||||||
{
|
|
||||||
"status": "incomplete"
|
|
||||||
"version": 3
|
|
||||||
"data": {
|
|
||||||
"secret": "az9u4mymhqktrbupmwkvv6xmgds5dk3",
|
|
||||||
"order": "ABCDE",
|
|
||||||
"item": "Standard ticket",
|
|
||||||
"item_id": 1,
|
|
||||||
"variation": null,
|
|
||||||
"variation_id": null,
|
|
||||||
"attendee_name": "Peter Higgs",
|
|
||||||
"attention": false,
|
|
||||||
"redeemed": true,
|
|
||||||
"checkin_allowed": true,
|
|
||||||
"addons_text": "Parking spot",
|
|
||||||
"paid": true
|
|
||||||
},
|
|
||||||
"questions": [
|
|
||||||
{
|
|
||||||
"id": 12,
|
|
||||||
"type": "C",
|
|
||||||
"question": "Choose a shirt size",
|
|
||||||
"required": true,
|
|
||||||
"position": 2,
|
|
||||||
"items": [1],
|
|
||||||
"options": [
|
|
||||||
{
|
|
||||||
"id": 24,
|
|
||||||
"answer": "M"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"id": 25,
|
|
||||||
"answer": "L"
|
|
||||||
}
|
|
||||||
]
|
|
||||||
}
|
|
||||||
]
|
|
||||||
}
|
|
||||||
|
|
||||||
**Example error response with data**:
|
|
||||||
|
|
||||||
.. sourcecode:: http
|
.. sourcecode:: http
|
||||||
|
|
||||||
@@ -142,41 +56,13 @@ uses to communicate with the pretix server.
|
|||||||
{
|
{
|
||||||
"status": "error",
|
"status": "error",
|
||||||
"reason": "already_redeemed",
|
"reason": "already_redeemed",
|
||||||
"version": 3,
|
"version": 2
|
||||||
"data": {
|
|
||||||
"secret": "az9u4mymhqktrbupmwkvv6xmgds5dk3",
|
|
||||||
"order": "ABCDE",
|
|
||||||
"item": "Standard ticket",
|
|
||||||
"item_id": 1,
|
|
||||||
"variation": null,
|
|
||||||
"variation_id": null,
|
|
||||||
"attendee_name": "Peter Higgs",
|
|
||||||
"attention": false,
|
|
||||||
"redeemed": true,
|
|
||||||
"checkin_allowed": true,
|
|
||||||
"addons_text": "Parking spot",
|
|
||||||
"paid": true
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
**Example error response without data**:
|
|
||||||
|
|
||||||
.. sourcecode:: http
|
|
||||||
|
|
||||||
HTTP/1.1 200 OK
|
|
||||||
Content-Type: text/json
|
|
||||||
|
|
||||||
{
|
|
||||||
"status": "error",
|
|
||||||
"reason": "unkown_ticket",
|
|
||||||
"version": 3
|
|
||||||
}
|
}
|
||||||
|
|
||||||
Possible error reasons:
|
Possible error reasons:
|
||||||
|
|
||||||
* ``unpaid`` - Ticket is not paid for or has been refunded
|
* ``unpaid`` - Ticket is not paid for or has been refunded
|
||||||
* ``already_redeemed`` - Ticket already has been redeemed
|
* ``already_redeemed`` - Ticket already has been redeemed
|
||||||
* ``product`` - Tickets with this product may not be scanned at this device
|
|
||||||
* ``unknown_ticket`` - Secret does not match a ticket in the database
|
* ``unknown_ticket`` - Secret does not match a ticket in the database
|
||||||
|
|
||||||
:query key: Secret API key
|
:query key: Secret API key
|
||||||
@@ -213,21 +99,18 @@ uses to communicate with the pretix server.
|
|||||||
"variation": null,
|
"variation": null,
|
||||||
"attendee_name": "Peter Higgs",
|
"attendee_name": "Peter Higgs",
|
||||||
"redeemed": false,
|
"redeemed": false,
|
||||||
"attention": false,
|
|
||||||
"checkin_allowed": true,
|
|
||||||
"addons_text": "Parking spot",
|
|
||||||
"paid": true
|
"paid": true
|
||||||
},
|
},
|
||||||
...
|
...
|
||||||
],
|
],
|
||||||
"version": 3
|
"version": 2
|
||||||
}
|
}
|
||||||
|
|
||||||
:query query: Search query
|
:query query: Search query
|
||||||
:query key: Secret API key
|
:query key: Secret API key
|
||||||
:statuscode 200: Valid request
|
:statuscode 200: Valid request
|
||||||
:statuscode 404: Unknown organizer or event
|
:statuscode 404: Unknown organizer or event
|
||||||
:statuscode 403: Invalid authorization key
|
:statuscode 403: Invalid authorization key
|
||||||
|
|
||||||
.. http:get:: /pretixdroid/api/(organizer)/(event)/download/
|
.. http:get:: /pretixdroid/api/(organizer)/(event)/download/
|
||||||
|
|
||||||
@@ -249,7 +132,6 @@ uses to communicate with the pretix server.
|
|||||||
Content-Type: text/json
|
Content-Type: text/json
|
||||||
|
|
||||||
{
|
{
|
||||||
"version": 3,
|
|
||||||
"results": [
|
"results": [
|
||||||
{
|
{
|
||||||
"secret": "az9u4mymhqktrbupmwkvv6xmgds5dk3",
|
"secret": "az9u4mymhqktrbupmwkvv6xmgds5dk3",
|
||||||
@@ -258,32 +140,11 @@ uses to communicate with the pretix server.
|
|||||||
"variation": null,
|
"variation": null,
|
||||||
"attendee_name": "Peter Higgs",
|
"attendee_name": "Peter Higgs",
|
||||||
"redeemed": false,
|
"redeemed": false,
|
||||||
"attention": false,
|
|
||||||
"checkin_allowed": true,
|
|
||||||
"paid": true
|
"paid": true
|
||||||
},
|
},
|
||||||
...
|
...
|
||||||
],
|
],
|
||||||
"questions": [
|
"version": 2
|
||||||
{
|
|
||||||
"id": 12,
|
|
||||||
"type": "C",
|
|
||||||
"question": "Choose a shirt size",
|
|
||||||
"required": true,
|
|
||||||
"position": 2,
|
|
||||||
"items": [1],
|
|
||||||
"options": [
|
|
||||||
{
|
|
||||||
"id": 24,
|
|
||||||
"answer": "M"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"id": 25,
|
|
||||||
"answer": "L"
|
|
||||||
}
|
|
||||||
]
|
|
||||||
}
|
|
||||||
]
|
|
||||||
}
|
}
|
||||||
|
|
||||||
:query key: Secret API key
|
:query key: Secret API key
|
||||||
@@ -294,7 +155,7 @@ uses to communicate with the pretix server.
|
|||||||
.. http:get:: /pretixdroid/api/(organizer)/(event)/status/
|
.. http:get:: /pretixdroid/api/(organizer)/(event)/status/
|
||||||
|
|
||||||
Returns status information, such as the total number of tickets and the
|
Returns status information, such as the total number of tickets and the
|
||||||
number of performed check-ins.
|
number of performed checkins.
|
||||||
|
|
||||||
**Example request**:
|
**Example request**:
|
||||||
|
|
||||||
@@ -314,7 +175,7 @@ uses to communicate with the pretix server.
|
|||||||
{
|
{
|
||||||
"checkins": 17,
|
"checkins": 17,
|
||||||
"total": 42,
|
"total": 42,
|
||||||
"version": 3,
|
"version": 2,
|
||||||
"event": {
|
"event": {
|
||||||
"name": "Demo Converence",
|
"name": "Demo Converence",
|
||||||
"slug": "democon",
|
"slug": "democon",
|
||||||
|
|||||||
@@ -1,111 +0,0 @@
|
|||||||
PDF ticket output
|
|
||||||
=================
|
|
||||||
|
|
||||||
The PDF ticket output plugin provides a HTTP API that exposes the various layouts used
|
|
||||||
to generate PDF tickets.
|
|
||||||
|
|
||||||
Resource description
|
|
||||||
--------------------
|
|
||||||
|
|
||||||
The ticket layout resource contains the following public fields:
|
|
||||||
|
|
||||||
.. rst-class:: rest-resource-table
|
|
||||||
|
|
||||||
===================================== ========================== =======================================================
|
|
||||||
Field Type Description
|
|
||||||
===================================== ========================== =======================================================
|
|
||||||
id integer Internal layout ID
|
|
||||||
name string Internal layout description
|
|
||||||
default boolean ``true`` if this is the default layout
|
|
||||||
layout object Layout specification for libpretixprint
|
|
||||||
background URL Background PDF file
|
|
||||||
item_assignments list of objects Products this layout is assigned to
|
|
||||||
└ item integer Item ID
|
|
||||||
===================================== ========================== =======================================================
|
|
||||||
|
|
||||||
.. versionchanged:: 1.16
|
|
||||||
|
|
||||||
This resource has been added.
|
|
||||||
|
|
||||||
|
|
||||||
Endpoints
|
|
||||||
---------
|
|
||||||
|
|
||||||
.. http:get:: /api/v1/organizers/(organizer)/events/(event)/ticketlayouts/
|
|
||||||
|
|
||||||
Returns a list of all ticket layouts
|
|
||||||
|
|
||||||
**Example request**:
|
|
||||||
|
|
||||||
.. sourcecode:: http
|
|
||||||
|
|
||||||
GET /api/v1/organizers/bigevents/events/democon/ticketlayouts/ HTTP/1.1
|
|
||||||
Host: pretix.eu
|
|
||||||
Accept: application/json, text/javascript
|
|
||||||
|
|
||||||
**Example response**:
|
|
||||||
|
|
||||||
.. sourcecode:: http
|
|
||||||
|
|
||||||
HTTP/1.1 200 OK
|
|
||||||
Vary: Accept
|
|
||||||
Content-Type: text/javascript
|
|
||||||
|
|
||||||
{
|
|
||||||
"count": 1,
|
|
||||||
"next": null,
|
|
||||||
"previous": null,
|
|
||||||
"results": [
|
|
||||||
{
|
|
||||||
"id": 1,
|
|
||||||
"name": "Default layout",
|
|
||||||
"default": true,
|
|
||||||
"layout": {…},
|
|
||||||
"background": {},
|
|
||||||
"item_assignments": []
|
|
||||||
}
|
|
||||||
]
|
|
||||||
}
|
|
||||||
|
|
||||||
:query page: The page number in case of a multi-page result set, default is 1
|
|
||||||
:param organizer: The ``slug`` field of a valid organizer
|
|
||||||
:param event: The ``slug`` field of a valid event
|
|
||||||
:statuscode 200: no error
|
|
||||||
:statuscode 401: Authentication failure
|
|
||||||
:statuscode 403: The requested organizer does not exist **or** you have no permission to view it.
|
|
||||||
|
|
||||||
.. http:get:: /api/v1/organizers/(organizer)/events/(event)/ticketlayouts/(id)/
|
|
||||||
|
|
||||||
Returns information on layout.
|
|
||||||
|
|
||||||
**Example request**:
|
|
||||||
|
|
||||||
.. sourcecode:: http
|
|
||||||
|
|
||||||
GET /api/v1/organizers/bigevents/events/democon/ticketlayouts/1/ HTTP/1.1
|
|
||||||
Host: pretix.eu
|
|
||||||
Accept: application/json, text/javascript
|
|
||||||
|
|
||||||
**Example response**:
|
|
||||||
|
|
||||||
.. sourcecode:: http
|
|
||||||
|
|
||||||
HTTP/1.1 200 OK
|
|
||||||
Vary: Accept
|
|
||||||
Content-Type: text/javascript
|
|
||||||
|
|
||||||
{
|
|
||||||
"id": 1,
|
|
||||||
"name": "Default layout",
|
|
||||||
"default": true,
|
|
||||||
"layout": {…},
|
|
||||||
"background": {},
|
|
||||||
"item_assignments": []
|
|
||||||
}
|
|
||||||
|
|
||||||
:param organizer: The ``slug`` field of the organizer to fetch
|
|
||||||
:param event: The ``slug`` field of the event to fetch
|
|
||||||
:param id: The ``id`` field of the layout to fetch
|
|
||||||
:statuscode 200: no error
|
|
||||||
:statuscode 401: Authentication failure
|
|
||||||
:statuscode 403: The requested organizer/event does not exist **or** you have no permission to view it.
|
|
||||||
@@ -1,8 +1,4 @@
|
|||||||
-r ../src/requirements.txt
|
-r ../src/requirements.txt
|
||||||
sphinx==1.6.*
|
sphinx
|
||||||
sphinx-rtd-theme
|
sphinx-rtd-theme
|
||||||
sphinxcontrib-httpdomain
|
sphinxcontrib-httpdomain
|
||||||
sphinxcontrib-images
|
|
||||||
sphinxcontrib-spelling
|
|
||||||
# See https://github.com/rfk/pyenchant/pull/130
|
|
||||||
git+https://github.com/raphaelm/pyenchant.git@patch-1#egg=pyenchant
|
|
||||||
|
|||||||
|
Before Width: | Height: | Size: 76 KiB |
|
Before Width: | Height: | Size: 90 KiB |
|
Before Width: | Height: | Size: 64 KiB |
|
Before Width: | Height: | Size: 90 KiB |
|
Before Width: | Height: | Size: 103 KiB |
|
Before Width: | Height: | Size: 84 KiB |
|
Before Width: | Height: | Size: 97 KiB |
|
Before Width: | Height: | Size: 120 KiB |
|
Before Width: | Height: | Size: 91 KiB |
|
Before Width: | Height: | Size: 94 KiB |
|
Before Width: | Height: | Size: 65 KiB |
|
Before Width: | Height: | Size: 64 KiB |
|
Before Width: | Height: | Size: 59 KiB |
|
Before Width: | Height: | Size: 98 KiB |
|
Before Width: | Height: | Size: 44 KiB |
|
Before Width: | Height: | Size: 87 KiB |
|
Before Width: | Height: | Size: 84 KiB |
|
Before Width: | Height: | Size: 84 KiB |
|
Before Width: | Height: | Size: 45 KiB |
|
Before Width: | Height: | Size: 34 KiB |
|
Before Width: | Height: | Size: 73 KiB |
|
Before Width: | Height: | Size: 76 KiB |
|
Before Width: | Height: | Size: 49 KiB |
@@ -1,134 +0,0 @@
|
|||||||
addon
|
|
||||||
addons
|
|
||||||
anonymize
|
|
||||||
api
|
|
||||||
auditability
|
|
||||||
auth
|
|
||||||
autobuild
|
|
||||||
backend
|
|
||||||
backends
|
|
||||||
banktransfer
|
|
||||||
boolean
|
|
||||||
booleans
|
|
||||||
cancelled
|
|
||||||
casted
|
|
||||||
checkbox
|
|
||||||
checksum
|
|
||||||
config
|
|
||||||
contenttypes
|
|
||||||
contextmanager
|
|
||||||
cookiecutter
|
|
||||||
cron
|
|
||||||
cronjob
|
|
||||||
cryptographic
|
|
||||||
debian
|
|
||||||
deduplication
|
|
||||||
discoverable
|
|
||||||
django
|
|
||||||
dockerfile
|
|
||||||
durations
|
|
||||||
eu
|
|
||||||
filename
|
|
||||||
filesystem
|
|
||||||
fontawesome
|
|
||||||
frontend
|
|
||||||
frontpage
|
|
||||||
gettext
|
|
||||||
gunicorn
|
|
||||||
hardcoded
|
|
||||||
hostname
|
|
||||||
idempotency
|
|
||||||
incrementing
|
|
||||||
inofficial
|
|
||||||
invalidations
|
|
||||||
iterable
|
|
||||||
Jimdo
|
|
||||||
libpretixprint
|
|
||||||
libsass
|
|
||||||
linters
|
|
||||||
memcached
|
|
||||||
metadata
|
|
||||||
middleware
|
|
||||||
mixin
|
|
||||||
mixins
|
|
||||||
multi
|
|
||||||
multidomain
|
|
||||||
namespace
|
|
||||||
namespaced
|
|
||||||
namespaces
|
|
||||||
namespacing
|
|
||||||
natively
|
|
||||||
nginx
|
|
||||||
NotificationType
|
|
||||||
ons
|
|
||||||
optimizations
|
|
||||||
overpayment
|
|
||||||
param
|
|
||||||
percental
|
|
||||||
positionid
|
|
||||||
pre
|
|
||||||
prepend
|
|
||||||
prepended
|
|
||||||
prepending
|
|
||||||
preprocessor
|
|
||||||
presale
|
|
||||||
pretix
|
|
||||||
pretixdroid
|
|
||||||
pretixpresale
|
|
||||||
prometheus
|
|
||||||
proxied
|
|
||||||
proxying
|
|
||||||
pseudonymize
|
|
||||||
pseudonymization
|
|
||||||
queryset
|
|
||||||
redemptions
|
|
||||||
redis
|
|
||||||
refactored
|
|
||||||
regex
|
|
||||||
renderer
|
|
||||||
renderers
|
|
||||||
reportlab
|
|
||||||
screenshot
|
|
||||||
selectable
|
|
||||||
serializers
|
|
||||||
serializers
|
|
||||||
sexualized
|
|
||||||
startup
|
|
||||||
stdout
|
|
||||||
stylesheet
|
|
||||||
subdirectories
|
|
||||||
subdirectory
|
|
||||||
subdomain
|
|
||||||
subdomains
|
|
||||||
subevent
|
|
||||||
subevents
|
|
||||||
submodule
|
|
||||||
subpath
|
|
||||||
systemd
|
|
||||||
testutils
|
|
||||||
timestamp
|
|
||||||
tuples
|
|
||||||
un
|
|
||||||
unconfigured
|
|
||||||
unix
|
|
||||||
unprefixed
|
|
||||||
untrusted
|
|
||||||
username
|
|
||||||
url
|
|
||||||
versa
|
|
||||||
versioning
|
|
||||||
viewset
|
|
||||||
viewsets
|
|
||||||
webhook
|
|
||||||
webhooks
|
|
||||||
webserver
|
|
||||||
webservice
|
|
||||||
workflow
|
|
||||||
zipcode
|
|
||||||
Datetime
|
|
||||||
Embeddable
|
|
||||||
Hierarkey
|
|
||||||
OAuth
|
|
||||||
SSL
|
|
||||||
Uptime
|
|
||||||
Yay
|
|
||||||
@@ -1,99 +0,0 @@
|
|||||||
.. _event_create:
|
|
||||||
|
|
||||||
Creating an event
|
|
||||||
=================
|
|
||||||
|
|
||||||
After you have created an organizer account, the next step is to create your event. An event is the basic object in
|
|
||||||
pretix that everything is organized around. One event corresponds to one ticket shop with all its products, quotas,
|
|
||||||
orders and settings.
|
|
||||||
|
|
||||||
To create an event, you can click the "Create a new event" tile on your dashboard or the button above the list of
|
|
||||||
events. You will then be presented with the first step of event creation:
|
|
||||||
|
|
||||||
.. thumbnail:: ../../screens/event/create_step1.png
|
|
||||||
:align: center
|
|
||||||
:class: screenshot
|
|
||||||
|
|
||||||
Here, you first need to decide for the organizer the event belongs to. You will not be able to change this
|
|
||||||
association later. This will determine default settings for the event, as well as access control to the event's
|
|
||||||
settings.
|
|
||||||
|
|
||||||
Second, you need to select the languages that the ticket shop should be available in. You can change this setting
|
|
||||||
later, but if you select it correctly now, it will automatically ask you for all descriptions in the respective
|
|
||||||
languages starting from the next step.
|
|
||||||
|
|
||||||
Last on this page, you can decide if this event represents an event series. In this cases, the event will turn into
|
|
||||||
multiple events included in once, meaning that you will get one combined ticket shop for multiple actual events. This
|
|
||||||
is useful if you have a large number of events that are very similar to each other and that should be sold together
|
|
||||||
(i.e. users should be able to buy tickets for multiple events at the same time). Those single events can differ in
|
|
||||||
available products, quotas, prices and some meta information, but most settings need to be the same for all of them.
|
|
||||||
We recommend to use this feature only if you really know that you need it and if you really run a lot of events, not if
|
|
||||||
you run e.g. a yearly conference. You can read more on this feature :ref:`here <subevents>`.
|
|
||||||
|
|
||||||
Once you set these values, you can proceed to the next step:
|
|
||||||
|
|
||||||
.. thumbnail:: ../../screens/event/create_step2.png
|
|
||||||
:align: center
|
|
||||||
:class: screenshot
|
|
||||||
|
|
||||||
In this step, you will be asked more detailed questions about your event. In particular, you can fill in the
|
|
||||||
following fields:
|
|
||||||
|
|
||||||
Name
|
|
||||||
This is the public name of your event. It should be descriptive and tell both you and the user which event you are
|
|
||||||
dealing with, but should still be concise. You probably know how your event is named already ;)
|
|
||||||
|
|
||||||
Short form
|
|
||||||
This will be used in multiple places. For example, the URL of your ticket shop will include this short form of
|
|
||||||
your event name, but it will also be the default prefix e.g. for invoice numbers. We recommend to use some natural
|
|
||||||
abbreviation of your event name, maybe together with a date, of no more than 10 characters. This is the only value
|
|
||||||
on this page that can't be changed later.
|
|
||||||
|
|
||||||
Event start time
|
|
||||||
The date and time that your event starts at. You can later configure settings to hide the time, if you don't want
|
|
||||||
to show that.
|
|
||||||
|
|
||||||
Event end time
|
|
||||||
The date and time your event ends at. You can later configure settings to hide this value completely -- or you can
|
|
||||||
just leave it empty. It's optional!
|
|
||||||
|
|
||||||
Location
|
|
||||||
This is the location of your event in a human-readable format. We will show this on the ticket shop frontpage, but
|
|
||||||
it might also be used e.g. in Wallet tickets.
|
|
||||||
|
|
||||||
Event currency
|
|
||||||
This is the currency all prices and payments in your shop will be handled in.
|
|
||||||
|
|
||||||
Sales tax rate
|
|
||||||
If you need to pay a form of sales tax (also known as VAT in many countries) on your products, you can set a tax rate
|
|
||||||
in percent here that will be used as a default later. After creating your event, you can also create multiple tax
|
|
||||||
rates or fine-tune the tax settings.
|
|
||||||
|
|
||||||
Default language
|
|
||||||
If you selected multiple supported languages in the previous step, you can now decide which one should be
|
|
||||||
displayed by default.
|
|
||||||
|
|
||||||
Start of presale
|
|
||||||
If you set this date, no ticket will be sold before this date. We normally recommend not to set this date during
|
|
||||||
event creation because it will make testing your shop harder.
|
|
||||||
|
|
||||||
End of presale
|
|
||||||
If you set this date, no ticket will be sold after this date.
|
|
||||||
|
|
||||||
If all of this is set, you can proceed to the next step. If this is your first event, there will not be a next step
|
|
||||||
and you are done! If you have already created events before, you will be asked if you want to copy settings from one
|
|
||||||
of them:
|
|
||||||
|
|
||||||
.. thumbnail:: ../../screens/event/create_step3.png
|
|
||||||
:align: center
|
|
||||||
:class: screenshot
|
|
||||||
|
|
||||||
If you do so, all products, categories, quotas and most settings of the other event will be taken over. You should
|
|
||||||
still review them if they make sense for your new event, but it could save you a lot of work. After this step, your
|
|
||||||
event is created successfully:
|
|
||||||
|
|
||||||
.. thumbnail:: ../../screens/event/create_step4.png
|
|
||||||
:align: center
|
|
||||||
:class: screenshot
|
|
||||||
|
|
||||||
You can now fine-tune all settings to your liking, publish your event and start selling tickets!
|
|
||||||