{"docs":{"name":"Freshly","info":"\n<p>Another API description</p>\n","copyright":null,"doc_url":"/docs/1.0","api_url":"/api/shopify","resources":{"inventory_batch_order_items":{"doc_url":"/docs/1.0/inventory_batch_order_items","id":"inventory_batch_order_items","api_url":"/api/shopify","name":"Inventory_batch_order_items","short_description":null,"full_description":"","version":"1.0","formats":null,"metadata":null,"methods":[{"doc_url":"/docs/1.0/inventory_batch_order_items/index","name":"index","apis":[{"api_url":"/api/shopify/inventory_batch_order_items","http_method":"GET","short_description":"List of inventory batch order items based on Shopify order ID and Shopify line item ID","deprecated":null}],"formats":null,"full_description":"","errors":[{"code":401,"description":"The provided token is invalid","metadata":null},{"code":422,"description":"Could not process parameters","metadata":null}],"params":[{"name":"line_item_id","full_name":"line_item_id","description":"\n<p>Shopify line item ID</p>\n","required":true,"allow_nil":false,"allow_blank":false,"validator":"Must be a Integer","expected_type":"numeric","metadata":null,"show":true,"validations":[],"deprecated":false},{"name":"order_id","full_name":"order_id","description":"\n<p>Shopify order ID</p>\n","required":true,"allow_nil":false,"allow_blank":false,"validator":"Must be a Integer","expected_type":"numeric","metadata":null,"show":true,"validations":[],"deprecated":false}],"returns":[],"examples":["// invalid params\nGET /api/shopify/inventory_batch_order_items?line_item_id=37651\n422\nparam is missing or the value is empty: order_id","// invalid token\nGET /api/shopify/inventory_batch_order_items?order_id=17841&line_item_id=97368\n401\nHTTP Token: Access denied.\n","// valid token and params\nGET /api/shopify/inventory_batch_order_items?order_id=64371&line_item_id=27144\n200\n[\n  {\n    \"id\": 1597,\n    \"inventory_batch_id\": 4047,\n    \"quantity\": 2,\n    \"created_at\": \"2023-07-03 05:48:06 UTC\",\n    \"updated_at\": \"2023-07-03 05:48:06 UTC\",\n    \"order_id\": 64371,\n    \"line_item_id\": 27144\n  }\n]"],"metadata":null,"see":[],"headers":[{"name":"Authorization","description":"Bearer token","options":{"required":true}}],"show":true},{"doc_url":"/docs/1.0/inventory_batch_order_items/create","name":"create","apis":[{"api_url":"/api/shopify/inventory_batch_order_items","http_method":"POST","short_description":"Create inventory batch order item","deprecated":null}],"formats":null,"full_description":"\n<p>All parameters must be nested under inventory_batch_order_item, e.g. inventory_batch_order_<a href=\"order_id\">item</a>. The order_id (Shopify order ID) is REQUIRED alongside line_item_id, inventory_batch_id and quantity; requests missing any of them are rejected with a 422 response.</p>\n","errors":[{"code":401,"description":"The provided token is invalid","metadata":null},{"code":422,"description":"Could not process parameters","metadata":null}],"params":[{"name":"inventory_batch_order_item","full_name":"inventory_batch_order_item","description":"","required":true,"allow_nil":false,"allow_blank":false,"validator":"Must be a Hash","expected_type":"hash","metadata":null,"show":true,"validations":[],"deprecated":false,"params":[{"name":"line_item_id","full_name":"inventory_batch_order_item[line_item_id]","description":"\n<p>Shopify line item ID</p>\n","required":true,"allow_nil":false,"allow_blank":false,"validator":"Must be a Integer","expected_type":"numeric","metadata":null,"show":true,"validations":[],"deprecated":false},{"name":"order_id","full_name":"inventory_batch_order_item[order_id]","description":"\n<p>Shopify order ID</p>\n","required":true,"allow_nil":false,"allow_blank":false,"validator":"Must be a Integer","expected_type":"numeric","metadata":null,"show":true,"validations":[],"deprecated":false},{"name":"inventory_batch_id","full_name":"inventory_batch_order_item[inventory_batch_id]","description":"\n<p>Inventory batch ID</p>\n","required":true,"allow_nil":false,"allow_blank":false,"validator":"Must be a Integer","expected_type":"numeric","metadata":null,"show":true,"validations":[],"deprecated":false},{"name":"quantity","full_name":"inventory_batch_order_item[quantity]","description":"\n<p>Quantity</p>\n","required":true,"allow_nil":false,"allow_blank":false,"validator":"Must be a Integer","expected_type":"numeric","metadata":null,"show":true,"validations":[],"deprecated":false}]}],"returns":[],"examples":["Request (all params nested under inventory_batch_order_item):\n\nPOST /api/shopify/inventory_batch_order_items\n{\n  \"inventory_batch_order_item\": {\n    \"order_id\": 5443815864496,\n    \"line_item_id\": 13374776201392,\n    \"inventory_batch_id\": 4050,\n    \"quantity\": 2\n  }\n}\n\nResponse (201):\n\n{\n  \"id\": 1598,\n  \"inventory_batch_id\": 4050,\n  \"quantity\": 2,\n  \"created_at\": \"2024-03-01 05:48:06 UTC\",\n  \"updated_at\": \"2024-03-01 05:48:06 UTC\",\n  \"order_id\": 5443815864496,\n  \"line_item_id\": 13374776201392\n}\n","// invalid token\nPOST /api/shopify/inventory_batch_order_items\ninventory_batch_order_item[order_id]=70424&inventory_batch_order_item[line_item_id]=23779&inventory_batch_order_item[inventory_batch_id]=4048&inventory_batch_order_item[quantity]=2\n401\nHTTP Token: Access denied.\n","// invalid params\nPOST /api/shopify/inventory_batch_order_items\ninventory_batch_order_item[quantity]=2\n422\nServer error","// valid token and params\nPOST /api/shopify/inventory_batch_order_items\ninventory_batch_order_item[order_id]=50743&inventory_batch_order_item[line_item_id]=63389&inventory_batch_order_item[inventory_batch_id]=4050&inventory_batch_order_item[quantity]=2\n201\n{\n  \"id\": 1598,\n  \"inventory_batch_id\": 4050,\n  \"quantity\": 2,\n  \"created_at\": \"2023-07-03 05:48:06 UTC\",\n  \"updated_at\": \"2023-07-03 05:48:06 UTC\",\n  \"order_id\": 50743,\n  \"line_item_id\": 63389\n}"],"metadata":null,"see":[],"headers":[{"name":"Authorization","description":"Bearer token","options":{"required":true}}],"show":true},{"doc_url":"/docs/1.0/inventory_batch_order_items/destroy","name":"destroy","apis":[{"api_url":"/api/shopify/inventory_batch_order_items/:id","http_method":"DELETE","short_description":"Delete inventory batch order item","deprecated":null}],"formats":null,"full_description":"\n<p>Responds with a JSON object: {“message”: “Batch removed”} on success, or {“error”: “…”} with an appropriate HTTP status on failure.</p>\n","errors":[{"code":401,"description":"The provided token is invalid","metadata":null},{"code":404,"description":"Record not found","metadata":null}],"params":[{"name":"id","full_name":"id","description":"\n<p>Inventory batch order item ID</p>\n","required":true,"allow_nil":false,"allow_blank":false,"validator":"Must be a Integer","expected_type":"numeric","metadata":null,"show":true,"validations":[],"deprecated":false}],"returns":[],"examples":["Response (200):\n\n{ \"message\": \"Batch removed\" }\n\nResponse (404):\n\n{ \"error\": \"Record not found\" }\n","// invalid id\nDELETE /api/shopify/inventory_batch_order_items/100\n404\n{\n  \"error\": \"Record not found\"\n}","// invalid token\nDELETE /api/shopify/inventory_batch_order_items/1593\n401\nHTTP Token: Access denied.\n","// valid token and id\nDELETE /api/shopify/inventory_batch_order_items/1594\n200\n{\n  \"message\": \"Batch removed\"\n}"],"metadata":null,"see":[],"headers":[{"name":"Authorization","description":"Bearer token","options":{"required":true}}],"show":true}],"headers":null,"deprecated":null},"inventory_batches":{"doc_url":"/docs/1.0/inventory_batches","id":"inventory_batches","api_url":"/api/shopify","name":"Inventory_batches","short_description":null,"full_description":"","version":"1.0","formats":null,"metadata":null,"methods":[{"doc_url":"/docs/1.0/inventory_batches/index","name":"index","apis":[{"api_url":"/api/shopify/inventory_batches","http_method":"GET","short_description":"List of inventory batches based on pagination, search, and filter (by variant ID or location ID or both).","deprecated":null}],"formats":null,"full_description":"\n<p>In the response, the custom fields batch_name, batch_number, barcode, invoice_number and description are returned nested under the metadata object of each batch, not as top-level attributes.</p>\n","errors":[{"code":401,"description":"The provided token is invalid","metadata":null}],"params":[{"name":"location_id","full_name":"location_id","description":"\n<p>Shopify location ID</p>\n","required":false,"allow_nil":false,"allow_blank":false,"validator":"Must be a Integer","expected_type":"numeric","metadata":null,"show":true,"validations":[],"deprecated":false},{"name":"variant_id","full_name":"variant_id","description":"\n<p>Shopify variant ID</p>\n","required":false,"allow_nil":false,"allow_blank":false,"validator":"Must be a Integer","expected_type":"numeric","metadata":null,"show":true,"validations":[],"deprecated":false},{"name":"page","full_name":"page","description":"\n<p>Page number</p>\n","required":false,"allow_nil":false,"allow_blank":false,"validator":"Must be a Integer","expected_type":"numeric","metadata":null,"show":true,"validations":[],"deprecated":false},{"name":"search","full_name":"search","description":"\n<p>Search by inventory batch batch_name, batch_number, barcode, invoice_number description or product title or variant title or barcode</p>\n","required":false,"allow_nil":false,"allow_blank":false,"validator":"Must be a String","expected_type":"string","metadata":null,"show":true,"validations":[],"deprecated":false}],"returns":[],"examples":["// invalid token\nGET /api/shopify/inventory_batches?location_id=1000&variant_id=2000&page=1&search=Inventory+Batch\n401\nHTTP Token: Access denied.\n","// valid token\nGET /api/shopify/inventory_batches?location_id=1000&variant_id=2000&page=1&search=Inventory+Batch\n200\n[\n  {\n    \"id\": 4037,\n    \"quantity\": 55,\n    \"expired_at\": null,\n    \"expiry_date\": \"2023-07-13 05:48:06 UTC\",\n    \"received_date\": \"2023-07-03 05:48:06 UTC\",\n    \"metadata\": {\n      \"batch_name\": \"Inventory Batch\"\n    },\n    \"created_at\": \"2023-07-03 05:48:06 UTC\",\n    \"updated_at\": \"2023-07-03 05:48:06 UTC\",\n    \"notified_at\": null,\n    \"discounted\": false,\n    \"location_id\": 1000,\n    \"variant_id\": 2000\n  }\n]"],"metadata":null,"see":[],"headers":[{"name":"Authorization","description":"Bearer token","options":{"required":true}}],"show":true},{"doc_url":"/docs/1.0/inventory_batches/show","name":"show","apis":[{"api_url":"/api/shopify/inventory_batches/:id","http_method":"GET","short_description":"Show inventory batch","deprecated":null}],"formats":null,"full_description":"\n<p>In the response, the custom fields batch_name, batch_number, barcode, invoice_number and description are returned nested under the metadata object of the batch, not as top-level attributes.</p>\n","errors":[{"code":401,"description":"The provided token is invalid","metadata":null},{"code":404,"description":"Record not found","metadata":null}],"params":[{"name":"id","full_name":"id","description":"\n<p>Inventory batch ID</p>\n","required":true,"allow_nil":false,"allow_blank":false,"validator":"Must be a Integer","expected_type":"numeric","metadata":null,"show":true,"validations":[],"deprecated":false}],"returns":[],"examples":["// valid token\nGET /api/shopify/inventory_batches/4029\n200\n{\n  \"id\": 4029,\n  \"quantity\": 55,\n  \"expired_at\": null,\n  \"expiry_date\": \"2023-07-13 05:48:05 UTC\",\n  \"received_date\": \"2023-07-03 05:48:05 UTC\",\n  \"metadata\": {\n    \"batch_name\": \"Inventory Batch\"\n  },\n  \"created_at\": \"2023-07-03 05:48:05 UTC\",\n  \"updated_at\": \"2023-07-03 05:48:05 UTC\",\n  \"notified_at\": null,\n  \"discounted\": false,\n  \"location_id\": 1000,\n  \"variant_id\": 2000\n}","// invalid id\nGET /api/shopify/inventory_batches/4031\n404\nRecord not found","// invalid token\nGET /api/shopify/inventory_batches/4032\n401\nHTTP Token: Access denied.\n"],"metadata":null,"see":[],"headers":[{"name":"Authorization","description":"Bearer token","options":{"required":true}}],"show":true},{"doc_url":"/docs/1.0/inventory_batches/create","name":"create","apis":[{"api_url":"/api/shopify/inventory_batches","http_method":"POST","short_description":"Create inventory batch","deprecated":null}],"formats":null,"full_description":"\n<p>In the response, the custom fields batch_name, batch_number, barcode, invoice_number and description are returned nested under the metadata object of the batch, not as top-level attributes (see the example below).</p>\n","errors":[{"code":401,"description":"The provided token is invalid","metadata":null},{"code":422,"description":"Could not process parameters","metadata":null}],"params":[{"name":"enable_shopify_sync","full_name":"enable_shopify_sync","description":"\n<p>Whether to apply a Shopify inventory adjustment for this change. Accepted values: true or false. Can be sent at the top level or nested under inventory_batch. Note: the app preference “Batch quantities added or adjusted on Freshly are reflected in Shopify” is a master switch. When that preference is OFF, this parameter has no effect and no Shopify inventory adjustment occurs. When the preference is ON, passing true applies an inventory adjustment at the batch’s location; passing false or omitting the parameter leaves Shopify inventory unchanged.</p>\n","required":false,"allow_nil":false,"allow_blank":false,"validator":"Must be one of: <code>true</code>, <code>false</code>, <code>1</code>, <code>0</code>.","expected_type":"boolean","metadata":null,"show":true,"validations":[],"deprecated":false},{"name":"inventory_batch","full_name":"inventory_batch","description":"","required":false,"allow_nil":false,"allow_blank":false,"validator":"Must be a Hash","expected_type":"hash","metadata":null,"show":true,"validations":[],"deprecated":false,"params":[{"name":"location_id","full_name":"inventory_batch[location_id]","description":"\n<p>Shopify location ID</p>\n","required":true,"allow_nil":false,"allow_blank":false,"validator":"Must be a Integer","expected_type":"numeric","metadata":null,"show":true,"validations":[],"deprecated":false},{"name":"variant_id","full_name":"inventory_batch[variant_id]","description":"\n<p>Shopify variant ID</p>\n","required":true,"allow_nil":false,"allow_blank":false,"validator":"Must be a Integer","expected_type":"numeric","metadata":null,"show":true,"validations":[],"deprecated":false},{"name":"quantity","full_name":"inventory_batch[quantity]","description":"\n<p>Inventory batch quantity</p>\n","required":true,"allow_nil":false,"allow_blank":false,"validator":"Must be a Integer","expected_type":"numeric","metadata":null,"show":true,"validations":[],"deprecated":false},{"name":"enable_shopify_sync","full_name":"inventory_batch[enable_shopify_sync]","description":"\n<p>Alternative placement of the top-level enable_shopify_sync parameter (either location is accepted; see enable_shopify_sync above for semantics)</p>\n","required":false,"allow_nil":false,"allow_blank":false,"validator":"Must be one of: <code>true</code>, <code>false</code>, <code>1</code>, <code>0</code>.","expected_type":"boolean","metadata":null,"show":true,"validations":[],"deprecated":false},{"name":"batch_name","full_name":"inventory_batch[batch_name]","description":"\n<p>Inventory batch name (returned under metadata in the response)</p>\n","required":false,"allow_nil":false,"allow_blank":false,"validator":"Must be a String","expected_type":"string","metadata":null,"show":true,"validations":[],"deprecated":false},{"name":"batch_number","full_name":"inventory_batch[batch_number]","description":"\n<p>Inventory batch number (returned under metadata in the response)</p>\n","required":false,"allow_nil":false,"allow_blank":false,"validator":"Must be a String","expected_type":"string","metadata":null,"show":true,"validations":[],"deprecated":false},{"name":"barcode","full_name":"inventory_batch[barcode]","description":"\n<p>Inventory batch barcode (returned under metadata in the response)</p>\n","required":false,"allow_nil":false,"allow_blank":false,"validator":"Must be a String","expected_type":"string","metadata":null,"show":true,"validations":[],"deprecated":false},{"name":"invoice_number","full_name":"inventory_batch[invoice_number]","description":"\n<p>Inventory batch invoice number (returned under metadata in the response)</p>\n","required":false,"allow_nil":false,"allow_blank":false,"validator":"Must be a String","expected_type":"string","metadata":null,"show":true,"validations":[],"deprecated":false},{"name":"description","full_name":"inventory_batch[description]","description":"\n<p>Inventory batch description (returned under metadata in the response)</p>\n","required":false,"allow_nil":false,"allow_blank":false,"validator":"Must be a String","expected_type":"string","metadata":null,"show":true,"validations":[],"deprecated":false},{"name":"received_date","full_name":"inventory_batch[received_date]","description":"\n<p>Inventory batch received date (YYYY-MM-DD, or any ISO 8601 date/time)</p>\n","required":false,"allow_nil":false,"allow_blank":false,"validator":"Must be a String","expected_type":"string","metadata":null,"show":true,"validations":[],"deprecated":false},{"name":"expiry_date","full_name":"inventory_batch[expiry_date]","description":"\n<p>Inventory batch expiry date; same format as received_date (YYYY-MM-DD, or any ISO 8601 date/time)</p>\n","required":false,"allow_nil":false,"allow_blank":false,"validator":"Must be a String","expected_type":"string","metadata":null,"show":true,"validations":[],"deprecated":false}]}],"returns":[],"examples":["Request:\n\nPOST /api/shopify/inventory_batches\n{\n  \"enable_shopify_sync\": true,\n  \"inventory_batch\": {\n    \"location_id\": 63066407088,\n    \"variant_id\": 44519466369200,\n    \"quantity\": 55,\n    \"batch_name\": \"Strawberry Jam March\",\n    \"batch_number\": \"SJ-2024-03\",\n    \"barcode\": \"0123456789012\",\n    \"invoice_number\": \"INV-1042\",\n    \"description\": \"March restock\",\n    \"received_date\": \"2024-03-01\",\n    \"expiry_date\": \"2024-09-01\"\n  }\n}\n\nResponse (201) - batch_name, batch_number, barcode, invoice_number and\ndescription are returned under the \"metadata\" object, not at the top level:\n\n{\n  \"id\": 4041,\n  \"quantity\": 55,\n  \"expired_at\": null,\n  \"expiry_date\": \"2024-09-01 00:00:00 UTC\",\n  \"received_date\": \"2024-03-01 00:00:00 UTC\",\n  \"metadata\": {\n    \"batch_name\": \"Strawberry Jam March\",\n    \"batch_number\": \"SJ-2024-03\",\n    \"barcode\": \"0123456789012\",\n    \"invoice_number\": \"INV-1042\",\n    \"description\": \"March restock\"\n  },\n  \"created_at\": \"2024-03-01 05:48:06 UTC\",\n  \"updated_at\": \"2024-03-01 05:48:06 UTC\",\n  \"notified_at\": null,\n  \"discounted\": false,\n  \"location_id\": 63066407088,\n  \"variant_id\": 44519466369200\n}\n","// invalid params\nPOST /api/shopify/inventory_batches\ninventory_batch[quantity]=55\n422\nLocation must exist and Variant must exist","// invalid token\nPOST /api/shopify/inventory_batches\nenable_shopify_sync=true&inventory_batch[location_id]=1000&inventory_batch[variant_id]=2000&inventory_batch[quantity]=55&inventory_batch[batch_name]=batch_name&inventory_batch[batch_number]=batch_number&inventory_batch[barcode]=barcode&inventory_batch[invoice_number]=invoice_number&inventory_batch[description]=description&inventory_batch[received_date]=2023-07-03\n401\nHTTP Token: Access denied.\n","// valid token and params\nPOST /api/shopify/inventory_batches\nenable_shopify_sync=true&inventory_batch[location_id]=1000&inventory_batch[variant_id]=2000&inventory_batch[quantity]=55&inventory_batch[batch_name]=batch_name&inventory_batch[batch_number]=batch_number&inventory_batch[barcode]=barcode&inventory_batch[invoice_number]=invoice_number&inventory_batch[description]=description&inventory_batch[received_date]=2023-07-03\n201\n{\n  \"id\": 4041,\n  \"quantity\": 55,\n  \"expired_at\": null,\n  \"expiry_date\": null,\n  \"received_date\": \"2023-07-03 00:00:00 UTC\",\n  \"metadata\": {\n    \"batch_name\": \"batch_name\",\n    \"batch_number\": \"batch_number\",\n    \"barcode\": \"barcode\",\n    \"invoice_number\": \"invoice_number\",\n    \"description\": \"description\"\n  },\n  \"created_at\": \"2023-07-03 05:48:06 UTC\",\n  \"updated_at\": \"2023-07-03 05:48:06 UTC\",\n  \"notified_at\": null,\n  \"discounted\": false,\n  \"location_id\": 1000,\n  \"variant_id\": 2000\n}"],"metadata":null,"see":[],"headers":[{"name":"Authorization","description":"Bearer token","options":{"required":true}}],"show":true},{"doc_url":"/docs/1.0/inventory_batches/update","name":"update","apis":[{"api_url":"/api/shopify/inventory_batches/:id","http_method":"PUT","short_description":"Update inventory batch","deprecated":null}],"formats":null,"full_description":"\n<p>In the response, the custom fields batch_name, batch_number, barcode, invoice_number and description are returned nested under the metadata object of the batch, not as top-level attributes (see the example below).</p>\n","errors":[{"code":401,"description":"The provided token is invalid","metadata":null},{"code":404,"description":"Record not found","metadata":null},{"code":422,"description":"Could not process parameters","metadata":null}],"params":[{"name":"enable_shopify_sync","full_name":"enable_shopify_sync","description":"\n<p>Whether to apply a Shopify inventory adjustment for this change. Accepted values: true or false. Can be sent at the top level or nested under inventory_batch. Note: the app preference “Batch quantities added or adjusted on Freshly are reflected in Shopify” is a master switch. When that preference is OFF, this parameter has no effect and no Shopify inventory adjustment occurs. When the preference is ON, passing true applies an inventory adjustment at the batch’s location; passing false or omitting the parameter leaves Shopify inventory unchanged.</p>\n","required":false,"allow_nil":false,"allow_blank":false,"validator":"Must be one of: <code>true</code>, <code>false</code>, <code>1</code>, <code>0</code>.","expected_type":"boolean","metadata":null,"show":true,"validations":[],"deprecated":false},{"name":"inventory_batch","full_name":"inventory_batch","description":"","required":false,"allow_nil":false,"allow_blank":false,"validator":"Must be a Hash","expected_type":"hash","metadata":null,"show":true,"validations":[],"deprecated":false,"params":[{"name":"location_id","full_name":"inventory_batch[location_id]","description":"\n<p>Shopify location ID</p>\n","required":true,"allow_nil":false,"allow_blank":false,"validator":"Must be a Integer","expected_type":"numeric","metadata":null,"show":true,"validations":[],"deprecated":false},{"name":"variant_id","full_name":"inventory_batch[variant_id]","description":"\n<p>Shopify variant ID</p>\n","required":true,"allow_nil":false,"allow_blank":false,"validator":"Must be a Integer","expected_type":"numeric","metadata":null,"show":true,"validations":[],"deprecated":false},{"name":"quantity","full_name":"inventory_batch[quantity]","description":"\n<p>Inventory batch quantity</p>\n","required":true,"allow_nil":false,"allow_blank":false,"validator":"Must be a Integer","expected_type":"numeric","metadata":null,"show":true,"validations":[],"deprecated":false},{"name":"enable_shopify_sync","full_name":"inventory_batch[enable_shopify_sync]","description":"\n<p>Alternative placement of the top-level enable_shopify_sync parameter (either location is accepted; see enable_shopify_sync above for semantics)</p>\n","required":false,"allow_nil":false,"allow_blank":false,"validator":"Must be one of: <code>true</code>, <code>false</code>, <code>1</code>, <code>0</code>.","expected_type":"boolean","metadata":null,"show":true,"validations":[],"deprecated":false},{"name":"batch_name","full_name":"inventory_batch[batch_name]","description":"\n<p>Inventory batch name (returned under metadata in the response)</p>\n","required":false,"allow_nil":false,"allow_blank":false,"validator":"Must be a String","expected_type":"string","metadata":null,"show":true,"validations":[],"deprecated":false},{"name":"batch_number","full_name":"inventory_batch[batch_number]","description":"\n<p>Inventory batch number (returned under metadata in the response)</p>\n","required":false,"allow_nil":false,"allow_blank":false,"validator":"Must be a String","expected_type":"string","metadata":null,"show":true,"validations":[],"deprecated":false},{"name":"barcode","full_name":"inventory_batch[barcode]","description":"\n<p>Inventory batch barcode (returned under metadata in the response)</p>\n","required":false,"allow_nil":false,"allow_blank":false,"validator":"Must be a String","expected_type":"string","metadata":null,"show":true,"validations":[],"deprecated":false},{"name":"invoice_number","full_name":"inventory_batch[invoice_number]","description":"\n<p>Inventory batch invoice number (returned under metadata in the response)</p>\n","required":false,"allow_nil":false,"allow_blank":false,"validator":"Must be a String","expected_type":"string","metadata":null,"show":true,"validations":[],"deprecated":false},{"name":"description","full_name":"inventory_batch[description]","description":"\n<p>Inventory batch description (returned under metadata in the response)</p>\n","required":false,"allow_nil":false,"allow_blank":false,"validator":"Must be a String","expected_type":"string","metadata":null,"show":true,"validations":[],"deprecated":false},{"name":"received_date","full_name":"inventory_batch[received_date]","description":"\n<p>Inventory batch received date (YYYY-MM-DD, or any ISO 8601 date/time)</p>\n","required":false,"allow_nil":false,"allow_blank":false,"validator":"Must be a String","expected_type":"string","metadata":null,"show":true,"validations":[],"deprecated":false},{"name":"expiry_date","full_name":"inventory_batch[expiry_date]","description":"\n<p>Inventory batch expiry date; same format as received_date (YYYY-MM-DD, or any ISO 8601 date/time)</p>\n","required":false,"allow_nil":false,"allow_blank":false,"validator":"Must be a String","expected_type":"string","metadata":null,"show":true,"validations":[],"deprecated":false}]}],"returns":[],"examples":["Request:\n\nPUT /api/shopify/inventory_batches/4025\n{\n  \"inventory_batch\": {\n    \"location_id\": 63066407088,\n    \"variant_id\": 44519466369200,\n    \"quantity\": 56,\n    \"batch_number\": \"SJ-2024-03\",\n    \"expiry_date\": \"2024-09-01\"\n  }\n}\n\nResponse (200) - batch_name, batch_number, barcode, invoice_number and\ndescription are returned under the \"metadata\" object, not at the top level:\n\n{\n  \"id\": 4025,\n  \"quantity\": 56,\n  \"expired_at\": null,\n  \"expiry_date\": \"2024-09-01 00:00:00 UTC\",\n  \"received_date\": \"2024-03-01 00:00:00 UTC\",\n  \"metadata\": {\n    \"batch_name\": \"Strawberry Jam March\",\n    \"batch_number\": \"SJ-2024-03\"\n  },\n  \"created_at\": \"2024-03-01 05:48:05 UTC\",\n  \"updated_at\": \"2024-03-05 09:12:44 UTC\",\n  \"notified_at\": null,\n  \"discounted\": false,\n  \"location_id\": 63066407088,\n  \"variant_id\": 44519466369200\n}\n","// valid token and params\nPUT /api/shopify/inventory_batches/4025\ninventory_batch[quantity]=56&inventory_batch[location_id]=1000&inventory_batch[variant_id]=2000\n200\n{\n  \"id\": 4025,\n  \"quantity\": 56,\n  \"expired_at\": null,\n  \"expiry_date\": \"2023-07-13 05:48:05 UTC\",\n  \"received_date\": \"2023-07-03 05:48:05 UTC\",\n  \"metadata\": {\n    \"batch_name\": \"Inventory Batch\"\n  },\n  \"created_at\": \"2023-07-03 05:48:05 UTC\",\n  \"updated_at\": \"2023-07-03 05:48:05 UTC\",\n  \"notified_at\": null,\n  \"discounted\": false,\n  \"location_id\": 1000,\n  \"variant_id\": 2000\n}","// invalid params\nPUT /api/shopify/inventory_batches/4026\ninventory_batch[quantity]=56\n422\nLocation must exist and Variant must exist","// invalid id\nPUT /api/shopify/inventory_batches/100\ninventory_batch[quantity]=56&inventory_batch[location_id]=1000&inventory_batch[variant_id]=2000\n404\nRecord not found","// invalid token\nPUT /api/shopify/inventory_batches/4028\ninventory_batch[location_id]=1000&inventory_batch[variant_id]=2000&inventory_batch[quantity]=56&inventory_batch[batch_name]=batch_name&inventory_batch[batch_number]=batch_number&inventory_batch[barcode]=barcode&inventory_batch[invoice_number]=invoice_number&inventory_batch[description]=description&inventory_batch[received_date]=2023-07-03\n401\nHTTP Token: Access denied.\n"],"metadata":null,"see":[],"headers":[{"name":"Authorization","description":"Bearer token","options":{"required":true}}],"show":true},{"doc_url":"/docs/1.0/inventory_batches/destroy","name":"destroy","apis":[{"api_url":"/api/shopify/inventory_batches/:id","http_method":"DELETE","short_description":"Delete inventory batch","deprecated":null}],"formats":null,"full_description":"\n<p>Responds with a JSON object: {“message”: “Inventory batch deleted”} on success, or {“error”: “…”} with an appropriate HTTP status on failure.</p>\n","errors":[{"code":401,"description":"The provided token is invalid","metadata":null},{"code":404,"description":"Record not found","metadata":null}],"params":[{"name":"id","full_name":"id","description":"\n<p>Inventory batch ID</p>\n","required":true,"allow_nil":false,"allow_blank":false,"validator":"Must be a Integer","expected_type":"numeric","metadata":null,"show":true,"validations":[],"deprecated":false}],"returns":[],"examples":["Response (200):\n\n{ \"message\": \"Inventory batch deleted\" }\n\nResponse (404):\n\n{ \"error\": \"Record not found\" }\n","// invalid id\nDELETE /api/shopify/inventory_batches/100\n404\n{\n  \"error\": \"Record not found\"\n}","// valid token\nDELETE /api/shopify/inventory_batches/4034\n200\n{\n  \"message\": \"Inventory batch deleted\"\n}","// invalid token\nDELETE /api/shopify/inventory_batches/4035\n401\nHTTP Token: Access denied.\n"],"metadata":null,"see":[],"headers":[{"name":"Authorization","description":"Bearer token","options":{"required":true}}],"show":true}],"headers":null,"deprecated":null},"shops":{"doc_url":"/docs/1.0/shops","id":"shops","api_url":"/api/shopify","name":"Shops","short_description":null,"full_description":"","version":"1.0","formats":null,"metadata":null,"methods":[{"doc_url":"/docs/1.0/shops/show","name":"show","apis":[{"api_url":"/api/shopify/shop","http_method":"GET","short_description":"get current Shop","deprecated":null}],"formats":null,"full_description":"","errors":[],"params":[],"returns":[],"examples":["// invalid token\nGET /api/shopify/shop\n401\nHTTP Token: Access denied.\n","// valid token\nGET /api/shopify/shop\n200\n{\n  \"name\": \"shopify store\",\n  \"shopify_domain\": \"44733.myshopify.com\"\n}"],"metadata":null,"see":[],"headers":[{"name":"Authorization","description":"Bearer token","options":{"required":true}}],"show":true}],"headers":null,"deprecated":null}}}}