All Collections
LeafLink Integration
Distru + LeafLink Integration Guide
Distru + LeafLink Integration Guide

How to set up and use the Distru + LeafLink integration

Azam Khan avatar
Written by Azam Khan
Updated over a week ago

TITLE: Distru + LeafLink Integration Guide

PURPOSE: The Distru + LeafLink integration streamlines your order fulfillment by keeping inventory levels accurate, reducing manual data entry and allowing you to bypass Metrc to create transfers.



  • LeafLink - a wholesale management platform that connects cannabis brands and retailers; Distru shares an integration option with users who also utilize LeafLink

OVERVIEW: This article will assist in setting up the initial synchronization between Distru and LeafLink, including how to sync data between the two apps for inventory and sales orders.

Already on the integration? Read this article for additional tips for success.

Syncing Info

What Syncs between the two platforms?

  • LeafLink sales reps will sync to Distru users

  • LeafLink products will sync to Distru products (and vice versa)

  • LeafLink orders will sync to Distru sales orders

  • Distru inventory levels will sync to LeafLink inventory levels

  • Optional: Distru Product Sale prices will sync to the relevant Leaflink Product (and vice versa)

  • Optional: Distru Invoice payments will sync Order Payments on Leaflink

Sync Times

Pro Tip: You may enable faster syncing times for Orders and Products in Settings once you set up the integration. See how to here.

Sync Errors

If any errors occur when orders, products or inventory try to sync, we will send an email to the Distru company admins. You can also add error recipient emails in the integration settings. Check your email, or make sure your company admin knows to check their email for errors.

Here's an example error email:

How to set up the integration

In LeafLink:

  1. Settings → Applications → Click Create an App

    1. App Name: Distru Integration

    2. Developer Email: Add your email

    3. Describe the goal of your application: Distru sync

    4. Permissions: Select “Read & Write” for Orders, Products, and Customers

    5. Click “Create App”

    6. Copy API Key

In Distru

  1. Go to Settings → Integrations → LeafLink

  2. API Key tab: Paste the LeafLink API Key (do not type by hand) and hit enter

  3. Users tab: Map each Distru user to the associated LeafLink user (if users are not assigned, orders will not come through)

  4. Settings tab:

    • Status after which price changes to the order in LeafLink should be ignored in Distru - choose the status where changing pricing in LeafLink should not reflect in Distru. Note, only the pricing will be ignored, not other fields.

    • Location to use when syncing available inventory to LeafLink - pick any location where your inventory is located. You can pick multiple locations. If left blank, it will pull inventory from all locations in Distru.

    • Use customer's default inventory source as Sales Order inventory source - If you have certain customers who must have inventory fulfilled from a certain location, you can set the Default Inventory Source on their Distru Company. Turn this toggle on to automatically use that inventory source for orders from that customer

    • Sync Distru Sale Price to Leaflink Wholesale Price - Toggle on to sync the price of your Distru products to their linked Leaflink products. Distru's required field is called "Sale Price", and Leaflink's required field is called "Wholesale Price". With this toggle on, we will update and sync the two fields whenever there is a change to either side. If 'Sell in Multiples' is enabled for this product, the sale price in Distru will calculate and adjust based on the Units Per Case entered under the LeafLink tab while editing the product.

    • Sync payments recorded in Distru to LeafLink - If toggled on, Invoice Payments in Distru will create an Order Payment in Leaflink. Deleting an Invoice Payment in Distru will post a negative Order Payment in Leaflink. Payments DO NOT sync from Leaflink to Distru, only from Distru to Leaflink. Toggling on will not sync payments posted before the setting was turned on.

🔑 Key to success: Make sure all of your sales reps in LeafLink are connected to Distru users, otherwise orders will not sync

How to enable faster sync times for products and orders

In LeafLink:

  1. Settings → Developer Options tab → Click +Add Webhook (If you don't see developer options, you might need to have a LeafLink user with full permissions to check the company settings and reveal the "developers options" tab)

  2. Copy/paste this name exactly: Distru products and orders

  3. Check "Enabled" box and both Type boxes

  4. Click "Add Webhook" button; this should successfully create a Webhook

  5. Click "Generate Key" under the Company Webhook Key section

  6. You'll see a dialog box, click OK to confirm you want to generate a Webhook key

  7. You'll now see a webhook key populated. Double click it to copy the key

In Distru:

  1. Go to Settings → Integrations → LeafLink

  2. In the API tab → LeafLink Webhook Key field: copy/paste the webhook Key (do not type by hand) and hit enter

How to Sync Products

There are two places to sync products:

  1. In the integration settings page

  2. On the product form

How to sync products in the integration settings:

  1. In Distru, go to Settings → Integrations → LeafLink

  2. Click the Unlinked Products tab. You'll see Distru will automatically suggest products to link

  3. You can also select a different product from the dropdown by clicking in the product field

  4. As soon as you link a product, it will lock. To unlock it, you must click "Unlink"

  5. Once products are linked, they'll move to the "Linked Products" tab

How to sync a new or existing Distru product to a LeafLink product on the product form:

Create a product in Distru, or edit an existing product

Click the LeafLink tab

Enable “Select the LeafLink product to connect this Distru product to”

Click “Create LeafLink product”

Fill in all required fields, noting that a LeafLink product has many fields, but Distru only allows you to fill in a subset of them:

  1. Name

  2. SKU

  3. Description

  4. enable or disable 'Show Inventory Quantity to Buyers'

  5. LeafLink License

  6. LeafLink Brand

  7. LeafLink Product Line

  8. LeafLink Category

  9. LeafLink Subcategory

  10. Inventory Management

  11. Wholesale Price

  12. Sale Price

  13. Retail Price

  14. Minimum and Maximum Order (Units)

  15. LeafLink Strain Classification

  16. LeafLink Strain

  17. Unit Type: this is set by Distru based on the unit type of the Distru product. If the unit type of the Distru product is not supported in LeafLink (i.e. liters, cartridges, etc), the LeafLink unit type will be Unit.

  18. Sell in Multiples (and Units Per Case, if Sell in Multiples is enabled)

NOTE: You can update any of the fields above for a LeafLink product which is connected to a Distru product. Distru will then push those updates to LeafLink.

Click Update Product and new product will sync to LeafLink after 10 minutes

How to sync an existing LeafLink product to Distru on the product form:

Create a new product in Distru, fill in details and click Create Product.

NOTE: A Distru product can only be connected to an existing LeafLink product if both have the same unit type.

Edit the product and click the LeafLink tab

Enable “Select the LeafLink product to connect this Distru product to”

Select the corresponding LeafLink product

Click Update product and wait 10 minutes for it to sync to LeafLink

Additional Product Syncing Info

  • LeafLink products can be configured to be sold in Cases. For example, the product in the screenshot below is configured to be sold in cases of 10 units each. However, products configured to be sold in cases can also be sold in single units.

Screenshot 2021-01-05 at 16.59.40
  • A LeafLink product and a Distru product can be connected to each other and still have different names, prices, even SKUs. At least for now. This is subject to change of course.

  • You can disconnect a Distru product from its LeafLink product.

  • In the Products table, you’ll see a “LeafLink Product” column:

    • It will be empty for non-LeafLink-synced products

    • It will show the name and hyperlink to LeafLink product page for LeafLink-synced products

✅ Pro Tip: Need to make changes to products? Always update the following fields in Distru, not in LeafLink: Product name, Price, SKU & Unit type

✅ Pro Tip: You can only link one LeafLink product to one Distru product. If you have more than one strain, for example, for a single product, you can create a Product Line in LeafLink and add it as a "Variety"

How to Sync Customers

Automatic Syncing:

If you have customers in LeafLink that match enough information (i.e. name, addresses, license, etc.) with an existing Company in Distru, these customers will automatically link when the first Sales Order is synced.

Once those customers are mapped, billing and shipping addresses will populate only if that customer has one location. If there are multiple locations, the billing and shipping addresses will not populate, you'll have to select those manually in the Sales Order.

You can always edit the LeafLink Customer field in the Distru Company if the automatic sync didn't link the correct company.

Manual Syncing:

For a new or existing customer in LeafLink that does not exist in Distru:

  1. When a LeafLink order comes in with a new or existing LeafLink customer and this company doesn’t exist in Distru yet, the Distru user has to manually fill in the Customer name in the Sales Order. This will create a new Company in Distru. Moving forward, Distru will always associate that LeafLink customer with the newly created Distru Company.

  2. Then in the Companies section in Distru, fill in all additional details about that customer themselves. Distru doesn’t do any pre-filling of fields like company name, address, license number, etc.

  3. Once the user makes the company selection in the sales order form, it forms an association between the Distru company and the LeafLink customer.

  4. In the future if an order comes from the same customer in LeafLink, the company would be automatically filled out in the order in Distru.

  5. When an order is synced, you may change the customer in Distru. Moving forward, the new company will be associated with the company in LeafLink, but won't change the company on old orders.

In Distru there are 2 new columns available on the Companies table page: “LeafLink Customer” and “LeafLink Brand”

How to Sync Orders

  1. An order is manually created in LeafLink by a sales rep or a buyer

  2. That order is fetched by Distru and created if the following conditions are met:

    1. The LeafLink order has at least one sales rep attached to it

    2. All the sales reps in the LeafLink order are connected to Distru users.

    3. All products in the LeafLink order are connected to Distru products and have sufficient inventory.

    4. If one of the above criteria is not met, an email will be sent to the Distru admins of the company and error recipient emails explaining why the Distru did not auto-create a sales order.

  3. SO customer:

    1. If the LeafLink order customer is connected to a Distru company, the auto-created Distru SO will have that Distru company as a customer. Otherwise, the SO will be created without a customer and when the user sets a customer on the SO form, that Distru company will be connected to the LeafLink customer moving forward as mentioned earlier in the Customer Sync section.

  4. SO location:

    1. A company-wide setting allows Distru users to specify a default inventory location for all LeafLink-synced SOs

    2. If this setting is not set to any Location, the SO will be auto-created without one.

  5. SO owner:

    1. when auto-creating the SO, Distru will set the SO owner to the Distru user connected to the LeafLink order sales rep.

    2. if the LeafLink order has multiple sales reps, one will be selected at random.

  6. SO tax:

    1. if the LeafLink order has a tax and there is a Distru tax with the same percentage, Distru will add the tax to the Distru SO. Otherwise the SO will have no tax.

  7. SO credit:

    1. If you apply a LeafLink credit to an order, it will appear on the Distru order as a discount that is not editable, however you can edit the credits in LeafLink and it will sync over to Distru.

  8. Internal and external notes in the LeafLink order are copied onto the SO.

  9. Discount and shipping charge in the LeafLink order are copied onto the SO.

  10. LeafLink order items with negative price are added as discounts on SOs.

  11. Distru delivery date needs to be filled in, in order for the ship date to sync in LeafLink.


  • When a single LeafLink order contain both medical and recreational products, LeafLink currently splits the order into separate orders in LeafLink: one order containing the medical products and the other containing the recreational products. As a result, Distru will also have two sales orders created (one for the medical products, one for the recreational products) once the LeafLink order syncs to Distru and meets the requirements previously mentioned.

  • While Distru typically consolidates duplicated, matching lines on a sales order into a single line item with combined quantities, however LeafLink supports having duplicate line items on a sales order. Therefore, Distru sales orders that are created from LeafLink-synced orders, Distru will retain the line item layout that the LeafLink order has designated instead of Distru combining these duplicate lines into a single sales order line item.

Sales Order Status Mapping

Updating Orders: When to update in LeafLink and when to update in Distru

  • Don’t change or delete order items in LeafLink if they have already been partially or fully fulfilled in Distru. Instead, change them or delete them in Distru.

  • Don't add new order item to LeafLink-synced orders in Distru and/or in LeafLink, if the order is past processing status.

  • Don’t add new order items in LeafLink once the Distru order has completed processing.

  • Don’t reject the LeafLink order if the Distru order is Ready to ship or beyond. Instead, do cancel the order in Distru.

  • Deleting a LeafLink-synced Distru SO will unsync the order in LeafLink. You'll also have the option to Reject the order you want to delete in LeafLink.

  • You may change the inventory source on individual orders in Distru once the order has synced by selecting a different location under "Inventory Source" on the top of the order form

  • When combining orders in LeafLink that have already been synced to Distru, the orders will move to Canceled status and the combined order will sync as a new order in Distru.

Deleting Orders that have synced:

  • If you need to delete an order that has synced from LeafLink to Distru, you may delete the Sales Order in Distru

  • You have the option to Reject the associated order in LeafLink

  • If you choose not to reject the associated order in LeafLink, it will remain in the Submitted status in LeafLink. You may resync the same order by editing the order in LeafLink, and this will sync as a brand new Sales Order in Distru.

✅ Pro Tip: In LeafLink make sure "Require Order Payment Term" is disabled, otherwise orders will remain in Submitted status and require a manual adjustment to payment terms for every order:

✅ Pro Tip: LeafLink order numbers will appear on all Distru Sales Order, Invoice and Shipping Manifest PDFs. You can also search for LeafLink order numbers in the Sales Order dashboard and table.

How to Transfer Orders in Metrc

There are two ways to create a Metrc transfer:

1. Create a transfer template

  • Open the Sales Order and click the three dots next to the order number

  • Select Create Transfer Template

  • Fill in the details and Create Transfer Template

  • In Metrc, go to Transfers → Templates. The name will be Sales Order number from Distru. Click Use

  • Make any necessary changes, then Register Transfer

  • Once the outgoing transfer has been created in Metrc, Distru will detect it and automatically match it to the Sales Order and mark it as “Completed” in Distru and LeafLink.

2. Manually match with a Metrc Transfer

  • Open the Sales Order and click the three dots next to the order number

  • Select Match with Metrc Transfer

  • Select transfer to match the Sales Order with

  • Add packages for each line item (note you can add multiple packages per line item)

  • Submit and confirm matching the sales order with the Metrc transfer

✅ Pro Tip: Need to make adjustments on a submitted order? Don’t delete the order in Distru, otherwise it will mark the order as Rejected in LeafLink. Instead, make order adjustments in LeafLink.

✅ Pro Tip: Add LeafLink orders to the Sales Orders table in Distru

How to Sync Inventory

Every time a new LeafLink order comes in or is created, LeafLink reserves the quantity of the products within that order, lessening their available amount.

Since Distru is the ultimate source of truth for inventory levels, every 10 minutes Distru will push available quantity for LeafLink synced products to LeafLink. See below to understand the sync settings further!

In Distru, you can edit a product and edit its LeafLink settings after connecting it to a LL item!

INVENTORY MANAGEMENT - What do these do?

  • Unlimited - Ignores the Distru inventory, and gives the LL product unlimited quantity.

  • Inherited - LL inherits the inventory number upon first syncing, but does NOT keep a live sync of inventory. Quantity must be updated in LL

  • Managed - LL inventory will reflect the Distru Inventory, and will keep a live sync.

✅ Pro Tip: If you want a live inventory sync between Distru & Leaflink, Pick Managed.

Distru provides a company-wide setting that allows customers to select a location from which to calculate the available quantity. If no location is selected, the available quantity will be calculated including all locations.


Having issues with orders, products, users or inventory syncing?

Read this Checklist for Success to help you troubleshoot any issues you're experiencing.

Need help?

Contact your CSR or open the chat bubble to ask questions and we’ll help you out!

Did this answer your question?