# Distru API > Distru is an ERP for the cannabis industry. Its REST API manages the full supply chain — products, inventory, sales orders, invoices, purchases, manufacturing, and compliance syncing with state traceability systems (Metrc, BioTrack). All endpoints live under `https://app.distru.com/public/v1/`. Requests and responses are JSON. API access must be enabled for your account by a Distru representative; a sandbox environment is available on request. ## When to use this API Reach for this API when your task touches a cannabis operator's data inside Distru. It is the right tool for: - Syncing Distru records into another system — pull orders, invoices, payments, inventory, or products into accounting software, a data warehouse, or a BI tool (incremental sync with `updated_datetime` is recommended; webhooks can trigger a sync sooner). - Creating or updating records from outside Distru — push sales orders from an e-commerce storefront, purchases from a procurement tool, or payments from a payment processor via the upsert endpoints. - Automating operational workflows — generate invoices and PDFs, adjust stock, record manufacturing runs (assemblies), attach lab test results to batches. - Reading compliance state — packages, Metrc transfers, licensed locations, and test results already synced with the state traceability system. It is the wrong tool for: managing the Distru web app itself (permissions, settings, and user management are app-only), point-of-sale retail transactions, or talking to Metrc/BioTrack directly (Distru mediates compliance writes). How to call it: plain REST over HTTPS at `https://app.distru.com/public/v1/` with `Authorization: Bearer `. No SDK is required — generate a typed client from [the OpenAPI spec](https://docs.distru.com/openapi.json) if you want one. Start with the conventions in the next section, then look up each endpoint's page under its resource below, or search [llms-full.txt](https://docs.distru.com/llms-full.txt). ## How agents should use this API - For reference material, fetch [the full documentation](https://docs.distru.com/llms-full.txt) — the complete docs as one Markdown file, with one section per resource. Use [the OpenAPI 3.0 specification](https://docs.distru.com/openapi.json) for exact request/response schemas and to generate typed clients. - Authenticate every request with `Authorization: Bearer ` plus `Content-Type: application/json` and `Accept: application/json`. An admin creates tokens in the Distru app under Settings → Integrations → Distru API. A token carries the creating admin's permissions — keep it server-side. - Treat every id as an opaque string. Never parse, construct, or guess ids. - Request a list endpoint with no page parameter for the first page, then paginate by following the `next_page` URL in each paginated response — pass it back exactly as given — until it is null. Never build a page selector yourself and never assume a page size; the server may change it at any time. - Writes use upsert endpoints: one `POST` serves create and update (`id` absent → create, `id` present → update). Updates are sparse: an omitted field is left unchanged, `null` clears a field. Nested collections (`items`, `charges`) may be omitted entirely to leave existing rows untouched; sending one replaces the whole set (an existing row whose id you omit is deleted, `{"id": "..."}` alone keeps a row unchanged, an entry without an id is added) — see each endpoint's docs for its exact semantics. - Enums are SCREAMING_CASE in both requests and responses (`"COMPLETED"`, not `"completed"`), with a few exceptions — check the OpenAPI spec or the endpoint's docs for the exact values. - Array filters repeat a bracketed key (`?ids[]=a&ids[]=b`), max 200 values. Datetime filters are inclusive comma ranges: `?updated_datetime=,` (omit one side for open-ended). - Every error has one shape: `{ "errors": [ { "message": "...", "pointer": ["items", 0, "quantity"] } ] }` where `pointer` is the path to the offending request field (`["base"]` for whole-request errors). The only status codes are 200/201, 400 (bad input), 401 (bad token), 403 (missing permission, or a record your team restrictions hide), 404 (no such record for your company, including a malformed id), and 429. The API never returns 422. - Every paginated list endpoint with an `updated_datetime` filter is rate limited ([list](https://docs.distru.com/api/incremental-sync.md#list-rate-limits)): each account has one budget of 3,000 calls across all of them, refilling at 5 per minute, and every page costs one, lookups included. Getting a record by id is not limited. Only a call whose `updated_datetime` lower bound is within the last 30 days is free and never refused. PDF endpoints (paths ending in `/pdf`) have their own limit: 20/minute and 1,000/day per account. A 429 includes a `Retry-After` header — honor it. - Webhooks push create/edit/delete events to your endpoint for the main entity types (orders, invoices, purchases, and more — see the webhooks docs). To keep a local copy of Distru records, we recommend the [incremental sync approach](https://docs.distru.com/api/incremental-sync.md). - Breaking changes are announced only through the [email list](https://share.hsforms.com/1ui8lKXQ2RAaytYEyEphCiQ2usrt) — advise integrators to sign up. ## Documentation - [Full documentation](https://docs.distru.com/llms-full.txt): Complete API docs as one Markdown file. - [Agent Skill](https://docs.distru.com/SKILL.md): Installable SKILL.md teaching an agent this API's conventions — save it into your agent's skills directory. - [OpenAPI 3.0 specification](https://docs.distru.com/openapi.json): Machine-readable schemas for every endpoint and model. - [Authentication](https://docs.distru.com/api/authentication.md): Creating and using API tokens. - [Handling errors](https://docs.distru.com/api/handling-errors.md): The error envelope and status codes. - [Incremental sync](https://docs.distru.com/api/incremental-sync.md): Keeping a copy in sync with `updated_datetime` and deleted records, and the list rate limits. - [Pagination](https://docs.distru.com/api/incremental-sync.md#pagination): Cursor pagination via `next_page` URLs. - [Sparse updates](https://docs.distru.com/api/sparse-updates.md): Upsert semantics for partial updates and nested collections. - [Webhooks](https://docs.distru.com/api/webhooks.md): Real-time create/edit/delete notifications. - [Rate limiting](https://docs.distru.com/api/rate-limiting.md): List and PDF download limits and `Retry-After`. - [Changelog](https://docs.distru.com/api/changelog.md): Dated API changes, newest first. ## Sales - Order: Sales orders and their line items, charges, and status lifecycle. - [Get orders](https://docs.distru.com/api/order/get-orders.md) - [Upsert an order](https://docs.distru.com/api/order/upsert-an-order.md) - [Delete an order](https://docs.distru.com/api/order/delete-an-order.md) - [Get an order](https://docs.distru.com/api/order/get-an-order.md) - [Generate a sales order slip PDF](https://docs.distru.com/api/order/generate-a-sales-order-slip-pdf.md) - [Generate a sales order's Certificate of Analysis (COA) PDF](https://docs.distru.com/api/order/generate-a-sales-order-s-certificate-of-analysis-coa-pdf.md) - Invoice: Invoices generated from sales orders. - [Get invoices](https://docs.distru.com/api/invoice/get-invoices.md) - [Upsert an invoice](https://docs.distru.com/api/invoice/upsert-an-invoice.md) - [Delete an invoice](https://docs.distru.com/api/invoice/delete-an-invoice.md) - [Get an invoice](https://docs.distru.com/api/invoice/get-an-invoice.md) - [Insert a payment for an invoice](https://docs.distru.com/api/invoice/insert-a-payment-for-an-invoice.md) - [Generate an invoice PDF](https://docs.distru.com/api/invoice/generate-an-invoice-pdf.md) - [Generate an invoice's Certificate of Analysis (COA) PDF](https://docs.distru.com/api/invoice/generate-an-invoice-s-certificate-of-analysis-coa-pdf.md) - Payment: Payments applied to invoices. - [Get payments](https://docs.distru.com/api/payment/get-payments.md) - [Get a payment](https://docs.distru.com/api/payment/get-a-payment.md) - [Void a payment](https://docs.distru.com/api/payment/void-a-payment.md) - PaymentMethod: Available payment methods. - [Get payment methods](https://docs.distru.com/api/payment-method/get-payment-methods.md) - [Get a payment method](https://docs.distru.com/api/payment-method/get-a-payment-method.md) - PaymentTerm: Payment terms (e.g. net-30). - [Get payment terms](https://docs.distru.com/api/payment-term/get-payment-terms.md) - Credit: Customer credits and their application. - [Get credits](https://docs.distru.com/api/credit/get-credits.md) - [Create or update a credit](https://docs.distru.com/api/credit/create-or-update-a-credit.md) - [Delete a credit](https://docs.distru.com/api/credit/delete-a-credit.md) - [Get a credit](https://docs.distru.com/api/credit/get-a-credit.md) - [Cancel a credit](https://docs.distru.com/api/credit/cancel-a-credit.md) - Return: Returns of sold inventory. - [Get returns](https://docs.distru.com/api/return/get-returns.md) - [Get a return](https://docs.distru.com/api/return/get-a-return.md) - Menu: Sales menus controlling product visibility. - [Get menus](https://docs.distru.com/api/menu/get-menus.md) - [Get a menu](https://docs.distru.com/api/menu/get-a-menu.md) - PriceTier: Tiered pricing rules applied to order items. - [Get price tiers](https://docs.distru.com/api/price-tier/get-price-tiers.md) - [Upsert a price tier](https://docs.distru.com/api/price-tier/upsert-a-price-tier.md) - [Delete a price tier](https://docs.distru.com/api/price-tier/delete-a-price-tier.md) - [Get a price tier](https://docs.distru.com/api/price-tier/get-a-price-tier.md) - ChargePreset: Reusable charge/discount templates applied to orders, purchases, and invoices. - [Get charge presets](https://docs.distru.com/api/charge-preset/get-charge-presets.md) - [Upsert a charge preset](https://docs.distru.com/api/charge-preset/upsert-a-charge-preset.md) - [Delete a charge preset](https://docs.distru.com/api/charge-preset/delete-a-charge-preset.md) - [Get a charge preset](https://docs.distru.com/api/charge-preset/get-a-charge-preset.md) ## Purchasing & manufacturing - Purchase: Purchase orders; receiving moves inventory into a location. - [Get purchases](https://docs.distru.com/api/purchase/get-purchases.md) - [Upsert a purchase order](https://docs.distru.com/api/purchase/upsert-a-purchase-order.md) - [Delete a purchase](https://docs.distru.com/api/purchase/delete-a-purchase.md) - [Get a purchase](https://docs.distru.com/api/purchase/get-a-purchase.md) - [Insert a payment for a purchase](https://docs.distru.com/api/purchase/insert-a-payment-for-a-purchase.md) - [Generate a purchase order PDF](https://docs.distru.com/api/purchase/generate-a-purchase-order-pdf.md) - Assembly: Manufacturing runs consuming input inventory and producing outputs. - [Get assemblies](https://docs.distru.com/api/assembly/get-assemblies.md) - [Upsert an assembly](https://docs.distru.com/api/assembly/upsert-an-assembly.md) - [Create a test sample](https://docs.distru.com/api/assembly/create-a-test-sample.md) - [Split a package](https://docs.distru.com/api/assembly/split-a-package.md) - [Delete an assembly](https://docs.distru.com/api/assembly/delete-an-assembly.md) - [Get an assembly](https://docs.distru.com/api/assembly/get-an-assembly.md) - [Generate a work order PDF](https://docs.distru.com/api/assembly/generate-a-work-order-pdf.md) - Cost: Costs attached to batches, packages, and products. - [Add costs to batches](https://docs.distru.com/api/cost/add-costs-to-batches.md) - [Add costs to packages](https://docs.distru.com/api/cost/add-costs-to-packages.md) - [Add costs to products](https://docs.distru.com/api/cost/add-costs-to-products.md) - CostType: Categories for costs. - [Get cost types](https://docs.distru.com/api/cost-type/get-cost-types.md) - [Upsert a cost type](https://docs.distru.com/api/cost-type/upsert-a-cost-type.md) - [Delete a cost type](https://docs.distru.com/api/cost-type/delete-a-cost-type.md) - [Get a cost type](https://docs.distru.com/api/cost-type/get-a-cost-type.md) ## Inventory & compliance - Inventory: Current inventory quantities by product, batch, and location. - [Get inventory levels](https://docs.distru.com/api/inventory/get-inventory-levels.md) - Package: Compliance packages, including Metrc-synced operations. - [Get packages](https://docs.distru.com/api/package/get-packages.md) - [Finish packages](https://docs.distru.com/api/package/finish-packages.md) - [Import packages](https://docs.distru.com/api/package/import-packages.md) - [Move packages](https://docs.distru.com/api/package/move-packages.md) - [Update a package](https://docs.distru.com/api/package/update-a-package.md) - [Generate a package's Certificate of Analysis (COA) PDF](https://docs.distru.com/api/package/generate-a-package-s-certificate-of-analysis-coa-pdf.md) - Batch: Production batches tying inventory to test results and costs. - [Get batches](https://docs.distru.com/api/batch/get-batches.md) - [Create or update a batch](https://docs.distru.com/api/batch/create-or-update-a-batch.md) - [Delete a batch](https://docs.distru.com/api/batch/delete-a-batch.md) - [Get a batch](https://docs.distru.com/api/batch/get-a-batch.md) - [Generate a batch's Certificate of Analysis (COA) PDF](https://docs.distru.com/api/batch/generate-a-batch-s-certificate-of-analysis-coa-pdf.md) - Bin: Storage bins within locations. - [Get bins](https://docs.distru.com/api/bin/get-bins.md) - [Upsert a bin](https://docs.distru.com/api/bin/upsert-a-bin.md) - [Delete a bin](https://docs.distru.com/api/bin/delete-a-bin.md) - [Get a bin](https://docs.distru.com/api/bin/get-a-bin.md) - Location: Licensed locations inventory lives in. Own locations are written via POST /locations and partner companies' locations via the Company resource; coordinates are geocoded from the address. - [Get locations](https://docs.distru.com/api/location/get-locations.md) - [Upsert a location](https://docs.distru.com/api/location/upsert-a-location.md) - [Get a location](https://docs.distru.com/api/location/get-a-location.md) - License: The company's own cannabis licenses, with compliance sync health per license. Partner companies' licenses are written via the Company resource. - [Get licenses](https://docs.distru.com/api/license/get-licenses.md) - [Get a license](https://docs.distru.com/api/license/get-a-license.md) - LicenseType: The license type values valid for the company's US state. - [Get license types](https://docs.distru.com/api/license-type/get-license-types.md) - StockAdjustment: Manual inventory adjustments. - [Get adjustments](https://docs.distru.com/api/stock-adjustment/get-adjustments.md) - [Insert a stock adjustment](https://docs.distru.com/api/stock-adjustment/insert-a-stock-adjustment.md) - [Get a stock adjustment](https://docs.distru.com/api/stock-adjustment/get-a-stock-adjustment.md) - Metrc: Metrc-specific resources such as transfers and items. - [Get Metrc items](https://docs.distru.com/api/metrc/get-metrc-items.md) - [Get Metrc lab test batches](https://docs.distru.com/api/metrc/get-metrc-lab-test-batches.md) - [Get Metrc locations](https://docs.distru.com/api/metrc/get-metrc-locations.md) - [Get Metrc packages](https://docs.distru.com/api/metrc/get-metrc-packages.md) - [Get a Metrc package](https://docs.distru.com/api/metrc/get-a-metrc-package.md) - [Get Metrc strains](https://docs.distru.com/api/metrc/get-metrc-strains.md) - [Get Metrc tags](https://docs.distru.com/api/metrc/get-metrc-tags.md) - [Get a Metrc tag](https://docs.distru.com/api/metrc/get-a-metrc-tag.md) - [Get Metrc transfers](https://docs.distru.com/api/metrc/get-metrc-transfers.md) - [Get a Metrc transfer](https://docs.distru.com/api/metrc/get-a-metrc-transfer.md) - TestResult: Lab test results attached to batches. - [Get test results](https://docs.distru.com/api/test-result/get-test-results.md) - [Upsert a test result](https://docs.distru.com/api/test-result/upsert-a-test-result.md) - [Delete a test result](https://docs.distru.com/api/test-result/delete-a-test-result.md) - [Get a test result](https://docs.distru.com/api/test-result/get-a-test-result.md) - [Generate a test result's Certificate of Analysis (COA) PDF](https://docs.distru.com/api/test-result/generate-a-test-result-s-certificate-of-analysis-coa-pdf.md) ## Catalog - Product: The product catalog. - [Get products](https://docs.distru.com/api/product/get-products.md) - [Upsert a product](https://docs.distru.com/api/product/upsert-a-product.md) - [Delete a product](https://docs.distru.com/api/product/delete-a-product.md) - [Get a product](https://docs.distru.com/api/product/get-a-product.md) - [Delete a product bill of materials](https://docs.distru.com/api/product/delete-a-product-bill-of-materials.md) - [Upsert a product bill of materials](https://docs.distru.com/api/product/upsert-a-product-bill-of-materials.md) - [Associate images with a product](https://docs.distru.com/api/product/associate-images-with-a-product.md) - ProductCategory: Product categories. - [Get product categories](https://docs.distru.com/api/product-category/get-product-categories.md) - [Upsert a product category](https://docs.distru.com/api/product-category/upsert-a-product-category.md) - [Delete a product category](https://docs.distru.com/api/product-category/delete-a-product-category.md) - [Get a product category](https://docs.distru.com/api/product-category/get-a-product-category.md) - ProductSubcategory: Product subcategories. - [Get product subcategories](https://docs.distru.com/api/product-subcategory/get-product-subcategories.md) - [Upsert a product subcategory](https://docs.distru.com/api/product-subcategory/upsert-a-product-subcategory.md) - [Delete a product subcategory](https://docs.distru.com/api/product-subcategory/delete-a-product-subcategory.md) - [Get a product subcategory](https://docs.distru.com/api/product-subcategory/get-a-product-subcategory.md) - ProductGroup: Groupings of related products. - [Get product groups](https://docs.distru.com/api/product-group/get-product-groups.md) - [Upsert a product group](https://docs.distru.com/api/product-group/upsert-a-product-group.md) - [Delete a product group](https://docs.distru.com/api/product-group/delete-a-product-group.md) - [Get a product group](https://docs.distru.com/api/product-group/get-a-product-group.md) - ProductImage: Upload and delete product images. - [Upload a product image](https://docs.distru.com/api/product-image/upload-a-product-image.md) - [Delete a product image](https://docs.distru.com/api/product-image/delete-a-product-image.md) - ProductPosMapping: Mappings between Distru products and POS systems. - [List product POS mappings](https://docs.distru.com/api/product-pos-mapping/list-product-pos-mappings.md) - [Create or update a product POS mapping](https://docs.distru.com/api/product-pos-mapping/create-or-update-a-product-pos-mapping.md) - [Delete a product POS mapping](https://docs.distru.com/api/product-pos-mapping/delete-a-product-pos-mapping.md) - [Get a product POS mapping](https://docs.distru.com/api/product-pos-mapping/get-a-product-pos-mapping.md) - OfficialProductCategory: State-defined product categories. - [Get official product categories](https://docs.distru.com/api/official-product-category/get-official-product-categories.md) - Strain: Cannabis strains. - [Get strains](https://docs.distru.com/api/strain/get-strains.md) - [Create or update a strain](https://docs.distru.com/api/strain/create-or-update-a-strain.md) - [Delete a strain](https://docs.distru.com/api/strain/delete-a-strain.md) - [Get a strain](https://docs.distru.com/api/strain/get-a-strain.md) - UnitType: Units of measure. - [Get unit types](https://docs.distru.com/api/unit-type/get-unit-types.md) - [Get a unit type](https://docs.distru.com/api/unit-type/get-a-unit-type.md) - Tag: Tags for organizing records. - [Get tags](https://docs.distru.com/api/tag/get-tags.md) - [Upsert a tag](https://docs.distru.com/api/tag/upsert-a-tag.md) - [Delete a tag](https://docs.distru.com/api/tag/delete-a-tag.md) - [Get a tag](https://docs.distru.com/api/tag/get-a-tag.md) ## Companies & people - Company: Customer and vendor companies. - [Get companies](https://docs.distru.com/api/company/get-companies.md) - [Upsert a company](https://docs.distru.com/api/company/upsert-a-company.md) - [Delete a company](https://docs.distru.com/api/company/delete-a-company.md) - [Get a company](https://docs.distru.com/api/company/get-a-company.md) - [Upsert a company's license](https://docs.distru.com/api/company/upsert-a-company-s-license.md) - [Upsert a company's location](https://docs.distru.com/api/company/upsert-a-company-s-location.md) - CompanyGroup: Groupings of related companies. - [Get company groups](https://docs.distru.com/api/company-group/get-company-groups.md) - [Upsert a company group](https://docs.distru.com/api/company-group/upsert-a-company-group.md) - [Delete a company group](https://docs.distru.com/api/company-group/delete-a-company-group.md) - [Get a company group](https://docs.distru.com/api/company-group/get-a-company-group.md) - Contact: Contacts at companies. - [Get contacts](https://docs.distru.com/api/contact/get-contacts.md) - [Upsert a contact](https://docs.distru.com/api/contact/upsert-a-contact.md) - [Delete a contact](https://docs.distru.com/api/contact/delete-a-contact.md) - [Get a contact](https://docs.distru.com/api/contact/get-a-contact.md) - User: Users in your Distru account. - [Get users](https://docs.distru.com/api/user/get-users.md) - [Get a user](https://docs.distru.com/api/user/get-a-user.md) - Driver: Delivery drivers. - [Get drivers](https://docs.distru.com/api/driver/get-drivers.md) - [Upsert a driver](https://docs.distru.com/api/driver/upsert-a-driver.md) - [Delete a driver](https://docs.distru.com/api/driver/delete-a-driver.md) - [Get a driver](https://docs.distru.com/api/driver/get-a-driver.md) - Vehicle: Delivery vehicles. - [Get vehicles](https://docs.distru.com/api/vehicle/get-vehicles.md) - [Create or update a vehicle](https://docs.distru.com/api/vehicle/create-or-update-a-vehicle.md) - [Delete a vehicle](https://docs.distru.com/api/vehicle/delete-a-vehicle.md) - [Get a vehicle](https://docs.distru.com/api/vehicle/get-a-vehicle.md) ## Other - CustomField: Custom field definitions; values ride on records as `custom_data`. - [List custom field definitions](https://docs.distru.com/api/custom-field/list-custom-field-definitions.md) - [Create a custom field](https://docs.distru.com/api/custom-field/create-a-custom-field.md) - [Delete a custom field](https://docs.distru.com/api/custom-field/delete-a-custom-field.md) - [Get a custom field definition](https://docs.distru.com/api/custom-field/get-a-custom-field-definition.md) - [Update a custom field](https://docs.distru.com/api/custom-field/update-a-custom-field.md) - DeletedRecord: Records deleted in the last 90 days, of every type with its own list or get-by-id endpoint (the Metrc lists aside), for keeping a synced copy free of them. - [Get deleted records](https://docs.distru.com/api/deleted-record/get-deleted-records.md) - FileAttachment: Files attached to records. - [Insert a file attachment](https://docs.distru.com/api/file-attachment/insert-a-file-attachment.md) - Task: Tasks and to-dos. - [Get tasks](https://docs.distru.com/api/task/get-tasks.md) - [Upsert a task](https://docs.distru.com/api/task/upsert-a-task.md) - [Delete a task](https://docs.distru.com/api/task/delete-a-task.md) - [Get a task](https://docs.distru.com/api/task/get-a-task.md) - Tax: Tax definitions applied to orders. - [Get taxes](https://docs.distru.com/api/tax/get-taxes.md) - [Get a tax](https://docs.distru.com/api/tax/get-a-tax.md) - Reports: Prebuilt report data (COGS, transaction history, and more). - [Get the Cost of Goods Sold report](https://docs.distru.com/api/cogs/get-the-cost-of-goods-sold-report.md) - [Get the Cultivation Transaction History report](https://docs.distru.com/api/cultivation-transaction-history/get-the-cultivation-transaction-history-report.md) - [Get the Harvest Outputs report](https://docs.distru.com/api/harvest-outputs/get-the-harvest-outputs-report.md) - [Get the Inventory Assets report](https://docs.distru.com/api/inventory-assets/get-the-inventory-assets-report.md) - [Get the Inventory Transaction History report](https://docs.distru.com/api/inventory-transaction-history/get-the-inventory-transaction-history-report.md) - [Get the Inventory Valuation report](https://docs.distru.com/api/inventory-valuation/get-the-inventory-valuation-report.md) - [Get the Inventory Velocity report](https://docs.distru.com/api/inventory-velocity/get-the-inventory-velocity-report.md) - [Get the Invoice History report](https://docs.distru.com/api/invoice-history/get-the-invoice-history-report.md) - [Get the Order Fulfillment report](https://docs.distru.com/api/order-fulfillment/get-the-order-fulfillment-report.md) - [Get the Plant Lifecycle report](https://docs.distru.com/api/plant-lifecycle/get-the-plant-lifecycle-report.md) - [Get the Purchase Order History report](https://docs.distru.com/api/purchase-order-history/get-the-purchase-order-history-report.md) - [Get the Purchases By Company report](https://docs.distru.com/api/purchases-by-company/get-the-purchases-by-company-report.md) - [Get the Purchases By Product report](https://docs.distru.com/api/purchases-by-product/get-the-purchases-by-product-report.md) - [Get the Sales By Company report](https://docs.distru.com/api/sales-by-company/get-the-sales-by-company-report.md) - [Get the Sales By Product report](https://docs.distru.com/api/sales-by-product/get-the-sales-by-product-report.md) - [Get the Sales By User report](https://docs.distru.com/api/sales-by-user/get-the-sales-by-user-report.md) - [Get the Sales Order History report](https://docs.distru.com/api/sales-order-history/get-the-sales-order-history-report.md) - [Get the Sales Order Item History report](https://docs.distru.com/api/sales-order-item-history/get-the-sales-order-item-history-report.md) - [Get the Sales Order Tax report](https://docs.distru.com/api/sales-order-tax/get-the-sales-order-tax-report.md) ## MCP server Distru also has an MCP server, so an AI tool can use Distru directly instead of calling this API. - URL: `https://mcp.distru.com/mcp` (Streamable HTTP). - Access must be enabled for the account by a Distru representative. - Apps with a connector screen, such as Claude and ChatGPT: add a custom connector with that URL and choose Sign in with Distru (OAuth). - Tools that take a config file: create a key in Distru under Settings → Distru MCP, which needs the Manage MCP API Keys permission, and send it on every request as `Authorization: Bearer distru_mcp_...`. - [Distru MCP server](https://docs.distru.com/mcp.md): The tools your AI uses inside Distru. - [Connect your AI tool](https://docs.distru.com/mcp/connect.md): Add the Distru MCP server to Claude, ChatGPT, Claude Code, Cursor or any MCP client. - [How the tools work](https://docs.distru.com/mcp/conventions.md): Inputs every tool takes, paging, dates, and how to get the most out of the tools. - [Limits](https://docs.distru.com/mcp/limits.md): Rate limits on the Distru MCP server, and how to pace an agent. - [Linked accounts](https://docs.distru.com/mcp/linked-accounts.md): Use one connection across every Distru account linked to your login. ## MCP tools: Catalog - [Update products in bulk](https://docs.distru.com/mcp/tools/bulk-update-products.md): Applies the same changes to many products in one all-or-nothing save. Setting the unit price updates linked LeafLink products when your LeafLink settings sync prices. - [Create a custom field](https://docs.distru.com/mcp/tools/create-custom-field.md): Adds a custom field to one entity type, e.g. a Lab dropdown on packages; it then appears on every record of that type. - [Create a lookup value](https://docs.distru.com/mcp/tools/create-reference-type.md): Adds a value to one of your named lists, such as a product tag, category, group or payment method. Only a payment method reaches QuickBooks. - [Delete a custom field](https://docs.distru.com/mcp/tools/delete-custom-field.md): Permanently deletes a custom field and erases its value from every record of its entity type; this can't be undone. - [Get a product](https://docs.distru.com/mcp/tools/get-product.md): Gets one product with its pricing, costs, stock levels, potency, strain, brand, vendor and menus. - [Create, update or delete a product](https://docs.distru.com/mcp/tools/mutate-product.md): Creates, updates or deletes one catalog product. - [Search custom fields](https://docs.distru.com/mcp/tools/search-custom-fields.md): Searches the custom fields of the caller's company — extra attributes it adds to an entity type, e.g. a Lab dropdown on packages. - [Search lookups](https://docs.distru.com/mcp/tools/search-lookups.md): Searches your named lists, such as product categories, tags, groups, payment terms and taxes. - [Search price tiers](https://docs.distru.com/mcp/tools/search-price-tiers.md): Searches the price tiers of the company: discounts that lower the unit price of sales order items. - [Search products](https://docs.distru.com/mcp/tools/search-products.md): Searches the product catalog with prices, costs, stock across locations, potency and classification. - [Set a product's bill of materials](https://docs.distru.com/mcp/tools/set-product-bill-of-materials.md): Creates, updates or removes a product's bill of materials: what one unit of the product takes, and the costs it adds. - [Update a custom field](https://docs.distru.com/mcp/tools/update-custom-field.md): Renames a custom field, or changes its description, whether it's required, or its dropdown or checkbox options. ## MCP tools: Commerce - [Get a menu's settings](https://docs.distru.com/mcp/tools/get-menu-settings.md): Gets one of your company's menus, inactive ones included, with everything distru-mutate-menu writes but the passcode. - [Create or update a menu](https://docs.distru.com/mcp/tools/mutate-menu.md): Creates or updates one of your company's menus: who can see and order from it, ordering rules, how stock and prices show, selling by potency, trade samples, order notifications, and its collections. - [Search a menu's collections](https://docs.distru.com/mcp/tools/search-menu-collections.md): Lists the collections on one menu, or fetches one collection with its products (collectionId). - [Search a menu's products](https://docs.distru.com/mcp/tools/search-menu-products.md): Searches the products on one menu, with quantity available, sold-out status and THC as that menu shows them. - [Search menus](https://docs.distru.com/mcp/tools/search-menus.md): Searches the wholesale menus the company publishes to its buyers: one row per menu with its names, visibility, public URL, ordering rules and AI order intake address. ## MCP tools: Compliance - [Get a Metrc manifest](https://docs.distru.com/mcp/tools/get-metrc-manifest.md): Gets one Metrc transfer manifest by manifest number, with its recipients and packages. - [Import Metrc packages](https://docs.distru.com/mcp/tools/import-metrc-packages.md): Brings Metrc packages into Distru inventory as Distru packages, all-or-nothing: each package's full Metrc quantity is added as stock at its location. - [Search unused Metrc tags](https://docs.distru.com/mcp/tools/search-available-metrc-tags.md): Searches the unused Metrc tags the state issued to you. - [Search your licenses](https://docs.distru.com/mcp/tools/search-licenses.md): Searches the caller's company's own state cannabis licenses, never a customer's or vendor's, with each Metrc license's sync health. - [Search Metrc sync history](https://docs.distru.com/mcp/tools/search-metrc-activities.md): Searches Metrc activities — the changes Distru sends to Metrc. - [Search Metrc item categories](https://docs.distru.com/mcp/tools/search-metrc-item-categories.md): Lists the Metrc item categories the company's licenses can use, sorted by name: the exact names distru-search-metrc-items categoryNames takes. - [Search Metrc items](https://docs.distru.com/mcp/tools/search-metrc-items.md): Searches the Metrc items of one license — the product definitions the state has accepted. - [Search Metrc rooms](https://docs.distru.com/mcp/tools/search-metrc-locations.md): Searches Metrc locations — the facility rooms Distru syncs from Metrc, with the license each belongs to. - [Search Metrc manifests](https://docs.distru.com/mcp/tools/search-metrc-manifests.md): Searches Metrc transfer manifests across the company's Metrc licenses, as Distru last synced them from Metrc. - [Search Metrc packages](https://docs.distru.com/mcp/tools/search-metrc-packages.md): Searches the packages Metrc holds for one license, as Distru last synced them, whether or not they are in Distru inventory. - [Search pending Metrc items](https://docs.distru.com/mcp/tools/search-pending-metrc-items.md): Searches the Metrc items of one license that Distru has queued but Metrc has not created yet. - [Search lab test results](https://docs.distru.com/mcp/tools/search-test-results.md): Searches lab test results — the potency records a COA file can be attached to. ## MCP tools: Costing - [Cost of goods sold report](https://docs.distru.com/mcp/tools/report-cogs.md): Cost of goods sold: one row per sold line item on a COMPLETED order that was not fully returned, with price, actual and default cost, profit and margin. - [Inventory valuation report](https://docs.distru.com/mcp/tools/report-inventory-valuation.md): Current stock and value per product, by state: active, reserved, available and incoming. ## MCP tools: Cultivation - [Get a harvest](https://docs.distru.com/mcp/tools/get-harvest.md): Gets a single cultivation harvest by ID: the harvested plant material of one strain under one license, with weights, cost breakdown and its teardown. - [Get a plant](https://docs.distru.com/mcp/tools/get-plant.md): Gets a single cultivation plant by ID with its teardowns (oldest first; a plant can be in several, e.g. manicure then teardown) and plant group. - [Get a plant group](https://docs.distru.com/mcp/tools/get-plant-group.md): Gets a single cultivation plant group (plant batch) by ID with plant counts by stage and Metrc source lineage. - [Get a teardown](https://docs.distru.com/mcp/tools/get-teardown.md): Gets one teardown: the work that turns flowering plants into harvests, with plant counts and weights. - [Cultivation transaction history](https://docs.distru.com/mcp/tools/report-cultivation-transaction-history.md): Every cultivation event in a date range, from plant batch creation to harvest, waste and packaging. - [Harvest outputs report](https://docs.distru.com/mcp/tools/report-harvest-outputs.md): One row per harvest assembly line: harvested material used, products made and costs. - [Plant lifecycle report](https://docs.distru.com/mcp/tools/report-plant-lifecycle.md): One row per plant batch: plants started, moved to veg, destroyed and harvested, with dates and costs per stage. - [Search harvests](https://docs.distru.com/mcp/tools/search-harvests.md): Searches harvests, the last step of the plant lifecycle after the teardown. - [Search plant groups](https://docs.distru.com/mcp/tools/search-plant-groups.md): Searches cultivation plant groups (plant batches) — a group of immature plants tracked as one unit until tagged. - [Search plants](https://docs.distru.com/mcp/tools/search-plants.md): Searches individual tagged cultivation plants. - [Search teardowns](https://docs.distru.com/mcp/tools/search-teardowns.md): Searches teardowns — cultivation work that turns flowering plants into harvests. ## MCP tools: Directory - [Update companies in bulk](https://docs.distru.com/mcp/tools/bulk-update-companies.md): Applies the same changes to many companies, your own included, in one all-or-nothing save. - [Get a company](https://docs.distru.com/mcp/tools/get-company.md): Gets one customer, vendor or your own company, with its licenses, addresses and default order notes. - [Get your user and company setup](https://docs.distru.com/mcp/tools/get-me.md): Gets the authenticated user and their company setup: timezone, US state, compliance system, active modules and key inventory and sales settings. - [Create, update or delete a company](https://docs.distru.com/mcp/tools/mutate-company.md): Creates, updates or deletes one customer or vendor company; UPDATE also takes your own company (isMyCompany), which DELETE refuses. - [Create, update or delete a contact](https://docs.distru.com/mcp/tools/mutate-company-contact.md): Creates, updates or deletes one contact (a person) at a customer or vendor company, or at your own. - [Create, update or delete a company license](https://docs.distru.com/mcp/tools/mutate-company-license.md): Creates, updates or deletes one license of a customer or vendor company. - [Create, update or delete a company address](https://docs.distru.com/mcp/tools/mutate-company-location.md): Creates, updates or deletes one location (address) of a customer or vendor company. - [Search companies](https://docs.distru.com/mcp/tools/search-companies.md): Searches the companies the caller's company does business with — its customers and vendors — plus the one record for its own company, flagged isMyCompany; set isMyCompany when a question hinges on which company is the user's own (e.g. products they vend or sell themselves). - [Search contacts](https://docs.distru.com/mcp/tools/search-contacts.md): Searches the contacts of the caller's company — the people it deals with at its customers, vendors and its own company. - [Search tasks](https://docs.distru.com/mcp/tools/search-tasks.md): Searches the caller's company's tasks — to-dos assigned to a user with a due date, optionally linked to one record. - [Search users](https://docs.distru.com/mcp/tools/search-users.md): Searches Distru users — the caller's teammates within their company, e.g. to find who owns an order or a task. ## MCP tools: Inventory - [Add inventory costs](https://docs.distru.com/mcp/tools/add-inventory-costs.md): Adds costs to one package, batch or product, spread over its quantity on hand. - [Adjust inventory](https://docs.distru.com/mcp/tools/adjust-inventory.md): Adjusts the quantity of a package, batch or product. Changes Metrc or BioTrack only for a package tracked there. - [Update batches in bulk](https://docs.distru.com/mcp/tools/bulk-update-batches.md): Applies the same changes to many batches in one all-or-nothing save: if any batch fails a check, nothing is saved and the error names the failing batches. - [Update packages in bulk](https://docs.distru.com/mcp/tools/bulk-update-packages.md): Applies the same changes to many packages in one all-or-nothing save: if any package fails a check, nothing is saved and the error names every failing package by Metrc label. - [Create an assembly](https://docs.distru.com/mcp/tools/create-assembly.md): Creates a PENDING assembly: a manufacturing or packaging job that consumes input inventory and produces output inventory, for non-compliance and Metrc products. - [Finish or unfinish packages](https://docs.distru.com/mcp/tools/finish-packages.md): Finishes empty Metrc packages in Metrc and Distru, or unfinishes them, all-or-nothing. - [Get an assembly](https://docs.distru.com/mcp/tools/get-assembly.md): Gets one assembly by ID: header detail with kind, status, cost, license and owner. - [Get a batch](https://docs.distru.com/mcp/tools/get-batch.md): Gets one inventory batch by ID: header detail with quantity, activeQuantityCost, dates, product, owner and primary test result. - [Get a package](https://docs.distru.com/mcp/tools/get-package.md): Gets one package with its compliance status, lab results, potency, quantities, location and costs. - [Move packages](https://docs.distru.com/mcp/tools/move-packages.md): Moves whole packages to another location. Changes Metrc only when given a Metrc room. - [Move stock between locations](https://docs.distru.com/mcp/tools/move-stock.md): Moves quantity of batch-tracked or product-tracked products from one of your locations to another, completed at once (a stock transfer). - [Create, update or delete a batch](https://docs.distru.com/mcp/tools/mutate-batch.md): Creates, updates or deletes one batch (lot) of a batch-tracked product. - [Inventory assets report](https://docs.distru.com/mcp/tools/report-inventory-assets.md): Stock per product and location, split by batch or package, with prices and costs. - [Inventory transaction history](https://docs.distru.com/mcp/tools/report-inventory-transaction-history.md): Every stock movement in a date range: orders, purchases, returns, assemblies, transfers and adjustments. - [Search assemblies](https://docs.distru.com/mcp/tools/search-assemblies.md): Searches assemblies — jobs that consume input inventory and produce output products. - [Search batches](https://docs.distru.com/mcp/tools/search-batches.md): Searches inventory batches — the lot a batch-tracked product's stock belongs to; only batches of batch-tracked products are returned. - [Search inventory locations](https://docs.distru.com/mcp/tools/search-locations.md): Searches your warehouses and rooms, with the license and Metrc room each maps to. - [Search packages](https://docs.distru.com/mcp/tools/search-packages.md): Searches inventory packages — the physical containers stock is held in, each carrying its compliance tag where the product is package-tracked. - [Search stock transfers](https://docs.distru.com/mcp/tools/search-stock-transfers.md): Searches stock transfers — moves of inventory between your locations — with their lines. - [Split a package](https://docs.distru.com/mcp/tools/split-package.md): Splits part of a package into new packages, each with its own Metrc tag. Claims those tags in Trym when your company is connected to it. ## MCP tools: Orders - [Cancel a customer credit](https://docs.distru.com/mcp/tools/cancel-credit.md): Cancels what's left on a customer credit so it can't be spent. Reaches QuickBooks when your settings sync credits and the customer is linked there, unless the credit came from an overpayment. - [Issue a customer credit](https://docs.distru.com/mcp/tools/create-credit.md): Issues a credit that a customer's later payments can draw on. Reaches QuickBooks when your settings sync credits and the customer is linked there. - [Invoice a sales order](https://docs.distru.com/mcp/tools/create-invoice.md): Creates the invoice of a sales order that has none. Reaches QuickBooks unless its total is negative, and your POS (Dutchie, Blaze or Treez) when the customer is mapped to one of its retailers. - [Record an invoice payment](https://docs.distru.com/mcp/tools/create-invoice-payment.md): Records a payment received against an invoice. QuickBooks gets the invoice if it isn't there yet, otherwise the payment when your QuickBooks settings sync payments. LeafLink gets the payment when your LeafLink settings sync payments and the order is linked to LeafLink. - [Delete an invoice](https://docs.distru.com/mcp/tools/delete-invoice.md): Permanently deletes an invoice and its payments. Removes the invoice from QuickBooks if it's there, and its payments too when your settings sync payments. - [Download a PDF](https://docs.distru.com/mcp/tools/download-pdf.md): Creates a PDF of an invoice, order slip, purchase order, work order, COA or Metrc manifest, and returns a download link. - [Email a PDF](https://docs.distru.com/mcp/tools/email-pdf.md): Emails one of those PDFs as an attachment, with the same email the Distru web app sends. - [Get a customer credit](https://docs.distru.com/mcp/tools/get-credit.md): Gets one customer credit by ID, with where it came from (sourcePayment or sourceReturn) and where it was applied (creditUses); line items and history are opt-in. - [Get an invoice](https://docs.distru.com/mcp/tools/get-invoice.md): Gets one invoice by ID: header detail with totals, paid and remaining amounts, dates, customer, owner, billing location and sales order. - [Get an invoice payment](https://docs.distru.com/mcp/tools/get-invoice-payment.md): Gets one payment received against an invoice by ID, with the credits it used (creditUses) and the credits its overpayment created (overpaymentCredits). - [Check the QuickBooks connection](https://docs.distru.com/mcp/tools/get-quickbooks-integration.md): Shows whether QuickBooks is connected, when it last synced, and the sync settings. - [Get a return](https://docs.distru.com/mcp/tools/get-return.md): Gets one return by ID: header detail with quantities, status, total, company, location, owner and sales order. - [Get a sales order](https://docs.distru.com/mcp/tools/get-sales-order.md): Gets one sales order by ID: header detail, customer, owner, shipping and billing locations, menu, the compliance license stock was drawn from and the compliance manifest number. - [Invoice report](https://docs.distru.com/mcp/tools/report-invoice-history.md): Invoice report: one row per invoice with its dates, sales order, customer, payment status, money totals and tax, charge and discount summaries; no line items. - [Order fulfillment report](https://docs.distru.com/mcp/tools/report-order-fulfillment.md): A grid of products by order for a date range, showing how much of each product each order needs. - [Sales order report](https://docs.distru.com/mcp/tools/report-sales-orders.md): Sales order report, one row per order, line item or tax rate. - [Sales totals report](https://docs.distru.com/mcp/tools/report-sales-totals.md): Sales totals over a date range, per customer, product or sales rep. - [Search customer credits](https://docs.distru.com/mcp/tools/search-credits.md): Searches customer credits from overpayments, returns, QuickBooks or issued by hand. - [Search invoice payments](https://docs.distru.com/mcp/tools/search-invoice-payments.md): Searches payments received against invoices, one row per payment, without the credits it used or created (use distru-get-invoice-payment for those). - [Search invoices](https://docs.distru.com/mcp/tools/search-invoices.md): Searches invoices — one row per invoice with totals, the amount paid, credit applied and the remaining balance, not line items. - [Search QuickBooks accounts](https://docs.distru.com/mcp/tools/search-qb-accounts.md): Searches your QuickBooks chart of accounts, as Distru last copied it. - [Search QuickBooks sync history](https://docs.distru.com/mcp/tools/search-quickbooks-activities.md): Shows each attempt to write a Distru change to QuickBooks, and why it failed. - [Search QuickBooks items](https://docs.distru.com/mcp/tools/search-quickbooks-items.md): Searches the QuickBooks products and services that Distru lines sync to. - [Search returns](https://docs.distru.com/mcp/tools/search-returns.md): Searches returns (product a customer sent back, reversing inventory and financials) — header fields only; for one return's line items, use distru-get-return with includeReturnItems. - [Search sales orders](https://docs.distru.com/mcp/tools/search-sales-orders.md): Searches sales orders — one row per order, not line items. - [Sync a record to QuickBooks](https://docs.distru.com/mcp/tools/sync-to-quickbooks.md): Pushes one record to QuickBooks again, with anything it depends on. - [Update a customer credit](https://docs.distru.com/mcp/tools/update-credit.md): Changes a customer credit's amount, notes or owner. Reaches QuickBooks when your settings sync credits and the customer is linked there, unless only the owner changes or the credit came from a QuickBooks credit memo. - [Void an invoice payment](https://docs.distru.com/mcp/tools/void-invoice-payment.md): Voids a payment received against an invoice. Reaches QuickBooks when your QuickBooks settings sync payments, and LeafLink when your LeafLink settings sync payments and the order is linked to LeafLink. ## MCP tools: Purchasing - [Record a purchase payment](https://docs.distru.com/mcp/tools/create-purchase-payment.md): Records a payment made to a supplier against a purchase order. Reaches QuickBooks when your settings sync purchases, purchase payments and the purchase order's status, and its total isn't negative (a zero total needs its own setting). - [Get a purchase order](https://docs.distru.com/mcp/tools/get-purchase-order.md): Gets one purchase order (a purchase from a supplier) by ID: header detail with supplier, owner, intake, billing and supplier locations, amount paid and the matched compliance manifest number. - [Get a purchase payment](https://docs.distru.com/mcp/tools/get-purchase-payment.md): Gets one payment made to a supplier against a purchase order by ID, with the purchase's payment status, paid amount and total. - [Create, update or delete a purchase order](https://docs.distru.com/mcp/tools/mutate-purchase-order.md): Creates, updates or deletes one purchase order. Reaches QuickBooks when your settings sync purchases: saving pushes an order, never a draft, when they sync its status and its total isn't negative (a zero total needs its own setting), and deleting removes its bill. - [Purchase order report](https://docs.distru.com/mcp/tools/report-purchase-order-history.md): Purchase order report: one row per purchase with its dates, vendor, status, owner, amount and amount paid; no line items. - [Purchase totals report](https://docs.distru.com/mcp/tools/report-purchase-totals.md): Purchase totals over a date range, per vendor or product. - [Search purchase orders](https://docs.distru.com/mcp/tools/search-purchase-orders.md): Searches purchase orders (purchases from suppliers) — one row per purchase, not line items. - [Search purchase payments](https://docs.distru.com/mcp/tools/search-purchase-payments.md): Searches payments made to suppliers against purchase orders, one row per payment, with the purchase's payment status, paid amount and total. - [Void a purchase payment](https://docs.distru.com/mcp/tools/void-purchase-payment.md): Voids a payment made to a supplier. Reaches QuickBooks when your settings sync purchases and purchase payments.