Product APIs

🚧

NEW! Sellable_Quantity Cap

A cap has been applied to the Sellable_Quantity field in the Product API. The cap has been set to 30. If it should change, Partners will be notified.

If a product has more units available for sale than the Sellable_Quantity cap, the cap value will be displayed (currently 30). The Sellable_Quantity field will show the true inventory level once the unit count drops below the cap.

πŸ“˜

Page Size + GET/List of Products

When using the GET/List of Products endpoint, Treez recommends excluding the page_size as a query parameter. When page_size is excluded Treez will return the maximum amount of information possible by default. Having this set up will ensure that your integration is not making any unnecessary calls to our mutual customer's site. The current maximum page_size for the GET/ List of Products endpoint is 1000 for most dispensary instances, with a few specific exceptions.

INTRODUCTION

Using the Product API you can easily create new products in the POS system. The Product API also allows you to update the details of an existing product, search for a specific product, and download a list of all existing products.

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

AUTHORIZATION

In order to access the Product API, please use the client_id and API key provided to your organization to generate an access_token with the Authorization API.

LIMITATIONS

  • You can’t create an additional data fields for a product.
  • You can’t set a field as required.
  • You can’t adjust the inventory for a product when you create or update a product.
  • You can’t add a product image when you create or update a product. Call the Product Image endpoint separately to add an image.
  • Rate limit is 10TPS per Treez location
  • Each product variant(s) are a separate product and have their own unique id. This is well-matched with the product module in the POS portal.

UPLOAD A PRODUCT IMAGE VIA API

Treez allows uploading an image via API.

https://api.treez.io/v2.0/dispensary/{dispensary_name}/product/{product_id}/image/upload

DETAILS:

  • Upload of gif, jpg, and png images is supported
  • Authorization is required
  • Image must be uploaded against a valid product_id
  • Only 1 image upload per call
  • File size cannot be larger than 5 MB
  • Cannot submit an empty file
  • Content-Type must be 'multipart/form-data'
  • Specify the image name and (optional) path using the 'form' parameter
curl --request POST \
     --url https://api.treez.io/v2.0/dispensary/partnersandbox2/product/4e455ece-120a-4286-907f-58503115fa13/image/upload \
     --header 'authorization: bearer o96wJz2jwb...' \
     --header 'client_id: UMCTcZKXUj...' \
     --header 'content-type: multipart/form-data' \
     --form [email protected]
{
    "resultCode": "SUCCESS",
    "resultReason": null,
    "resultDetail": null,
    "data": {
        "url": "https://treezpartnersandbox2.s3.amazonaws.com/product/1e43a152-f84f-4022-a2c6-0c66c86e9e7..."
    }
}

Pagination: page_count and total_count explained

  • The page_count value provides the count of product records on the current page.
  • The total_count value is the total number of product records in the dispensary instance.
  • To determine the number of pages of records that are available, divide total_count by page_count.
  • All pages will show the same page_count with exception of the last page if there is a remainder that's less than the max page size.
  • Calling a page number that is out of range will return a 200 response with page_count=0 and total_count=0.