### Example API Request for Retrieving a Product Source: https://developer.leaflink.com/legacy/v2/api/ref This example demonstrates how to make an API request to retrieve a specific product using its ID. It includes the base URL and path, along with placeholders for path and query parameters. Authorization is typically handled via a token. ```http GET https://app.leaflink.com/api/v2/products/{id}/ # Path Parameters: id: integer (required) - The ID for the product. # Query Parameters: fields_include: string (optional) - Include only specific fields, separated by commas. fields_exclude: string (optional) - Exclude specific fields, separated by commas. include_children: string (optional) - Include additional fields like 'images', 'volume_discounts', and 'strains'. # Authorization: # _Token_ ``` -------------------------------- ### Create Product API Request Example Source: https://developer.leaflink.com/legacy/v2/api/ref This example demonstrates how to structure a request to create a new product using the Leaflink Legacy V2 API. It includes common fields such as pricing, image count, and status indicators. Authorization is typically handled via a token. ```json { "strains": [], "price_schedule_price": { "amount": 100, "currency": "USD" }, "image_count": 1, "is_ancillary": false, "s2s_conversion_amount": "1.0000", "extern_sts_ids": null, "strain_classification_display": "N/A", "modified": "2020-06-11T15:53:07.137980-06:00", "sub_category": 14, "has_deals_eligible_children": false, "discount_percent": 0, "base_units_per_unit": null, "external_ids": {}, "threshold_value": 0, "threshold_action": "unavailable", "reverse_threshold_value": 1, "reverse_threshold_action": "available", "show_quantity": true, "product_data_items": [] } ``` -------------------------------- ### List All Products - API Endpoint Example Source: https://developer.leaflink.com/legacy/v2/api/ref This example demonstrates how to retrieve a list of all products for which the user has 'Manage Inventory' permissions. It also mentions alternative endpoints to fetch products filtered by a specific company or a parent product. ```http GET /products ``` ```http GET /companies/{company_id}/products/ ``` ```http GET /products/{parent_product_id}/products/ ``` -------------------------------- ### Product Sample Request and Response Source: https://developer.leaflink.com/legacy/v2/api/ref Provides examples of a request payload for a product and a detailed success response. ```APIDOC ## Product Sample Data ### Request Body Example #### Content-Type application/json ```json { "quantity": 2000 } ``` ### Response Example (200 OK) #### Content-Type application/json ```json { "id": 2093, "created_on": "2020-02-19T00:36:22.353448-06:00", "last_edit": "2020-04-27T07:41:29.797149-06:00", "drop_date": null, "dropped": null, "name": "Swiss Masters Chocolate Bar (Dark)", "sku": "SWI-BAR-DAR-100", "description": "

Our premium Swiss Masters chocolate bars are bold, rich, and steeped in chocolate tradition. The Swiss Master dark chocolate has 70% dark chocolate paired with 100mg THC.

", "quantity": "2000.0000", "reserved_qty": "120.0000", "display_name": "Swiss Masters Chocolate Bar (Dark)", "unit_multiplier": 12, "retail_price": { "amount": 18, "currency": "USD" }, "wholesale_price": { "amount": 108, "currency": "USD" }, "sale_price": { "amount": 0, "currency": "USD" }, "minimum_order": "1.0000", "maximum_order": null, "is_medical_line_item": false, "AVAILABLE_FOR_SAMPLES": true, "extern_acct_id": null, "extern_income_acct_id": "", "featured": false, "tagline": null, "featured_on_deals": false, "allow_fractional_quantities": false, "parent": null, "listing_state": "Available", "display_listing_state": "Available", "inventory_management": 1, "unit_of_measure": "Unit", "sell_in_unit_of_measure": "Case", "unit_denomination": { "id": 1, "value": "1.00000", "name": "One", "label": "1" }, "category": 7, "grow_type": null, "seller": 3721, "seller_internal_id": "PROD-001", "brand": 49, "product_line": 164, "manufacturer": 3721, "strain_classification": "na", "license": { "id": 2619, "number": "404R-00000", "type": "Recreational", "display_type": "Adult Use", "classification": "MIPS" }, "available_inventory": 1880, "children_count": 0, "strains": [], "price_schedule_price": { "amount": 108, "currency": "USD" }, "image_count": 1, "is_ancillary": false, "s2s_conversion_amount": "1.0000", "extern_sts_ids": null, "strain_classification_display": "N/A", "modified": "2020-06-11T15:53:07.137980-06:00", "sub_category": 14, "has_deals_eligible_children": false, "discount_percent": 0, "base_units_per_unit": null, "external_ids": { "system-name": "1234567890" }, "threshold_value": 0, "threshold_action": "unavailable", "reverse_threshold_value": 1, "reverse_threshold_action": "available", "show_quantity": true } ``` ``` -------------------------------- ### GET /api/v2/product-batches/ Source: https://developer.leaflink.com/legacy/v2/api/ref Retrieves a list of product-batch assignments. Supports pagination. ```APIDOC ## List assignments Retrieves a list of product-batch assignments. Supports pagination. ### Description Retrieves a list of product-batch assignments. Supports pagination. Requires authentication with a token. ### Method GET ### Endpoint `/api/v2/product-batches/` ### Parameters #### Query Parameters - **limit** (integer) - Optional - Number of results to return per page. - **offset** (integer) - Optional - The initial index from which to return the results. ### Responses #### Success Response (200) - **count** (integer) - The total number of assignments. - **next** (string) - URL for the next page of results. - **previous** (string) - URL for the previous page of results. - **results** (array) - An array of product-batch assignment objects. - **id** (integer) - Unique id generated by LeafLink. - **product** (string) - Id for the Product. - **batch** (integer) - Id for the batch. #### Response Example ```json { "count": 0, "next": "http://example.com", "previous": "http://example.com", "results": [ { "id": 0, "product": "string", "batch": 0 } ] } ``` ``` -------------------------------- ### Query Batches with Filters - API Request Source: https://developer.leaflink.com/legacy/v2/api/ref This snippet demonstrates how to query batches using various filter parameters available in the LeafLink Legacy v2 API. It includes filters for dates, IDs, owner company slugs, production batch numbers, product IDs, and cannabinoid percentages. The example implicitly shows how to construct a GET request URL with query parameters. ```http GET https://app.leaflink.com/api/v2/batches/?batch_date__lt=2019-08-24&id=123&owner=456&company_slug=example-company&production_batch_number=PROD123,PROD456&products=789&thc=10-20&cbd=5-15&limit=50&offset=0 ``` -------------------------------- ### POST /products/ Source: https://developer.leaflink.com/legacy/v2/api/ref Creates a new product in the system. This endpoint handles the creation of product entries with various attributes including inventory, pricing, and classification. ```APIDOC ## POST /products/ ### Description Creates a new product in the system. This endpoint handles the creation of product entries with various attributes including inventory, pricing, and classification. ### Method POST ### Endpoint /api/v2/products/ ### Parameters #### Request Body - **name** (string) - Required - The name of the product. - **sku** (string) - Required - The Stock Keeping Unit for the product. - **description** (string) - Required - A detailed description of the product. - **quantity** (string) - Required - The current inventory quantity of the product. - **display_name** (string) - Required - The name of the product as displayed to users. - **unit_multiplier** (integer) - Required - The multiplier for the unit of measure. - **retail_price** (object) - Required - The retail pricing information for the product. - **amount** (integer) - Required - The retail price amount. - **currency** (string) - Required - The currency of the retail price. - **wholesale_price** (object) - Required - The wholesale pricing information for the product. - **amount** (integer) - Required - The wholesale price amount. - **currency** (string) - Required - The currency of the wholesale price. - **sale_price** (object) - Required - The sale pricing information for the product. - **amount** (integer) - Required - The sale price amount. - **currency** (string) - Required - The currency of the sale price. - **minimum_order** (string) - Required - The minimum order quantity for the product. - **maximum_order** (string) - Optional - The maximum order quantity for the product. - **listing_state** (string) - Required - The current listing state of the product (e.g., 'Available'). - **inventory_management** (integer) - Required - Flag indicating if inventory management is enabled (1 for enabled, 0 for disabled). - **unit_of_measure** (string) - Required - The unit of measure for the product (e.g., 'Unit', 'Gram'). - **unit_denomination** (integer) - Required - The denomination of the unit of measure. - **category** (integer) - Required - The ID of the product category. - **seller** (integer) - Required - The ID of the seller for the product. - **seller_internal_id** (string) - Required - The internal ID assigned by the seller. - **brand** (integer) - Required - The ID of the brand for the product. - **manufacturer** (integer) - Required - The ID of the manufacturer for the product. See `id` in the companies response. - **strain_classification** (string) - Required - The classification of the strain (e.g., 'sativa', 'indica', 'hybrid', 'na'). - **license** (integer) - Required - The ID of the license associated with the product. - **strains** (array of integers) - Optional - The strains associated with the product. Required for products with the `Flower` category. - **extern_sts_ids** (array of strings) - Optional - IDs used by the Metrc add-on. - **base_units_per_unit** (string) - Optional - Required if using 'Unit' as the base unit of measure. Describes the number of base units in each unit of the product. - **external_ids** (object) - Optional - A set of key-value pairs for storing external system IDs. - **threshold_value** (integer) - Optional - The inventory quantity threshold for triggering actions. - **threshold_action** (string) - Optional - The action to take when the inventory quantity reaches the threshold (e.g., 'default', 'backorder', 'unavailable', 'internal'). - **reverse_threshold_value** (integer) - Optional - The inventory quantity threshold for reverse actions. - **reverse_threshold_action** (string) - Optional - The action to take when the inventory quantity reaches the reverse threshold (e.g., 'default', 'available', 'internal'). - **show_quantity** (boolean) - Optional - Whether to show inventory quantities to buyers. - **product_data_items** (array of objects) - Optional - Product specifications. ### Request Example ```json { "name": "Swiss Masters Chocolate Bar (Dark)", "sku": "SWI-BAR-DAR-100", "description": "

Our premium Swiss Masters chocolate bars are bold, rich, and steeped in chocolate tradition. The Swiss Master dark chocolate has 70% dark chocolate paired with 100mg THC.

", "quantity": "800.0000", "display_name": "Swiss Masters Chocolate Bar (Dark)", "unit_multiplier": 12, "retail_price": { "amount": 18, "currency": "USD" }, "wholesale_price": { "amount": 108, "currency": "USD" }, "sale_price": { "amount": 0, "currency": "USD" }, "minimum_order": "1.0000", "maximum_order": null, "listing_state": "Available", "inventory_management": 1, "unit_of_measure": "Unit", "unit_denomination": 1, "category": 7, "seller": 3721, "seller_internal_id": "PROD-001", "brand": 49, "manufacturer": 3721, "strain_classification": "na", "license": 2619, "external_ids": { "system-name": "1234567890" }, "threshold_value": 0, "threshold_action": "unavailable", "reverse_threshold_value": 1, "reverse_threshold_action": "available", "show_quantity": true } ``` ### Response #### Success Response (201) - **(No specific fields documented for success response)** #### Response Example (No example provided in the source text) ``` -------------------------------- ### Customer Object Structure Example Source: https://developer.leaflink.com/legacy/v2/api/ref An example JSON representation of the customer object, illustrating the data types and structure for various customer attributes. This includes basic information, contact details, addresses, and financial settings. ```json { "id": 0, "state": "string", "managers": [ 0 ], "created_on": "2019-08-24T14:15:22Z", "modified": "2019-08-24T14:15:22Z", "next_contact_date": "2019-08-24", "nickname": "string", "external_id": "string", "ext_acct_id": "string", "license_number": "string", "old_license_number": "string", "license_inactive": true, "business_identifier": "string", "ein": "string", "directions": "string", "delivery_preferences": "string", "currency": "string", "shipping_charge": "string", "brand": "string", "name": "string", "dba": "string", "business_license_name": "string", "description": "string", "website": "http://example.com", "address": "string", "unit_number": "string", "zipcode": "string", "city": "string", "county": "string", "country": "string", "lat": "string", "long": "string", "phone": "string", "phone_extension": "string", "email": "user@example.com" } ``` -------------------------------- ### JSON Response Sample (200 OK) Source: https://developer.leaflink.com/legacy/v2/api/ref This is a sample JSON response for a successful product query (HTTP 200 OK). It includes detailed information about the product, such as its ID, name, pricing, inventory, and categorization. ```json { "id": 2093, "created_on": "2020-02-19T00:36:22.353448-06:00", "last_edit": "2020-04-27T07:41:29.797149-06:00", "drop_date": null, "dropped": null, "name": "Swiss Masters Chocolate Bar (Dark)", "sku": "SWI-BAR-DAR-100", "description": "

Our premium Swiss Masters chocolate bars are bold, rich, and steeped in chocolate tradition. The Swiss Master dark chocolate has 70% dark chocolate paired with 100mg THC.

", "quantity": "2000.0000", "reserved_qty": "120.0000", "display_name": "Swiss Masters Chocolate Bar (Dark)", "unit_multiplier": 12, "retail_price": { "amount": 18, "currency": "USD" }, "wholesale_price": { "amount": 108, "currency": "USD" }, "sale_price": { "amount": 0, "currency": "USD" }, "minimum_order": "1.0000", "maximum_order": null, "is_medical_line_item": false, "AVAILABLE_FOR_SAMPLES": true, "extern_acct_id": null, "extern_income_acct_id": "", "featured": false, "tagline": null, "featured_on_deals": false, "allow_fractional_quantities": false, "parent": null, "listing_state": "Available", "display_listing_state": "Available", "inventory_management": 1, "unit_of_measure": "Unit", "sell_in_unit_of_measure": "Case", "unit_denomination": { "id": 1, "value": "1.00000", "name": "One", "label": "1" }, "category": 7, "grow_type": null, "seller": 3721, "seller_internal_id": "PROD-001", "brand": 49, "product_line": 164, "manufacturer": 3721, "strain_classification": "na", "license": { "id": 2619, "number": "404R-00000", "type": "Recreational", "display_type": "Adult Use", "classification": "MIPS" }, "available_inventory": 1880, "children_count": 0, "strains": [ ], "price_schedule_price": { "amount": 108, "currency": "USD" }, "image_count": 1, "is_ancillary": false, "s2s_conversion_amount": "1.0000", "extern_sts_ids": null, "strain_classification_display": "N/A", "modified": "2020-06-11T15:53:07.137980-06:00", "sub_category": 14, "has_deals_eligible_children": false, "discount_percent": 0, "base_units_per_unit": null, "external_ids": { "system-name": "1234567890" }, "threshold_value": 0, "threshold_action": "unavailable", "reverse_threshold_value": 1, "reverse_threshold_action": "available", "show_quantity": true } ``` -------------------------------- ### List Retailer Inventory Products (GET Request) Source: https://developer.leaflink.com/legacy/v2/api/ref This documentation describes how to list all products available in the retailer inventory using a GET request to the specified endpoint. It supports filtering by company ID and pagination using limit and offset parameters. ```http GET https://app.leaflink.com/api/v2/retailer-inventory/ # Query Parameters: # company: string (optional) - Filter by company ID. # limit: integer (optional) - Number of results to return per page. # offset: integer (optional) - The initial index from which to return the results. ``` -------------------------------- ### Product Response Sample Source: https://developer.leaflink.com/legacy/v2/api/ref Example response structure for a product endpoint, illustrating the detailed fields available for a product. ```APIDOC ## Product Response Sample ### Description This is a sample response for a product endpoint, showcasing the various attributes associated with a product listing. ### Response Example (200) ```json { "id": 2093, "created_on": "2020-02-19T00:36:22.353448-06:00", "last_edit": "2020-04-27T07:41:29.797149-06:00", "drop_date": null, "dropped": null, "name": "Swiss Masters Chocolate Bar (Dark)", "sku": "SWI-BAR-DAR-100", "description": "

Our premium Swiss Masters chocolate bars are bold, rich, and steeped in chocolate tradition. The Swiss Master dark chocolate has 70% dark chocolate paired with 100mg THC.

", "quantity": "800.0000", "reserved_qty": "120.0000", "display_name": "Swiss Masters Chocolate Bar (Dark)", "unit_multiplier": 12, "retail_price": { "amount": 18, "currency": "USD" }, "wholesale_price": { "amount": 108, "currency": "USD" }, "sale_price": { "amount": 0, "currency": "USD" }, "minimum_order": "1.0000", "maximum_order": null, "is_medical_line_item": false, "AVAILABLE_FOR_SAMPLES": true, "extern_acct_id": null, "extern_income_acct_id": "", "featured": false, "tagline": null, "featured_on_deals": false, "allow_fractional_quantities": false, "parent": null, "listing_state": "Archived", "display_listing_state": "Archived", "inventory_management": 1, "unit_of_measure": "Unit", "sell_in_unit_of_measure": "Case", "unit_denomination": { "id": 1, "value": "1.00000", "name": "One", "label": "1" }, "category": 7, "grow_type": null, "seller": 3721, "seller_internal_id": "PROD-001", "brand": 49, "product_line": 164, "manufacturer": 3721, "strain_classification": "na", "license": { "id": 2619, "number": "404R-00000", "type": "Recreational", "display_type": "Adult Use", "classification": "MIPS" }, "available_inventory": 680, "children_count": 0, "strains": [], "price_schedule_price": { "amount": 108, "currency": "USD" }, "image_count": 1, "is_ancillary": false, "s2s_conversion_amount": "1.0000", "extern_sts_ids": null, "strain_classification_display": "N/A", "modified": "2020-06-11T15:53:07.137980-06:00", "sub_category": 14, "has_deals_eligible_children": false, "discount_percent": 0, "base_units_per_unit": null, "external_ids": { "system-name": "1234567890" }, "threshold_value": 0, "threshold_action": "unavailable", "reverse_threshold_value": 1, "reverse_threshold_action": "available", "show_quantity": true } ``` ``` -------------------------------- ### POST /websites/developer_leaflink_legacy_v2_api/products Source: https://developer.leaflink.com/legacy/v2/api/ref Creates a new product with specified details. ```APIDOC ## POST /websites/developer_leaflink_legacy_v2_api/products ### Description Create a new product. ### Method POST ### Endpoint /websites/developer_leaflink_legacy_v2_api/products ### Parameters #### Request Body - **strains** (array) - Optional - List of strains associated with the product. - **price_schedule_price** (object) - Required - Pricing information for the product. - **amount** (number) - Required - The price amount. - **currency** (string) - Required - The currency of the price (e.g., "USD"). - **image_count** (integer) - Optional - The number of images for the product. - **is_ancillary** (boolean) - Optional - Indicates if the product is ancillary. - **s2s_conversion_amount** (string) - Optional - Conversion amount for S2S. - **extern_sts_ids** (any) - Optional - External STS IDs. - **strain_classification_display** (string) - Optional - Display name for strain classification. - **modified** (string) - Optional - The date and time the product was last modified. - **sub_category** (integer) - Optional - The sub-category ID of the product. - **has_deals_eligible_children** (boolean) - Optional - Indicates if the product has deal-eligible children. - **discount_percent** (integer) - Optional - The discount percentage applied to the product. - **base_units_per_unit** (any) - Optional - Base units per unit information. - **external_ids** (object) - Optional - External IDs associated with the product. - **threshold_value** (integer) - Optional - The threshold value for an action. - **threshold_action** (string) - Optional - The action to take when the threshold is met (e.g., "unavailable"). - **reverse_threshold_value** (integer) - Optional - The reverse threshold value. - **reverse_threshold_action** (string) - Optional - The action to take when the reverse threshold is met (e.g., "available"). - **show_quantity** (boolean) - Optional - Indicates whether to show the quantity. - **product_data_items** (array) - Optional - List of product data items. ### Request Example ```json { "strains": [], "price_schedule_price": { "amount": 100, "currency": "USD" }, "image_count": 1, "is_ancillary": false, "s2s_conversion_amount": "1.0000", "extern_sts_ids": null, "strain_classification_display": "N/A", "modified": "2020-06-11T15:53:07.137980-06:00", "sub_category": 14, "has_deals_eligible_children": false, "discount_percent": 0, "base_units_per_unit": null, "external_ids": {}, "threshold_value": 0, "threshold_action": "unavailable", "reverse_threshold_value": 1, "reverse_threshold_action": "available", "show_quantity": true, "product_data_items": [] } ``` ### Response #### Success Response (200) - **message** (string) - Confirmation message. - **product_id** (string) - The ID of the created product. #### Response Example ```json { "message": "Product created successfully", "product_id": "prod_12345" } ``` ### Authorization _Token_ ``` -------------------------------- ### Read CompanyActivityEntry Source: https://developer.leaflink.com/legacy/v2/api/ref Get a `CompanyActivityEntry` by ID. ```APIDOC ## Read CompanyActivityEntry ### Description Get a `CompanyActivityEntry` by ID. ### Method GET ### Endpoint /api/v2/activity-entries/{id}/ ### Parameters #### Path Parameters - **id** (integer) - Required - A unique integer value identifying this company activity entry. ### Responses #### Success Response (200) - **id** (integer) - The unique identifier for the activity entry. - **type** (string) - The type of activity. - **created_on** (string) - The datetime the activity was created. - **modified** (string) - The datetime the activity was last modified. - **date** (string) - The datetime the activity occurred. - **entry** (string) - The description of the activity. - **delete** (boolean) - Whether the activity is marked as deleted. - **owner** (integer) - The ID of the company that owns the activity entry. - **author** (integer) - The ID of the staff member who authored the activity. - **company** (integer) - The ID of the company the activity is related to. - **customer** (integer) - The ID of the customer company the activity is related to. - **staff** (integer) - The ID of the staff member the activity is focused on. - **brand** (integer) - The ID of the brand associated with the activity. - **contact** (integer) - The ID of the contact associated with the activity. #### Response Example ```json { "id": 0, "type": "string", "created_on": "2019-08-24T14:15:22Z", "modified": "2019-08-24T14:15:22Z", "date": "2019-08-24T14:15:22Z", "entry": "string", "delete": true, "owner": 0, "author": 0, "company": 0, "customer": 0, "staff": 0, "brand": 0, "contact": 0 } ``` ``` -------------------------------- ### Upload Batch Document Request Body Example Source: https://developer.leaflink.com/legacy/v2/api/ref This example demonstrates the request body structure for uploading a new batch document. It uses multipart/form-data and includes required fields like 'document' (file URI) and 'batch' (integer ID), along with an optional 'summary' field. ```text document= batch= summary= ``` -------------------------------- ### Untitled No description -------------------------------- ### Create Inventory Item Request Body Example Source: https://developer.leaflink.com/legacy/v2/api/ref This example shows the required structure for the JSON request body when creating a new inventory item. Key fields include 'batch', 'is_archived', 'facility', 'product', and 'quantity'. Note the special behavior if an existing non-archived item is found. ```json { "batch": 0, "is_archived": true, "facility": 0, "product": 0, "quantity": 0 } ``` -------------------------------- ### Untitled No description -------------------------------- ### GET /api/v2/batches/{id}/ Source: https://developer.leaflink.com/legacy/v2/api/ref Retrieves a specific batch by its ID. ```APIDOC ## GET /api/v2/batches/{id}/ ### Description Retrieves a specific batch by its ID. ### Method GET ### Endpoint /api/v2/batches/{id}/ ### Parameters #### Path Parameters - **id** (string) - Required - The ID for the batch. ### Response #### Success Response (200) - **id** (integer) - The unique identifier for the batch. - **owner** (string) - The ID of the company that owns the batch. - **production_batch_number** (string) - The production batch number. - **batch_date** (string) - The date the batch was created (YYYY-MM-DD). - **thc** (string) - The THC percentage. - **thca** (string) - The THCa percentage. - **total_thc** (string) - The total THC percentage. - **cbd** (string) - The CBD percentage. - **cbda** (string) - The CBDa percentage. - **cbg** (string) - The CBG percentage. - **cbn** (string) - The CBN percentage. - **total_cannabinoids** (string) - The total cannabinoids percentage. - **documents** (array) - An array of associated document objects. - **id** (integer) - The unique identifier for the document. - **created_on** (string) - The date and time the document was created. - **modified** (string) - The date and time the document was last modified. - **summary** (string) - A summary of the document. - **document** (string) - The URL of the document. - **cannabinoid_unit** (string) - The unit for cannabinoid measurements. - **testing_source** (string) - The source of the test results. - **is_from_api** (boolean) - Indicates if the batch data originated from an API. ### Response Example ```json { "id": 0, "owner": "string", "production_batch_number": "string", "batch_date": "2019-08-24", "thc": "string", "thca": "string", "total_thc": "string", "cbd": "string", "cbda": "string", "cbg": "string", "cbn": "string", "total_cannabinoids": "string", "documents": [ { "id": 0, "created_on": "2019-08-24T14:15:22Z", "modified": "2019-08-24T14:15:22Z", "summary": "string", "document": "http://example.com" } ], "cannabinoid_unit": "string", "testing_source": "string", "is_from_api": true } ``` ``` -------------------------------- ### Untitled No description -------------------------------- ### GET /api/v2/retailer-inventory/{id}/ Source: https://developer.leaflink.com/legacy/v2/api/ref Retrieve details of a specific product by its ID. ```APIDOC ## GET /api/v2/retailer-inventory/{id}/ ### Description Retrieve an individual product using its ID. Requires authentication with a token. ### Method GET ### Endpoint https://app.leaflink.com/api/v2/retailer-inventory/{id}/ ### Parameters #### Path Parameters - **id** (integer) - Required - The ID of the product to retrieve. ### Response #### Success Response (200) - **id** (integer) - Unique identifier for the product. - **is_low** (boolean) - Indicates if the inventory level is low. - **source** (string) - Source system providing the data. - **name** (string) - Product name. - **sku** (string) - Product SKU. - **brand** (string) - Product brand. - **quantity** (integer) - Product inventory level. - **company** (integer) - Company ID. - **unit_of_measure** (string) - Product unit of measure. - **created_on** (string) - Timestamp when the product was created (ISO 8601 format). - **modified** (string) - Timestamp when the product was last modified (ISO 8601 format). #### Response Example ```json { "id": 0, "is_low": true, "source": "string", "name": "string", "sku": "string", "brand": "string", "quantity": 0, "company": 0, "unit_of_measure": "string", "created_on": "2019-08-24T14:15:22Z", "modified": "2019-08-24T14:15:22Z" } ``` ``` -------------------------------- ### POST /api/v2/product-batches/ Source: https://developer.leaflink.com/legacy/v2/api/ref Creates a new product-batch assignment. Requires authentication with a token. ```APIDOC ## Create an assignment Creates a new product-batch assignment. ### Description Creates a new product-batch assignment. Requires authentication with a token. ### Method POST ### Endpoint `/api/v2/product-batches/` ### Parameters #### Request Body - **product** (string) - Required - Id for the Product. See `id` in the product object. - **batch** (integer) - Required - Id for the batch. See `id` in the batch object. ### Request Example ```json { "product": "string", "batch": 0 } ``` ### Responses #### Success Response (201) - **id** (integer) - Unique id generated by LeafLink. - **product** (string) - Id for the Product. - **batch** (integer) - Id for the batch. #### Response Example ```json { "id": 0, "product": "string", "batch": 0 } ``` ```