LeafLink Orders Received API

Access the order object

Operations 7

GET /orders-received/ List orders #
POST /orders-received/ Create an order #
GET /orders-received/{number}/ Retrieve an order #
PATCH /orders-received/{number}/ Update an order #
DELETE /orders-received/{number}/ Delete a draft order #
POST /orders-received/{number}/transition/{action}/ Transition an order #
GET /orders/{order_number}/delivery-information/ Retrieve delivery information #

Work with this as data

Every API here is available over the APIs.io API and to AI agents over MCP.

MCP server

One button, every client — Claude, Cursor, VS Code and the rest.

https://apis.io/mcp

Tools for apis

7 MCP tools reach this
  • find_apisBrowse and filter every API in the catalog.
  • get_api_artifactsOne API's artifacts, grouped by type.
  • get_openapiThe primary OpenAPI for this API.
  • find_similar_apisAPIs that look like this one.
  • apis_io_searchSTART HERE — APIs, providers and tags for one query, each with its total.
  • resolveTurn a domain, URL or GitHub org into the provider it belongs to.
  • find_cohortsEvery scored population of providers in the catalog.
All 92 tools →

Call it yourself

curl for this page
This API
curl "https://apis.io/api/v1/apis/leaflink-orders-received-api"
All apis
curl "https://apis.io/api/v1/apis?limit=25"

Discovery needs no key. Ratings and market analysis are Pro.

Get an API key

Free tier, no form to fill in. Signing in shares your email address with us — we store it to create your key and to recognise you if you sign in with another provider. See our Privacy Policy and Terms.

A second provider on the same verified email joins the account you already have.

OpenAPI Specification

leaflink-orders-received-api-openapi.yml Raw ↑
openapi: 3.2.0
info:
  title: LeafLink Marketplace V2 Orders Received API
  description: '# 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](https://developer.leaflink.com/brands/api/authorization/#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.

    '
  termsOfService: https://leaflink.com/terms-and-conditions/
  contact:
    email: support@leaflink.com
  version: ''
servers:
- url: https://app.leaflink.com/api/v2
security:
- Token: []
tags:
- description: Access the order object
  name: orders-received
paths:
  /orders-received/:
    get:
      operationId: orders-received_list
      summary: List orders
      description: List received orders for all active companies where the user has the Manage Orders Received permission. <br /> <br />Per company via <b>/companies/{company_id}/orders-received/</b>
      parameters:
      - name: fields_include
        in: query
        description: Include only specific fields in the response, separated by commas.
        schema:
          type: string
      - name: fields_exclude
        in: query
        description: Exclude specific fields in the response, separated by commas.
        schema:
          type: string
      - name: fields_add
        in: query
        description: Include additional fields in the response. Available values include `created_by` and `last_changed_by`
        schema:
          type: string
      - name: include_children
        in: query
        description: Include additional fields in the response. Available values include `line_items`, `customer`, and `sales_reps`
        schema:
          type: string
      - name: seller__slug__iexact
        in: query
        description: Filter results the company slug on the seller side of the order.  Case-insensitive exact match.
        required: false
        schema:
          type: string
      - name: modified__gte
        in: query
        description: Filter by the modified date, greater than or equal to
        required: false
        schema:
          type: string
      - name: modified__lte
        in: query
        description: Filter by the modified date, less than or equal to
        required: false
        schema:
          type: string
      - name: modified__gt
        in: query
        description: Filter by the modified date, greater than
        required: false
        schema:
          type: string
      - name: modified__lt
        in: query
        description: Filter by the modified date, less than
        required: false
        schema:
          type: string
      - name: external_id_seller
        in: query
        description: Filter by the number assigned to the order by the seller company
        required: false
        schema:
          type: string
      - name: external_id_seller__icontains
        in: query
        description: 'Filter by the number assigned to the order by the seller company. Case-insensitive containment match: returns orders that contain the string'
        required: false
        schema:
          type: string
      - name: created_on__gte
        in: query
        description: Filter by the created_on date, greater than or equal to
        required: false
        schema:
          type: string
      - name: created_on__lte
        in: query
        description: Filter by the created_on date, less than or equal to
        required: false
        schema:
          type: string
      - name: created_on__gt
        in: query
        description: Filter by the created_on date, greater than
        required: false
        schema:
          type: string
      - name: created_on__lt
        in: query
        description: Filter by the created_on date, less than
        required: false
        schema:
          type: string
      - name: order_id
        in: query
        description: Filter by the external_id_seller or the number
        required: false
        schema:
          type: string
      - name: number
        in: query
        description: Filter by the unique order number generated by LeafLink.
        required: false
        schema:
          type: string
      - name: status
        in: query
        description: Filter by status. Multiple statuses can be submitted as comma-separated list. Case Insensitive.
        required: false
        schema:
          type: string
          enum:
          - draft
          - submitted
          - accepted
          - backorder
          - fulfilled
          - shipped
          - complete
          - rejected
          - combined
          - cancelled
      - name: status__not
        in: query
        description: Exclude by order status. Multiple statuses can be submitted as a comma-separated list. Case Insensitive.
        required: false
        schema:
          type: string
          enum:
          - draft
          - submitted
          - accepted
          - backorder
          - fulfilled
          - shipped
          - complete
          - rejected
          - combined
          - cancelled
      - name: brand
        in: query
        description: Filter by brand id
        required: false
        schema:
          type: number
      - name: brand__in
        in: query
        description: Filter by multiple brand ids, separated by commas
        required: false
        schema:
          type: number
      - name: buyer
        in: query
        description: Filter by the id of the company on the buyer side of the order
        required: false
        schema:
          type: string
      - name: paid
        in: query
        description: Filter by paid status
        required: false
        schema:
          type: string
      - name: customer
        in: query
        description: Filter by the customer name or nickname for the company on the buyer side of the order
        required: false
        schema:
          type: string
      - name: sales_rep
        in: query
        description: Filter by the user id of the sales rep assigned to an order.  This is the id field on the company-staff object.
        required: false
        schema:
          type: number
      - name: classification
        in: query
        description: Filter by the classification of the license-type associated to the order
        required: false
        schema:
          type: string
      - name: user
        in: query
        description: Filter by the username, first name, or last name of the last person who edited the order
        required: false
        schema:
          type: string
      - name: connected_to_metrc
        in: query
        description: Filter by whether or not they have metrc packages associated with their line items
        required: false
        schema:
          type: string
      - name: manual
        in: query
        description: Filter by whether or not orders were manually created by the company on the seller side of the order
        required: false
        schema:
          type: string
      - name: company_slug
        in: query
        description: Filter by the slug of seller company
        required: false
        schema:
          type: string
      - name: service_zone
        in: query
        description: Filter Orders by service zone of customers
        required: false
        schema:
          type: number
      - name: limit
        in: query
        description: Number of results to return per page.
        required: false
        schema:
          type: integer
      - name: offset
        in: query
        description: The initial index from which to return the results.
        required: false
        schema:
          type: integer
      - name: external_id_key
        in: query
        description: Filter for orders that match external_ids key:values.  Must be used with external_id_values.
        schema:
          type: string
      - name: external_id_values
        in: query
        description: Filter for orders that match external_ids key:values.  Multiple values separated by a comma.  Must be used with external_id_key.
        schema:
          type: string
      responses:
        '200':
          description: ''
          content:
            application/json:
              schema:
                type: object
                properties:
                  count:
                    type: integer
                  next:
                    type:
                    - string
                    - 'null'
                    format: uri
                  previous:
                    type:
                    - string
                    - 'null'
                    format: uri
                  results:
                    type: array
                    items:
                      $ref: '#/components/schemas/OrderResponse'
                example:
                  count: 2
                  next: null
                  previous: null
                  results:
                  - 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:
                      id: 148515
                      display_name: Good Vibrations Dispensary
                      ext_acct_id: null
                      delinquent: false
                    brand: null
                    status: Accepted
                    manual: false
                    discount: 0
                    discount_type: '%'
                    tax_amount: 0
                    tax_type: '%'
                    final_tax: '0.00'
                    shipping_charge:
                      amount: 0
                      currency: USD
                    total:
                      amount: 594
                      currency: USD
                    payment_term: Net 7
                    payment_methods:
                    - Cash
                    - ACH
                    available_payment_options:
                    - id: 216377
                      is_default: true
                      payment_program: flexible
                      payment_strategy: reverse_factored
                      payment_method:
                        id: 4
                        method: ACH
                      payment_term:
                        id: 3
                        term: Net 15
                        days: 15
                        code: net15
                    - id: 216375
                      is_default: false
                      payment_program: null
                      payment_strategy: null
                      payment_method:
                        id: 1
                        method: Cash
                      payment_term:
                        id: 20
                        term: COD
                        days: null
                        code: cod
                    selected_payment_option:
                      id: 1732313
                      is_default: true
                      payment_program: flexible
                      payment_strategy: reverse_factored
                      payment_method:
                        id: 4
                        method: ACH
                      payment_term:
                        id: 3
                        term: Net 15
                        days: 15
                        code: net15
                    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:
                    - id: 13
                      user: John Doe
                    classification: Adult Use
                    payment_balance: 594
                    available_transitions:
                    - fulfilled
                    - rejected
                    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: '0.00'
                    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:
                      system-name: '45897'
                    corporate_address:
                      address: 17034 Highway 10
                      city: Moffat
                      state: CO
                      unit_number: 1A
                      zipcode: '81143'
                    delivery_address:
                      address: 17034 Highway 17
                      city: Moffat
                      state: CO
                      unit_number: 1A
                      zipcode: '81143'
                  - number: 4165a155-979b-4e6e-b3a5-8ef917ce9491
                    short_id: 17ce9491
                    external_id_seller: null
                    external_id_buyer: null
                    ext_acct_id: null
                    created_on: '2020-06-10T13:34:10.663097-06:00'
                    user: scooter.s
                    buyer: 3109
                    seller: 1
                    customer:
                      id: 26032
                      display_name: New Leaf
                      ext_acct_id: null
                      delinquent: false
                    brand: null
                    status: Accepted
                    manual: true
                    discount: 0
                    discount_type: '%'
                    tax_amount: 0
                    tax_type: '%'
                    final_tax: '0.00'
                    shipping_charge:
                      amount: 0
                      currency: USD
                    total:
                      amount: 210.4
                      currency: USD
                    payment_term: COD
                    payment_methods:
                    - Wire Transfer
                    payment_due_date: null
                    paid: false
                    paid_date: null
                    ship_date: null
                    shipping_details: null
                    notes: Mary can process on 6/15
                    internal_notes: null
                    delivery_preferences: ''
                    sales_reps:
                    - id: 5659
                      user: Jane Doe
                    classification: Adult Use
                    payment_balance: 210.4
                    available_transitions:
                    - fulfilled
                    - rejected
                    modified: '2020-06-10T16:04:40.312860-06:00'
                    has_special_requests: true
                    delivery_provider: null
                    order_taxes: []
                    delivery_info: null
                    is_combination: false
                    credits: '45.01'
                    facility_id: 123
                    order_number: 4165a155-979b-4e6e-b3a5-8ef917ce9491
                    order_seller_number: 17ce9491
                    order_buyer_number: 17ce9491
                    order_short_number: 17ce9491
                    distributor: ''
                    external_ids: {}
                    corporate_address:
                      address: Some Address 2
                      city: Moffat
                      state: CO
                      unit_number: 1A
                      zipcode: '81143'
                    delivery_address:
                      address: Some Address 1
                      city: Moffat
                      state: CO
                      unit_number: 1A
                      zipcode: '81143'
      tags:
      - orders-received
    post:
      operationId: orders-received_create
      summary: Create an order
      description: '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.

        '
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/OrderCreate'
            example:
              external_id_seller: INV-1092
              ext_acct_id: null
              seller: 1
              customer:
                id: 148515
              line_items:
              - product: 2093
                quantity: 10
                notes: Please include sample
                ordered_unit_price:
                  amount: 108
                  currency: USD
                sale_price:
                  amount: 99
                  currency: USD
              status: Draft
              discount: 0
              discount_type: '%'
              tax_amount: 0
              tax_type: '%'
              shipping_charge:
                amount: 0
                currency: USD
              payment_term: Net 7
              selected_payment_option:
                payment_method_id: 4
                payment_term_id: 3
              delivery_preferences: Monday - Wednesday Only Please
              sales_reps:
              - id: 13
              facility_id: 123
      responses:
        '201':
          description: ''
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/OrderResponse'
      tags:
      - orders-received
  /orders-received/{number}/:
    parameters:
    - name: number
      in: path
      required: true
      description: Order number
      schema:
        type: string
        format: uuid
    get:
      operationId: orders-received_read
      summary: Retrieve an order
      description: Retrieve an individual order.
      parameters:
      - name: fields_include
        in: query
        description: Include only specific fields in the response, separated by commas.
        schema:
          type: string
      - name: fields_exclude
        in: query
        description: Exclude specific fields in the response, separated by commas.
        schema:
          type: string
      - name: fields_add
        in: query
        description: Include additional fields in the response. Available values include `created_by` and `last_changed_by`
        schema:
          type: string
      - name: include_children
        in: query
        description: Include additional fields in the response. Available values include `line_items`, `customer`, and `sales_reps`
        schema:
          type: string
      responses:
        '200':
          description: ''
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/OrderResponse'
      tags:
      - orders-received
    patch:
      operationId: orders-received_partial_update
      summary: Update an order
      description: Update an Order. May update child LineItem objects in the same request.
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/OrderUpdate'
            example:
              discount: 15
              discount_type: $
      responses:
        '200':
          description: ''
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/OrderResponse'
      tags:
      - orders-received
    delete:
      operationId: orders-received_delete
      summary: Delete a draft order
      description: Delete a draft order. This operation is <b>only available for draft orders</b>.
      responses:
        '204':
          description: ''
      tags:
      - orders-received
  /orders-received/{number}/transition/{action}/:
    parameters:
    - name: number
      in: path
      description: Order number
      required: true
      schema:
        type: string
    - name: action
      in: path
      required: true
      description: Order transition action.  Available values include `submit`, `accept`, `fulfill`, `cancel`, `reject`, `ship`, and `complete`
      schema:
        type: string
    post:
      operationId: orders-received_transition_create
      summary: Transition an order
      description: Perform an order transition action.
      responses:
        '200':
          description: ''
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/OrderResponse'
      tags:
      - orders-received
  /orders/{order_number}/delivery-information/:
    parameters:
    - name: order_number
      in: path
      description: Order number
      required: true
      schema:
        type: string
    get:
      operationId: orders-received-delivery-information_read
      summary: Retrieve delivery information
      description: Retrieve an order and associated delivery information.
      responses:
        '200':
          description: ''
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/OrderDeliveryInformation'
      tags:
      - orders-received
components:
  schemas:
    LightCompanyStaff:
      description: Sales representatives associated with the order.
      type: object
      properties:
        id:
          title: Id
          description: id for the company staff user assigned to this order
          type: integer
          readOnly: true
        user:
          title: User
          description: Concatenated string that contains the first name + last name of the company staff user
          type: string
          readOnly: true
    OrderResponse:
      type: object
      properties:
        number:
          title: Number
          description: <uuid> Order number generated by LeafLink
          type: string
          readOnly: true
          minLength: 1
        short_id:
          description: The _Order No._ displayed in the user interface
          type: string
        external_id_seller:
          title: External id seller
          description: Number assigned to the order by the seller company
          type:
          - string
          - 'null'
          minLength: 1
        external_id_buyer:
          title: External id buyer
          description: Number assigned to the order by the buyer company
          type:
          - string
          - 'null'
          minLength: 1
        ext_acct_id:
          title: Accounting Service ID
          description: Accounting Service ID
          type:
          - string
          - 'null'
          maxLength: 255
        created_on:
          title: Created on
          description: Date and time the order was created
          type: string
          format: date-time
        user:
          title: User
          description: username of the user who last edited the order
          type: string
          readOnly: true
        buyer:
          title: Buyer
          description: Company on the buy side of the order.
          type:
          - integer
          - 'null'
        seller:
          title: Seller
          description: Company on the sell side of the order.
          type: integer
        customer:
          $ref: '#/components/schemas/LightCompanyCustomer'
        brand:
          title: Brand of Order
          description: id of the brand for this order.  Only applicable if the seller has the "Separate Orders by Brand" setting enabled.
          type:
          - integer
          - 'null'
        status:
          title: Status
          description: Order status
          type: string
          enum:
          - Draft
          - Submitted
          - Accepted
          - Backorder
          - Fulfilled
          - Shipped
          - Complete
          - Rejected
          - Combined
          - Cancelled
        manual:
          title: Manual
          description: Was the order manually created by the seller company?
          type: boolean
        discount:
          description: Discount value applied to the order
          type: number
          format: decimal
        discount_type:
          description: 'Type of discount: % or $'
          type: string
          minLength: 1
        tax_amount:
          title: Tax amount
          description: Tax amount applied to the order
          type: number
          format: decimal
        tax_type:
          title: Tax type
          description: 'Type of tax: %'
          type: string
          minLength: 1
        final_tax:
          description: Tax total for the order
          type: string
        shipping_charge:
          required:
          - amount
          - currency
          type: object
          properties:
            amount:
              title: Amount
              type: string
              format: decimal
            currency:
              title: Currency
              type: string
              minLength: 1
        total:
          required:
          - amount
          - currency
          type: object
          properties:
            amount:
              title: Amount
              type: string
              format: decimal
            currency:
              title: Currency
              type: string
              minLength: 1
        payment_term:
          title: Payment term
          description: Payment term for the order Deprecated field, please use payment_option instead
          type:
          - string
          - 'null'
          readOnly: true
        payment_methods:
          title: Payment methods
          description: Payment methods for the order Deprecated field, please use payment_option instead
          type:
          - array
          - 'null'
          items:
            type: string
          readOnly: true
        selected_payment_option:
          id: 1732313
          is_default: false
          payment_program: flexible
          payment_strategy: reverse_factored
          payment_method:
            id: 4
            method: ACH
          payment_term:
            id: 3
            term: Net 15
            days: 15
            code: net15
        payment_due_date:
          title: Payment Due Date
          description: Date that the Payment is due
          type:
          - string
          - 'null'
          format: date-time
        paid:
          title: Is paid?
          description: If this order has been paid for
          type: boolean
        paid_date:
          title: Paid date
          description: Date the order was paid
          type:
          - string
          - 'null'
          format: date
        ship_date:
          title: Ship date
          description: Date and time the order was shipped
          type:
          - string
          - 'null'
          format: date-time
        shipping_details:
          title: Shipping details
          description: Shipping details included on an order
          type:
          - string
          - 'null'
          minLength: 1
        notes:
          title: Order Notes
          description: Additional notes for an Order
          type:
          - string
          - 'null'
          maxLength: 2000
        internal_notes:
          title: Order Notes
          description: Internal notes for an Order
          type:
          - string
          - 'null'
          maxLength: 2000
        delivery_preferences:
          title: Delivery Preferences
          description: Customer Delivery Preferences
          type:
          - string
          - 'null'
        sales_reps:
          description: Sales representatives associated with the order.
          type: array
          items:
            $ref: '#/components/schemas/LightCompanyStaff'
          readOnly: true
        classification:
          title: Classification
          description: Classification of the license-type associated to the order
          type: string
          minLength: 1
        payment_balance:
          title: Payment balance
          description: The outstanding balance on the order
          type: string
          readOnly: true
        available_transitions:
          title: Available transitions
          description: States that the order can transition to
          type: string
          readOnly: true
        modified:
          title: Modified
          description: Date and time that the order was last modified
          type: string
          format: date-time
        has_special_requests:
          title: Has special requests
          description: Does the order have special requests?
          type: boolean
        delivery_provider:
          title: Delivery provider
          description: The company delivering this order.
          type:
          - integer
          - 'null'
        order_taxes:
          description: Details about the taxes applied to the order
          type: array
          items:
            $ref: '#/components/schemas/LightOrderTax'
        delivery_info:
          $ref: '#/components/schemas/DeliveryProviderOrderInformation'
        is_combination:
          title: Is combination
          type: string
          readOnly: true
        llf_payment_method:
          type: boolean
          readOnly: true
        credits:
          type: string
          readOnly: true
          description: Total dollar value of credits applied to the order
        facility_id:
          type: integer
          readOnly: true
          description: Facility ID related to an order
        order_number:
          title: Order number
          description: Read only alias of number.
          type: string
          readOnly: true
          minLength: 1
        order_seller_number:
          title: Order seller number
          description: Read only alias of external_id_seller.If external_id_seller is missing, short_id will be provided.
          type: string
          readOnly: true
        order_buyer_number:
          title: Order buyer number
          description: Read only alias of external_id_buyer.  If external_id_buyer is missing, short_id will be provided.
          type: string
          readOnly: true
        order_short_number:
          title: Order short number
          description: Read only alias of short_id.
          type: string
          readOnly: true
          minLength: 1
        distributor:
          title: Distributor
          description: id of the distributor delivering this order
          type: string
          readOnly: true
        external_ids:
          $ref: '#/components/schemas/ExternalIds'
        corporate_address:
          title: Corporate Address
          description: Read only corporate address as provided during order creation.
          type: object
          readOnly: true
          properties:
            address:
              title: Address
              type: string
            city:
              title: City
              type: string
            state:
              title: State
              type: string
            unit_number:
              title: Unit Number
              type: string
            zipcode:
              title: Zip Code
              type: string
        delivery_address:
          title: Delivery Address
          description: Read only delivery address as provided during order creation.
          type: object
          readOnly: true
          properties:
            address:
              title: Address
              type: string
            city:
              title: City
              type: string
            state:
              title: State
              type: string
            unit_numb

# --- truncated at 32 KB (52 KB total) ---
# Full source: https://raw.githubusercontent.com/api-evangelist/leaflink/refs/heads/main/openapi/leaflink-orders-received-api-openapi.yml