LeafLink 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

  • www.leaflink.com - production environment

  • sandbox.leaflink.com - sandbox environment

  • 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.

Authentication

Token

You must authenticate your requests by including your API key in each request header as described below.

Requests should include a header named Authorization, with the value App {MY_API_KEY}. Note the single space in the header value.

Example: Authorization: App MY_API_KEY

Learn more about generating your key

Legacy API keys: If you are not using an Application API key, your authorization header should include the string Token and access will be scoped to all companies under which the user exists as a companystaff.

Example: Authorization: Token MY_API_KEY

Security Scheme Type API Key
Header parameter name: Authorization

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 (External id seller) non-empty Nullable

Number assigned to the order by the seller company

external_id_buyer
string (External id buyer) non-empty Nullable

Number assigned to the order by the buyer company

ext_acct_id
string (Accounting Service ID) <= 255 characters Nullable

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 (Buyer) Nullable

Company on the buy side of the order.

seller
integer (Seller)

Company on the sell side of the order.

customer
object (Customer)

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

brand
integer (Brand of Order) Nullable

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

shipping_charge
object
total
object
payment_term
string (Payment term) Nullable

Payment term for the order

payment_methods
Array of strings (Payment methods) Nullable

Payment methods for the order

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

Date that the Payment is due

paid
boolean (Is paid?)

If this order has been paid for

paid_date
string <date> (Paid date) Nullable

Date the order was paid

ship_date
string <date-time> (Ship date) Nullable

Date and time the order was shipped

shipping_details
string (Shipping details) non-empty Nullable

Shipping details included on an order

notes
string (Order Notes) <= 2000 characters Nullable

Additional notes for an Order

internal_notes
string (Order Notes) <= 2000 characters Nullable

Internal notes for an Order

delivery_preferences
string (Delivery Preferences) Nullable

Customer Delivery Preferences

sales_reps
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 (Delivery provider) Nullable

The company delivering this order.

order_taxes
Array of objects (LightOrderTax)

Details about the taxes applied to the order

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

Total dollar value of credits applied to the 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.

corporate_address
object (Corporate Address)

Read only corporate address as provided during order creation.

delivery_address
object (Delivery Address)

Read only delivery address as provided during order creation.

Copy
Expand all Collapse all
{
  • "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":
    [
    ],
  • "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",
  • "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:
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