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