Processing Orders via Polling

Polling the TEvp API for new orders is the least desirable way to know about new orders and is only recommended as a fail-safe to webhooks. Since this should never be the primary way to know about new orders, you shoudl only poll the API for new orders every 5-10 minutes.

Retrieve Orders With a state of pending and a type of Order

You can retrieve all your orders from the API, but for the purpose of automatically processing orders you want to filter to only ones with a state of pending. Additionally, if the brokerage is using our API for their website you may wish to filter out those orders by also including direct_buyer_type=Office.

curl -H 'X-Token: FsxRk6qxJgVn6qzsgPQznyvVNykPwd22' \ -H 'X-Signature: WGiennHhZLefDmeUyAfvamiGkjEK77PXjMyyNxkdVswf' \ -H 'Accept: application/json' \ --url 'https://api.ticketevolution.com/v9/orders?state=pending&type=Order'

 

The result of that all will be an array of orders, even if there is only one.

You will want to loop through that list of orders processing each one. Each order will also have an array named items (even if there is only one). Each item will be a set of tickets identified by the remote_id which was provided to us in the upload as the unique identifier for that set of tickets, usually in a column named TicketID.