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 Field | Priority | Default Value* | Additional Context |
---|---|---|---|
drop_date | 4 | The product must be set to a listing status of "Unavailable" in order to flip it to "Available" on the drop date | |
name | 1 | ||
sku | 1 | ||
description | 1 | Use product name | |
quantity | 2 | Required if seller is managing inventory | |
unit_multiplier | 2 | Use "1" | Required if seller is selling in cases (multiples). This is a very common practice for sellers across all product categories. |
retail_price | 1 | Use "0.00" if no retail price is stored in the source system | |
wholesale_price | 1 | ||
sale_price | 1 | Use "0.00" if no sale price is stored in the source system | |
minimum_order | 1 | Use "0.01" if no minimum order quantity is stored in the source system | |
maximum_order | 1 | Use "100000" if no maximum order quantity is stored in the source system | |
AVAILABLE_FOR_SAMPLES | 3 | Use "true" | Certain markets like Canada and OH do not allow samples |
extern_acct_id | 5 | ||
extern_income_acct_id | 5 | ||
featured | 4 | Use "false" | |
tagline | 4 | ||
featured_on_deals | 4 | ||
allow_fractional_quantities | 4 | Recommended if Flower category product is sold in bulk | |
parent | 4 | Required 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_state | 1 | Use "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_state | 4 | ||
inventory_management | 1 | Use "1" to set the inventory of the product to managed | If set to "1", available inventory quantity should be using "quantity" field |
unit_of_measure | 1 | Use "Unit" and enter the number of units per unit in the base_units_per_unit field | |
sell_in_unit_of_measure | 2 | Required if seller is selling in cases and unit_multiplier is greater than 1 | |
unit_denomination | 1 | Use "1" | |
category | 1 | ||
sub_category | 1 | ||
grow_type | 4 | ||
seller | 1 | ||
brand | 1 | ||
product_line | 2 | Using 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. | |
manufacturer | 1 | Use the same value as the seller | |
strain_classification | 1 | Use "na" | |
license | 1 | Required for product to appear on menu for buyer visibility and for compliance. Use "N/A" for ancillary products. | |
strains | 2 | Required for flower category products. | |
s2s_conversion_amount | 5 | ||
extern_sts_ids | 5 | ||
base_units_per_unit | 2 | Required if using Unit as base unit of measure | |
external_ids | 3 | Helpful for storing IDs from source system | |
threshold_value | 3 | When product inventory quantity reaches below this value, take various actions. | |
threshold_action | 3 | Action to take when product inventory quantity reaches below a specified value. Available values include default, backorder, unavailable,and internal. | |
reverse_threshold_value | 3 | When product inventory quantity reaches above this value, take various actions. | |
reverse_threshold_action | 3 | Action 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