Freshly Inventory
App · 9 actions
Track your Shopify store's inventory batches and expiry dates in Freshly Inventory and record which batch each order used.
Actions
| Action | What it does |
|---|---|
| Assign batch to order item | Record that units of an order's line item came from a batch. |
| Create batch | Add an inventory batch for a product variant at a location, with its quantity and dates. |
| Delete batch | Delete an inventory batch. |
| Delete batch assignment | Remove a batch assignment from an order's line item. |
| Get batch | Get one inventory batch by its ID. |
| Get shop | Get the name and Shopify domain of the store the API key belongs to. |
| List batch assignments for order item | List which batches the units of an order's line item came from. |
| List batches | List one page of inventory batches, optionally for one location or variant, or matching a search. |
| Update batch | Change a batch's quantity, dates or details. |
Assign batch to order item
Record that units of an order's line item came from a batch.
Inputs
- Order ID
order_idnumberRequired - The Shopify order ID.
- Line item ID
line_item_idnumberRequired - The Shopify line item ID in that order.
- Batch ID
inventory_batch_idnumberRequired - The batch the units came from, from List batches.
- Quantity
quantitynumberRequired - How many units came from that batch.At least 1.
Outputs
dataobject- The response from Freshly Inventory.
Example output
{
"data": {
"created_at": "2024-03-01 05:48:06 UTC",
"id": 1598,
"inventory_batch_id": 4050,
"line_item_id": 13374776201392,
"order_id": 5443815864496,
"quantity": 2,
"updated_at": "2024-03-01 05:48:06 UTC"
}
}Create batch
Add an inventory batch for a product variant at a location, with its quantity and dates.
Inputs
- Location ID
location_idnumberRequired - The Shopify location ID where the batch is stocked.
- Variant ID
variant_idnumberRequired - The Shopify product variant ID the batch belongs to.
- Quantity
quantitynumberRequired - How many units are in the batch.At least 0.
- Expiry date
expiry_datedate - When the batch expires.
- Received date
received_datedate - When the batch was received.
- Batch name
batch_nametext - A name for the batch.
- Batch number
batch_numbertext - The batch or lot number.
- Barcode
barcodetext - The batch's barcode.
- Invoice number
invoice_numbertext - The supplier invoice number.
- Description
descriptiontext - A description of the batch.
- Adjust Shopify inventory
enable_shopify_synctrue/false - Also adjust the variant's Shopify inventory at the batch's location. Works only when the Freshly preference that reflects batch quantities in Shopify is on.
Outputs
dataobject- The response from Freshly Inventory.
Example output
{
"data": {
"created_at": "2024-03-01 05:48:06 UTC",
"discounted": false,
"expired_at": "2024-09-01 00:00:00 UTC",
"expiry_date": "2024-09-01 00:00:00 UTC",
"id": 4041,
"location_id": 63066407088,
"metadata": {
"barcode": "0123456789012",
"batch_name": "Strawberry Jam March",
"batch_number": "SJ-2024-03",
"description": "March restock",
"invoice_number": "INV-1042"
},
"notified_at": "2024-08-25 00:00:00 UTC",
"quantity": 55,
"received_date": "2024-03-01 00:00:00 UTC",
"updated_at": "2024-03-01 05:48:06 UTC",
"variant_id": 44519466369200
}
}Delete batch
Delete an inventory batch.
Inputs
- Batch ID
idnumberRequired - The batch's ID, from List batches.
Outputs
dataobject- The response from Freshly Inventory.
Example output
{
"data": {
"message": "Inventory batch deleted"
}
}Delete batch assignment
Remove a batch assignment from an order's line item.
Inputs
- Assignment ID
idnumberRequired - The assignment's ID, from List batch assignments for order item.
Outputs
dataobject- The response from Freshly Inventory.
Example output
{
"data": {
"message": "Batch removed"
}
}Get batch
Get one inventory batch by its ID.
Inputs
- Batch ID
idnumberRequired - The batch's ID, from List batches.
Outputs
dataobject- The response from Freshly Inventory.
Example output
{
"data": {
"created_at": "2024-03-01 05:48:06 UTC",
"discounted": false,
"expired_at": "2024-09-01 00:00:00 UTC",
"expiry_date": "2024-09-01 00:00:00 UTC",
"id": 4041,
"location_id": 63066407088,
"metadata": {
"barcode": "0123456789012",
"batch_name": "Strawberry Jam March",
"batch_number": "SJ-2024-03",
"description": "March restock",
"invoice_number": "INV-1042"
},
"notified_at": "2024-08-25 00:00:00 UTC",
"quantity": 55,
"received_date": "2024-03-01 00:00:00 UTC",
"updated_at": "2024-03-01 05:48:06 UTC",
"variant_id": 44519466369200
}
}Get shop
Get the name and Shopify domain of the store the API key belongs to.
Inputs
None.
Outputs
dataobject- The response from Freshly Inventory.
Example output
{
"data": {
"name": "Pantry Goods",
"shopify_domain": "pantry-goods.myshopify.com"
}
}List batch assignments for order item
List which batches the units of an order's line item came from.
Inputs
- Order ID
order_idnumberRequired - The Shopify order ID.
- Line item ID
line_item_idnumberRequired - The Shopify line item ID in that order.
Outputs
datalist- The assignments.
Example output
{
"data": [
{
"created_at": "2024-03-01 05:48:06 UTC",
"id": 1598,
"inventory_batch_id": 4050,
"line_item_id": 13374776201392,
"order_id": 5443815864496,
"quantity": 2,
"updated_at": "2024-03-01 05:48:06 UTC"
}
]
}List batches
List one page of inventory batches, optionally for one location or variant, or matching a search.
Inputs
- Location ID
location_idnumber - Only batches at this Shopify location ID.
- Variant ID
variant_idnumber - Only batches of this Shopify variant ID.
- Search
searchtext - Words to find in the batch name, batch number, barcode, invoice number, description, product title or variant title.
- Page
pagenumber - Which page to read, starting at 1.At least 1.
Outputs
datalist- The batches.
Example output
{
"data": [
{
"created_at": "2024-03-01 05:48:06 UTC",
"discounted": false,
"expired_at": "2024-09-01 00:00:00 UTC",
"expiry_date": "2024-09-01 00:00:00 UTC",
"id": 4041,
"location_id": 63066407088,
"metadata": {
"barcode": "0123456789012",
"batch_name": "Strawberry Jam March",
"batch_number": "SJ-2024-03",
"description": "March restock",
"invoice_number": "INV-1042"
},
"notified_at": "2024-08-25 00:00:00 UTC",
"quantity": 55,
"received_date": "2024-03-01 00:00:00 UTC",
"updated_at": "2024-03-01 05:48:06 UTC",
"variant_id": 44519466369200
}
]
}Update batch
Change a batch's quantity, dates or details. Location, variant and quantity are always needed.
Inputs
- Batch ID
idnumberRequired - The batch's ID, from List batches.
- Location ID
location_idnumberRequired - The Shopify location ID where the batch is stocked.
- Variant ID
variant_idnumberRequired - The Shopify product variant ID the batch belongs to.
- Quantity
quantitynumberRequired - How many units are in the batch.At least 0.
- Expiry date
expiry_datedate - When the batch expires.
- Received date
received_datedate - When the batch was received.
- Batch name
batch_nametext - A name for the batch.
- Batch number
batch_numbertext - The batch or lot number.
- Barcode
barcodetext - The batch's barcode.
- Invoice number
invoice_numbertext - The supplier invoice number.
- Description
descriptiontext - A description of the batch.
- Adjust Shopify inventory
enable_shopify_synctrue/false - Also adjust the variant's Shopify inventory at the batch's location. Works only when the Freshly preference that reflects batch quantities in Shopify is on.
Outputs
dataobject- The response from Freshly Inventory.
Example output
{
"data": {
"created_at": "2024-03-01 05:48:06 UTC",
"discounted": false,
"expired_at": "2024-09-01 00:00:00 UTC",
"expiry_date": "2024-09-01 00:00:00 UTC",
"id": 4041,
"location_id": 63066407088,
"metadata": {
"barcode": "0123456789012",
"batch_name": "Strawberry Jam March",
"batch_number": "SJ-2024-03",
"description": "March restock",
"invoice_number": "INV-1042"
},
"notified_at": "2024-08-25 00:00:00 UTC",
"quantity": 55,
"received_date": "2024-03-01 00:00:00 UTC",
"updated_at": "2024-03-01 05:48:06 UTC",
"variant_id": 44519466369200
}
}