LeafLink Marketplace V2 API

Download OpenAPI specification:Download

Introduction

HTTP Request Notes

All endpoints covered in this document are preceded by https://{{domain}}/api/v2/ unless otherwise noted.

Available domains

  • app.leaflink.com - production environment

  • www.sandbox.leaflink.com - sandbox environment

  • www.leaflink-integrations.leaflink.com - integrations sandbox environment

Learn more about sandbox environments

Request paths must end in a slash character ('/'). Those that do not will return a 400 (Bad Request) response.

Dynamic Responses

Some of our API endpoints support dynamic responses. These are responses that vary in content and/or object level payload size according to request path or query parameters.

Available parameters are listed beneath endpoint definitions.

The order object

number
string (Number) non-empty

Order number generated by LeafLink

short_id
string

The Order No. displayed in the user interface

external_id_seller
string or null (External id seller) non-empty

Number assigned to the order by the seller company

external_id_buyer
string or null (External id buyer) non-empty

Number assigned to the order by the buyer company

ext_acct_id
string or null (Accounting Service ID) <= 255 characters

Accounting Service ID

created_on
string <date-time> (Created on)

Date and time the order was created

user
string (User)

username of the user who last edited the order

buyer
integer or null (Buyer)

Company on the buy side of the order.

seller
integer (Seller)

Company on the sell side of the order.

object (Customer)

Seller's customer record for the company on the buyer side of the order

brand
integer or null (Brand of Order)

id of the brand for this order. Only applicable if the seller has the "Separate Orders by Brand" setting enabled.

status
string (Status)
Enum: "Draft" "Submitted" "Accepted" "Backorder" "Fulfilled" "Shipped" "Complete" "Rejected" "Combined" "Cancelled"

Order status

manual
boolean (Manual)

Was the order manually created by the seller company?

discount
number <decimal>

Discount value applied to the order

discount_type
string non-empty

Type of discount: % or $

tax_amount
number <decimal> (Tax amount)

Tax amount applied to the order

tax_type
string (Tax type) non-empty

Type of tax: % or $

final_tax
string

Tax total for the order

object
object
payment_term
string or null (Payment term)

Payment term for the order Deprecated field, please use payment_option instead

payment_methods
Array of strings or null (Payment methods)

Payment methods for the order Deprecated field, please use payment_option instead

selected_payment_option
any
payment_due_date
string or null <date-time> (Payment Due Date)

Date that the Payment is due

paid
boolean (Is paid?)

If this order has been paid for

paid_date
string or null <date> (Paid date)

Date the order was paid

ship_date
string or null <date-time> (Ship date)

Date and time the order was shipped

shipping_details
string or null (Shipping details) non-empty

Shipping details included on an order

notes
string or null (Order Notes) <= 2000 characters

Additional notes for an Order

internal_notes
string or null (Order Notes) <= 2000 characters

Internal notes for an Order

delivery_preferences
string or null (Delivery Preferences)

Customer Delivery Preferences

Array of objects (LightCompanyStaff)

Sales representatives associated with the order.

classification
string (Classification) non-empty

Classification of the license-type associated to the order

payment_balance
string (Payment balance)

The outstanding balance on the order

available_transitions
string (Available transitions)

States that the order can transition to

modified
string <date-time> (Modified)

Date and time that the order was last modified

has_special_requests
boolean (Has special requests)

Does the order have special requests?

delivery_provider
integer or null (Delivery provider)

The company delivering this order.

Array of objects (LightOrderTax)

Details about the taxes applied to the order

object (Delivery info)
is_combination
string (Is combination)
llf_payment_method
boolean
credits
string

Total dollar value of credits applied to the order

facility_id
integer

Facility ID related to an order

order_number
string (Order number) non-empty

Read only alias of number.

order_seller_number
string (Order seller number)

Read only alias of external_id_seller.If external_id_seller is missing, short_id will be provided.

order_buyer_number
string (Order buyer number)

Read only alias of external_id_buyer. If external_id_buyer is missing, short_id will be provided.

order_short_number
string (Order short number) non-empty

Read only alias of short_id.

distributor
string (Distributor)

id of the distributor delivering this order

external_ids
object (ExternalIds)

Set of key-value pairs for storing external system IDs. Key value can be up to 36 characters long.

object (Corporate Address)

Read only corporate address as provided during order creation.

object (Delivery Address)

Read only delivery address as provided during order creation.

{
  • "number": "aec108ac-a1f4-40fa-966e-a12ga9bf6e2f",
  • "short_id": "a9bf6e2f",
  • "external_id_seller": null,
  • "external_id_buyer": null,
  • "ext_acct_id": null,
  • "created_on": "2020-06-10T15:15:03.776119-06:00",
  • "user": "james.g",
  • "buyer": 6109,
  • "seller": 1,
  • "customer": {
    },
  • "brand": null,
  • "status": "Accepted",
  • "manual": false,
  • "discount": 0,
  • "discount_type": "%",
  • "tax_amount": 0,
  • "tax_type": "%",
  • "final_tax": "0.00",
  • "shipping_charge": {
    },
  • "total": {
    },
  • "payment_term": "Net 7",
  • "payment_methods": [
    ],
  • "available_payment_options": [
    ],
  • "selected_payment_option": {
    },
  • "payment_due_date": null,
  • "paid": false,
  • "paid_date": null,
  • "ship_date": null,
  • "shipping_details": null,
  • "notes": "",
  • "internal_notes": null,
  • "delivery_preferences": "Monday - Wednesday Only Please",
  • "sales_reps": [
    ],
  • "classification": "Adult Use",
  • "payment_balance": 594,
  • "available_transitions": [
    ],
  • "modified": "2020-06-10T16:14:49.494713-06:00",
  • "has_special_requests": false,
  • "delivery_provider": null,
  • "order_taxes": [ ],
  • "delivery_info": null,
  • "is_combination": false,
  • "credits": "420.10",
  • "facility_id": 123,
  • "order_number": "aec108ac-a1f4-40fa-966e-a12ga9bf6e2f",
  • "order_seller_number": "a9bf6e2f",
  • "order_buyer_number": "a9bf6e2f",
  • "order_short_number": "a9bf6e2f",
  • "distributor": "",
  • "external_ids": {
    },
  • "corporate_address": {
    },
  • "delivery_address": {
    }
}

orders-received

Access the order object

List orders

List received orders for all active companies where the user has the Manage Orders Received permission.

Per company via /companies/{company_id}/orders-received/

Authorizations:
Token
query Parameters
fields_include
string

Include only specific fields in the response, separated by commas.

fields_exclude
string

Exclude specific fields in the response, separated by commas.

fields_add
string

Include additional fields in the response. Available values include created_by and last_changed_by

include_children
string

Include additional fields in the response. Available values include line_items, customer, and sales_reps

seller__slug__iexact
string

Filter results the company slug on the seller side of the order. Case-insensitive exact match.

modified__gte
string

Filter by the modified date, greater than or equal to

modified__lte
string

Filter by the modified date, less than or equal to

modified__gt
string

Filter by the modified date, greater than

modified__lt
string

Filter by the modified date, less than

external_id_seller
string

Filter by the number assigned to the order by the seller company

external_id_seller__icontains
string

Filter by the number assigned to the order by the seller company. Case-insensitive containment match: returns orders that contain the string

created_on__gte
string

Filter by the created_on date, greater than or equal to

created_on__lte
string

Filter by the created_on date, less than or equal to

created_on__gt
string

Filter by the created_on date, greater than

created_on__lt
string

Filter by the created_on date, less than

order_id
string

Filter by the external_id_seller or the number

number
string

Filter by the unique order number generated by LeafLink.

status
string
Enum: "draft" "submitted" "accepted" "backorder" "fulfilled" "shipped" "complete" "rejected" "combined" "cancelled"

Filter by status. Multiple statuses can be submitted as comma-separated list. Case Insensitive.

status__not
string
Enum: "draft" "submitted" "accepted" "backorder" "fulfilled" "shipped" "complete" "rejected" "combined" "cancelled"

Exclude by order status. Multiple statuses can be submitted as a comma-separated list. Case Insensitive.

brand
number

Filter by brand id

brand__in
number

Filter by multiple brand ids, separated by commas

buyer
string

Filter by the id of the company on the buyer side of the order

paid
string

Filter by paid status

customer
string

Filter by the customer name or nickname for the company on the buyer side of the order

sales_rep
number

Filter by the user id of the sales rep assigned to an order. This is the id field on the company-staff object.

classification
string

Filter by the classification of the license-type associated to the order

user
string

Filter by the username, first name, or last name of the last person who edited the order

connected_to_metrc
string

Filter by whether or not they have metrc packages associated with their line items

manual
string

Filter by whether or not orders were manually created by the company on the seller side of the order

company_slug
string

Filter by the slug of seller company

service_zone
number

Filter Orders by service zone of customers

limit
integer

Number of results to return per page.

offset
integer

The initial index from which to return the results.

external_id_key
string

Filter for orders that match external_ids key:values. Must be used with external_id_values.

external_id_values
string

Filter for orders that match external_ids key:values. Multiple values separated by a comma. Must be used with external_id_key.

Responses

Response samples

Content type
application/json
{
  • "count": 2,
  • "next": null,
  • "previous": null,
  • "results": [
    ]
}

Create an order

Create an Order. May create child LineItem objects in the same request.

WARNING - BETA FEATURE: This API is in active development and is subject to change.

Authorizations:
Token
Request Body schema: application/json
seller
required
integer

Seller company for this order

required
object (Customer)

Seller's customer record for the company on the buyer side of the order

status
required
string
Enum: "Draft" "Submitted"

Order status

required
Array of objects (Line Item)
brand
integer

Brand for this order. Only applicable if the seller has the "Separate Orders by Brand" setting enabled.

external_id_seller
string

Number assigned to the order by the seller company

ext_acct_id
string

External account id.

discount
number <decimal>

Discount value applied to the order

discount_type
string (Discount type) non-empty

Type of discount: % or $

tax_amount
number <decimal> (Tax amount)

Tax amount applied to the order

tax_type
string (Tax type) non-empty

Type of tax: % or $

object
payment_term
string or null (Payment term)

Payment term for the order

payment_due_date
string or null <date-time> (Payment Due Date)

Date that the Payment is due

paid
boolean (Is paid?)

If this order has been paid for

paid_date
string or null <date> (Paid date)

Date the order was paid

ship_date
string or null <date-time> (Ship date)

Date and time the order was shipped

shipping_details
string or null (Shipping details) non-empty

Shipping details included on an order

notes
string or null (Order Notes) <= 2000 characters

Additional notes for an Order

internal_notes
string or null (Order Notes) <= 2000 characters

Internal notes for an Order

delivery_preferences
string or null (Delivery Preferences)

Customer Delivery Preferences

Array of objects (CompanyStaff)

Sales representatives associated with the order.

delivery_provider
integer or null (Delivery provider)

The company delivering this order.

object (Delivery info)
facility_id
integer or null (Facility)

The facility fulfilling this order.

Responses

Request samples

Content type
application/json
{
  • "external_id_seller": "INV-1092",
  • "ext_acct_id": null,
  • "seller": 1,
  • "customer": {
    },
  • "line_items": [
    ],
  • "status": "Draft",
  • "discount": 0,
  • "discount_type": "%",
  • "tax_amount": 0,
  • "tax_type": "%",
  • "shipping_charge": {
    },
  • "payment_term": "Net 7",
  • "selected_payment_option": {
    },
  • "delivery_preferences": "Monday - Wednesday Only Please",
  • "sales_reps": [
    ],
  • "facility_id": 123
}

Response samples

Content type
application/json
{
  • "number": "aec108ac-a1f4-40fa-966e-a12ga9bf6e2f",
  • "short_id": "a9bf6e2f",
  • "external_id_seller": null,
  • "external_id_buyer": null,
  • "ext_acct_id": null,
  • "created_on": "2020-06-10T15:15:03.776119-06:00",
  • "user": "james.g",
  • "buyer": 6109,
  • "seller": 1,
  • "customer": {
    },
  • "brand": null,
  • "status": "Accepted",
  • "manual": false,
  • "discount": 0,
  • "discount_type": "%",
  • "tax_amount": 0,
  • "tax_type": "%",
  • "final_tax": "0.00",
  • "shipping_charge": {
    },
  • "total": {
    },
  • "payment_term": "Net 7",
  • "payment_methods": [
    ],
  • "available_payment_options": [
    ],
  • "selected_payment_option": {
    },
  • "payment_due_date": null,
  • "paid": false,
  • "paid_date": null,
  • "ship_date": null,
  • "shipping_details": null,
  • "notes": "",
  • "internal_notes": null,
  • "delivery_preferences": "Monday - Wednesday Only Please",
  • "sales_reps": [
    ],
  • "classification": "Adult Use",
  • "payment_balance": 594,
  • "available_transitions": [
    ],
  • "modified": "2020-06-10T16:14:49.494713-06:00",
  • "has_special_requests": false,
  • "delivery_provider": null,
  • "order_taxes": [ ],
  • "delivery_info": null,
  • "is_combination": false,
  • "credits": "420.10",
  • "facility_id": 123,
  • "order_number": "aec108ac-a1f4-40fa-966e-a12ga9bf6e2f",
  • "order_seller_number": "a9bf6e2f",
  • "order_buyer_number": "a9bf6e2f",
  • "order_short_number": "a9bf6e2f",
  • "distributor": "",
  • "external_ids": {
    },
  • "corporate_address": {
    },
  • "delivery_address": {
    }
}

Retrieve an order

Retrieve an individual order.

Authorizations:
Token
path Parameters
number
required
string <uuid>

Order number

query Parameters
fields_include
string

Include only specific fields in the response, separated by commas.

fields_exclude
string

Exclude specific fields in the response, separated by commas.

fields_add
string

Include additional fields in the response. Available values include created_by and last_changed_by

include_children
string

Include additional fields in the response. Available values include line_items, customer, and sales_reps

Responses

Response samples

Content type
application/json
{
  • "number": "aec108ac-a1f4-40fa-966e-a12ga9bf6e2f",
  • "short_id": "a9bf6e2f",
  • "external_id_seller": null,
  • "external_id_buyer": null,
  • "ext_acct_id": null,
  • "created_on": "2020-06-10T15:15:03.776119-06:00",
  • "user": "james.g",
  • "buyer": 6109,
  • "seller": 1,
  • "customer": {
    },
  • "brand": null,
  • "status": "Accepted",
  • "manual": false,
  • "discount": 0,
  • "discount_type": "%",
  • "tax_amount": 0,
  • "tax_type": "%",
  • "final_tax": "0.00",
  • "shipping_charge": {
    },
  • "total": {
    },
  • "payment_term": "Net 7",
  • "payment_methods": [
    ],
  • "available_payment_options": [
    ],
  • "selected_payment_option": {
    },
  • "payment_due_date": null,
  • "paid": false,
  • "paid_date": null,
  • "ship_date": null,
  • "shipping_details": null,
  • "notes": "",
  • "internal_notes": null,
  • "delivery_preferences": "Monday - Wednesday Only Please",
  • "sales_reps": [
    ],
  • "classification": "Adult Use",
  • "payment_balance": 594,
  • "available_transitions": [
    ],
  • "modified": "2020-06-10T16:14:49.494713-06:00",
  • "has_special_requests": false,
  • "delivery_provider": null,
  • "order_taxes": [ ],
  • "delivery_info": null,
  • "is_combination": false,
  • "credits": "420.10",
  • "facility_id": 123,
  • "order_number": "aec108ac-a1f4-40fa-966e-a12ga9bf6e2f",
  • "order_seller_number": "a9bf6e2f",
  • "order_buyer_number": "a9bf6e2f",
  • "order_short_number": "a9bf6e2f",
  • "distributor": "",
  • "external_ids": {
    },
  • "corporate_address": {
    },
  • "delivery_address": {
    }
}

Update an order

Update an Order. May update child LineItem objects in the same request.

Authorizations:
Token
path Parameters
number
required
string <uuid>

Order number

Request Body schema: application/json
discount
number <decimal>

Discount value applied to the order

discount_type
string (Discount type) non-empty

Type of discount: % or $

tax_amount
number <decimal> (Tax amount)

Tax amount applied to the order

tax_type
string (Tax type) non-empty

Type of tax: % or $

object
payment_term
string or null (Payment term)

Payment term for the order Deprecated field, please use payment_option instead

object (Selected payment option)

Payment option that was selected for an order

payment_due_date
string or null <date-time> (Payment Due Date)

Date that the Payment is due

paid
boolean (Is paid?)

If this order has been paid for

paid_date
string or null <date> (Paid date)

Date the order was paid

ship_date
string or null <date-time> (Ship date)

Date and time the order was shipped

shipping_details
string or null (Shipping details) non-empty

Shipping details included on an order

notes
string or null (Order Notes) <= 2000 characters

Additional notes for an Order

internal_notes
string or null (Order Notes) <= 2000 characters

Internal notes for an Order

delivery_preferences
string or null (Delivery Preferences)

Customer Delivery Preferences

classification
string (Classification) non-empty

Classification of the license-type associated to the order

delivery_provider
integer or null (Delivery provider)

The company delivering this order.

object (Delivery info)
external_ids
object (ExternalIds)

Set of key-value pairs for storing external system IDs. Key value can be up to 36 characters long.

Responses

Request samples

Content type
application/json
{
  • "discount": 15,
  • "discount_type": "$"
}

Response samples

Content type
application/json
{
  • "number": "aec108ac-a1f4-40fa-966e-a12ga9bf6e2f",
  • "short_id": "a9bf6e2f",
  • "external_id_seller": null,
  • "external_id_buyer": null,
  • "ext_acct_id": null,
  • "created_on": "2020-06-10T15:15:03.776119-06:00",
  • "user": "james.g",
  • "buyer": 6109,
  • "seller": 1,
  • "customer": {
    },
  • "brand": null,
  • "status": "Accepted",
  • "manual": false,
  • "discount": 0,
  • "discount_type": "%",
  • "tax_amount": 0,
  • "tax_type": "%",
  • "final_tax": "0.00",
  • "shipping_charge": {
    },
  • "total": {
    },
  • "payment_term": "Net 7",
  • "payment_methods": [
    ],
  • "available_payment_options": [
    ],
  • "selected_payment_option": {
    },
  • "payment_due_date": null,
  • "paid": false,
  • "paid_date": null,
  • "ship_date": null,
  • "shipping_details": null,
  • "notes": "",
  • "internal_notes": null,
  • "delivery_preferences": "Monday - Wednesday Only Please",
  • "sales_reps": [
    ],
  • "classification": "Adult Use",
  • "payment_balance": 594,
  • "available_transitions": [
    ],
  • "modified": "2020-06-10T16:14:49.494713-06:00",
  • "has_special_requests": false,
  • "delivery_provider": null,
  • "order_taxes": [ ],
  • "delivery_info": null,
  • "is_combination": false,
  • "credits": "420.10",
  • "facility_id": 123,
  • "order_number": "aec108ac-a1f4-40fa-966e-a12ga9bf6e2f",
  • "order_seller_number": "a9bf6e2f",
  • "order_buyer_number": "a9bf6e2f",
  • "order_short_number": "a9bf6e2f",
  • "distributor": "",
  • "external_ids": {
    },
  • "corporate_address": {
    },
  • "delivery_address": {
    }
}

Delete a draft order

Delete a draft order. This operation is only available for draft orders.

Authorizations:
Token
path Parameters
number
required
string <uuid>

Order number

Responses

Transition an order

Perform an order transition action.

Authorizations:
Token
path Parameters
number
required
string

Order number

action
required
string

Order transition action. Available values include submit, accept, fulfill, cancel, reject, ship, and complete

Responses

Response samples

Content type
application/json
{
  • "number": "aec108ac-a1f4-40fa-966e-a12ga9bf6e2f",
  • "short_id": "a9bf6e2f",
  • "external_id_seller": null,
  • "external_id_buyer": null,
  • "ext_acct_id": null,
  • "created_on": "2020-06-10T15:15:03.776119-06:00",
  • "user": "james.g",
  • "buyer": 6109,
  • "seller": 1,
  • "customer": {
    },
  • "brand": null,
  • "status": "Accepted",
  • "manual": false,
  • "discount": 0,
  • "discount_type": "%",
  • "tax_amount": 0,
  • "tax_type": "%",
  • "final_tax": "0.00",
  • "shipping_charge": {
    },
  • "total": {
    },
  • "payment_term": "Net 7",
  • "payment_methods": [
    ],
  • "available_payment_options": [
    ],
  • "selected_payment_option": {
    },
  • "payment_due_date": null,
  • "paid": false,
  • "paid_date": null,
  • "ship_date": null,
  • "shipping_details": null,
  • "notes": "",
  • "internal_notes": null,
  • "delivery_preferences": "Monday - Wednesday Only Please",
  • "sales_reps": [
    ],
  • "classification": "Adult Use",
  • "payment_balance": 594,
  • "available_transitions": [
    ],
  • "modified": "2020-06-10T16:14:49.494713-06:00",
  • "has_special_requests": false,
  • "delivery_provider": null,
  • "order_taxes": [ ],
  • "delivery_info": null,
  • "is_combination": false,
  • "credits": "420.10",
  • "facility_id": 123,
  • "order_number": "aec108ac-a1f4-40fa-966e-a12ga9bf6e2f",
  • "order_seller_number": "a9bf6e2f",
  • "order_buyer_number": "a9bf6e2f",
  • "order_short_number": "a9bf6e2f",
  • "distributor": "",
  • "external_ids": {
    },
  • "corporate_address": {
    },
  • "delivery_address": {
    }
}

order-payments

List payments

List payments for all active companies where the user has the Manage Orders Received permission.

Filter by order with /orders-received/{order_number}/payments/

Authorizations:
Token
query Parameters
limit
integer

Number of results to return per page.

offset
integer

The initial index from which to return the results.

Responses

Response samples

Content type
application/json
{
  • "count": 0,
  • "previous": "http://example.com",
  • "results": [
    ]
}

Create a payment

Create a new payment

Authorizations:
Token
Request Body schema: application/json
required
order
required
string

Number of the order this payment applies to. See number on the order object.

recorded_by
required
integer

Id of the user recording this payment. See id on the company staff object.

required
object
payment_date
required
string <date-time>

Date and time the payment was submitted on.

reason
string

Description for this payment.

payment_type
string
Enum: "other" "cash" "check" "credit" "trade" "ach" "wire" "cashier"

Type of payment

Responses

Request samples

Content type
application/json
{
  • "order": "string",
  • "recorded_by": 0,
  • "total": {
    },
  • "payment_date": "2019-08-24T14:15:22Z",
  • "reason": "string",
  • "payment_type": "other"
}

Response samples

Content type
application/json
{
  • "id": 0,
  • "created_on": "2019-08-24T14:15:22Z",
  • "modified": "2019-08-24T14:15:22Z",
  • "order": "string",
  • "recorded_by": 0,
  • "recorder_name": "string",
  • "total": {
    },
  • "payment_date": "2019-08-24T14:15:22Z",
  • "reason": "string",
  • "payment_type": "other"
}

Retrieve a payment

Retrieve a payment by id.

Authorizations:
Token
path Parameters
id
required
integer

A unique integer value identifying the order payment.

Responses

Response samples

Content type
application/json
{
  • "id": 0,
  • "created_on": "2019-08-24T14:15:22Z",
  • "modified": "2019-08-24T14:15:22Z",
  • "order": "string",
  • "recorded_by": 0,
  • "recorder_name": "string",
  • "total": {
    },
  • "payment_date": "2019-08-24T14:15:22Z",
  • "reason": "string",
  • "payment_type": "other"
}

order-sales-reps

List

List all OrderSalesReps under the company access scope. For legacy auth, includes companies where the user has the Can Manage Orders Received permission.

Authorizations:
Token
query Parameters
limit
integer

Number of results to return per page.

offset
integer

The initial index from which to return the results.

Responses

Response samples

Content type
application/json
{
  • "count": 0,
  • "previous": "http://example.com",
  • "results": [
    ]
}

Create

Create a new OrderSalesRep.

Authorizations:
Token
Request Body schema: application/json
required
order
required
string <uuid> (Order)
rep
required
integer (Rep)

Responses

Request samples

Content type
application/json
{
  • "order": "93b532b3-a125-4cd2-9b71-9996b1e164ce",
  • "rep": 0
}

Response samples

Content type
application/json
{
  • "id": 0,
  • "order": "93b532b3-a125-4cd2-9b71-9996b1e164ce",
  • "rep": 0,
  • "created_on": "2019-08-24T14:15:22Z"
}

Read

Retrieve an individual OrderSalesRep by ID.

Authorizations:
Token
path Parameters
id
required
integer

A unique integer value identifying this order sales rep.

Responses

Response samples

Content type
application/json
{
  • "id": 0,
  • "order": "93b532b3-a125-4cd2-9b71-9996b1e164ce",
  • "rep": 0,
  • "created_on": "2019-08-24T14:15:22Z"
}

Delete

Remove OrderSalesRep object by ID.

Authorizations:
Token
path Parameters
id
required
integer

A unique integer value identifying this order sales rep.

Responses

order-event-logs

List

List all order event logs.

Authorizations:
Token
query Parameters
id
number

Filter by id

by
string

Filter Event Logs by the username, first name, or last name of the person whose event created it.

order
string

Filter Event Logs by their associated order number.

limit
integer

Number of results to return per page.

offset
integer

The initial index from which to return the results.

Responses

Response samples

Content type
application/json
{
  • "count": 0,
  • "previous": "http://example.com",
  • "results": [
    ]
}

Read

Retrieve an individual order event log by id.

Authorizations:
Token
path Parameters
id
required
integer

A unique integer value identifying this order event log.

Responses

Response samples

Content type
application/json
{
  • "id": 0,
  • "order": "93b532b3-a125-4cd2-9b71-9996b1e164ce",
  • "author_name": "string",
  • "by": "string",
  • "event_type": "accepted",
  • "description": "string",
  • "created_on": "2019-08-24T14:15:22Z",
  • "modified": "2019-08-24T14:15:22Z",
  • "timestamp": "2019-08-24T14:15:22Z",
  • "changed_fields": { },
  • "source": "app",
  • "source_detail": "string"
}

The line item object

id
integer (Id)

id of the line item

object

Price at the time the order was placed

quantity
string <decimal> (Quantity)

Number of units ordered

order
string or null <uuid> (Order)

The number of the order this line item is attached to. number or order_number on the order object.

product
string (Product)

id for the product

notes
string or null (Notes)

Notes for this specific ordered product

is_sample
boolean (Is sample)

Is this line item a sample?

object

Alternative sale price

unit_multiplier
integer (Unit multiplier)

How many individual units are sold when compared to the assigned unit of measure

is_medical_line_item
boolean (Is medical line item)

Is this a medical line item?

is_packed
boolean (Is packed)

Is the line-item packed?

packed_at
string or null <date-time> (Packed at)

Date and time this line-item was packed

packed_by
integer or null (CompanyStaff user)

The CompanyStaff user that packed this product

unit_of_measure
string (Unit of measure)

Units this product is measured in

position
integer or null (Position)

Position for this line item in the displayed list of line items on the order

bulk_units
integer (Bulk units)

The number of units of bulk available. quantity / unit_multiplier

on_sale
boolean (On sale)

Is this line item on sale?

is_backorder
boolean or null (Is backorder)

Is this line item backordered?

order_id
string (Order id)
batch
integer or null (Batch)

Batch that should be displayed in invoice.

package_tags
string (Package tags)

Tags associated to line items via attached packages.

frozen_data
object (Frozen data)
wholesale_price
string or null <decimal> (Wholesale price)

Wholesale Price

{
  • "id": 0,
  • "ordered_unit_price": {
    },
  • "quantity": "string",
  • "order": "93b532b3-a125-4cd2-9b71-9996b1e164ce",
  • "product": "string",
  • "notes": "string",
  • "is_sample": true,
  • "sale_price": {
    },
  • "unit_multiplier": 0,
  • "is_medical_line_item": true,
  • "is_packed": true,
  • "packed_at": "2019-08-24T14:15:22Z",
  • "packed_by": 0,
  • "unit_of_measure": "string",
  • "position": 0,
  • "bulk_units": 0,
  • "on_sale": true,
  • "is_backorder": true,
  • "order_id": "string",
  • "batch": 0,
  • "package_tags": "string",
  • "frozen_data": { },
  • "wholesale_price": "string"
}

line-items

The LineItem model represents a single entry in an itemized purchase order.

List line items

List line items for all active companies where the user has the Manage Orders Received permission.

Line items can also be retrieved by order via /orders-received/{order_number}/line-items
or by company via /companies/{company_id}/line-items/

Authorizations:
Token
query Parameters
expand
string

Expand an id field into its full object. Supported values include product.

id
number

Filter by id

product__name
string

Filter by product name.

product_id
string

Filter by product id.

order
string

Filter by order number or external_id_seller. Multiple values may be separated by commas.

is_sample
string

Filter by sample status.

order__created_on__gte
string

Filter by Order created_on, greater than or equal to

order__created_on__lte
string

Filter by Order created_on, less than or equal to

order__ship_date__gte
string

Filter by Order ship_date, greater than or equal to

order__ship_date__lte
string

Filter by Order ship_date, less than or equal to

order__modified__gte
string

Filter by Order modified, greater than or equal to

order__modified__lte
string

Filter by Order modified, less than or equal to

order__customer__cities
string

Filter by Order Customer cities, separated by commas.

order__customer__managers
string

Filter by Order Customer managers, separated by commas.

order__customers
string

Filter by Order Customer, separated by commas.

company_slug
string

Filter by seller company slug

order__service_zone
number

Filter by order__service_zone

limit
integer

Number of results to return per page.

offset
integer

The initial index from which to return the results.

Responses

Response samples

Content type
application/json
{
  • "count": 0,
  • "previous": "http://example.com",
  • "results": [
    ]
}

Create line item

Create a line item for an existing order.

⚠️ WARNING - BETA FEATURE

This API is in active development and is subject to change.

Authorizations:
Token
Request Body schema: application/json
required
object

Price at the time the order was placed

required
object

Sale price for this order

quantity
required
string <decimal> (Quantity)

Number of units ordered

product
required
string (Product)

id for the product

order
string or null <uuid> (Order)

The number of the order this line item is attached to. Optional for line items embedded in an order object.

notes
string or null (Notes)

Notes for this specific ordered product

is_sample
boolean (Is sample)

Is this line item a sample?

unit_multiplier
integer (Unit multiplier)

How many individual units are sold when compared to the assigned unit of measure

is_medical_line_item
boolean (Is medical line item)

Is this a medical line item?

is_packed
boolean (Is packed)

Is the line-item packed?

packed_at
string or null <date-time> (Packed at)

Date and time this line-item was packed

packed_by
integer or null (CompanyStaff user)

The CompanyStaff user that packed this product

position
integer or null (Position)

Position for this line item in the displayed list of line items on the order

batch
integer or null (Batch)

Batch that should be displayed in invoice.

wholesale_price
string or null <decimal> (Wholesale price)

Wholesale Price

Responses

Request samples

Content type
application/json
{
  • "product": 2093,
  • "quantity": 10,
  • "notes": "Please include sample",
  • "ordered_unit_price": {
    },
  • "sale_price": {
    },
  • "order": "93b532b3-a125-4cd2-9b71-9996b1e164ce"
}

Response samples

Content type
application/json
{
  • "id": 0,
  • "ordered_unit_price": {
    },
  • "quantity": "string",
  • "order": "93b532b3-a125-4cd2-9b71-9996b1e164ce",
  • "product": "string",
  • "notes": "string",
  • "is_sample": true,
  • "sale_price": {
    },
  • "unit_multiplier": 0,
  • "is_medical_line_item": true,
  • "is_packed": true,
  • "packed_at": "2019-08-24T14:15:22Z",
  • "packed_by": 0,
  • "unit_of_measure": "string",
  • "position": 0,
  • "bulk_units": 0,
  • "on_sale": true,
  • "is_backorder": true,
  • "order_id": "string",
  • "batch": 0,
  • "package_tags": "string",
  • "frozen_data": { },
  • "wholesale_price": "string"
}

Retrieve a line item

Retrieve an individual line item

Authorizations:
Token
path Parameters
id
required
integer

A unique integer value identifying this ordered product.

query Parameters
expand
string

Expand an id field into its full object. Supported values include product.

Responses

Response samples

Content type
application/json
{
  • "id": 0,
  • "ordered_unit_price": {
    },
  • "quantity": "string",
  • "order": "93b532b3-a125-4cd2-9b71-9996b1e164ce",
  • "product": "string",
  • "notes": "string",
  • "is_sample": true,
  • "sale_price": {
    },
  • "unit_multiplier": 0,
  • "is_medical_line_item": true,
  • "is_packed": true,
  • "packed_at": "2019-08-24T14:15:22Z",
  • "packed_by": 0,
  • "unit_of_measure": "string",
  • "position": 0,
  • "bulk_units": 0,
  • "on_sale": true,
  • "is_backorder": true,
  • "order_id": "string",
  • "batch": 0,
  • "package_tags": "string",
  • "frozen_data": { },
  • "wholesale_price": "string"
}

Update a line item

Update an existing line item

Authorizations:
Token
path Parameters
id
required
integer

A unique integer value identifying this ordered product.

Request Body schema: application/json
required
object

Price at the time the order was placed

quantity
string <decimal> (Quantity)

Number of units ordered

notes
string or null (Notes)

Notes for this specific ordered product

is_sample
boolean (Is sample)

Is this line item a sample?

object

Alternative sale price

is_packed
boolean (Is packed)

Is the line-item packed?

packed_at
string or null <date-time> (Packed at)

Date and time this line-item was packed

packed_by
integer or null (CompanyStaff user)

The CompanyStaff user that packed this product

position
integer or null (Position)

Position for this line item in the displayed list of line items on the order

batch
integer or null (Batch)

Batch that should be displayed in invoice.

Responses

Request samples

Content type
application/json
{
  • "ordered_unit_price": {
    },
  • "quantity": "string",
  • "notes": "string",
  • "is_sample": true,
  • "sale_price": {
    },
  • "is_packed": true,
  • "packed_at": "2019-08-24T14:15:22Z",
  • "packed_by": 0,
  • "position": 0,
  • "batch": 0
}

Response samples

Content type
application/json
{
  • "id": 0,
  • "ordered_unit_price": {
    },
  • "quantity": "string",
  • "order": "93b532b3-a125-4cd2-9b71-9996b1e164ce",
  • "product": "string",
  • "notes": "string",
  • "is_sample": true,
  • "sale_price": {
    },
  • "unit_multiplier": 0,
  • "is_medical_line_item": true,
  • "is_packed": true,
  • "packed_at": "2019-08-24T14:15:22Z",
  • "packed_by": 0,
  • "unit_of_measure": "string",
  • "position": 0,
  • "bulk_units": 0,
  • "on_sale": true,
  • "is_backorder": true,
  • "order_id": "string",
  • "batch": 0,
  • "package_tags": "string",
  • "frozen_data": { },
  • "wholesale_price": "string"
}

Delete a line item

Delete a line item

Authorizations:
Token
path Parameters
id
required
integer

A unique integer value identifying this ordered product.

Responses

The product object

id
integer

Unique id generated by LeafLink.

created_on
string <date-time>

Date and time the product was created

last_edit
string <date-time>

Date and time the product was last edited by a user

drop_date
string <date-time>

Date and time the product is scheduled to transition to Available, if applicable.

dropped
string <date-time>

Date and time the product transitioned to Available.

name
string
sku
string <= 255 characters
description
string
quantity
string

Inventory level

reserved_qty
string

Inventory reserved by orders in the Submitted or Accepted states

available_inventory
string

Inventory available for sale (quantity - reserved_qty).

display_name
string

If the product is a variety, the parent product name + the product name

unit_multiplier
integer
Default: 1

If sold in multiples, the number of units sold per case

object

Manufacturer's Suggested Retail Price (MSRP)

object

Wholesale price displayed to buyers in the LeafLink marketplace

object

Sale price displayed to buyers in the LeafLink marketplace

minimum_order
string

Minimum units required for an order

maximum_order
string

Maximum units allowed for an order

is_medical_line_item
boolean

Is the product a medical product?

AVAILABLE_FOR_SAMPLES
boolean

Is this product available for samples?

extern_acct_id
string

Id of the product in QuickBooks Online.

extern_income_acct_id
string

The id for the QuickBooks Online income account.

featured
boolean

Is the product a featured product?

tagline
string

One-liner that displayed when the product is featured

featured_on_deals
boolean

Is this product featured on the LeafLink deals page?

allow_fractional_quantities
boolean

Does this product allow fractional quantities to be ordered?

object (Parent)

Parent product to which this product belongs. 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
string
Enum: "Available" "Archived" "Sample" "Backorder" "Internal" "Unavailable"
display_listing_state
string

The listing state string displayed in the marketplace.

inventory_management
string

id for the inventory setting [1: "Managed", 2: "Unlimited", 3: "Inherited"]

unit_of_measure
string
Enum: "Milligram" "Gram" "Kilogram" "Ounce" "Pound" "Unit" "Liter" "Milliliter"
sell_in_unit_of_measure
string
Value: "Case"

If selling the product in cases as opposed to individual units, set this field to Case.

object (UnitDenomination)
category
integer

Id for the category. See id in the product-categories response.

sub_category
integer

Id for the subcategory. See id in the product-subcategories response.

grow_type
integer

If a flower product, the id for the type of grow operation.

seller
integer

Id for the company listing the product. See id in the companies response.

brand
integer

Id for the brand. See id in the brands response.

product_line
integer

Id for the product line. See id in the product-lines response.

manufacturer
integer

Id for the company that manufactured the product. See id in the companies response. Can be the same id as the seller field.

strain_classification
string
Enum: "sativa" "indica" "hybrid" "na" "11-cbd" "high-cbd" "sativa-hybrid" "indica-hybrid"

If not applicable to the product, use na.

object (ComplianceLicense)
children_count
string

Number of varieties of this product

strains
Array of integers unique

The strains associated with the product. This field is required for products with the Flower category.

price_schedule_price
string

If using the buyer query parameter, the special price set for that customer with the price schedule feature. Otherwise, same as wholesale price.

image_count
string

The number of product images

is_ancillary
boolean

Is the product an ancillary product?

s2s_conversion_amount
string <decimal>

Conversion value used by the Metrc add on.

extern_sts_ids
Array of strings

Id used by the Metrc add on.

strain_classification_display
string (Strain classification display)
modified
string (Modified)

Date and time the product data was last modified.

has_deals_eligible_children
string

Does the product have varieties that are eligible for LeafLink deals?'

discount_percent
integer

Discount applied to a product, calculated by comparing the wholesale and sale price.

base_units_per_unit
string <decimal>

If the product unit_of_measure is Unit, this describes the number of base units in each unit of the product. The base unit is defined by the product category.
Cartridges = Grams
Topicals = Milligrams of Cannabinoids
Concentrates = Grams
Flower (excluding Seeds and Clones) = Grams
Edibles & Ingestibles = Milligrams of Cannabinoids
Pre-Rolls = Grams
Accessories = N/A

external_ids
object (ExternalIds)

Set of key-value pairs for storing external system IDs. Key value can be up to 36 characters long.

threshold_value
integer

When product inventory quantity reaches below this value, take various actions.

threshold_action
string

Action to take when product inventory quantity reaches below a specified value. Available values include default, backorder, unavailable,and internal.

reverse_threshold_value
integer

When product inventory quantity reaches above this value, take various actions.

reverse_threshold_action
string

Action to take when product inventory quantity reaches above a specified value. Available values include default, available, and internal.

show_quantity
boolean

Show inventory quantities to buyers?

Array of objects

Product specifications.

{
  • "id": 2093,
  • "created_on": "2020-02-19T00:36:22.353448-06:00",
  • "last_edit": "2020-04-27T07:41:29.797149-06:00",
  • "drop_date": null,
  • "dropped": null,
  • "name": "Swiss Masters Chocolate Bar (Dark)",
  • "sku": "SWI-BAR-DAR-100",
  • "description": "<p>Our premium Swiss Masters chocolate bars are bold, rich, and steeped in chocolate tradition. The Swiss Master dark chocolate has 70% dark chocolate paired with 100mg THC.</p>",
  • "quantity": "800.0000",
  • "reserved_qty": "120.0000",
  • "display_name": "Swiss Masters Chocolate Bar (Dark)",
  • "unit_multiplier": 12,
  • "retail_price": {
    },
  • "wholesale_price": {
    },
  • "sale_price": {
    },
  • "minimum_order": "1.0000",
  • "maximum_order": null,
  • "is_medical_line_item": false,
  • "AVAILABLE_FOR_SAMPLES": true,
  • "extern_acct_id": null,
  • "extern_income_acct_id": "",
  • "featured": false,
  • "tagline": null,
  • "featured_on_deals": false,
  • "allow_fractional_quantities": false,
  • "parent": null,
  • "listing_state": "Available",
  • "display_listing_state": "Available",
  • "inventory_management": 1,
  • "unit_of_measure": "Unit",
  • "sell_in_unit_of_measure": "Case",
  • "unit_denomination": {
    },
  • "category": 7,
  • "grow_type": null,
  • "seller": 3721,
  • "brand": 49,
  • "product_line": 164,
  • "manufacturer": 3721,
  • "strain_classification": "na",
  • "license": {
    },
  • "available_inventory": 680,
  • "children_count": 0,
  • "strains": [ ],
  • "price_schedule_price": {
    },
  • "image_count": 1,
  • "is_ancillary": false,
  • "s2s_conversion_amount": "1.0000",
  • "extern_sts_ids": null,
  • "strain_classification_display": "N/A",
  • "modified": "2020-06-11T15:53:07.137980-06:00",
  • "sub_category": 14,
  • "has_deals_eligible_children": false,
  • "discount_percent": 0,
  • "base_units_per_unit": null,
  • "external_ids": {
    },
  • "threshold_value": 0,
  • "threshold_action": "unavailable",
  • "reverse_threshold_value": 1,
  • "reverse_threshold_action": "available",
  • "show_quantity": true,
  • "product_data_items": [
    ]
}

products

The Product model represents a physical product offered for sale by a Company.

List products

List products for all active companies where the user has the Manage Inventory permission.

Products can also be retrieved by company via /companies/{company_id}/products/
or by parent product via /products/{parent_product_id}/products/

Authorizations:
Token
query Parameters
sku
string

Filter by one or more sku, separated by commas.

fields_include
string

Include only specific fields in the response, separated by commas.

fields_exclude
string

Exclude specific fields in the response, separated by commas.

include_children
string

Include additional fields in the response. Available values include images, volume_discounts, and strains

modified__lt
string

Filter by the modified date, less than

modified__lte
string

Filter by the modified date, less than or equal to

modified__gt
string

Filter by the modified on date, greater than

modified__gte
string

Filter by the modified date, greater than or equal to

last_edit__lt
string

Filter by last edit date, less than

last_edit__lte
string

Filter by last edit date, less than or equal to

last_edit__gt
string

Filter by last edit date, greater than

last_edit__gte
string

Filter by last edit date, greater than or equal to

created_on__lt
string

Filter by created on date, less than

created_on__lte
string

Filter by created on date, less than or equal to

created_on__gt
string

Filter by created on date, greater than

created_on__gte
string

Filter by created on date, greater than or equal to

id
number

Filter by product id

name
string

Filter by name, case insensitive

search
string

Filter by a search term

display_name
string

Filter by display name, case insensitive

brand
number

Filter by brand. Multiple values separated by commas.

company
number

Filter by company id. Multiple values separated by commas.

has_children
string

Filter by whether or not products have children

parent
number

Filter by parent product id. Multiple values separated by commas.

parent__isnull
string

Filter by whether or not products are parent products. A null value for parent indicated a parent product.

sub_category__isnull
string

Filter by whether or not products have sub-categories assigned. Values can be true or false

product_line
number

Filter by product line id. Multiple values separated by commas.

strains
number

Filter by strain id. Values available at the /strains/ endpoint. Multiple values separated by commas.

category
number

Filter by category id. Values available at the /product-categories/ endpoint. Multiple values separated by commas.

sub_category
number

Filter by sub_category id. Values available at the /product-subcategories/ endpoint. Multiple values separated by commas.

license
number

Filter by license id. Values available at the /licenses/ endpoint. Multiple values separated by commas.

license__isnull
string

Filter by license__isnull

license__type
number

Filter by license type display name. Values available at /license-types/ endpoint. Multiple values separated by commas.

listing_state
string

Filter by listing state id. Values available at /listing-states/ endpoint. Multiple values separated by commas.

archived
string

Filter by whether or not the product is archived

buyer
number

Filter by id for a specific buyer, view the products available to this buyer and the unique price_schedule_price if applicable

s2s_connected
string

Filter by s2s_connected

company_slug
string

Filter by the seller company slug

limit
integer

Number of results to return per page.

offset
integer

The initial index from which to return the results.

external_id_key
string

Filter for orders that match external_ids key:values. Must be used with external_id_values.

external_id_values
string

Filter for orders that match external_ids key:values. Multiple values separated by a comma. Must be used with external_id_key.

Responses

Response samples

Content type
application/json
{
  • "count": 2,
  • "next": null,
  • "previous": null,
  • "results": [
    ]
}

Create a product

Create a new product.

Authorizations:
Token
Request Body schema: application/json
drop_date
string <date-time>

Date and time the product is scheduled to transition to "Available", if applicable. The product must be set to a listing status of "Unavailable" in order to flip it to "Available" on the drop date.

name
required
string
sku
required
string <= 255 characters

A company's unique identifier for a product. Commas are not supported.

description
required
string

Populate with product name if no additional description is available in source system.

quantity
string

Inventory level. Required if seller is managing inventory

unit_multiplier
integer
Default: 1

Required if seller is selling in cases (multiples). This is a very common practice for sellers across all product categories. If sold in multiples, the number of units sold per case. If not selling in multiples, set to "1".

required
object

Manufacturer's Suggested Retail Price (MSRP). Use "0.00" if no retail price is stored in the source system.

required
object

Wholesale price displayed to buyers in the LeafLink marketplace.

required
object

Sale price displayed to buyers in the LeafLink marketplace. Use "0.00" if no sale price is stored in the source system.

minimum_order
required
string

Minimum units required for an order. Use "0.01" if no minimum order quantity is stored in the source system.

maximum_order
required
string

Maximum units allowed for an order. Use "100000" if no maximum order quantity is stored in the source system.

AVAILABLE_FOR_SAMPLES
boolean

Is this product available for samples? Set to "true" if value is not available in source system. Certain markets like Canada and OH do not allow samples.

extern_acct_id
string

Id of the product in QuickBooks Online.

extern_income_acct_id
string

The id for the QuickBooks Online income account.

featured
boolean

Is the product a featured product? Set to "false" if value is not available in source system.

tagline
string

One-liner that displayed when the product is featured

allow_fractional_quantities
boolean

Does this product allow fractional quantities to be ordered? Recommended if Flower category product is sold in bulk.

object (Parent)

Parent product to which this product belongs. 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
required
string
Enum: "Available" "Archived" "Sample" "Backorder" "Internal" "Unavailable"

Set to "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
string

The listing state string displayed in the marketplace.

inventory_management
required
string

id for the inventory setting [1: "Managed", 2: "Unlimited", 3: "Inherited"] Use "1" to set the inventory of the product to managed. If set to "1", available inventory quantity should be set using "quantity" field.

unit_of_measure
required
string
Enum: "Milligram" "Gram" "Kilogram" "Ounce" "Pound" "Unit" "Liter" "Milliliter"

If appropriate unit of measure is not available as an option, use "Unit" and enter the number of units per unit in the base_units_per_unit field.

sell_in_unit_of_measure
string
Value: "Case"

If selling the product in cases as opposed to individual units, set this field to "Case". Required if seller is selling in cases and unit_multiplier is greater than 1.

unit_denomination
required
integer

id for the unit denomination [1: "1", 2: "1/2", 3: "1/4", 4: "1/8", 5: "3/4", 6: "2", 7: "3 1/2", 8: "7", 9: "14", 10: "6", 11: "28", 12: "5 1/4", 13: "4", 14: "2 1/2", 15: "8", 16: "3 3/4", 17: "1/10", 18: "6/5", 19: "3/2", 20: "2/10", 21: "1/5", 22: "1/3", 23: "1/6", 24: "3/10", 25: "4/10"]. Set to "1" if appropriate value is not available as an option.

category
required
integer

Id for the category. See id in the product-categories response. Ids may differ per environment.

sub_category
required
integer

Id for the subcategory. See id in the product-subcategories response. Ids may differ per environment.

grow_type
integer

If a flower product, the id for the type of grow operation.

seller
required
integer

Id for the company listing the product. See id in the companies response.

brand
required
integer

Id for the brand. See id in the brands response.

product_line
integer

Id for the product line. See id in the product-lines response. 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
required
integer

Id for the company that manufactured the product. See id in the companies response. Typically set to the same id as the seller field.

strain_classification
required
string
Enum: "sativa" "indica" "hybrid" "na" "11-cbd" "high-cbd" "sativa-hybrid" "indica-hybrid"

If not applicable to the product, use na.

license
required
integer

Id for the license. See id in the licenses response. Required for product to appear on menu for buyer visibility and for compliance. Use "N/A" for ancillary products.

strains
Array of integers unique

The strains associated with the product. This field is required for products with the Flower category.

extern_sts_ids
Array of strings

Id used by the Metrc add on.

base_units_per_unit
string <decimal>

Required if using Unit as base unit of measure. If the product unit_of_measure is Unit, this describes the number of base units in each unit of the product. The base unit is defined by the product category.
Cartridges = Grams
Topicals = Milligrams of Cannabinoids
Concentrates = Grams
Flower (excluding Seeds and Clones) = Grams
Edibles & Ingestibles = Milligrams of Cannabinoids
Pre-Rolls = Grams
Accessories = N/A

external_ids
object (ExternalIds)

Set of key-value pairs for storing external system IDs. Key value can be up to 36 characters long.

threshold_value
integer

When product inventory quantity reaches below this value, take various actions.

threshold_action
string

Action to take when product inventory quantity reaches below a specified value. Available values include default, backorder, unavailable, and internal.

reverse_threshold_value
integer

When product inventory quantity reaches above this value, take various actions.

reverse_threshold_action
string

Action to take when product inventory quantity reaches above a specified value. Available values include default, available, and internal.

show_quantity
boolean

Show inventory quantities to buyers?

Array of objects

Product specifications.

Responses

Request samples

Content type
application/json
{
  • "name": "Swiss Masters Chocolate Bar (Dark)",
  • "sku": "SWI-BAR-DAR-100",
  • "description": "<p>Our premium Swiss Masters chocolate bars are bold, rich, and steeped in chocolate tradition. The Swiss Master dark chocolate has 70% dark chocolate paired with 100mg THC.</p>",
  • "quantity": "800.0000",
  • "display_name": "Swiss Masters Chocolate Bar (Dark)",
  • "unit_multiplier": 12,
  • "retail_price": {
    },
  • "wholesale_price": {
    },
  • "sale_price": {
    },
  • "minimum_order": "1.0000",
  • "maximum_order": null,
  • "listing_state": "Available",
  • "inventory_management": 1,
  • "unit_of_measure": "Unit",
  • "unit_denomination": 1,
  • "category": 7,
  • "seller": 3721,
  • "brand": 49,
  • "manufacturer": 3721,
  • "strain_classification": "na",
  • "license": 2619,
  • "external_ids": {
    },
  • "threshold_value": 0,
  • "threshold_action": "unavailable",
  • "reverse_threshold_value": 1,
  • "reverse_threshold_action": "available",
  • "show_quantity": true
}

Response samples

Content type
application/json
{
  • "id": 2093,
  • "created_on": "2020-02-19T00:36:22.353448-06:00",
  • "last_edit": "2020-04-27T07:41:29.797149-06:00",
  • "drop_date": null,
  • "dropped": null,
  • "name": "Swiss Masters Chocolate Bar (Dark)",
  • "sku": "SWI-BAR-DAR-100",
  • "description": "<p>Our premium Swiss Masters chocolate bars are bold, rich, and steeped in chocolate tradition. The Swiss Master dark chocolate has 70% dark chocolate paired with 100mg THC.</p>",
  • "quantity": "800.0000",
  • "reserved_qty": "120.0000",
  • "display_name": "Swiss Masters Chocolate Bar (Dark)",
  • "unit_multiplier": 12,
  • "retail_price": {
    },
  • "wholesale_price": {
    },
  • "sale_price": {
    },
  • "minimum_order": "1.0000",
  • "maximum_order": null,
  • "is_medical_line_item": false,
  • "AVAILABLE_FOR_SAMPLES": true,
  • "extern_acct_id": null,
  • "extern_income_acct_id": "",
  • "featured": false,
  • "tagline": null,
  • "featured_on_deals": false,
  • "allow_fractional_quantities": false,
  • "parent": null,
  • "listing_state": "Available",
  • "display_listing_state": "Available",
  • "inventory_management": 1,
  • "unit_of_measure": "Unit",
  • "sell_in_unit_of_measure": "Case",
  • "unit_denomination": {
    },
  • "category": 7,
  • "grow_type": null,
  • "seller": 3721,
  • "brand": 49,
  • "product_line": 164,
  • "manufacturer": 3721,
  • "strain_classification": "na",
  • "license": {
    },
  • "available_inventory": 680,
  • "children_count": 0,
  • "strains": [ ],
  • "price_schedule_price": {
    },
  • "image_count": 1,
  • "is_ancillary": false,
  • "s2s_conversion_amount": "1.0000",
  • "extern_sts_ids": null,
  • "strain_classification_display": "N/A",
  • "modified": "2020-06-11T15:53:07.137980-06:00",
  • "sub_category": 14,
  • "has_deals_eligible_children": false,
  • "discount_percent": 0,
  • "base_units_per_unit": null,
  • "external_ids": {
    },
  • "threshold_value": 0,
  • "threshold_action": "unavailable",
  • "reverse_threshold_value": 1,
  • "reverse_threshold_action": "available",
  • "show_quantity": true,
  • "product_data_items": [
    ]
}

Retrieve a product

Retrieve an individual product.

Authorizations:
Token
path Parameters
id
required
integer

The id for the product.

query Parameters
fields_include
string

Include only specific fields in the response, separated by commas.

fields_exclude
string

Exclude specific fields in the response, separated by commas.

include_children
string

Include additional fields in the response. Available values include images, volume_discounts, and strains

Responses

Response samples

Content type
application/json
{
  • "id": 2093,
  • "created_on": "2020-02-19T00:36:22.353448-06:00",
  • "last_edit": "2020-04-27T07:41:29.797149-06:00",
  • "drop_date": null,
  • "dropped": null,
  • "name": "Swiss Masters Chocolate Bar (Dark)",
  • "sku": "SWI-BAR-DAR-100",
  • "description": "<p>Our premium Swiss Masters chocolate bars are bold, rich, and steeped in chocolate tradition. The Swiss Master dark chocolate has 70% dark chocolate paired with 100mg THC.</p>",
  • "quantity": "800.0000",
  • "reserved_qty": "120.0000",
  • "display_name": "Swiss Masters Chocolate Bar (Dark)",
  • "unit_multiplier": 12,
  • "retail_price": {
    },
  • "wholesale_price": {
    },
  • "sale_price": {
    },
  • "minimum_order": "1.0000",
  • "maximum_order": null,
  • "is_medical_line_item": false,
  • "AVAILABLE_FOR_SAMPLES": true,
  • "extern_acct_id": null,
  • "extern_income_acct_id": "",
  • "featured": false,
  • "tagline": null,
  • "featured_on_deals": false,
  • "allow_fractional_quantities": false,
  • "parent": null,
  • "listing_state": "Available",
  • "display_listing_state": "Available",
  • "inventory_management": 1,
  • "unit_of_measure": "Unit",
  • "sell_in_unit_of_measure": "Case",
  • "unit_denomination": {
    },
  • "category": 7,
  • "grow_type": null,
  • "seller": 3721,
  • "brand": 49,
  • "product_line": 164,
  • "manufacturer": 3721,
  • "strain_classification": "na",
  • "license": {
    },
  • "available_inventory": 680,
  • "children_count": 0,
  • "strains": [ ],
  • "price_schedule_price": {
    },
  • "image_count": 1,
  • "is_ancillary": false,
  • "s2s_conversion_amount": "1.0000",
  • "extern_sts_ids": null,
  • "strain_classification_display": "N/A",
  • "modified": "2020-06-11T15:53:07.137980-06:00",
  • "sub_category": 14,
  • "has_deals_eligible_children": false,
  • "discount_percent": 0,
  • "base_units_per_unit": null,
  • "external_ids": {
    },
  • "threshold_value": 0,
  • "threshold_action": "unavailable",
  • "reverse_threshold_value": 1,
  • "reverse_threshold_action": "available",
  • "show_quantity": true,
  • "product_data_items": [
    ]
}

Update a product

Update an existing product.

Authorizations:
Token
path Parameters
id
required
integer

The id for the product.

Request Body schema: application/json
drop_date
string <date-time>

Date and time the product is scheduled to transition to Available, if applicable.

name
string
sku
string <= 255 characters
description
string
quantity
string

Inventory level

available_inventory
string

Inventory available for sale (quantity - reserved_qty).

unit_multiplier
integer
Default: 1

If sold in multiples, the number of units sold per case

object

Manufacturer's Suggested Retail Price (MSRP)

object

Wholesale price displayed to buyers in the LeafLink marketplace

object

Sale price displayed to buyers in the LeafLink marketplace

minimum_order
string

Minimum units required for an order

maximum_order
string

Maximum units allowed for an order

AVAILABLE_FOR_SAMPLES
boolean

Is this product available for samples?

extern_acct_id
string

Id of the product in QuickBooks Online.

extern_income_acct_id
string

The id for the QuickBooks Online income account.

featured
boolean

Is the product a featured product?

tagline
string

One-liner that displayed when the product is featured

allow_fractional_quantities
boolean

Does this product allow fractional quantities to be ordered?

object (Parent)

Parent product to which this product belongs. 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
string
Enum: "Available" "Archived" "Sample" "Backorder" "Internal" "Unavailable"
display_listing_state
string

The listing state string displayed in the marketplace.

inventory_management
string

id for the inventory setting [1: "Managed", 2: "Unlimited", 3: "Inherited"]

unit_of_measure
string
Enum: "Milligram" "Gram" "Kilogram" "Ounce" "Pound" "Unit" "Liter" "Milliliter"
sell_in_unit_of_measure
string
Value: "Case"

If selling the product in cases as opposed to individual units, set this field to Case.

unit_denomination
integer

id for the unit denomination [1: "1", 2: "1/2", 3: "1/4", 4: "1/8", 5: "3/4", 6: "2", 7: "3 1/2", 8: "7", 9: "14", 10: "6", 11: "28", 12: "5 1/4", 13: "4", 14: "2 1/2", 15: "8", 16: "3 3/4", 17: "1/10", 18: "6/5", 19: "3/2", 20: "2/10", 21: "1/5", 22: "1/3", 23: "1/6", 24: "3/10", 25: "4/10"]

category
integer

Id for the category. See id in the product-categories response.

sub_category
integer

Id for the subcategory. See id in the product-subcategories response.

grow_type
integer

If a flower product, the id for the type of grow operation.

seller
integer

Id for the company listing the product. See id in the companies response.

brand
integer

Id for the brand. See id in the brands response.

product_line
integer

Id for the product line. See id in the product-lines response.

manufacturer
integer

Id for the company that manufactured the product. See id in the companies response. Can be the same id as the seller field.

strain_classification
string
Enum: "sativa" "indica" "hybrid" "na" "11-cbd" "high-cbd" "sativa-hybrid" "indica-hybrid"

If not applicable to the product, use na.

object (ComplianceLicense)
strains
Array of integers unique

The strains associated with the product. This field is required for products with the Flower category.

extern_sts_ids
Array of strings

Id used by the Metrc add on.

base_units_per_unit
string <decimal>

If the product unit_of_measure is Unit, this describes the number of base units in each unit of the product. The base unit is defined by the product category.
Cartridges = Grams
Topicals = Milligrams of Cannabinoids
Concentrates = Grams
Flower (excluding Seeds and Clones) = Grams
Edibles & Ingestibles = Milligrams of Cannabinoids
Pre-Rolls = Grams
Accessories = N/A

external_ids
object (ExternalIds)

Set of key-value pairs for storing external system IDs. Key value can be up to 36 characters long.

threshold_value
integer

When product inventory quantity reaches below this value, take various actions.

threshold_action
string

Action to take when product inventory quantity reaches below a specified value. Available values include default, backorder, unavailable, and internal.

reverse_threshold_value
integer

When product inventory quantity reaches above this value, take various actions.

reverse_threshold_action
string

Action to take when product inventory quantity reaches above a specified value. Available values include default, available, and internal.

show_quantity
boolean

Show inventory quantities to buyers?

Array of objects

Product specifications. The list in the request will replace any existing product data items.

Responses

Request samples

Content type
application/json
{
  • "quantity": 2000
}

Response samples

Content type
application/json
{
  • "id": 2093,
  • "created_on": "2020-02-19T00:36:22.353448-06:00",
  • "last_edit": "2020-04-27T07:41:29.797149-06:00",
  • "drop_date": null,
  • "dropped": null,
  • "name": "Swiss Masters Chocolate Bar (Dark)",
  • "sku": "SWI-BAR-DAR-100",
  • "description": "<p>Our premium Swiss Masters chocolate bars are bold, rich, and steeped in chocolate tradition. The Swiss Master dark chocolate has 70% dark chocolate paired with 100mg THC.</p>",
  • "quantity": "2000.0000",
  • "reserved_qty": "120.0000",
  • "display_name": "Swiss Masters Chocolate Bar (Dark)",
  • "unit_multiplier": 12,
  • "retail_price": {
    },
  • "wholesale_price": {
    },
  • "sale_price": {
    },
  • "minimum_order": "1.0000",
  • "maximum_order": null,
  • "is_medical_line_item": false,
  • "AVAILABLE_FOR_SAMPLES": true,
  • "extern_acct_id": null,
  • "extern_income_acct_id": "",
  • "featured": false,
  • "tagline": null,
  • "featured_on_deals": false,
  • "allow_fractional_quantities": false,
  • "parent": null,
  • "listing_state": "Available",
  • "display_listing_state": "Available",
  • "inventory_management": 1,
  • "unit_of_measure": "Unit",
  • "sell_in_unit_of_measure": "Case",
  • "unit_denomination": {
    },
  • "category": 7,
  • "grow_type": null,
  • "seller": 3721,
  • "brand": 49,
  • "product_line": 164,
  • "manufacturer": 3721,
  • "strain_classification": "na",
  • "license": {
    },
  • "available_inventory": 1880,
  • "children_count": 0,
  • "strains": [ ],
  • "price_schedule_price": {
    },
  • "image_count": 1,
  • "is_ancillary": false,
  • "s2s_conversion_amount": "1.0000",
  • "extern_sts_ids": null,
  • "strain_classification_display": "N/A",
  • "modified": "2020-06-11T15:53:07.137980-06:00",
  • "sub_category": 14,
  • "has_deals_eligible_children": false,
  • "discount_percent": 0,
  • "base_units_per_unit": null,
  • "external_ids": {
    },
  • "threshold_value": 0,
  • "threshold_action": "unavailable",
  • "reverse_threshold_value": 1,
  • "reverse_threshold_action": "available",
  • "show_quantity": true
}

Archive a product

Archive a product.

Authorizations:
Token
path Parameters
id
required
integer

The id for the product.

Responses

Response samples

Content type
application/json
{
  • "id": 2093,
  • "created_on": "2020-02-19T00:36:22.353448-06:00",
  • "last_edit": "2020-04-27T07:41:29.797149-06:00",
  • "drop_date": null,
  • "dropped": null,
  • "name": "Swiss Masters Chocolate Bar (Dark)",
  • "sku": "SWI-BAR-DAR-100",
  • "description": "<p>Our premium Swiss Masters chocolate bars are bold, rich, and steeped in chocolate tradition. The Swiss Master dark chocolate has 70% dark chocolate paired with 100mg THC.</p>",
  • "quantity": "800.0000",
  • "reserved_qty": "120.0000",
  • "display_name": "Swiss Masters Chocolate Bar (Dark)",
  • "unit_multiplier": 12,
  • "retail_price": {
    },
  • "wholesale_price": {
    },
  • "sale_price": {
    },
  • "minimum_order": "1.0000",
  • "maximum_order": null,
  • "is_medical_line_item": false,
  • "AVAILABLE_FOR_SAMPLES": true,
  • "extern_acct_id": null,
  • "extern_income_acct_id": "",
  • "featured": false,
  • "tagline": null,
  • "featured_on_deals": false,
  • "allow_fractional_quantities": false,
  • "parent": null,
  • "listing_state": "Archived",
  • "display_listing_state": "Archived",
  • "inventory_management": 1,
  • "unit_of_measure": "Unit",
  • "sell_in_unit_of_measure": "Case",
  • "unit_denomination": {
    },
  • "category": 7,
  • "grow_type": null,
  • "seller": 3721,
  • "brand": 49,
  • "product_line": 164,
  • "manufacturer": 3721,
  • "strain_classification": "na",
  • "license": {
    },
  • "available_inventory": 680,
  • "children_count": 0,
  • "strains": [ ],
  • "price_schedule_price": {
    },
  • "image_count": 1,
  • "is_ancillary": false,
  • "s2s_conversion_amount": "1.0000",
  • "extern_sts_ids": null,
  • "strain_classification_display": "N/A",
  • "modified": "2020-06-11T15:53:07.137980-06:00",
  • "sub_category": 14,
  • "has_deals_eligible_children": false,
  • "discount_percent": 0,
  • "base_units_per_unit": null,
  • "external_ids": {
    },
  • "threshold_value": 0,
  • "threshold_action": "unavailable",
  • "reverse_threshold_value": 1,
  • "reverse_threshold_action": "available",
  • "show_quantity": true
}

product-categories

List categories

List all categories.

Authorizations:
Token
query Parameters
limit
integer

Number of results to return per page.

offset
integer

The initial index from which to return the results.

Responses

Response samples

Content type
application/json
{}

Retrieve a category

Retrieve an individual category.

Authorizations:
Token
path Parameters
id
required
integer

The id for the category.

Responses

Response samples

Content type
application/json
{
  • "id": 0,
  • "name": "string",
  • "slug": "string",
  • "description": "string"
}

product-subcategories

List subcategories

List all subcategories.

Authorizations:
Token
query Parameters
limit
integer

Number of results to return per page.

offset
integer

The initial index from which to return the results.

Responses

Response samples

Content type
application/json
{}

Retrieve a subcategory

Retrieve an individual subcategory.

Authorizations:
Token
path Parameters
id
required
integer

The id for the product subcategory.

Responses

Response samples

Content type
application/json
{
  • "id": 0,
  • "name": "string",
  • "slug": "string",
  • "description": "string",
  • "category": 0
}

listing-states

product-images

Product images for display in the marketplace. Each product may have up to 5 images.

List images

List all all images.

Retrieved per product via the product query parameter or with the following path parameter, /products/{product_id}/images

Authorizations:
Token
query Parameters
product
number

Filter by product id.

id
number

Filter by image id.

company_slug
string

Filter by company slug.

limit
integer

Number of results to return per page.

offset
integer

The initial index from which to return the results.

Responses

Response samples

Content type
application/json
{}

Upload an image

Upload a new product image. This request requires multipart form data.

Authorizations:
Token
Request Body schema: multipart/form-data
required
image
required
string <binary>

The uploaded file, sent via multipart form data. Retrieved as a url link.

product
required
integer

The id for the product that the image will be assigned to.

position
required
integer or null [ 1 .. 5 ]

The position of the image.

Responses

Response samples

Content type
application/json
{}

Retrieve an image

Retrieve an individual image.

Authorizations:
Token
path Parameters
id
required
integer

The id for the image.

Responses

Response samples

Content type
application/json
{}

Delete an image

Delete an image.

Authorizations:
Token
path Parameters
id
required
integer

The id for the image.

Responses

product-lines

List product lines

List all product lines.


Retrieved per company with the company query parameter or with the following path parameter, /companies/{company_id}/product-lines/
Authorizations:
Token
query Parameters
brand
string

Filter by brand

id
number

Filter by id

company
number

Filter by company

company_slug
string

Filter by owner company slug.

limit
integer

Number of results to return per page.

offset
integer

The initial index from which to return the results.

Responses

Response samples

Content type
application/json
{}

Create a product line

Create a new product line.

Authorizations:
Token
Request Body schema: application/json
required
name
required
string <= 100 characters
brand
required
integer

Id for the brand. See id in the brands response.

menu_position
integer

Position of the product line on the menu.

Responses

Request samples

Content type
application/json
{
  • "name": "string",
  • "brand": 0,
  • "menu_position": 0
}

Response samples

Content type
application/json
{
  • "id": 0,
  • "name": "string",
  • "brand": 0,
  • "menu_position": 0
}

Retrieve a product line

Retrieve an individual product line.

Authorizations:
Token
path Parameters
id
required
integer

The id for the product line.

Responses

Response samples

Content type
application/json
{
  • "id": 0,
  • "name": "string",
  • "brand": 0,
  • "menu_position": 0
}

Update a product line

Update an existing product line.

Authorizations:
Token
path Parameters
id
required
integer

The id for the product line.

Request Body schema: application/json
required
name
string <= 100 characters
brand
integer

Id for the brand. See id in the brands response.

menu_position
integer

Position of the product line on the menu.

Responses

Request samples

Content type
application/json
{
  • "name": "string",
  • "brand": 0,
  • "menu_position": 0
}

Response samples

Content type
application/json
{
  • "id": 0,
  • "name": "string",
  • "brand": 0,
  • "menu_position": 0
}

strains

List strains

List all strains.

Authorizations:
Token
query Parameters
id
number

Filter by strain id

name
string

Filter by strain name

company
number

Filter by company ids, separated by commas

company_slug
string

Filter by company slug

company__isnull
string

Filter by company__isnull

parents
number

Filter by parent strain ids, separated by commas

strain_classification
string

Filter by strain classifications, separated by commas.

limit
integer

Number of results to return per page.

offset
integer

The initial index from which to return the results.

Responses

Response samples

Content type
application/json
{}

Create a strain

Create a new strain.

Authorizations:
Token
Request Body schema: application/json
required
name
required
string
parents
Array of integers

Array of parent strain ids

company
integer

Id for the company that created the strain.

strain_classification
required
string
Enum: "sativa" "indica" "hybrid" "na" "11-cbd" "high-cbd" "sativa-hybrid" "indica-hybrid"

Responses

Request samples

Content type
application/json
{
  • "name": "string",
  • "parents": [
    ],
  • "company": 0,
  • "strain_classification": "sativa"
}

Response samples

Content type
application/json
{
  • "id": 0,
  • "name": "string",
  • "parents": [
    ],
  • "company": 0,
  • "strain_classification": "sativa"
}

Retrieve a strain

Retrieve an individual Strain.

Authorizations:
Token

Responses

Response samples

Content type
application/json
{
  • "id": 0,
  • "name": "string",
  • "parents": [
    ],
  • "company": 0,
  • "strain_classification": "sativa"
}

The batch object

id
integer

Unique id generated by LeafLink.

owner
string

Id for the company

production_batch_number
string
batch_date
string <date>
thc
string <decimal>
thca
string <decimal>
total_thc
string <decimal>
cbd
string <decimal>
cbda
string <decimal>
cbg
string <decimal>
cbn
string <decimal>
total_cannabinoids
string <decimal>
Array of objects
cannabinoid_unit
string

Unit for the test results. Acceptable values include %, MG/ML, MG/G

testing_source
string

Name of the source system for the test results

is_from_api
boolean

Describes whether this batch was created via an external system

{
  • "id": 0,
  • "owner": "string",
  • "production_batch_number": "string",
  • "batch_date": "2019-08-24",
  • "thc": "string",
  • "thca": "string",
  • "total_thc": "string",
  • "cbd": "string",
  • "cbda": "string",
  • "cbg": "string",
  • "cbn": "string",
  • "total_cannabinoids": "string",
  • "documents": [
    ],
  • "cannabinoid_unit": "string",
  • "testing_source": "string",
  • "is_from_api": true
}

batches

List batches

List all batches.

For legacy auth, retrieved per company with the owner query parameter or with the following path parameter, /companies/{company_id}/batches/

Authorizations:
Token
query Parameters
batch_date__lt
string

Filter by batch_date__lt

batch_date__lte
string

Filter by batch_date__lte

batch_date__gt
string

Filter by batch_date__gt

batch_date__gte
string

Filter by batch_date__gte

id
number

Filter by one or multiple batch ids, separated by commas.

owner
number

Filter by one or multiple company ids, separated by commas.

company_slug
string

Filter by owner company slug.

production_batch_number
string

Filter by one or multiple production_batch_numbers, separated by commas.

products
number

Filter by one or multiple product ids, separated by commas.

thc
string

Filter by a range of THC percent.

thca
string

Filter by a range of THCa percent.

total_thc
string

Filter by a range of total THC percent.

cbd
string

Filter by a range of CBD percent.

cbda
string

Filter by a range of CBDa percent.

cbg
string

Filter by a range of CBG percent.

cbn
string

Filter by a range of CBN percent.

total_cannabinoids
string

Filter by a range of total cannabinoids percent.

limit
integer

Number of results to return per page.

offset
integer

The initial index from which to return the results.

Responses

Response samples

Content type
application/json
{
  • "count": 0,
  • "previous": "http://example.com",
  • "results": [
    ]
}

Create a batch

Create a new batch.

Authorizations:
Token
Request Body schema: application/json
required
owner
required
string

id for the company

production_batch_number
required
string <= 50 characters
batch_date
required
string <date>
thc
string <decimal>
thca
string <decimal>
total_thc
string <decimal>
cbd
string <decimal>
cbda
string <decimal>
cbg
string or null <decimal>
cbn
string <decimal>
total_cannabinoids
string <decimal>
cannabinoid_unit
string

Unit for the test results. Acceptable values include %, MG/ML, MG/G

testing_source
required
string

Name of the source system for the test results

Responses

Request samples

Content type
application/json
{
  • "owner": "string",
  • "production_batch_number": "string",
  • "batch_date": "2019-08-24",
  • "thc": "string",
  • "thca": "string",
  • "total_thc": "string",
  • "cbd": "string",
  • "cbda": "string",
  • "cbg": "string",
  • "cbn": "string",
  • "total_cannabinoids": "string",
  • "cannabinoid_unit": "string",
  • "testing_source": "string"
}

Response samples

Content type
application/json
{
  • "id": 0,
  • "owner": "string",
  • "production_batch_number": "string",
  • "batch_date": "2019-08-24",
  • "thc": "string",
  • "thca": "string",
  • "total_thc": "string",
  • "cbd": "string",
  • "cbda": "string",
  • "cbg": "string",
  • "cbn": "string",
  • "total_cannabinoids": "string",
  • "documents": [
    ],
  • "cannabinoid_unit": "string",
  • "testing_source": "string",
  • "is_from_api": true
}

Retrieve a batch

Retrieve an individual batch.

Authorizations:
Token
path Parameters
id
required
string

The id for the batch.

Responses

Response samples

Content type
application/json
{
  • "id": 0,
  • "owner": "string",
  • "production_batch_number": "string",
  • "batch_date": "2019-08-24",
  • "thc": "string",
  • "thca": "string",
  • "total_thc": "string",
  • "cbd": "string",
  • "cbda": "string",
  • "cbg": "string",
  • "cbn": "string",
  • "total_cannabinoids": "string",
  • "documents": [
    ],
  • "cannabinoid_unit": "string",
  • "testing_source": "string",
  • "is_from_api": true
}

Update a batch

Update an existing batch.

Authorizations:
Token
path Parameters
id
required
string

The id for the batch.

Request Body schema: application/json
required
production_batch_number
string <= 50 characters
batch_date
string <date>
thc
string <decimal>
thca
string <decimal>
total_thc
string <decimal>
cbd
string <decimal>
cbda
string <decimal>
cbg
string <decimal>
cbn
string <decimal>
total_cannabinoids
string <decimal>
cannabinoid_unit
string

Unit for the test results. Acceptable values include %, MG/ML, MG/G

Responses

Request samples

Content type
application/json
{
  • "production_batch_number": "string",
  • "batch_date": "2019-08-24",
  • "thc": "string",
  • "thca": "string",
  • "total_thc": "string",
  • "cbd": "string",
  • "cbda": "string",
  • "cbg": "string",
  • "cbn": "string",
  • "total_cannabinoids": "string",
  • "cannabinoid_unit": "string"
}

Response samples

Content type
application/json
{
  • "id": 0,
  • "owner": "string",
  • "production_batch_number": "string",
  • "batch_date": "2019-08-24",
  • "thc": "string",
  • "thca": "string",
  • "total_thc": "string",
  • "cbd": "string",
  • "cbda": "string",
  • "cbg": "string",
  • "cbn": "string",
  • "total_cannabinoids": "string",
  • "documents": [
    ],
  • "cannabinoid_unit": "string",
  • "testing_source": "string",
  • "is_from_api": true
}

Delete a batch

Delete a batch.

Authorizations:
Token
path Parameters
id
required
string

The id for the batch.

Responses

The product batch object

The product batch object assigns a batch to a product.

id
integer

Unique id generated by LeafLink.

product
string

Id for the Product. See id in the product object.

batch
integer

Id for the batch. See id in the batch object.

{
  • "id": 0,
  • "product": "string",
  • "batch": 0
}

product-batches

Manage assignments.

List assignments

Authorizations:
Token
query Parameters
limit
integer

Number of results to return per page.

offset
integer

The initial index from which to return the results.

Responses

Response samples

Content type
application/json
{}

Create an assignment

Authorizations:
Token
Request Body schema: application/json
required
product
required
string

Id for the Product. See id in the product object.

batch
required
integer

Id for the batch. See id in the batch object.

Responses

Request samples

Content type
application/json
{
  • "product": "string",
  • "batch": 0
}

Response samples

Content type
application/json
{
  • "id": 0,
  • "product": "string",
  • "batch": 0
}

Retrieve an assignment

Authorizations:
Token
path Parameters
id
required
string

The id for the assignment.

Responses

Response samples

Content type
application/json
{
  • "id": 0,
  • "product": "string",
  • "batch": 0
}

Delete an assignment

Authorizations:
Token
path Parameters
id
required
string

The id for the assignment.

Responses

The batch document object

id
integer

Unique id generated by LeafLink.

batch
integer

Id for the batch. See id in the batch object.

created_on
string <date-time>

Date and time the document was uploaded.

modified
string <date-time>

Date and time the document was last modified.

summary
string
document
string <uri>

uri for the document

{
  • "id": 0,
  • "batch": 0,
  • "created_on": "2019-08-24T14:15:22Z",
  • "modified": "2019-08-24T14:15:22Z",
  • "summary": "string",
  • "document": "http://example.com"
}

batch-documents

List batch documents

List all batch documents.

Authorizations:
Token

Responses

Response samples

Content type
application/json
{}

Upload a batch document

Upload a new batch document.

Authorizations:
Token
Request Body schema: multipart/form-data
required
document
required
string <binary>

uri for the file

batch
required
integer

id for the Batch to attach this document to.

summary
string <= 350 characters

Additional information about the document.

Responses

Response samples

Content type
application/json
{
  • "id": 0,
  • "batch": 0,
  • "created_on": "2019-08-24T14:15:22Z",
  • "modified": "2019-08-24T14:15:22Z",
  • "summary": "string",
  • "document": "http://example.com"
}

Retrieve a batch document

Retrieve an individual batch document.

Authorizations:
Token
path Parameters
id
required
integer

The id for the batch document.

Responses

Response samples

Content type
application/json
{
  • "id": 0,
  • "batch": 0,
  • "created_on": "2019-08-24T14:15:22Z",
  • "modified": "2019-08-24T14:15:22Z",
  • "summary": "string",
  • "document": "http://example.com"
}

Delete a batch document

Delete a batch document.

Authorizations:
Token
path Parameters
id
required
integer

The id for the batch document.

Responses

The inventory item object

id
integer

Unique id generated by LeafLink.

facility
integer

ID of the associated facility.

inventory
integer

ID of the associated inventory.

product
integer

ID of the associated product.

quantity
number <decimal>

Number of inventory items available.

quantity_in_product_uom
string <decimal>

Number of inventory items available in unit of measure.

reserved_qty
string <decimal>

Number of reserved inventory items.

reserved_qty_in_product_uom
string <decimal>

Number of reserved inventory items in unit of measure.

batch
integer

ID of the associated batch.

is_archived
boolean

Indicated whether the inventory item is active.

{
  • "id": 0,
  • "facility": 0,
  • "inventory": 0,
  • "product": 0,
  • "quantity": 0,
  • "quantity_in_product_uom": "string",
  • "reserved_qty": "string",
  • "reserved_qty_in_product_uom": "string",
  • "batch": 0,
  • "is_archived": true
}

Inventory Items

The InventoryItem model represents items of a particular inventory batch at a given facility.

List

List all inventory items. By default this returns non-archived items - you can query for archived items by including the "include_archived" query parameter.

⚠️ WARNING - BETA FEATURE: This API is in active development and is subject to change.

Authorizations:
Token
query Parameters
include_archived
boolean

Filter by archived status

product
string

Filter by product ID

Responses

Response samples

Content type
application/json
{
  • "count": 0,
  • "previous": "http://example.com",
  • "results": [
    ]
}

Create

Create an inventory item.

NOTE: If a non-archived inventory item is found with the same product and facility but no batch, it will be marked as "archived" and a new inventory item will be created. As a result, subsequent GET requests will no longer return the old inventory item. As mentioned in the GET method description, you can query for archived items by including the "include_archived" query parameter.

⚠️ WARNING - BETA FEATURE: This API is in active development and is subject to change.

Authorizations:
Token
Request Body schema: application/json
required
batch
required
integer

ID of the associated batch.

is_archived
required
boolean

Indicated whether the inventory item is archived.

facility
required
integer

ID of the associated facility.

product
required
integer

ID of the associated product.

quantity
required
number <decimal>

Number of inventory items available.

Responses

Request samples

Content type
application/json
{
  • "batch": 0,
  • "is_archived": true,
  • "facility": 0,
  • "product": 0,
  • "quantity": 0
}

Response samples

Content type
application/json
{
  • "id": 0,
  • "facility": 0,
  • "inventory": 0,
  • "product": 0,
  • "quantity": 0,
  • "quantity_in_product_uom": "string",
  • "reserved_qty": "string",
  • "reserved_qty_in_product_uom": "string",
  • "batch": 0,
  • "is_archived": true
}

Read

Get inventory item by ID.

⚠️ WARNING - BETA FEATURE: This API is in active development and is subject to change.

Authorizations:
Token
path Parameters
id
required
integer

A unique integer value identifying this inventory item.

query Parameters
include_archived
boolean

Filter by the archived status. (False by default.)

Responses

Response samples

Content type
application/json
{
  • "id": 0,
  • "facility": 0,
  • "inventory": 0,
  • "product": 0,
  • "quantity": 0,
  • "quantity_in_product_uom": "string",
  • "reserved_qty": "string",
  • "reserved_qty_in_product_uom": "string",
  • "batch": 0,
  • "is_archived": true
}

Update

Update an existing inventory item by ID.

⚠️ WARNING - BETA FEATURE: This API is in active development and is subject to change.

Authorizations:
Token
path Parameters
id
required
integer

A unique integer value identifying this inventory item.

query Parameters
include_archived
boolean

Filter by the archived status. (False by default.)

Request Body schema: application/json
required
is_archived
boolean

Indicated whether the inventory item is active.

quantity
number <decimal>

Number of inventory items available.

Responses

Request samples

Content type
application/json
{
  • "is_archived": true,
  • "quantity": 0
}

Response samples

Content type
application/json
{
  • "id": 0,
  • "facility": 0,
  • "inventory": 0,
  • "product": 0,
  • "quantity": 0,
  • "quantity_in_product_uom": "string",
  • "reserved_qty": "string",
  • "reserved_qty_in_product_uom": "string",
  • "batch": 0,
  • "is_archived": true
}

The facility object

id
integer

Unique id generated by LeafLink.

name
string

Name of the facility.

description
string

Description of the facility.

{
  • "id": 0,
  • "name": "string",
  • "description": "string"
}

Facilities

The Facility model represents a location where inventory is located.

List

List all facilities.

⚠️ WARNING - BETA FEATURE: This API is in active development and is subject to change.

Authorizations:
Token

Responses

Response samples

Content type
application/json
{}

Read

Get facility by ID.

⚠️ WARNING - BETA FEATURE: This API is in active development and is subject to change.

Authorizations:
Token
path Parameters
id
required
integer

A unique integer value identifying this facility.

Responses

Response samples

Content type
application/json
{
  • "id": 0,
  • "name": "string",
  • "description": "string"
}

The customer object

id
integer

Unique id generated by LeafLink.

state
string

State abbreviation

managers
Array of integers unique

Ids for the sales reps assigned to this customer.

created_on
string <date-time>

Date and time the customer was created.

modified
string <date-time>

Date and time the customer was last modified.

next_contact_date
string <date>

Date for the next contact, YYYY-MM-DD

nickname
string <= 200 characters

Alternate name for the customer

external_id
string <= 100 characters

Id of the customer in a 3rd party system

ext_acct_id
string

Id of the customer in QuickBooks Online.

license_number
string <= 100 characters

License Number

old_license_number
string or null <= 100 characters

Old license number for the customer

license_inactive
boolean

Is the license inactive for this customer?

business_identifier
string <= 100 characters

Company identifier distinct from license numbers

ein
string <= 100 characters

Company's federal EIN number. For Customers linked to LeafLink Buyers (partner_id=Company.id), this field is read-only and inherited directly from the linked LeafLink Buyer Company. For Customers not linked to LeafLink Buyer Companies (partner_id=null), this field will return null.

directions
string <= 3000 characters

Directions to the customer's location

delivery_preferences
string

Customer delivery preferences. These will show up as footnotes on orders placed by the customer.

currency
string non-empty

Currency used by the customer.

shipping_charge
string <decimal>

Additional shipping charge

brand
string <= 400 characters

Brand name associated with the customer

name
string <= 400 characters

Customer name

dba
string <= 400 characters

DBA of customer

business_license_name
string <= 400 characters

Business License Name

description
string <= 4000 characters

Additional information about the customer

website
string <uri> <= 400 characters

Customer's website

address
string <= 400 characters

Customer's address

unit_number
string

Unit # for the address

zipcode
string <= 6 characters

Zipcode

city
string <= 400 characters

City

county
string <= 400 characters

County

country
string <= 400 characters

Country

lat
string <decimal>

Location latitude

long
string <decimal>

Location longitude

phone
string <= 400 characters

Phone Number

phone_extension
string <= 400 characters

Phone Extension

email
string <email> <= 255 characters

Email address

notes
string <= 3000 characters

Other information about the customer

leaflink_last_views
string <date-time>

The last time this customer viewed your products.

leaflink_source
boolean

Was this customer added to your CRM by LeafLink?

archived
boolean

Is the customer record archived?

delinquent
boolean

Is this customer delinquent on billing?

discount_percent
string <decimal>

Discount percent for orders from this customer.

owner
integer

Id for the company that this customer record is for.

partner
integer

Id for the buyer company that this customer record represents.

tier
integer

Id for the customer's tier

price_schedule
integer

Id for the price schedule assigned to the customer

service_zone
integer

Customer's service zone

license_type
integer (Business License Type)

Customer's business license type

payment_term
integer

Customer's payment terms Deprecated field, please use payment_option instead

payment_methods
Array of integers

Customer's payment methods Deprecated field, please use payment_option instead

available_payment_options
Array of any (Available payment options)

Available payment options for a customer

status
integer

Id for the customer's status

external_ids
object (ExternalIds)

Set of key-value pairs for storing external system IDs. Key value can be up to 36 characters long.

object (Address)
object (Address)
{
  • "id": 0,
  • "state": "string",
  • "managers": [
    ],
  • "created_on": "2019-08-24T14:15:22Z",
  • "modified": "2019-08-24T14:15:22Z",
  • "next_contact_date": "2019-08-24",
  • "nickname": "string",
  • "external_id": "string",
  • "ext_acct_id": "string",
  • "license_number": "string",
  • "old_license_number": "string",
  • "license_inactive": true,
  • "business_identifier": "string",
  • "ein": "string",
  • "directions": "string",
  • "delivery_preferences": "string",
  • "currency": "string",
  • "shipping_charge": "string",
  • "brand": "string",
  • "name": "string",
  • "dba": "string",
  • "business_license_name": "string",
  • "description": "string",
  • "website": "http://example.com",
  • "address": "string",
  • "unit_number": "string",
  • "zipcode": "string",
  • "city": "string",
  • "county": "string",
  • "country": "string",
  • "lat": "string",
  • "long": "string",
  • "phone": "string",
  • "phone_extension": "string",
  • "email": "user@example.com",
  • "notes": "string",
  • "leaflink_last_views": "2019-08-24T14:15:22Z",
  • "leaflink_source": true,
  • "archived": true,
  • "delinquent": true,
  • "discount_percent": "string",
  • "owner": 0,
  • "partner": 0,
  • "tier": 0,
  • "price_schedule": 0,
  • "service_zone": 0,
  • "license_type": 0,
  • "payment_term": 0,
  • "payment_methods": [
    ],
  • "available_payment_options": [
    ],
  • "status": 0,
  • "external_ids": { },
  • "corporate_address": {
    },
  • "delivery_address": {
    }
}

customers

The Customer model represents a business relationship between a buyer and seller on LeafLink.

List customers

List customers for all active companies where the user is a member of.

Authorizations:
Token
query Parameters
fields_include
string

Include only specific fields in the response, separated by commas.

fields_exclude
string

Exclude specific fields in the response, separated by commas.

include_children
string

Include additional fields in the response. Available values include tags, service_zone, managers, contacts, and license_type

nickname
string

Filter by the customer's nickname.

nickname__in
string

Filter by nickname__in

nickname__startswith
string

Filter by nickname__startswith

phone
string

Filter by the customer's business phone number.

phone__in
string

Filter by phone__in

phone__startswith
string

Filter by phone__startswith

dba
string

Filter by the customer's dba.

dba__in
string

Filter by dba__in

dba__startswith
string

Filter by dba__startswith

owner__slug
string

Filter by the slug of the Company that owns this Customer record.

id__in
number

Filter by id__in

id
number

Filter by id

next_contact_date__lt
string

Filter by next_contact_date__lt

next_contact_date__lte
string

Filter by next_contact_date__lte

next_contact_date__gt
string

Filter by next_contact_date__gt

next_contact_date__gte
string

Filter by next_contact_date__gte

company_slug
string

Filter by the slug of the Company that owns this Customer record.

external_id
string

Filter by the customer's external id.

external_id__in
string

Filter by external_id__in

external_id__startswith
string

Filter by external_id__startswith

ein
string

Filter by the customer's EIN.

ein__in
string

Filter by ein__in

ein__startswith
string

Filter by ein__startswith

discount_percent__lt
number

Filter by discount_percent__lt

discount_percent__lte
number

Filter by discount_percent__lte

discount_percent__gt
number

Filter by discount_percent__gt

discount_percent__gte
number

Filter by discount_percent__gte

old_license_number
string

Filter by the customer's previous license number.

old_license_number__in
string

Filter by old_license_number__in

old_license_number__startswith
string

Filter by old_license_number__startswith

modified__lt
string

Filter by the datetime the object was last modified, less than.

modified__lte
string

Filter by the datetime the object was last modified, less than or equal to.

modified__gt
string

Filter by the datetime the object was last modified, greater than.

modified__gte
string

Filter by the datetime the object was last modified, greater than or equal to.

brand
string

Filter by the customer's associated brand.

brand__in
string

Filter by brand__in

brand__startswith
string

Filter by brand__startswith

created_on__lt
string

Filter by created_on datetime, less than.

created_on__lte
string

Filter by created_on datetime, less than or equal to.

created_on__gt
string

Filter by created_on datetime, greater than.

created_on__gte
string

Filter by created_on datetime, greater than or equal to.

address
string

Filter by the customer's address.

address__in
string

Filter by address__in

address__startswith
string

Filter by address__startswith

business_license_name
string

Filter by the customer's business license name.

business_license_name__in
string

Filter by business_license_name__in

business_license_name__startswith
string

Filter by business_license_name__startswith

name
string

Filter by the customer's name.

name__in
string

Filter by name__in

name__startswith
string

Filter by name__startswith

business_identifier
string

Filter by the customer's business identifier.

business_identifier__in
string

Filter by business_identifier__in

business_identifier__startswith
string

Filter by business_identifier__startswith

license_number
string

Filter by the customer's license number.

license_number__in
string

Filter by license_number__in

license_number__startswith
string

Filter by license_number__startswith

ext_acct_id
string

Filter by the customer's external account id.

ext_acct_id__in
string

Filter by ext_acct_id__in

ext_acct_id__startswith
string

Filter by ext_acct_id__startswith

ext_acct_id__isnull
string

Filter by ext_acct_id__isnull

email
string

Filter by the customer's email.

email__in
string

Filter by email__in

email__startswith
string

Filter by email__startswith

website
string

Filter by the customer's website.

website__in
string

Filter by website__in

website__startswith
string

Filter by website__startswith

owner
number

Filter by owner ID.

partner
number

Filter by partner ID.

tier
number

Filter by the ID of a customer's tier.

price_schedule
number

Filter by the ID of a customer's price schedule.

service_zone
number

Filter by the ID of a customer's service zone.

license_type
number

Filter by the ID of a customer's license type.

license_inactive
string

Filter by the whether a customer's license is active.

payment_term
integer

Filter by the customer's payment term

payment_method
integer

Filter by the customer's payment method

status
number

Filter by the ID of a customer's status.

state
number

Filter by the ID of a customer's state.

leaflink_source
string

Filter by whether the customer was added by LeafLink.

archived
string

Filter by whether the customer has been archived.

delinquent
string

Filter by whether the customer is delinquent.

limit
integer

Number of results to return per page.

offset
integer

The initial index from which to return the results.

external_id_key
string

Filter for orders that match external_ids key:values. Must be used with external_id_values.

external_id_values
string

Filter for orders that match external_ids key:values. Multiple values separated by a comma. Must be used with external_id_key.

Responses

Response samples

Content type
application/json
{
  • "count": 0,
  • "previous": "http://example.com",
  • "results": [
    ]
}

Create a customer

Create a new customer.

Authorizations:
Token
Request Body schema: application/json
required
state
string (State)

State abbreviation

managers
Array of integers unique

Ids for the sales reps assigned to this customer.

next_contact_date
string <date> (Next contact date)

Date for the next contact, YYYY-MM-DD

nickname
string (Nickname) <= 200 characters

Alternate name for the customer

external_id
string (External ID) <= 100 characters

Id of the customer in a 3rd party system

ext_acct_id
string (Accounting Service External ID)

Id of the customer in QuickBooks Online.

license_number
string (License Number) <= 100 characters

License Number

old_license_number
string or null <= 100 characters

Old license number for the customer

license_inactive
boolean (License Inactive)

Is the license inactive for this customer?

business_identifier
string (Business Identifier / UBI) <= 100 characters

Company identifier distinct from license numbers

ein
string (EIN Number) <= 100 characters

Company's federal EIN number. DEPRECATED for writes. For Customers linked to LeafLink Buyers (partner_id=Company.id), this field is read-only and inherited directly from the linked LeafLink Buyer Company. For Customers not linked to LeafLink Buyer Companies (partner_id=null), this field will return null.

directions
string (Directions) <= 3000 characters

Directions to the customer's location

delivery_preferences
string (Delivery Preferences)

Customer delivery preferences. These will show up as footnotes on orders placed by the customer.

shipping_charge
string <decimal> (Shipping charge)

Additional shipping charge

brand
string (Brand Name) <= 400 characters

Brand name associated with the customer

name
required
string (Name) <= 400 characters

Customer name

dba
string (DBA) <= 400 characters

DBA of customer

business_license_name
string (Business License Name) <= 400 characters

Business License Name

description
string (Description) <= 4000 characters

Additional information about the customer

website
string <uri> (Website) <= 400 characters

Customer's website

address
string (Address) <= 400 characters

Customer's address

unit_number
string (Unit #)

Unit # for the address

zipcode
string (Zipcode) <= 6 characters

Zipcode

city
string (City) <= 400 characters

City

county
string (County) <= 400 characters

County

country
string (Country) <= 400 characters

Country

lat
string <decimal> (Lat)

Location latitude

long
string <decimal> (Long)

Location longitude

phone
string (Phone) <= 400 characters

Phone Number

phone_extension
string <= 400 characters

Phone Extension

email
string <email> <= 255 characters

Email address

notes
string (Notes) <= 3000 characters

Other information about the customer

archived
boolean (Is Archived)

Is the customer record archived?

delinquent
boolean (Delinquent Customer)

Is this customer delinquent on billing?

discount_percent
string <decimal> (Discount Percent)

Discount percent for orders from this customer.

owner
required
integer (Owner)

Id for the company that this customer record is for.

tier
integer (Tier)

Id for the customer's tier

price_schedule
integer

Id for the price schedule assigned to the customer

service_zone
integer (Service Zone)

Customer's service zone

license_type
integer (Business License Type)

Customer's business license type

payment_term
any (Payment Term)

Deprecated field, please use payment_option instead
Customer's payment terms
Enum: "llf" "cod" "net3" "net7" "net10" "net14" "net15" "net20" "net30" "net60" "net90" "prepay" "consign"
Deprecated values (will be mapped appropriately):
(1, "Cash") replaced with "cod"
(2, "Net 7") replaced with "net7"
(3, "Net 15") replaced with "net15",
(4, "Net 30") replaced with "net30"
(5, "Net 10") replaced with "net10"
(6, "Net 20") replaced with "net20
(7, "Net 60") replaced with "net60"
(8, "Net 3") replaced with "net3"
(9, "Net 14") replaced with "net14"
(10, "Pre-Payment") replaced with "prepay"
(11, "LeafLink Financial - Net 30") replaced with "llf" with payment_methods ["ach"]
(12, "Consignment") replaced with "consign"
(13, "LeafLink Financial - Net 15") replaced with "llf" with payment_methods ["ach"]
(14, "Net 90") replaced with "net90"
(15, "Wire on Delivery") replaced with "cod" with payment_methods ["wire"]
(20, "COD") replaced with "cod"
(21, "LeafLink Financial") replaced with "llf" with payment_methods ["ach"]

payment_methods
any (Payment Methods)

Deprecated field, please use payment_option instead
Customer's payment method
Enum: "cash" "check" "wire" "ach"

available_payment_options
object (Customer Payment Option)

Payment option available for customer

status
integer (Customer Account Status)

Id for the customer's status

external_ids
object (ExternalIds)

Set of key-value pairs for storing external system IDs. Key value can be up to 36 characters long.

object (Address)
object (Address)

Responses

Request samples

Content type
application/json
{
  • "state": "string",
  • "managers": [
    ],
  • "next_contact_date": "2019-08-24",
  • "nickname": "string",
  • "external_id": "string",
  • "ext_acct_id": "string",
  • "license_number": "string",
  • "old_license_number": "string",
  • "license_inactive": true,
  • "business_identifier": "string",
  • "ein": "string",
  • "directions": "string",
  • "delivery_preferences": "string",
  • "shipping_charge": "string",
  • "brand": "string",
  • "name": "string",
  • "dba": "string",
  • "business_license_name": "string",
  • "description": "string",
  • "website": "http://example.com",
  • "address": "string",
  • "unit_number": "string",
  • "zipcode": "string",
  • "city": "string",
  • "county": "string",
  • "country": "string",
  • "lat": "string",
  • "long": "string",
  • "phone": "string",
  • "phone_extension": "string",
  • "email": "user@example.com",
  • "notes": "string",
  • "archived": true,
  • "delinquent": true,
  • "discount_percent": "string",
  • "owner": 0,
  • "tier": 0,
  • "price_schedule": 0,
  • "service_zone": 0,
  • "license_type": 0,
  • "payment_term": null,
  • "payment_methods": null,
  • "available_payment_options": { },
  • "status": 0,
  • "external_ids": { },
  • "corporate_address": {
    },
  • "delivery_address": {
    }
}

Response samples

Content type
application/json
{
  • "id": 0,
  • "state": "string",
  • "managers": [
    ],
  • "created_on": "2019-08-24T14:15:22Z",
  • "modified": "2019-08-24T14:15:22Z",
  • "next_contact_date": "2019-08-24",
  • "nickname": "string",
  • "external_id": "string",
  • "ext_acct_id": "string",
  • "license_number": "string",
  • "old_license_number": "string",
  • "license_inactive": true,
  • "business_identifier": "string",
  • "ein": "string",
  • "directions": "string",
  • "delivery_preferences": "string",
  • "currency": "string",
  • "shipping_charge": "string",
  • "brand": "string",
  • "name": "string",
  • "dba": "string",
  • "business_license_name": "string",
  • "description": "string",
  • "website": "http://example.com",
  • "address": "string",
  • "unit_number": "string",
  • "zipcode": "string",
  • "city": "string",
  • "county": "string",
  • "country": "string",
  • "lat": "string",
  • "long": "string",
  • "phone": "string",
  • "phone_extension": "string",
  • "email": "user@example.com",
  • "notes": "string",
  • "leaflink_last_views": "2019-08-24T14:15:22Z",
  • "leaflink_source": true,
  • "archived": true,
  • "delinquent": true,
  • "discount_percent": "string",
  • "owner": 0,
  • "partner": 0,
  • "tier": 0,
  • "price_schedule": 0,
  • "service_zone": 0,
  • "license_type": 0,
  • "payment_term": 0,
  • "payment_methods": [
    ],
  • "available_payment_options": [
    ],
  • "status": 0,
  • "external_ids": { },
  • "corporate_address": {
    },
  • "delivery_address": {
    }
}

Retrieve a customer

Retrieve a customer by ID.

Authorizations:
Token
path Parameters
id
required
integer

A unique integer value identifying this company customer.

query Parameters
fields_include
string

Include only specific fields in the response, separated by commas.

fields_exclude
string

Exclude specific fields in the response, separated by commas.

include_children
string

Include additional fields in the response. Available values include tags, service_zone, managers, contacts, and license_type

Responses

Response samples

Content type
application/json
{
  • "id": 0,
  • "state": "string",
  • "managers": [
    ],
  • "created_on": "2019-08-24T14:15:22Z",
  • "modified": "2019-08-24T14:15:22Z",
  • "next_contact_date": "2019-08-24",
  • "nickname": "string",
  • "external_id": "string",
  • "ext_acct_id": "string",
  • "license_number": "string",
  • "old_license_number": "string",
  • "license_inactive": true,
  • "business_identifier": "string",
  • "ein": "string",
  • "directions": "string",
  • "delivery_preferences": "string",
  • "currency": "string",
  • "shipping_charge": "string",
  • "brand": "string",
  • "name": "string",
  • "dba": "string",
  • "business_license_name": "string",
  • "description": "string",
  • "website": "http://example.com",
  • "address": "string",
  • "unit_number": "string",
  • "zipcode": "string",
  • "city": "string",
  • "county": "string",
  • "country": "string",
  • "lat": "string",
  • "long": "string",
  • "phone": "string",
  • "phone_extension": "string",
  • "email": "user@example.com",
  • "notes": "string",
  • "leaflink_last_views": "2019-08-24T14:15:22Z",
  • "leaflink_source": true,
  • "archived": true,
  • "delinquent": true,
  • "discount_percent": "string",
  • "owner": 0,
  • "partner": 0,
  • "tier": 0,
  • "price_schedule": 0,
  • "service_zone": 0,
  • "license_type": 0,
  • "payment_term": 0,
  • "payment_methods": [
    ],
  • "available_payment_options": [
    ],
  • "status": 0,
  • "external_ids": { },
  • "corporate_address": {
    },
  • "delivery_address": {
    }
}

Update a customer

Update a customer by ID.

Authorizations:
Token
path Parameters
id
required
integer

A unique integer value identifying this company customer.

Request Body schema: application/json
required
state
string (State)

State abbreviation

managers
Array of integers unique

Ids for the sales reps assigned to this customer.

next_contact_date
string <date> (Next contact date)

Date for the next contact, YYYY-MM-DD

nickname
string (Nickname) <= 200 characters

Alternate name for the customer

external_id
string (External ID) <= 100 characters

Id of the customer in a 3rd party system

ext_acct_id
string (Accounting Service External ID)

Id of the customer in QuickBooks Online.

license_number
string (License Number) <= 100 characters

License Number

old_license_number
string or null <= 100 characters

Old license number for the customer

license_inactive
boolean (License Inactive)

Is the license inactive for this customer?

business_identifier
string (Business Identifier / UBI) <= 100 characters

Company identifier distinct from license numbers

ein
string (EIN Number) <= 100 characters

Company's federal EIN number. DEPRECATED for writes. For Customers linked to LeafLink Buyers (partner_id=Company.id), this field is read-only and inherited directly from the linked LeafLink Buyer Company. For Customers not linked to LeafLink Buyer Companies (partner_id=null), this field will return null.

directions
string (Directions) <= 3000 characters

Directions to the customer's location

delivery_preferences
string (Delivery Preferences)

Customer delivery preferences. These will show up as footnotes on orders placed by the customer.

shipping_charge
string <decimal> (Shipping charge)

Additional shipping charge

brand
string (Brand Name) <= 400 characters

Brand name associated with the customer

name
string (Name) <= 400 characters

Customer name

dba
string (DBA) <= 400 characters

DBA of customer

business_license_name
string (Business License Name) <= 400 characters

Business License Name

description
string (Description) <= 4000 characters

Additional information about the customer

website
string <uri> (Website) <= 400 characters

Customer's website

address
string (Address) <= 400 characters

Customer's address

unit_number
string (Unit #)

Unit # for the address

zipcode
string (Zipcode) <= 6 characters

Zipcode

city
string (City) <= 400 characters

City

county
string (County) <= 400 characters

County

country
string (Country) <= 400 characters

Country

lat
string <decimal> (Lat)

Location latitude

long
string <decimal> (Long)

Location longitude

phone
string (Phone) <= 400 characters

Phone Number

phone_extension
string <= 400 characters

Phone Extension

email
string <email> <= 255 characters

Email address

notes
string (Notes) <= 3000 characters

Other information about the customer

archived
boolean (Is Archived)

Is the customer record archived?

delinquent
boolean (Delinquent Customer)

Is this customer delinquent on billing?

discount_percent
string <decimal> (Discount Percent)

Discount percent for orders from this customer.

owner
integer (Owner)

Id for the company that this customer record is for.

tier
integer (Tier)

Id for the customer's tier

price_schedule
integer

Id for the price schedule assigned to the customer

service_zone
integer (Service Zone)

Customer's service zone

license_type
integer (Business License Type)

Customer's business license type

available_payment_options
object (Customer Payment Option)

Payment option available for customer

payment_term
any (Payment Term)

Deprecated field, please use payment_option instead
Customer's payment terms
Enum: "llf" "cod" "net3" "net7" "net10" "net14" "net15" "net20" "net30" "net60" "net90" "prepay" "consign"
Deprecated values (will be mapped appropriately):
(1, "Cash") replaced with "cod"
(2, "Net 7") replaced with "net7"
(3, "Net 15") replaced with "net15",
(4, "Net 30") replaced with "net30"
(5, "Net 10") replaced with "net10"
(6, "Net 20") replaced with "net20
(7, "Net 60") replaced with "net60"
(8, "Net 3") replaced with "net3"
(9, "Net 14") replaced with "net14"
(10, "Pre-Payment") replaced with "prepay"
(11, "LeafLink Financial - Net 30") replaced with "llf" with payment_methods ["ach"]
(12, "Consignment") replaced with "consign"
(13, "LeafLink Financial - Net 15") replaced with "llf" with payment_methods ["ach"]
(14, "Net 90") replaced with "net90"
(15, "Wire on Delivery") replaced with "cod" with payment_methods ["wire"]
(20, "COD") replaced with "cod"
(21, "LeafLink Financial") replaced with "llf" with payment_methods ["ach"]

payment_methods
any (Payment Methods)

Deprecated field, please use payment_option instead
Customer's payment method
Enum: "cash" "check" "wire" "ach"

status
integer (Customer Account Status)

Id for the customer's status

external_ids
object (ExternalIds)

Set of key-value pairs for storing external system IDs. Key value can be up to 36 characters long.

object (Address)
object (Address)

Responses

Request samples

Content type
application/json
{
  • "state": "string",
  • "managers": [
    ],
  • "next_contact_date": "2019-08-24",
  • "nickname": "string",
  • "external_id": "string",
  • "ext_acct_id": "string",
  • "license_number": "string",
  • "old_license_number": "string",
  • "license_inactive": true,
  • "business_identifier": "string",
  • "ein": "string",
  • "directions": "string",
  • "delivery_preferences": "string",
  • "shipping_charge": "string",
  • "brand": "string",
  • "name": "string",
  • "dba": "string",
  • "business_license_name": "string",
  • "description": "string",
  • "website": "http://example.com",
  • "address": "string",
  • "unit_number": "string",
  • "zipcode": "string",
  • "city": "string",
  • "county": "string",
  • "country": "string",
  • "lat": "string",
  • "long": "string",
  • "phone": "string",
  • "phone_extension": "string",
  • "email": "user@example.com",
  • "notes": "string",
  • "archived": true,
  • "delinquent": true,
  • "discount_percent": "string",
  • "owner": 0,
  • "tier": 0,
  • "price_schedule": 0,
  • "service_zone": 0,
  • "license_type": 0,
  • "available_payment_options": { },
  • "payment_term": null,
  • "payment_methods": null,
  • "status": 0,
  • "external_ids": { },
  • "corporate_address": {
    },
  • "delivery_address": {
    }
}

Response samples

Content type
application/json
{
  • "id": 0,
  • "state": "string",
  • "managers": [
    ],
  • "created_on": "2019-08-24T14:15:22Z",
  • "modified": "2019-08-24T14:15:22Z",
  • "next_contact_date": "2019-08-24",
  • "nickname": "string",
  • "external_id": "string",
  • "ext_acct_id": "string",
  • "license_number": "string",
  • "old_license_number": "string",
  • "license_inactive": true,
  • "business_identifier": "string",
  • "ein": "string",
  • "directions": "string",
  • "delivery_preferences": "string",
  • "currency": "string",
  • "shipping_charge": "string",
  • "brand": "string",
  • "name": "string",
  • "dba": "string",
  • "business_license_name": "string",
  • "description": "string",
  • "website": "http://example.com",
  • "address": "string",
  • "unit_number": "string",
  • "zipcode": "string",
  • "city": "string",
  • "county": "string",
  • "country": "string",
  • "lat": "string",
  • "long": "string",
  • "phone": "string",
  • "phone_extension": "string",
  • "email": "user@example.com",
  • "notes": "string",
  • "leaflink_last_views": "2019-08-24T14:15:22Z",
  • "leaflink_source": true,
  • "archived": true,
  • "delinquent": true,
  • "discount_percent": "string",
  • "owner": 0,
  • "partner": 0,
  • "tier": 0,
  • "price_schedule": 0,
  • "service_zone": 0,
  • "license_type": 0,
  • "payment_term": 0,
  • "payment_methods": [
    ],
  • "available_payment_options": [
    ],
  • "status": 0,
  • "external_ids": { },
  • "corporate_address": {
    },
  • "delivery_address": {
    }
}

Archive a customer

Archive a customer by ID.

Authorizations:
Token
path Parameters
id
required
integer

A unique integer value identifying this company customer.

Responses

Response samples

Content type
application/json
{
  • "id": 0,
  • "state": "string",
  • "managers": [
    ],
  • "created_on": "2019-08-24T14:15:22Z",
  • "modified": "2019-08-24T14:15:22Z",
  • "next_contact_date": "2019-08-24",
  • "nickname": "string",
  • "external_id": "string",
  • "ext_acct_id": "string",
  • "license_number": "string",
  • "old_license_number": "string",
  • "license_inactive": true,
  • "business_identifier": "string",
  • "ein": "string",
  • "directions": "string",
  • "delivery_preferences": "string",
  • "currency": "string",
  • "shipping_charge": "string",
  • "brand": "string",
  • "name": "string",
  • "dba": "string",
  • "business_license_name": "string",
  • "description": "string",
  • "website": "http://example.com",
  • "address": "string",
  • "unit_number": "string",
  • "zipcode": "string",
  • "city": "string",
  • "county": "string",
  • "country": "string",
  • "lat": "string",
  • "long": "string",
  • "phone": "string",
  • "phone_extension": "string",
  • "email": "user@example.com",
  • "notes": "string",
  • "leaflink_last_views": "2019-08-24T14:15:22Z",
  • "leaflink_source": true,
  • "archived": true,
  • "delinquent": true,
  • "discount_percent": "string",
  • "owner": 0,
  • "partner": 0,
  • "tier": 0,
  • "price_schedule": 0,
  • "service_zone": 0,
  • "license_type": 0,
  • "payment_term": 0,
  • "payment_methods": [
    ],
  • "available_payment_options": [
    ],
  • "status": 0,
  • "external_ids": { },
  • "corporate_address": {
    },
  • "delivery_address": {
    }
}

contacts

The Contact model represents the contact information a user has stored as a company resource within LeafLink.

List

List all contacts for all active companies where the user has the MANAGE_CRM permission. Can be filtered by id, creation date, last modified date, first name, and last name. The contact's associated CompanyCustomers can be retrieved at /api/v2/contacts/{id}/customers/?

Authorizations:
Token
query Parameters
modified__lt
string

Filter by modified__lt

modified__lte
string

Filter by modified__lte

modified__gt
string

Filter by modified__gt

modified__gte
string

Filter by modified__gte

id
number

Filter by the exact id of the contact

last_name
string

Filter by the last name of a contact.

last_name__in
string

Filter by last_name__in

last_name__startswith
string

Filter by last_name__startswith

created_on__lt
string

Filter by created_on datetime, less than.

created_on__lte
string

Filter by created_on datetime, less than or equal to.

created_on__gt
string

Filter by created_on datetime, greater than.

created_on__gte
string

Filter by created_on datetime, greater than or equal to.

company_slug
string

Filter by owner Company slug.

first_name
string

Filter by the first name of a contact.

first_name__in
string

Filter by first_name__in

first_name__startswith
string

Filter by first_name__startswith

owner
number

Filter by one or multiple company ids, separated by commas.

delete
string

Filter by contact deletion status

limit
integer

Number of results to return per page.

offset
integer

The initial index from which to return the results.

Responses

Response samples

Content type
application/json
{
  • "count": 0,
  • "previous": "http://example.com",
  • "results": [
    ]
}

Create

Create a new contact.

Authorizations:
Token
Request Body schema: application/json
required
owner
required
integer (Owner)
first_name
required
string (First name) [ 1 .. 30 ] characters
last_name
string (Last name) <= 30 characters
email
string or null <email> (Email address) <= 255 characters
secondary_email
string or null <email> (Secondary email address) <= 255 characters
role
string or null (Position) <= 400 characters

Position or role at company

description
string or null (Description) <= 1500 characters

An overview of the contact

phone
string or null (Phone) <= 400 characters

Phone Number of Brand

phone_extension
string or null (Phone Extension) <= 20 characters
secondary_phone
string or null (Secondary Phone) <= 400 characters

Secondary Phone Number of Brand

secondary_phone_extension
string or null (Secondary Phone Extension) <= 20 characters
delete
boolean (Contact deleted)

Is this Contact marked as deleted?

Responses

Request samples

Content type
application/json
{
  • "owner": 0,
  • "first_name": "string",
  • "last_name": "string",
  • "email": "user@example.com",
  • "secondary_email": "user@example.com",
  • "role": "string",
  • "description": "string",
  • "phone": "string",
  • "phone_extension": "string",
  • "secondary_phone": "string",
  • "secondary_phone_extension": "string",
  • "delete": true
}

Response samples

Content type
application/json
{
  • "id": 0,
  • "created_on": "2019-08-24T14:15:22Z",
  • "modified": "2019-08-24T14:15:22Z",
  • "owner": 0,
  • "first_name": "string",
  • "last_name": "string",
  • "email": "user@example.com",
  • "secondary_email": "user@example.com",
  • "role": "string",
  • "description": "string",
  • "phone": "string",
  • "phone_extension": "string",
  • "secondary_phone": "string",
  • "secondary_phone_extension": "string",
  • "delete": true
}

Read

Retrieve an individual contact by ID.

Authorizations:
Token
path Parameters
id
required
integer

A unique integer value identifying this contact.

Responses

Response samples

Content type
application/json
{
  • "id": 0,
  • "created_on": "2019-08-24T14:15:22Z",
  • "modified": "2019-08-24T14:15:22Z",
  • "owner": 0,
  • "first_name": "string",
  • "last_name": "string",
  • "email": "user@example.com",
  • "secondary_email": "user@example.com",
  • "role": "string",
  • "description": "string",
  • "phone": "string",
  • "phone_extension": "string",
  • "secondary_phone": "string",
  • "secondary_phone_extension": "string",
  • "delete": true
}

Update

Update an existing contact by ID.

Authorizations:
Token
path Parameters
id
required
integer

A unique integer value identifying this contact.

Request Body schema: application/json
required
owner
required
integer (Owner)
first_name
required
string (First name) [ 1 .. 30 ] characters
last_name
string (Last name) <= 30 characters
email
string or null <email> (Email address) <= 255 characters
secondary_email
string or null <email> (Secondary email address) <= 255 characters
role
string or null (Position) <= 400 characters

Position or role at company

description
string or null (Description) <= 1500 characters

An overview of the contact

phone
string or null (Phone) <= 400 characters

Phone Number of Brand

phone_extension
string or null (Phone Extension) <= 20 characters
secondary_phone
string or null (Secondary Phone) <= 400 characters

Secondary Phone Number of Brand

secondary_phone_extension
string or null (Secondary Phone Extension) <= 20 characters
delete
boolean (Contact deleted)

Is this Contact marked as deleted?

Responses

Request samples

Content type
application/json
{
  • "owner": 0,
  • "first_name": "string",
  • "last_name": "string",
  • "email": "user@example.com",
  • "secondary_email": "user@example.com",
  • "role": "string",
  • "description": "string",
  • "phone": "string",
  • "phone_extension": "string",
  • "secondary_phone": "string",
  • "secondary_phone_extension": "string",
  • "delete": true
}

Response samples

Content type
application/json
{
  • "id": 0,
  • "created_on": "2019-08-24T14:15:22Z",
  • "modified": "2019-08-24T14:15:22Z",
  • "owner": 0,
  • "first_name": "string",
  • "last_name": "string",
  • "email": "user@example.com",
  • "secondary_email": "user@example.com",
  • "role": "string",
  • "description": "string",
  • "phone": "string",
  • "phone_extension": "string",
  • "secondary_phone": "string",
  • "secondary_phone_extension": "string",
  • "delete": true
}

Delete

Set the delete flag to True on a contact by ID. Deleted objects can be filtered out in lists with query parameters.

Authorizations:
Token
path Parameters
id
required
integer

A unique integer value identifying this contact.

Responses

activity-entries

The CompanyActivityEntry model represents a CRM action taken by a staff member that relates to a customer, with an optional description.

List

List all CompanyActivityEntry objects of companies the requester has CRM management access for.

Authorizations:
Token
query Parameters
date__lt
string

Filter by entered activity datetime, less than.

date__lte
string

Filter by entered activity datetime, less than or equal to.

date__gt
string

Filter by entered activity datetime, greater than.

date__gte
string

Filter by entered activity datetime, greater than or equal to.

entry
string

Filter by activity entry descriptions.

entry__in
string

Filter by entry__in

entry__startswith
string

Filter by entry__startswith

modified__lt
string

Filter by the datetime the object was last modified, less than.

modified__lte
string

Filter by the datetime the object was last modified, less than or equal to.

modified__gt
string

Filter by the datetime the object was last modified, greater than.

modified__gte
string

Filter by the datetime the object was last modified, greater than or equal to.

id
number

Filter by id

created_on__lt
string

Filter by created_on datetime, less than.

created_on__lte
string

Filter by created_on datetime, less than or equal to.

created_on__gt
string

Filter by created_on datetime, greater than.

created_on__gte
string

Filter by created_on datetime, greater than or equal to.

owner
number

Filter by owner ID.

author
number

Filter by author ID.

company
number

Filter by associated company ID.

customer
number

Filter by associated customer ID.

staff
number

Filter by associated staff ID.

type
string

Filter by activity type.

brand
number

Filter by associated brand ID.

contact
number

Filter by associated contact ID.

company_slug
string

Filter by Company slug

delete
string

Filter by deleted or non-deleted entries.

limit
integer

Number of results to return per page.

offset
integer

The initial index from which to return the results.

Responses

Response samples

Content type
application/json
{
  • "count": 0,
  • "previous": "http://example.com",
  • "results": [
    ]
}

Create

Create a new CompanyActivityEntry object for a company you have CRM management access for.

Authorizations:
Token
Request Body schema: application/json
required
type
required
string (Type)
date
string <date-time> (Date)
entry
required
string (Message) [ 1 .. 4000 ] characters

Message

delete
boolean (Activity deleted)

Is this Activity marked as deleted?

owner
required
integer (Company that owns Entry)

Company that owns activity entry

author
required
integer (Activity Entry Author)

Author who entered Activity

company
integer or null (Company entry is about)

Company entry is about

customer
integer or null (Customer Company entry is about)

Company entry is about

staff
integer or null (Staff entry is focused on)

Staff entry is focused on

brand
integer or null (Brand)
contact
integer or null (Contact)

Responses

Request samples

Content type
application/json
{
  • "type": "string",
  • "date": "2019-08-24T14:15:22Z",
  • "entry": "string",
  • "delete": true,
  • "owner": 0,
  • "author": 0,
  • "company": 0,
  • "customer": 0,
  • "staff": 0,
  • "brand": 0,
  • "contact": 0
}

Response samples

Content type
application/json
{
  • "id": 0,
  • "type": "string",
  • "created_on": "2019-08-24T14:15:22Z",
  • "modified": "2019-08-24T14:15:22Z",
  • "date": "2019-08-24T14:15:22Z",
  • "entry": "string",
  • "delete": true,
  • "owner": 0,
  • "author": 0,
  • "company": 0,
  • "customer": 0,
  • "staff": 0,
  • "brand": 0,
  • "contact": 0
}

Read

Get a CompanyActivityEntry by ID.

Authorizations:
Token
path Parameters
id
required
integer

A unique integer value identifying this company activity entry.

Responses

Response samples

Content type
application/json
{
  • "id": 0,
  • "type": "string",
  • "created_on": "2019-08-24T14:15:22Z",
  • "modified": "2019-08-24T14:15:22Z",
  • "date": "2019-08-24T14:15:22Z",
  • "entry": "string",
  • "delete": true,
  • "owner": 0,
  • "author": 0,
  • "company": 0,
  • "customer": 0,
  • "staff": 0,
  • "brand": 0,
  • "contact": 0
}

Update

Update an individual CompanyActivityEntry by ID.

Authorizations:
Token
path Parameters
id
required
integer

A unique integer value identifying this company activity entry.

Request Body schema: application/json
required
type
required
string (Type)
date
string <date-time> (Date)
entry
required
string (Message) [ 1 .. 4000 ] characters

Message

delete
boolean (Activity deleted)

Is this Activity marked as deleted?

owner
required
integer (Company that owns Entry)

Company that owns activity entry

author
required
integer (Activity Entry Author)

Author who entered Activity

company
integer or null (Company entry is about)

Company entry is about

customer
integer or null (Customer Company entry is about)

Company entry is about

staff
integer or null (Staff entry is focused on)

Staff entry is focused on

brand
integer or null (Brand)
contact
integer or null (Contact)

Responses

Request samples

Content type
application/json
{
  • "type": "string",
  • "date": "2019-08-24T14:15:22Z",
  • "entry": "string",
  • "delete": true,
  • "owner": 0,
  • "author": 0,
  • "company": 0,
  • "customer": 0,
  • "staff": 0,
  • "brand": 0,
  • "contact": 0
}

Response samples

Content type
application/json
{
  • "id": 0,
  • "type": "string",
  • "created_on": "2019-08-24T14:15:22Z",
  • "modified": "2019-08-24T14:15:22Z",
  • "date": "2019-08-24T14:15:22Z",
  • "entry": "string",
  • "delete": true,
  • "owner": 0,
  • "author": 0,
  • "company": 0,
  • "customer": 0,
  • "staff": 0,
  • "brand": 0,
  • "contact": 0
}

Delete

Set the delete flag on a CompanyActivityEntry to true. These can be filtered out in list requests.

Authorizations:
Token
path Parameters
id
required
integer

A unique integer value identifying this company activity entry.

Responses

customer-statuses

The CompanyCustomerStatus represents a set of customizable states for customers in the sales funnel.

List

List all CompanyCustomerStatus objects available for use.

Authorizations:
Token
query Parameters
limit
integer

Number of results to return per page.

offset
integer

The initial index from which to return the results.

Responses

Response samples

Content type
application/json
{
  • "count": 0,
  • "previous": "http://example.com",
  • "results": [
    ]
}

Create

Create a new customer status.

Authorizations:
Token
Request Body schema: application/json
required
state
required
string (Customer Status) [ 1 .. 40 ] characters

Customer Status State

order
integer (Sort Order) [ 1 .. 2147483647 ]

Sort order, lower is first.

description
string or null (Description) <= 1500 characters

Description of status

owner
required
integer (Company)

The Company that created the custom status.

is_stock
boolean (Is a LeafLink Stock Status)

Is this a stock LeafLink status?

hex_color
string or null (Hex Color) <= 40 characters

Hex color for customer status

Responses

Request samples

Content type
application/json
{
  • "state": "string",
  • "order": 1,
  • "description": "string",
  • "owner": 0,
  • "is_stock": true,
  • "hex_color": "string"
}

Response samples

Content type
application/json
{
  • "id": 0,
  • "state": "string",
  • "order": 1,
  • "description": "string",
  • "owner": 0,
  • "is_stock": true,
  • "hex_color": "string"
}

Read

Retrieve a CompanyCustomerStatus by ID.

Authorizations:
Token
path Parameters
id
required
integer

A unique integer value identifying this company customer status.

Responses

Response samples

Content type
application/json
{
  • "id": 0,
  • "state": "string",
  • "order": 1,
  • "description": "string",
  • "owner": 0,
  • "is_stock": true,
  • "hex_color": "string"
}

Update

Update an existing customer status by ID.

Authorizations:
Token
path Parameters
id
required
integer

A unique integer value identifying this company customer status.

Request Body schema: application/json
required
state
required
string (Customer Status) [ 1 .. 40 ] characters

Customer Status State

order
integer (Sort Order) [ 1 .. 2147483647 ]

Sort order, lower is first.

description
string or null (Description) <= 1500 characters

Description of status

owner
required
integer (Company)

The Company that created the custom status.

is_stock
boolean (Is a LeafLink Stock Status)

Is this a stock LeafLink status?

hex_color
string or null (Hex Color) <= 40 characters

Hex color for customer status

Responses

Request samples

Content type
application/json
{
  • "state": "string",
  • "order": 1,
  • "description": "string",
  • "owner": 0,
  • "is_stock": true,
  • "hex_color": "string"
}

Response samples

Content type
application/json
{
  • "id": 0,
  • "state": "string",
  • "order": 1,
  • "description": "string",
  • "owner": 0,
  • "is_stock": true,
  • "hex_color": "string"
}

Delete

Delete a customer status by ID.

Authorizations:
Token
path Parameters
id
required
integer

A unique integer value identifying this company customer status.

Responses

customer-tiers

The CompanyCustomerTier represents a set of read only objects depicting a customer's tier in relationship to a company.

List

List all CompanyCustomerTier objects available for use.

Authorizations:
Token
query Parameters
limit
integer

Number of results to return per page.

offset
integer

The initial index from which to return the results.

Responses

Response samples

Content type
application/json
{
  • "count": 0,
  • "previous": "http://example.com",
  • "results": [
    ]
}

Read

Retrieve a CompanyCustomerTier by ID.

Authorizations:
Token
path Parameters
id
required
integer

A unique integer value identifying this company customer tier.

Responses

Response samples

Content type
application/json
{
  • "id": 0,
  • "created_on": "2019-08-24T14:15:22Z",
  • "modified": "2019-08-24T14:15:22Z",
  • "rank": "string",
  • "sort": 2147483647
}

companies

List companies

List companies the requesting user is a staff member of.

Authorizations:
Token
query Parameters
limit
integer

Number of results to return per page.

offset
integer

The initial index from which to return the results.

Responses

Response samples

Content type
application/json
{
  • "count": 0,
  • "previous": "http://example.com",
  • "results": [
    ]
}

Retrieve a company

Retrieve an individual company.

Authorizations:
Token
path Parameters
id
required
integer

The id for the company.

Responses

Response samples

Content type
application/json
{
  • "address": "string",
  • "announcement": "string",
  • "apply_ancillary_tax": true,
  • "apply_arms_length_tax": true,
  • "batch_enabled": true,
  • "business_identifier": "string",
  • "business_license_name": "string",
  • "buyer": true,
  • "seller": true,
  • "city": "string",
  • "dba": "string",
  • "description": "string",
  • "has_accting": true,
  • "hide_attached_packages": true,
  • "id": 0,
  • "image": "http://example.com",
  • "name": "string",
  • "slug": "string",
  • "state": "string",
  • "sts_enabled": true,
  • "zipcode": "string"
}

company-staff

List staff members

List all staff members.

Authorizations:
Token
query Parameters
company
string

Filter by company id

is_admin
string

Filter by admin status, true or false

is_active
string

Filter by active status, true or false

company_slug
string

Filter by company slug

limit
integer

Number of results to return per page.

offset
integer

The initial index from which to return the results.

Responses

Response samples

Content type
application/json
{
  • "count": 0,
  • "previous": "http://example.com",
  • "results": [
    ]
}

Retrieve a staff member

Retrieve an individual staff member.

Authorizations:
Token
path Parameters
id
required
integer

The staff member id.

Responses

Response samples

Content type
application/json
{
  • "id": 0,
  • "user": 0,
  • "company": 0,
  • "is_admin": true,
  • "is_active": true,
  • "is_poc": true,
  • "email": "string",
  • "phone": "string",
  • "identification_number": "string",
  • "display_name": "string",
  • "username": "string"
}

licenses

The License model represents a single state-issued license held by a Company.

List

List all licenses for a user's companies.
You can list the licenses associated with a company's products at /companies/{company_id}/licenses

Authorizations:
Token
query Parameters
number__in
string

Filter by number__in

number
string

Filter by number

company_slug
string

Filter by company_slug

id
number

Filter by id

limit
integer

Number of results to return per page.

offset
integer

The initial index from which to return the results.

Responses

Response samples

Content type
application/json
{
  • "count": 0,
  • "previous": "http://example.com",
  • "results": [
    ]
}

Read

Retrieve an individual license by ID.

Authorizations:
Token
path Parameters
id
required
integer

A unique integer value identifying this license.

Responses

Response samples

Content type
application/json
{
  • "id": 0,
  • "number": "string",
  • "type": "string",
  • "display_type": "string",
  • "classification": "string"
}

license-types

The LicenseType model represents a category of state-issued licenses.

List

List all licenses types available on LeafLink.
You can list the license types associated with a company's products at /companies/{company_id}/license-types

Authorizations:
Token
query Parameters
limit
integer

Number of results to return per page.

offset
integer

The initial index from which to return the results.

Responses

Response samples

Content type
application/json
{
  • "count": 0,
  • "previous": "http://example.com",
  • "results": [
    ]
}

Read

Retrieve an individual license type by ID.

Authorizations:
Token
path Parameters
id
required
integer

A unique integer value identifying this license type.

Responses

Response samples

Content type
application/json
{
  • "id": 0,
  • "type": "string",
  • "display_type": "string",
  • "classification": "string",
  • "state": 0,
  • "require_ein": true,
  • "has_medical_line_items": true,
  • "active_for_registration": true,
  • "description": "string",
  • "pre_2018_CA": true,
  • "post_2018_CA": true,
  • "created_on": "2019-08-24T14:15:22Z",
  • "modified": "2019-08-24T14:15:22Z",
  • "state_abbr": "string"
}

brands

List brands

List all brands.

Retrieved per company with the company query parameter or with the following path parameter, /companies/{company_id}/brands/

Authorizations:
Token
query Parameters
company__in
string

Filter by a list of company ids.

company
string

Filter by company id.

company_slug
string

Filter by a company slug.

limit
integer

Number of results to return per page.

offset
integer

The initial index from which to return the results.

Responses

Response samples

Content type
application/json
{}

Retrieve a brand

Retrieve an individual brand.

Authorizations:
Token
path Parameters
id
required
integer

The id for the brand.

Responses

Response samples

Content type
application/json
{}

promocodes

The Promocode model represents a promotional discount code for a specific Brand.

List

View all promotional codes associated with brands under the company access scope.

Authorizations:
Token
query Parameters
company_slug
string

Filter by company_slug

brand
string

Filter by brand

code
string

Filter by code

limit
integer

Number of results to return per page.

offset
integer

The initial index from which to return the results.

Responses

Response samples

Content type
application/json
{
  • "count": 0,
  • "previous": "http://example.com",
  • "results": [
    ]
}

Create

Create a new promotional code, unique to brand and code.

Authorizations:
Token
Request Body schema: application/json
required
brand
required
integer (Brand)
code
required
string (Code) [ 1 .. 100 ] characters
discount_type
string (Discount Type)
Value: "%"
discount_amount
string <decimal> (Percent discount)

Percent discount for Order

start_date
required
string <date-time> (Start date)
end_date
required
string <date-time> (End date)

Responses

Request samples

Content type
application/json
{
  • "brand": 0,
  • "code": "string",
  • "discount_type": "%",
  • "discount_amount": "string",
  • "start_date": "2019-08-24T14:15:22Z",
  • "end_date": "2019-08-24T14:15:22Z"
}

Response samples

Content type
application/json
{
  • "id": 0,
  • "brand": 0,
  • "code": "string",
  • "discount_type": "%",
  • "discount_amount": "string",
  • "start_date": "2019-08-24T14:15:22Z",
  • "end_date": "2019-08-24T14:15:22Z"
}

Read

View a specific promotional code to which the current user has access.

Authorizations:
Token
path Parameters
id
required
string

Responses

Response samples

Content type
application/json
{
  • "id": 0,
  • "brand": 0,
  • "code": "string",
  • "discount_type": "%",
  • "discount_amount": "string",
  • "start_date": "2019-08-24T14:15:22Z",
  • "end_date": "2019-08-24T14:15:22Z"
}

Update

Update a promotional code's start date and end date fields.

Authorizations:
Token
path Parameters
id
required
string
Request Body schema: application/json
required
brand
required
integer (Brand)
code
required
string (Code) [ 1 .. 100 ] characters
discount_type
string (Discount Type)
Value: "%"
discount_amount
string <decimal> (Percent discount)

Percent discount for Order

start_date
required
string <date-time> (Start date)
end_date
required
string <date-time> (End date)

Responses

Request samples

Content type
application/json
{
  • "brand": 0,
  • "code": "string",
  • "discount_type": "%",
  • "discount_amount": "string",
  • "start_date": "2019-08-24T14:15:22Z",
  • "end_date": "2019-08-24T14:15:22Z"
}

Response samples

Content type
application/json
{
  • "id": 0,
  • "brand": 0,
  • "code": "string",
  • "discount_type": "%",
  • "discount_amount": "string",
  • "start_date": "2019-08-24T14:15:22Z",
  • "end_date": "2019-08-24T14:15:22Z"
}

Delete

Remove a promotional code entirely.

Authorizations:
Token
path Parameters
id
required
string

Responses

reports

The Report model represents a report download initiated by a User

List

List all reports generated under the company access scope. For legacy auth, only reports of types to which the user has permissions will be shown in the list.

Authorizations:
Token
query Parameters
company_slug
string

Filter by company slug.

limit
integer

Number of results to return per page.

offset
integer

The initial index from which to return the results.

Responses

Response samples

Content type
application/json
{
  • "count": 0,
  • "previous": "http://example.com",
  • "results": [
    ]
}

Create

Report download viewset

Authorizations:
Token
Request Body schema: application/json
required
report_type
required
string (Report type)
Enum: "orders-assigned" "orders-received" "orders-sent" "orders-report" "ordered-products" "accounts-receivable" "customer-value" "sales-rep-activity-feed" "brand-performance" "brand-owner-brand-performance" "brand-owner-inventory-overview"
company
required
integer (Company)

Company orders export refers to

query
object (Query)

Responses

Request samples

Content type
application/json
{
  • "report_type": "orders-assigned",
  • "company": 0,
  • "query": { }
}

Response samples

Content type
application/json
{
  • "number": "e3fa0eee-0f60-45ea-9b9d-9cab5dc9a86e",
  • "user": 0,
  • "status": "running",
  • "report_type": "orders-assigned",
  • "request_time": "2019-08-24T14:15:22Z",
  • "complete_time": "2019-08-24T14:15:22Z",
  • "company": 0,
  • "export": "http://example.com",
  • "query": { },
  • "to_email": "string"
}

Read

Retrieve an individual report by ID

Authorizations:
Token
path Parameters
number
required
string <uuid>

Responses

Response samples

Content type
application/json
{
  • "number": "e3fa0eee-0f60-45ea-9b9d-9cab5dc9a86e",
  • "user": 0,
  • "status": "running",
  • "report_type": "orders-assigned",
  • "request_time": "2019-08-24T14:15:22Z",
  • "complete_time": "2019-08-24T14:15:22Z",
  • "company": 0,
  • "export": "http://example.com",
  • "query": { },
  • "to_email": "string"
}

The buyer order object

id
string <uuid>

Unique id generated by LeafLink

short_id
string

The Order No. displayed in the user interface

status
string
Enum: "Draft" "Submitted" "Accepted" "Backorder" "Fulfilled" "Shipped" "Complete" "Rejected" "Combined" "Cancelled"

Order status

type
string

License type for the order

object

Company on the buy side of the order

object

Company on the sell side of the order

source
string

Describes whether this was a buyer or seller generated order "BGO" "SGO"

object

User who created the order. If BGO, full staff member details. If SGO, the staff member's name.

created_on
string <date-time>

Date and time that the order was created

last_edited_on
string <date-time>

Date and time that the order was last edited

currency
string

Currency used in the order

Array of objects
subtotal
number
shipping_charge
number
discount
number
tax
number
total
number
object
payment_term
any (Payment Term)

Deprecated field, please use payment_option instead
Customer's payment terms
Enum: "llf" "cod" "net3" "net7" "net10" "net14" "net15" "net20" "net30" "net60" "net90" "prepay" "consign"
Deprecated values (will be mapped appropriately):
(1, "Cash") replaced with "cod"
(2, "Net 7") replaced with "net7"
(3, "Net 15") replaced with "net15",
(4, "Net 30") replaced with "net30"
(5, "Net 10") replaced with "net10"
(6, "Net 20") replaced with "net20
(7, "Net 60") replaced with "net60"
(8, "Net 3") replaced with "net3"
(9, "Net 14") replaced with "net14"
(10, "Pre-Payment") replaced with "prepay"
(11, "LeafLink Financial - Net 30") replaced with "llf" with payment_methods ["ach"]
(12, "Consignment") replaced with "consign"
(13, "LeafLink Financial - Net 15") replaced with "llf" with payment_methods ["ach"]
(14, "Net 90") replaced with "net90"
(15, "Wire on Delivery") replaced with "cod" with payment_methods ["wire"]
(20, "COD") replaced with "cod"
(21, "LeafLink Financial") replaced with "llf" with payment_methods ["ach"]

payment_methods
any (Payment Methods)

Deprecated field, please use payment_option instead
Customer's payment method
Enum: "cash" "check" "wire" "ach"

payment_due_date
string <date>

Date the payment is due

ship_date
string <date-time>

Date and time the order was shipped

shipping_details
string

Shipping notes added by the seller

is_delivered
boolean
delivered_date
string

Date and time the order was delivered

notes
string

Additional notes added by the seller

sales_reps
Array of strings

Names of the sales reps assigned to the order

object (Delivery Address)

Read only delivery address as provided during order creation.

{
  • "id": "d8240c79-7c90-4177-8c46-919b5577a4c0",
  • "short_id": "5577a4c0",
  • "status": "Shipped",
  • "type": "Adult Use",
  • "buyer": {
    },
  • "seller": {
    },
  • "source": "BGO",
  • "created_by": {
    },
  • "created_on": "2020-07-12T10:40:00.681487-06:00",
  • "last_edited_on": "2020-07-14T14:13:53.753792-06:00",
  • "currency": "USD",
  • "line_items": [
    ],
  • "subtotal": 620,
  • "shipping_charge": 0,
  • "discount": 0,
  • "tax": 0,
  • "total": 620,
  • "payable_to": {
    },
  • "payment_term": null,
  • "payment_methods": [ ],
  • "payment_due_date": null,
  • "ship_date": null,
  • "shipping_details": null,
  • "is_delivered": false,
  • "delivered_date": null,
  • "notes": "",
  • "sales_reps": [
    ],
  • "delivery_address": {
    }
}

buyer-orders

List orders

List orders sent

Authorizations:
Token
query Parameters
seller
string

Filter results by seller id

fields_include
string

Include only specific fields in the response, separated by commas.

fields_exclude
string

Exclude specific fields in the response, separated by commas.

fields_add
string

Include additional fields in the response. Available values include created_by and last_changed_by

include_children
string

Include additional fields in the response. Available values include line_items, customer, and sales_reps

seller__slug__iexact
string

Filter results the company slug on the seller side of the order. Case-insensitive exact match.

modified__gte
string

Filter by the modified date, greater than or equal to

modified__lte
string

Filter by the modified date, less than or equal to

modified__gt
string

Filter by the modified date, greater than

modified__lt
string

Filter by the modified date, less than

external_id_seller
string

Filter by the number assigned to the order by the seller company

external_id_seller__icontains
string

Filter by the number assigned to the order by the seller company. Case-insensitive containment match: returns orders that contain the string

created_on__gte
string

Filter by the created_on date, greater than or equal to

created_on__lte
string

Filter by the created_on date, less than or equal to

created_on__gt
string

Filter by the created_on date, greater than

created_on__lt
string

Filter by the created_on date, less than

order_id
string

Filter by the external_id_seller or the number

number
string

Filter by the unique order number generated by LeafLink.

status
string
Enum: "submitted" "accepted" "backorder" "fulfilled" "shipped" "complete" "rejected" "combined" "cancelled"

Filter by status.

brand
number

Filter by brand id

brand__in
number

Filter by multiple brand ids, separated by commas

paid
string

Filter by paid status

sales_rep
number

Filter by the user id of the sales rep assigned to an order. This is the id field on the company-staff object.

classification
string

Filter by the classification of the license-type associated to the order

user
string

Filter by the username, first name, or last name of the last person who edited the order

connected_to_metrc
string

Filter by whether or not they have metrc packages associated with their line items

manual
string

Filter by whether or not orders were manually created by the company on the seller side of the order

company_slug
string

Filter by the slug of seller company

service_zone
number

Filter Orders by service zone of customers

limit
integer

Number of results to return per page.

offset
integer

The initial index from which to return the results.

external_id_key
string

Filter for orders that match external_ids key:values. Must be used with external_id_values.

external_id_values
string

Filter for orders that match external_ids key:values. Multiple values separated by a comma. Must be used with external_id_key.

Responses

Response samples

Content type
application/json
{
  • "count": 1,
  • "next": null,
  • "previous": null,
  • "results": [
    ]
}

retailer-inventory

Product information for a retailer company.

List products

List all products.

Authorizations:
Token
query Parameters
company
string

Filter by company id.

limit
integer

Number of results to return per page.

offset
integer

The initial index from which to return the results.

Responses

Response samples

Content type
application/json
{
  • "count": 0,
  • "previous": "http://example.com",
  • "results": [
    ]
}

Create a product

Create a new product.

Authorizations:
Token
Request Body schema: application/json
required
is_low
required
boolean

Indicates if the inventory level is low.

source
required
string [ 1 .. 400 ] characters

Describes the source system providing the data.

name
required
string [ 1 .. 400 ] characters

Product name

sku
required
string [ 1 .. 400 ] characters

Product sku

brand
required
string [ 1 .. 400 ] characters

Product brand

quantity
required
integer

Product inventory level

company
required
integer

Company id

unit_of_measure
required
string [ 1 .. 400 ] characters

Product unit of measure

Responses

Request samples

Content type
application/json
{
  • "is_low": true,
  • "source": "string",
  • "name": "string",
  • "sku": "string",
  • "brand": "string",
  • "quantity": 0,
  • "company": 0,
  • "unit_of_measure": "string"
}

Response samples

Content type
application/json
{
  • "id": 0,
  • "is_low": true,
  • "source": "string",
  • "name": "string",
  • "sku": "string",
  • "brand": "string",
  • "quantity": 0,
  • "company": 0,
  • "unit_of_measure": "string",
  • "created_on": "2019-08-24T14:15:22Z",
  • "modified": "2019-08-24T14:15:22Z"
}

Retrieve a product

Retrieve an individual product.

Authorizations:
Token
path Parameters
id
required
integer

The id for the product.

Responses

Response samples

Content type
application/json
{
  • "id": 0,
  • "is_low": true,
  • "source": "string",
  • "name": "string",
  • "sku": "string",
  • "brand": "string",
  • "quantity": 0,
  • "company": 0,
  • "unit_of_measure": "string",
  • "created_on": "2019-08-24T14:15:22Z",
  • "modified": "2019-08-24T14:15:22Z"
}

Update a product

Update an existing product.

Authorizations:
Token
path Parameters
id
required
integer

The id for the product.

Request Body schema: application/json
required
is_low
boolean

Indicates if the inventory level is low.

source
string [ 1 .. 400 ] characters

Describes the source system providing the data.

name
string [ 1 .. 400 ] characters

Product name

sku
string [ 1 .. 400 ] characters

Product sku

brand
string [ 1 .. 400 ] characters

Product brand

quantity
integer

Product inventory level

company
integer

Company id

unit_of_measure
string [ 1 .. 400 ] characters

Product unit of measure

Responses

Request samples

Content type
application/json
{
  • "is_low": true,
  • "source": "string",
  • "name": "string",
  • "sku": "string",
  • "brand": "string",
  • "quantity": 0,
  • "company": 0,
  • "unit_of_measure": "string"
}

Response samples

Content type
application/json
{
  • "id": 0,
  • "is_low": true,
  • "source": "string",
  • "name": "string",
  • "sku": "string",
  • "brand": "string",
  • "quantity": 0,
  • "company": 0,
  • "unit_of_measure": "string",
  • "created_on": "2019-08-24T14:15:22Z",
  • "modified": "2019-08-24T14:15:22Z"
}

Delete a product

Delete a product.

Authorizations:
Token
path Parameters
id
required
integer

The id for the product.

Responses