Available Endpoints

This page provides the various endpoints available to the partner and the capabilities of that endpoint.

Here is a postman collection you can use to start making calls to the Ticket API.

EndpointParametersEndpoint Use Case
GET/ Ticket by Ticket_ID

https://api.treez.io/v2.0/dispensary/
dispensary_name/ticket/ticket_id
dispensary_name - this information can be pulled from the client's URL. The dispensary name is listed before treez.io in the URL. (i.e., partnersandbox2.treez.io dispensary name is ‘partnersandbox2’).

ticket _id - is a unique id assigned to every ticket. This ID is NOT customer facing and can be accessed through Treez’s Ticket API responses.
This endpoint allows partners to pull up all available information regarding a specific ticket and will only return one ticket at a time.
GET/ Ticket by Order Number

https://api.treez.io/v2.0/dispensary/
dispensary_name/ticket/ordernumber/order_number
dispensary_name - this information can be pulled from the client's URL. The dispensary name is listed before treez.io in the URL(i.e. partnersandbox2.treez.io dispensary name is ‘partnersandbox2’).

order_number - the order number is a customer facing an alphanumeric number that is assigned to every order placed in Treez.
This endpoint allows partners to pull up all available information regarding a specific ticket and will only return one ticket at a time.
GET/ Ticket by Customer ID

https://api.treez.io/v2.0/dispensary/dispensary_name/
ticket/customer/customer_id
dispensary_name - this information can be pulled from the client's URL. The dispensary name is listed before treez.io in the URL (i.e., partnersandbox2.treez.io dispensary name is ‘partnersandbox2’).

customer_id - this ID is a unique identifier that is associated with each customer in Treez. Customer ID is a customer facing value, also referred to as the member ID.

hide_empty_tickets - this optional parameter will allow the partner to hide any tickets that have no ticketlines present from the response.
This endpoint can be used to pull multiple tickets that are associated with a customer ID.
GET/ Ticket by Order_Status

https://api.treez.io/v2.0/
dispensary/dispensary_name/ticket/
status/order_status/page/page_number/
pagesize/page_size?sort_by_field=lastUpdateAt&sort_order=desc
dispensary_name - this information can be pulled from the client's URL. The dispensary name is listed before treez.io in the URL (i.e., partnersandbox2.treez.io dispensary name is ‘partnersandbox2’).

Order_status - Order status reads the current stage of the order in fulfillment. The accepted values for this query parameter are:
VERIFICATION_PENDING
AWAITINGPROCESSING
INPROCESS
PACKEDREADY
OUTFOR_DELIVERY
COMPLETED
CANCELED
REMOVED
* PREVIEW

hide_empty_tickets - this optional parameter will allow the partner to hide any tickets that have no ticketlines present from the response.

sort_by_field=lastUpdateAt - this optional parameter returns results sorted by Last Update instead of Create Date.

sort_order - this optional parameter is used in conjunction with "sort_by_field=lastUpdateAt" to specify sort direction. Allowed values are "asc" and "desc"
This endpoint allows partners to easily search through the various stages of fulfillment to see what ticket are in what stage.
GET/ Ticket by Open Date

https://api.treez.io/v2.0/dispensary/
dispensary_name/ticket/opendate/
opendate/page/page_number/pagesize/page_size
dispensary_name - this information can be pulled from the client's URL. The dispensary name is listed before treez.io in the URL (i.e., partnersandbox2.treez.io dispensary name is ‘partnersandbox2’)

opendate - the date a ticket was opened (created). Accepted format for this parameter is YYYY-MM-DD.

hide_empty_tickets - this parameter will allow the partner to hide any tickets that have no ticketlines present from the response.
This endpoint it will return all ticket data for tickets which were opened (created) on the date specified.

The tickets returned can be in any status, so long as they were opened on the date specified in the requests.

Note: Tickets can have a closedate after their opendate.
GET/ Ticket by Close Date

https://api.treez.io/v2.0/dispensary/
dispensary_name/ticket/closedate/
closedate/page/page_number/pagesize/page_size
dispensary_name - this information can be pulled from the client's URL. The dispensary name is listed before treez.io in the URL (i.e., partnersandbox2.treez.io dispensary name is ‘partnersandbox2’).

closedate - the date the ticket was marked as completed. The accepted format for this field is YYYY-MM-DD.

hide_empty_tickets - this parameter will allow the partner to hide any tickets that have no ticketlines present from the response.
This endpoint will return all tickets completed on the selected date. This endpoint is the best way to get a list of tickets completed on a certain date.

*Note: Tickets can have an opendate prior to their completed date.
GET/ Tickets by Last Updated At

https://api.treez.io/v2.0/dispensary/
dispensary_name/ticket/lastUpdated/
after/last_updated_date/page/
page_number/pagesize/page_size
dispensary_name - this information can be pulled from the client's URL. The dispensary name is listed before treez.io in the URL (i.e., partnersandbox2.treez.io dispensary name is ‘partnersandbox2’).

last_updated_date - time stamp associated to a ticket after it gets updated. This field will only change after a ticket has been updated. Format that is accepted: YYYY-MM-DDTHH:MM:SS.000-07:00. This endpoint can only pull data going back 30 days.

hide_empty_tickets - this parameter will allow the partner to hide any tickets that have no ticketlines present from the response.
This endpoint is helpful when you are looking to pull a list of tickets that were updated after a certain date and time.
POST/ Preview Ticket

https://api.treez.io/v2.0/dispensary/
dispensary_name/ticket/previewticket
dispensary_name - this information can be pulled from the client's URL. The dispensary name is listed before treez.io in the URL (i.e., partnersandbox2.treez.io dispensary name is ‘partnersandbox2’).Using this endpoint will allow partners to submit pseudo tickets to Treez and get an accurate response from the API. This API is helpful because it allows you to see the API response for a particular request without creating a real ticket.

This should be used to check product availability, taxes, ticket totals (will include automated discounts setup in Treez) and purchase limits (where available) resulting from the contents of the preview request before submitting a real ticket. The ticket is calculated exactly as a real ticket would be.

Note: Ticket Preview does NOT reserve inventory associated with the request.
POST/ Create Ticket

https://api.treez.io/v2.0/dispensary/
dispensary_name/ticket/detailticket
dispensary_name - this information can be pulled from the client's URL. The dispensary name is listed before treez.io in the URL (i.e., partnersandbox2.treez.io dispensary name is ‘partnersandbox2’).This endpoint allows partners to generate a new ticket in Treez. The ticket information is passed through the body of the request.

*Note: Create Ticket reserves inventory associated with the request.
PUT/ Update Ticket

https://api.treez.io/v2.0/dispensary/
dispensary_name/ticket/update/ticket_id
dispensary_name - this information can be pulled from the client's URL. The dispensary name is listed before treez.io in the URL (i.e., partnersandbox2.treez.io dispensary name is ‘partnersandbox2’).

ticket _id - is a unique id assigned to every ticket. This ID is NOT customer facing and can be accessed through Treez’s API responses.
This endpoint allows the partner to update an existing ticket. Updates to a ticket can include:
add/remove/change customer associated to a ticket (customer_id)
adding/removing products
adding a POS discount
updating payment status
updating ticket status