Closed DhanshreeA closed 5 months ago
@DhanshreeA I see that the Item
field is numeric, do you have an idea how we can convert it to the known ticket types, e.g. speaker, or business?
Hey @Kislovskiy sorry for not getting to this sooner. The Items API lists the visible name for an item which can help us identify the known ticket types.
Hey @Kislovskiy sorry for not getting to this sooner. The Items API lists the visible name for an item which can help us identify the known ticket types.
ah, cool. Thank you! I build a prototype using the check-in list. I'll open a PR soon. You could take a look 🤓
@Kislovskiy Okay I think we can also identify speakers (with the conference vs tutorial variations)
So, when you query the Orders API with an order code, within positions
you would see two fields of interest (item and variation):
"id": 21385480,
"order": "RCZN9",
"positionid": 1,
"item": 339045,
"variation": 163263,
And when you query the Items API with the item ID 339045, you see a list of variations as a list:
{
"id": 339045,
"category": null,
"name": {
"en": "Presenter"
},
......,
"variations": [
{
"id": 163263,
"value": {
"en": "Speaker"
},
"active": true,
"description": {
"en": "Speaker Ticket - Access to three days of the conference: Wednesday-Friday (19-21 July 2023) + Sprints Weekend.<br>\r\nThank you for choosing EuroPython to share your time and experience with the community. We hope that you have a fantastic time presenting at the conference.<br>\r\nThe ticket is free. If you'd like to support our Finaid Programme - consider buying a ticket. Thanks! :)"
},
"position": 0,
wherein, value gives us the name of the ticket (so Presenter here), and if you look at the variations id, it tells you which type of presenter this person is (in this case, a Speaker... there are other variations it would appear, ie Tutorial presenter, Keynote presenter etc)
Hey, @DhanshreeA. Exactly, thank you for sharing this. I'll open a PR soon, however I found that it's easier to call /checkinlists
endpoint.
e.g.
curl --location 'https://pretix.eu/api/v1/organizers/europython/events/ep2023-staging2/checkinlists/295151/positions?order=M09CT&attendee_name=order%202%20dog' \
--header 'Authorization: Token <TOKEN>'
I'll share the Postman collection
Basic Pretix integration was implemented in 711eeb246fd35baea3ba98d33920a8bfd7370860. Thanks to everyone who was involved in it! 🎉
Authenticating Discord bot with Pretix We can authenticate the app with Pretix with a simple API token (unclear about which permissions are required at this point)
Validating a ticket We can use the Orders API to validate if a user holds a paid ticket, and the type of ticket they hold (if needed). If the status of the Order is
p
(Paid) then we can assume that the user holds a valid ticket. A caveat here would arise if we start charging cancellation fees but I don't think we do that. (Refer to the state diagram here)Fetching an Order We can fetch individual orders using either the order code or filtering by order creation email/company name/attendee email
Determining Ticket type: The Order object contains information about individual products contained within the it as Order Position Resource. The
Item
field within this object should help us identify the ticket type.