Ticket API
INTRODUCTION
Tickets are how customer orders are represented in Treez. The Ticket API allows you to search, create, and update orders for customers in a Treez portal.
Here is a postman collection you can use to start making calls to the Ticket API.
AUTHORIZATION
In order to access the Ticket API, please use the client_id and API key provided to your organization to generate an access_token with the Authorization API.
LIMITATIONS
- Once payments are added to the ticket, the Update Ticket API can’t be used to update information on the ticket.
- When the ticket status is posted as COMPLETED, the only update that can be made in that same call is adding a payment to a ticket. No other changes will be accepted by the Ticket API.
- Refunds can’t be handled or processed using the Ticket API.
- Ticket API cannot process the adding of products and ticket payment in the same request. Products should be added to the ticket first and then the payment should be posted in a separate API call to the [Update Existing Ticket] (https://code.treez.io/reference#updatebyticketidget) endpoint.
- Partial payments for tickets aren’t supported via Ticket API. It can either process the full payments or null. The payment amount posted should equate to data_point - total.
- The GET/ Ticket by Last Updated date can only pull data going back 30 days. If the limit is exceeded, you will not get a successful response back.
- The Ticket API allows you to apply item level discounts but not cart level discounts.
- While using the Create Ticket API endpoint for delivery orders, it should be noted that the configurations in Treez for the delivery zone do not impact the Ticket API. The configs in question are Delivery Radius, Included Zip Codes, and Excluded Zip Codes. These configurations can be found in Treez by going to Configuration>Config Page>eCommerce>Display Preferences. Partners should coordinate on the approved delivery zone with their Clients.
- API response limit is 50 results per request call.
- Rate limit is 10TPS per Treez location.
Ticket Preview Behavior
Ticket preview API may show different totals sometimes. The reason is related to the tax total. Different inventory batches may have different taxes applied to them. There could be a time gap when you previewed the order and you placed the order. The batch you previewed the order total from may have been sold out and the order might have been placed from the different batch having different taxes.
ERROR RESPONSES
Listed below are few commonly experienced errors.
Error Key | Error Description |
---|---|
VALIDATION_ERROR | When the POST/PUT request fails to meet the applied validation checks. |
PARTIAL_PAYMENT_NOT_SUPPORTED | In case of less or more payment amount is posted than expected i.e. total. |
CAN NOT UPDATE 'PAID' TICKET | If trying to update a 'PAID' ticket. A new ticket should be created for new orders. In the case of refunds associated, those need to be handled manually in the store. |
LOCATION_NAME DOES NOT MATCH | In case the product demanded is not located at the specified location. |
INSUFFICIENT_SELLABLE_QUANTITY | Quantities entered is more than the available quantities for the item. Request can't be fulfilled. |
RESPONSE_LIMIT_EXCEEDED | Response limit entered exceeds the maximum limit. Please do not exceed 50 per request call. |
WORKFLOW
Updated about 2 years ago