Best Practices

The following best practices should be followed when building integration solutions with LeafLink.

General

  • Supports clients testing the integration using one of the following two options:
    • Syncing with LeafLink’s Sandbox (sandbox.leaflink.com)
    • Permitting the manual sync of one product/order/etc. record to validate data before syncing all records
  • Ensures response times to mutual clients are within one business day and response times to LeafLink are within two business days
  • Supports storing multiple API tokens per client, if the account is split to multiple Companies on LeafLink
  • Securely stores API token using two-way encryption, encrypting for storage and display, while decrypting for calls to LeafLink’s API
  • Authentication utilizes LeafLink Application token
  • Includes the "User-Agent" header in all API requests to LeafLink
    • The value for the User-Agent key should be "system_name" (e.g. “sage_intacct”)

Orders

  • Supports creation and update of order/invoice in external system
  • Utilizes LeafLink’s order webhook to consume order data or initiate the export of order data
  • Associates orders/invoices between LeafLink and external system, using a field to store the LeafLink order ID in the system
  • Updates LeafLink order with “external_ids” key-value pair with external system order ID
  • Removes “external_ids” key-value pair if order is deleted in external system
  • Updates LeafLink order status based on system order status through to Complete
  • Updates order payment information in LeafLink based on payment status in system
  • Considers “unit_multiplier” field to calculate Unit or Sell in Multiples pricing
  • Considers Cancelled and Rejected order status
  • Considers Discounts, Tax, and Shipping Charge on order
  • Supports product sale price
  • Supports Sales Representative(s)
  • Option to use Unit or Sell in Multiples pricing
  • Notifies integration owner of any issues with order import to system

Products

  • Follows product Field Mapping Tips (see below)
  • Supports creation, update, and deletion of products
  • Updates LeafLink product with “external_ids” key-value pair with external system product ID
  • Notifies customer integration owner of any missing required fields or failures when creating products in LeafLink
  • Syncs inventory to reflect accurate available inventory in LeafLink
  • Supports products sold in multiples
  • Supports the creation and assignment of product lines
  • Supports the assignment of a license
  • Supports the creation and assignment of strains for flower products
  • Supports setting the base units per unit field for generic “Unit” base unit of measure products
  • Supports adding images to a product
  • Matches product of order to existing record and creates new product in external system, if not found
  • Notifies integration owner of any issues with product record creation

Field mapping tips

Follow the product field mapping tips below to position your integration to best serve your mutual customers.

Priority:

1 - Required 2 - Highly Recommended 3 - Nice to Have 4 - Optional 5 - Do Not Use

LeafLink API FieldPriorityDefault Value*Additional Context
drop_date4The product must be set to a listing status of "Unavailable" in order to flip it to "Available" on the drop date
name1
sku1
description1Use product name
quantity2Required if seller is managing inventory
unit_multiplier2Use "1"Required if seller is selling in cases (multiples). This is a very common practice for sellers across all product categories.
retail_price1Use "0.00" if no retail price is stored in the source system
wholesale_price1
sale_price1Use "0.00" if no sale price is stored in the source system
minimum_order1Use "0.01" if no minimum order quantity is stored in the source system
maximum_order1Use "100000" if no maximum order quantity is stored in the source system
AVAILABLE_FOR_SAMPLES3Use "true"Certain markets like Canada and OH do not allow samples
extern_acct_id5
extern_income_acct_id5
featured4Use "false"
tagline4
featured_on_deals4
allow_fractional_quantities4Recommended if Flower category product is sold in bulk
parent4Required if creating a variety (child product) of a parent product. Varieties are useful when selling a single product in various sizes (i.e. as eighths, grams, and half ounces).
listing_state1Use "Available" to make the product available for selling/buying"Internal" should be used when a seller does not want a product to be visible to buyers, but may be manually added to orders by the seller.
display_listing_state4
inventory_management1Use "1" to set the inventory of the product to managedIf set to "1", available inventory quantity should be using "quantity" field
unit_of_measure1Use "Unit" and enter the number of units per unit in the base_units_per_unit field
sell_in_unit_of_measure2Required if seller is selling in cases and unit_multiplier is greater than 1
unit_denomination1Use "1"
category1
sub_category1
grow_type4
seller1
brand1
product_line2Using product lines provides a better experience for buyers to be able to navigate the seller's menu. For the seller it provides better in platform reporting and analytics.
manufacturer1Use the same value as the seller
strain_classification1Use "na"
license1Required for product to appear on menu for buyer visibility and for compliance. Use "N/A" for ancillary products.
strains2Required for flower category products.
s2s_conversion_amount5
extern_sts_ids5
base_units_per_unit2Required if using Unit as base unit of measure
external_ids3Helpful for storing IDs from source system
threshold_value3When product inventory quantity reaches below this value, take various actions.
threshold_action3Action to take when product inventory quantity reaches below a specified value. Available values include default, backorder, unavailable,and internal.
reverse_threshold_value3When product inventory quantity reaches above this value, take various actions.
reverse_threshold_action3Action to take when product inventory quantity reaches above a specified value. Available values include default, available, and internal.
*If unable to map a related value from system

Batches

  • Supports the creation, update, and deletion of batches
  • Deletes batch once associated inventory is fully consumed
  • Supports the assignment of products to batches
  • Supports the upload of COA documentation

Customers

  • Supports creation and update of customers
  • Updates LeafLink customer with “external_ids” key-value pair with external system customer ID
  • Matches customer of order to existing record and creates new customer in external system, if not found
  • Notifies integration owner of any issues with customer record creation
Last Updated: