Support

Home Forums Event Espresso Premium Can i POST data to an Event Espresso josn end point to create a ticket booking

Can i POST data to an Event Espresso josn end point to create a ticket booking

Posted: May 5, 2021 at 6:38 pm

Viewing 1 reply thread


TTBC

May 5, 2021 at 6:38 pm

What data do I need to push to an EE API endpoint to create a single ticket purchase on a specific ticket and event?

This is so we can run some free tickets out of the back of another website that can easily use curl to push data into a ticket without haveing to be registered in WordPress.


Tony

  • Support Staff

May 6, 2021 at 6:08 am

Hi there,

What you can do is follow these steps to get started:

1) Review and follow the examples in the documentation:
a) https://github.com/eventespresso/event-espresso-core/blob/master/docs/C–REST-API/ee4-rest-api-introduction.md
Especially important: Learn how to use the discovery endpoints and Authentication.
b) https://github.com/eventespresso/event-espresso-core/blob/master/docs/C–REST-API/ee4-rest-api-writing-data.md

2) Create a registration via Event Espresso’s UI in the WordPress dashboard

3) Review the site’s database tables to see everything that was just written to the database. You’ll note that Event Espresso tables have an _esp_ prefix. Also note that an attendee custom post type is also written to the _posts table, and specific entities within event related tables need to be updated when a registration is added. For example, a ticket’s sold count needs to be incremented when an approved registration is added.

4) Learn how to read/GET the related registration data using the REST API:
https://github.com/eventespresso/event-espresso-core/blob/master/docs/C–REST-API/ee4-rest-api-reading-data.md
https://github.com/eventespresso/event-espresso-core/blob/master/docs/C–REST-API/ee4-rest-api-GET-including-specific-fields-and-related-entities-in-results.md
Here you’ll note how to do GET requests for registration-related data, which you’ll use much of the same syntax for POSTing data.

5) Once you’ve gotten this far, you can start putting together REST API requests to write to the database

Viewing 1 reply thread

The support post ‘Can i POST data to an Event Espresso josn end point to create a ticket booking’ is closed to new replies.

Have a question about this support post? Create a new support post in our support forums and include a link to this existing support post so we can help you.

Event Espresso