LeafLink Inventory API

The inventory API from LeafLink — 4 operation(s) for inventory.

Operations 4

POST /inventory/commands/compare-inventory #
POST /inventory/commands/initialize-history #
POST /inventory/commands/initialize-product-streams #
POST /inventory/commands/initialize-streams-for-seller #

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-inventory-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-inventory-api-openapi.yml Raw ↑
openapi: 3.2.0
info:
  title: LeafLink Inventory API
  version: '2022-10-31'
  description: 'This reference specification outlines all the available HTTP operations of the LeafLink API.


    See the [LeafLink Developer Hub](/api) for guides, how-to, and general information of the API.

    '
  termsOfService: https://www.leaflink.com/terms-and-conditions/
  contact:
    email: support@leaflink.com
servers:
- url: https://api.leaflink.com
  description: LeafLink API production URL.
- url: https://staging-api.leaflink.com
  description: LeafLink API staging URL.
security:
- bearerAuth: []
tags:
- name: inventory
paths:
  /inventory/commands/compare-inventory:
    post:
      operationId: inventory_commands_compare_inventory_create
      description: 'POST /inventory/commands/compare-inventory


        Staff-only endpoint for drift investigation. Compares V1 vs V2

        inventory state for a given scope. At least one of seller_id,

        product_id, facility_id, or batch_id is required. Read-only —

        writes no events.


        Seller requests default to summary mode and return a seller-level

        accuracy verdict plus all drifted product summaries. Diagnostic mode

        returns the legacy JSON array, restricted to scopes that have drifted

        (V1 vs V2 delta exceeds DRIFT_THRESHOLD on on_hand or reserved).


        Each entry carries a ``known_issues`` list naming recognised V1

        bugs that explain the drift. Pass ``ignore_known_issues=true``

        to exclude entries that match any known issue. Pass

        ``ignore_product_ids=[...]`` to exclude specific products from

        the scan.'
      tags:
      - inventory
      security:
      - bearerAuth: []
      responses:
        '200':
          description: No response body
          headers:
            RateLimit-Limit:
              schema:
                type: integer
              description: The requests quota in the time window.
            RateLimit-Remaining:
              schema:
                type: integer
              description: The remaining requests quota in the current window.
            RateLimit-Reset:
              schema:
                type: integer
              description: The time remaining in the current window, specified in seconds.
            RateLimit-Policy:
              schema:
                type: string
              description: The quota policy information.
        '429':
          description: Rate Limit Error
          headers:
            Retry-After:
              schema:
                type: integer
              description: The time remaining before the rejected request can be tried again, specified in seconds.
  /inventory/commands/initialize-history:
    post:
      operationId: inventory_commands_initialize_history_create
      description: 'POST /inventory/commands/initialize-history


        Staff-only endpoint to trigger proactive V2 item history initialization

        for a seller''s entire product catalog.


        Body: {"seller_id": <int>}'
      tags:
      - inventory
      security:
      - bearerAuth: []
      responses:
        '200':
          description: No response body
          headers:
            RateLimit-Limit:
              schema:
                type: integer
              description: The requests quota in the time window.
            RateLimit-Remaining:
              schema:
                type: integer
              description: The remaining requests quota in the current window.
            RateLimit-Reset:
              schema:
                type: integer
              description: The time remaining in the current window, specified in seconds.
            RateLimit-Policy:
              schema:
                type: string
              description: The quota policy information.
        '429':
          description: Rate Limit Error
          headers:
            Retry-After:
              schema:
                type: integer
              description: The time remaining before the rejected request can be tried again, specified in seconds.
  /inventory/commands/initialize-product-streams:
    post:
      operationId: inventory_commands_initialize_product_streams_create
      description: 'POST /inventory/commands/initialize-product-streams


        Initialize all inventory streams for a product. View fetches Django data via

        _get_legacy_streams_for_product and passes to command service.'
      tags:
      - inventory
      security:
      - bearerAuth: []
      responses:
        '200':
          description: No response body
          headers:
            RateLimit-Limit:
              schema:
                type: integer
              description: The requests quota in the time window.
            RateLimit-Remaining:
              schema:
                type: integer
              description: The remaining requests quota in the current window.
            RateLimit-Reset:
              schema:
                type: integer
              description: The time remaining in the current window, specified in seconds.
            RateLimit-Policy:
              schema:
                type: string
              description: The quota policy information.
        '429':
          description: Rate Limit Error
          headers:
            Retry-After:
              schema:
                type: integer
              description: The time remaining before the rejected request can be tried again, specified in seconds.
  /inventory/commands/initialize-streams-for-seller:
    post:
      operationId: inventory_commands_initialize_streams_for_seller_create
      description: 'POST /inventory/commands/initialize-streams


        Staff-only endpoint to trigger proactive V2 stream initialization

        for a seller''s entire product catalog. Dispatches a background Celery

        task on the low-priority initialization queue.


        Body: {"seller_id": <int>}'
      tags:
      - inventory
      security:
      - bearerAuth: []
      responses:
        '200':
          description: No response body
          headers:
            RateLimit-Limit:
              schema:
                type: integer
              description: The requests quota in the time window.
            RateLimit-Remaining:
              schema:
                type: integer
              description: The remaining requests quota in the current window.
            RateLimit-Reset:
              schema:
                type: integer
              description: The time remaining in the current window, specified in seconds.
            RateLimit-Policy:
              schema:
                type: string
              description: The quota policy information.
        '429':
          description: Rate Limit Error
          headers:
            Retry-After:
              schema:
                type: integer
              description: The time remaining before the rejected request can be tried again, specified in seconds.
components:
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      bearerFormat: JWT
      description: 'Authentication is done via access tokens (JWTs). See the [API authentication doc](/api/getting-started/#authentication) for more information.

        '
    tokenAuth:
      type: apiKey
      in: header
      name: Authorization
      description: Token-based authentication with required prefix "Token"