Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

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'

...

A pseudo-code example of what you probably want to do

 

Code Block
$orders = get_pending_orders_from_api();
foreach ($orders as $order) {
    $can_accept_order = true;
    foreach ($order->items as $item) {
        $tickets_are_available = check_our_inventory_for_availability($item->ticket_group->remote_id, $quantity);
        if (!$tickets_are_available) {
            $can_accept_order = false;
        }
    }
    if ($can_accept_order) {
        accept_order_with_tevo($order->id);
    } else {
        notify_someone_we_cannot_confirm_tevo_order();
    }
}

 


Differentiating Order Types

...

curl -H 'X-Token: FsxRk6qxJgVn6qzsgPQznyvVNykPwd22' \
     -H 'X-Signature: RFajHc97ooCUqQUAPPXVAmrapqVnunmcLFZP4a8ZVHJs' \
-H '
Accept: application/json' \
-d '{"reviewer_id":12345}' \
--url 'https://api.ticketevolution.com/v9/orders/{order_id}/accept'

...

curl -H 'X-Token: FsxRk6qxJgVn6qzsgPQznyvVNykPwd22' \
     -H 'X-Signature: Lyu2RxCtxYNZvJJXwDQbquoCcHB3gchHJWpaKkB6KBjk' \
-H 'Accept: application/json' \
--url 'https://api.ticketevolution.com/v9/orders/{order_id}/items/{item_id}/add_etickets'
-d '{"files":["<base64-encoded file>","<another base64-encoded file>"]}'

...