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 Customer API.

EnpointParametersEndpoint Use Case
GET/ Customer By ID

https://api.treez.io/v2.0/dispensary/
dispensary_name/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. ie. 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.
This endpoint allows partners to search for a specific customer using the customer_id also known as the member_id. The member_id is a unique customer facing value.
GET/ Customer by email address

https://api.treez.io/v2.0/dispensary/
dispensary_name/customer/email/email_id
dispensary_name - this information can be pulled from the client's URL. The dispensary name is listed before treez.io in the URL. ie. partnersandbox2.treez.io dispensary name is ‘partnersandbox2’.

email_id - email id is equivalent to a customer’s email address. When using this endpoint, enter an email address to filter your response.

include_image_list - When set to TRUE the imageList array will populate the customer documents uploaded to the profile. If the query parameter is omitted or set to FALSE, the ImageList array will not populate any information.
This endpoint allows partners to search for a specific customer using only their email address.

This endpoint is perfect for searching and identifying existing customer before attempting to create a new customer through your integration.

If there is a typo in the email it will impact what is returned in the response.
GET/ Customer by First and Last Name

https://api.treez.io/v2.0/dispensary/
dispensary_name/customer/firstname/first_name/
lastname/last_name
dispensary_name - this information can be pulled from the client's URL. The dispensary name is listed before treez.io in the URL. ie. partnersandbox2.treez.io dispensary name is ‘partnersandbox2’.

first_name - This path parameter is meant to represent the first name of the customer you are searching for.

Last_Name - This path parameter is meant to represent the last name of the customer you are searching for.

include_image_list - When set to TRUE the imageList array will populate the customer documents uploaded to the profile. If the query parameter is omitted or set to FALSE, the ImageList array will not populate any information.
This endpoint allows partners to search for customers by their first and last name.

This allows for searching and identifying existing customers when you cannot locate them by a phone number, email address or drivers license number.

If either the first or last name are spelled incorrectly it will impact what is returned in the Response.
GET/ Customer by Driver License #

https://api.treez.io/v2.0/dispensary/
dispensary_name/customer/driverlicense/driver_license
Dispensary_name - this information can be pulled from the client's URL. The dispensary name is listed before treez.io in the URL. ie. partnersandbox2.treez.io dispensary name is ‘partnersandbox2’.

driver_license - Using this path parameter allows partners to search for a specific customer by their drivers license number.

include_image_list - When set to TRUE the imageList array will populate the customer documents uploaded to the profile. If the query parameter is omitted or set to FALSE, the ImageList array will not populate any information.
This endpoint allows the partner to search for a specific customer by their drivers license number.

This is typically the most accurate way to locate an existing customer as their license information is the least likely to change over time.
GET/ Customer by Phone #

https://api.treez.io/v2.0/dispensary/
dispensary_name/customer/phone/phone_number
dispensary_name - this information can be pulled from the client's URL. The dispensary name is listed before treez.io in the URL. ie. partnersandbox2.treez.io dispensary name is ‘partnersandbox2’.

phone_number - Partners can use this path parameter to search for a specific customer by phone number.

include_image_list - When set to TRUE the imageList array will populate the customer documents uploaded to the profile. If the query parameter is omitted or set to FALSE, the ImageList array will not populate any information.
This endpoint has the ability to pull up specific customers by their phone number.

This endpoint is ideal for searching and identifying existing customers before attempting to create a new customer through your integration.
GET/ Customer by Sign Up Range

https://api.treez.io/v2.0/dispensary/
dispensary_name/customer/signup/
from/start_date/to/end_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. ie. partnersandbox2.treez.io dispensary name is ‘partnersandbox2’.

start _date & end_date - These two path parameters are meant to define the time range you would like to pull customers for. The proper date format is YYYY-MM-DD.

include_image_list - When set to TRUE the imageList array will populate the customer documents uploaded to the profile. If the query parameter is omitted or set to FALSE, the ImageList array will not populate any information.
This endpoint allows partners to pull a list of customers based on the date that they signed up with a store.

Note: Customers who were imported into Treez during on-boarding may have a default signup date of 2000/01/01. When attempting to pull a list of ALL customers, use a start_date of 2000/01/01.
GET/ Customer by Last_Updated_at

https://api.treez.io/v2.0/dispensary/
dispensary_name/customer/lastUpdated/
after/date_time/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. ie. partnersandbox2.treez.io dispensary name is ‘partnersandbox2’.

date_time - This path parameter is meant to represent the last updated at time you would like to pull customers with. The format for this timestamp is: YYYY-MM-DDTHH:MM:SS.000-07:00

include_image_list - When set to TRUE the imageList array will populate the customer documents uploaded to the profile. If the query parameter is omitted or set to FALSE, the ImageList array will not populate any information.
This endpoint can return a list of customers that have been updated after a specific point in time. The last_updated_at field is updated for a customer whenever a detail in their profile has changed.
GET/ List of Caregivers

https://api.treez.io/v2.0/dispensary/
dispensary_name/customer/caregivers
dispensary_name - this information can be pulled from the client's URL. The dispensary name is listed before treez.io in the URL. ie. partnersandbox2.treez.io dispensary name is ‘partnersandbox2’.This endpoint provides a list of customers who are marked as a caregiver.
POST/ Create Customer

https://api.treez.io/v2.0/dispensary/
dispensary_name/customer/detailcustomer
dispensary_name - this information can be pulled from the client's URL. The dispensary name is listed before treez.io in the URL. ie. partnersandbox2.treez.io dispensary name is ‘partnersandbox2’.The create customer endpoint allows partners to create a new customer profile

Note: Partners should utilize the GET Customer by phone, email, drivers license and/or first name/last name endpoints to check for existing customer profiles before attempting to create a new customer profile to prevent duplicate profiles.
POST/ Update Customer

/dispensary/{dispensary_name}/customer/update/{customer_id}

NOTE: This method will be deprecated. Please use PATCH method (below) for updates to customer records.
dispensary_name - this information can be pulled from the client's URL. The dispensary name is listed before treez.io in the URL. ie. 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.
This endpoint allows partners to edit existing customer profiles. To be able to update an existing account you need the customer_ID (member_id).

It should be noted that the Update Customer endpoint uses a POST for making your required changes. When submitting an update via POST, any value omitted from the call will be overwritten with a null value causing unintended data loss.
PATCH/ Update Customer

/dispensary/{dispensary_name}/customer/update/{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. ie. 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.
This endpoint allows integrators to update specific properties of a customer record by sending only those properties in the payload.
POST/ Merge Customers

/dispensary/{dispensary_name}/customer/merge
dispensary_name - this information can be pulled from the client's URL. The dispensary name is listed before treez.io in the URL. ie. partnersandbox2.treez.io dispensary name is ‘partnersandbox2’.

The request body must Include sourceCustomerId and desinationCustomerID

{ "sourceCustomerId": "{customer_id}", "destinationCustomerId": "{customer_id}" }
This endpoint allows duplicate customers to be merged into a single customer record.

Sample Requests

curl --location --request PATCH 'https://api.treez.io/v2.0/dispensary/partnersandbox2/customer/update/32483' \
--header 'Content-Type: application/json' \
--header 'client_id:  UMCTcZK...' \
--header 'Authorization: Bearer eyJhbGciOiJ...' \
--data-raw '{
        "rewards_balance": 5000
}'