mirror of
https://github.com/pretix/pretix.git
synced 2026-08-06 10:07:50 +00:00
Sync master with master of pretix/pretix@300f8f6 * Automatically sort new products to the end * Drop "squash your commits" from the dev guide * Add variation descriptions and allow to order addons * Link to Django's runserver options in dev docs * Allow <br> tags in rich text * Copy from event: deal with deleted items * Make validate_cart useful together with addons * Fix collapsing panels in the addon choice step * Button text change if addons are present * Update translations * Squash migrations and bump version * Ticket PDFs: Do not hide attendee name if code is hidden * Add a user guide on payments * Link PayPal and Stripe documentation in the respective forms * Hide payment fees if they are all equal to 0.00 * Refs #39 -- New concept of "teams" (#478) * New models * CRUD UI * UI for adding/removing team members * Log display for teams * Fix invitations, move frontend * Drop old models (incomplete) * Drop more old stuff * Drop even more old stuff * Fix tests * Fix permission test * flake8 fix * Add tests fore the new code * Rebase migrations * Fix typo in method name * Update translations * Force ordering of events on dashboard * Fix typos in events * Prepare the pretixdroid API for an async mode in the app * Pretixdroid tests: Ignore microseconds (chopped by mysql) * pretixdroid API: Add related lookups * Add idempotenty nonces to pretixdroid API * pretixdroid: force-accepting unpaids and time display * Marked webfonts as binary files (#487) Webfonts now listed as binary in `.gitattributes`. Works on pretix/pretix#486 * Fix #456 -- Allow products to be excluded from ticket-generation (#483) * Added non-admission setting to event `ticket_download_nonadm` now setting in storage. Still need logic for order page/PDF generation. Works on pretix/pretix#456. * Download button considers `ticket_download_nonadm` Modified Django tags to look at item admission attribute and `ticket_download_nonadm` setting. Works on pretix/pretix#456. * Ticket output for non-admission disabled PDFs/etc. will only be permitted/generated for items with the `admission` attribute, or if the `ticket_download_nonadm` event setting is true. Applies to single and whole-order ticket downloads. Works on pretix/pretix#456. * Fixed product exclusion in PDF output Forgot PDF output was a plugin, now includes same check as base `BaseTicketOutput.generate_order`. Works on pretix/pretix#456 * Mail signature (#485) * added signature field -- no function yet * added mail signature feature * fixed style issue * fixed problem with signature default * added unit test for mail signatures * added unit test for mail signatures * [WIP] Fix #447 -- Sendmail plugin: Create new mail based on an old one (#476) * send old email content to the new one * error key event * test commit * query bad ID * query bad ID * query bad ID * query bad ID * Update pretixdroid API version * Refs #447 -- Extend copying old mails to subject and receipients * Fixed bugs and added test for date range rendering (#488) * fixed bug for same dates, added unit check for daterange * fixed local language override in unit test * Fix #297 -- pretixdroid: Show metrics in the control panel (#481) * add checkin status page add dashboard widget add checkin page under orders * modify checkin logic added new fields in checkin page added filter items * add tests for checkins & minor improvement * support addin_product & noadm setting logic * remove name ordering check test case * Fix #379 -- Add logo to event organizers (#431) * [WIP] Add logo to event organizers. * Fix indentation issues. * Refactor code Refactor code Refactor code * Add new migration * Take files into account for organizer sform (settings form) * Fix grammer * Make bootstrap form errors specific to each fieldset * Display logo on organizer's page * Fix PR issues Fix PR issues Fix PR issues * Reorder imports * Remove conflicting migration * Fix rebase conflict * Fix #41 -- Drag-and-drop ticket editor Undo/redo Useful toolbox Font selection Add text content Use hex for colors JS-side dump and load Save Load layout, proper undo/redo First steps to Python rendering More PDF rendering Copy and paste Buttons for keyboard actions Splash Screen Block unbeforeunload in dirty state Remove debugging output Preview Upload new PDFs via the editor Fix bugs during PDF reload, link in settings form New default ticket Add OpenSans BI Custom fonts, fix tests * Added bootstrap-colorpicker * Allow inline PDF display in CSP header * Add fontpack to list of plugins * Update German translation * Add ticketoutputpdf's assets to MANIFEST.i * Fix migration of old ticket styles * Fix iCal download URL * Multi-line location field, new field for admission time * Admission date and time in editor * Remove icon from "add to calendar" * Try to fix PDF display problems in Safari * Proxy cachedfiles that are used as editor previews * Check Event.presale_is_running in more places * Fix CSS generation with an empty color field * Fix missing placeholders and reformat the sendmail view * Fix bug that lead to wrong payment amount when switching payment method to PayPal later * Update translation
229 lines
6.1 KiB
ReStructuredText
229 lines
6.1 KiB
ReStructuredText
pretixdroid HTTP API
|
|
====================
|
|
|
|
The pretixdroid plugin provides a HTTP API that the `pretixdroid Android app`_
|
|
uses to communicate with the pretix server.
|
|
|
|
.. warning:: This API is intended **only** to serve the pretixdroid Android app. There are no backwards compatibility
|
|
guarantees on this API. We will not add features that are not required for the Android App. There will be
|
|
a proper general-use API for pretix at a later point in time.
|
|
|
|
.. http:post:: /pretixdroid/api/(organizer)/(event)/redeem/
|
|
|
|
Redeems a ticket, i.e. checks the user in.
|
|
|
|
**Example request**:
|
|
|
|
.. sourcecode:: http
|
|
|
|
POST /pretixdroid/api/demoorga/democon/redeem/?key=ABCDEF HTTP/1.1
|
|
Host: demo.pretix.eu
|
|
Accept: application/json, text/javascript
|
|
Content-Type: application/x-www-form-urlencoded
|
|
|
|
secret=az9u4mymhqktrbupmwkvv6xmgds5dk3
|
|
|
|
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 can optionally include 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.
|
|
|
|
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
|
|
failure.
|
|
|
|
**Example successful response**:
|
|
|
|
.. sourcecode:: http
|
|
|
|
HTTP/1.1 200 OK
|
|
Content-Type: text/json
|
|
|
|
{
|
|
"status": "ok"
|
|
"version": 2
|
|
}
|
|
|
|
**Example error response**:
|
|
|
|
.. sourcecode:: http
|
|
|
|
HTTP/1.1 200 OK
|
|
Content-Type: text/json
|
|
|
|
{
|
|
"status": "error",
|
|
"reason": "already_redeemed",
|
|
"version": 2
|
|
}
|
|
|
|
Possible error reasons:
|
|
|
|
* ``unpaid`` - Ticket is not paid for or has been refunded
|
|
* ``already_redeemed`` - Ticket already has been redeemed
|
|
* ``unknown_ticket`` - Secret does not match a ticket in the database
|
|
|
|
:query key: Secret API key
|
|
:statuscode 200: Valid request
|
|
:statuscode 404: Unknown organizer or event
|
|
:statuscode 403: Invalid authorization key
|
|
|
|
.. http:get:: /pretixdroid/api/(organizer)/(event)/search/
|
|
|
|
Searches for a ticket.
|
|
At most 25 results will be returned. **Queries with less than 4 characters will always return an empty result set.**
|
|
|
|
**Example request**:
|
|
|
|
.. sourcecode:: http
|
|
|
|
GET /pretixdroid/api/demoorga/democon/search/?key=ABCDEF&query=Peter HTTP/1.1
|
|
Host: demo.pretix.eu
|
|
Accept: application/json, text/javascript
|
|
|
|
**Example response**:
|
|
|
|
.. sourcecode:: http
|
|
|
|
HTTP/1.1 200 OK
|
|
Content-Type: text/json
|
|
|
|
{
|
|
"results": [
|
|
{
|
|
"secret": "az9u4mymhqktrbupmwkvv6xmgds5dk3",
|
|
"order": "ABCE6",
|
|
"item": "Standard ticket",
|
|
"variation": null,
|
|
"attendee_name": "Peter Higgs",
|
|
"redeemed": false,
|
|
"paid": true
|
|
},
|
|
...
|
|
],
|
|
"version": 2
|
|
}
|
|
|
|
:query query: Search query
|
|
:query key: Secret API key
|
|
:statuscode 200: Valid request
|
|
:statuscode 404: Unknown organizer or event
|
|
:statuscode 403: Invalid authorization key
|
|
|
|
.. http:get:: /pretixdroid/api/(organizer)/(event)/download/
|
|
|
|
Download data for all tickets.
|
|
|
|
**Example request**:
|
|
|
|
.. sourcecode:: http
|
|
|
|
GET /pretixdroid/api/demoorga/democon/download/?key=ABCDEF HTTP/1.1
|
|
Host: demo.pretix.eu
|
|
Accept: application/json, text/javascript
|
|
|
|
**Example response**:
|
|
|
|
.. sourcecode:: http
|
|
|
|
HTTP/1.1 200 OK
|
|
Content-Type: text/json
|
|
|
|
{
|
|
"results": [
|
|
{
|
|
"secret": "az9u4mymhqktrbupmwkvv6xmgds5dk3",
|
|
"order": "ABCE6",
|
|
"item": "Standard ticket",
|
|
"variation": null,
|
|
"attendee_name": "Peter Higgs",
|
|
"redeemed": false,
|
|
"paid": true
|
|
},
|
|
...
|
|
],
|
|
"version": 2
|
|
}
|
|
|
|
:query key: Secret API key
|
|
:statuscode 200: Valid request
|
|
:statuscode 404: Unknown organizer or event
|
|
:statuscode 403: Invalid authorization key
|
|
|
|
.. http:get:: /pretixdroid/api/(organizer)/(event)/status/
|
|
|
|
Returns status information, such as the total number of tickets and the
|
|
number of performed checkins.
|
|
|
|
**Example request**:
|
|
|
|
.. sourcecode:: http
|
|
|
|
GET /pretixdroid/api/demoorga/democon/status/?key=ABCDEF HTTP/1.1
|
|
Host: demo.pretix.eu
|
|
Accept: application/json, text/javascript
|
|
|
|
**Example response**:
|
|
|
|
.. sourcecode:: http
|
|
|
|
HTTP/1.1 200 OK
|
|
Content-Type: text/json
|
|
|
|
{
|
|
"checkins": 17,
|
|
"total": 42,
|
|
"version": 2,
|
|
"event": {
|
|
"name": "Demo Converence",
|
|
"slug": "democon",
|
|
"date_from": "2016-12-27T17:00:00Z",
|
|
"date_to": "2016-12-30T18:00:00Z",
|
|
"timezone": "UTC",
|
|
"url": "https://demo.pretix.eu/demoorga/democon/",
|
|
"organizer": {
|
|
"name": "Demo Organizer",
|
|
"slug": "demoorga"
|
|
},
|
|
},
|
|
"items": [
|
|
{
|
|
"name": "T-Shirt",
|
|
"id": 1,
|
|
"checkins": 1,
|
|
"admission": False,
|
|
"total": 1,
|
|
"variations": [
|
|
{
|
|
"name": "Red",
|
|
"id": 1,
|
|
"checkins": 1,
|
|
"total": 12
|
|
},
|
|
{
|
|
"name": "Blue",
|
|
"id": 2,
|
|
"checkins": 4,
|
|
"total": 8
|
|
}
|
|
]
|
|
},
|
|
{
|
|
"name": "Ticket",
|
|
"id": 2,
|
|
"checkins": 15,
|
|
"admission": True,
|
|
"total": 22,
|
|
"variations": []
|
|
}
|
|
]
|
|
}
|
|
|
|
:query key: Secret API key
|
|
:statuscode 200: Valid request
|
|
:statuscode 404: Unknown organizer or event
|
|
:statuscode 403: Invalid authorization key
|
|
|
|
.. _pretixdroid Android app: https://github.com/pretix/pretixdroid
|