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

ActionWhat it does
Assign batch to order itemRecord that units of an order's line item came from a batch.
Create batchAdd an inventory batch for a product variant at a location, with its quantity and dates.
Delete batchDelete an inventory batch.
Delete batch assignmentRemove a batch assignment from an order's line item.
Get batchGet one inventory batch by its ID.
Get shopGet the name and Shopify domain of the store the API key belongs to.
List batch assignments for order itemList which batches the units of an order's line item came from.
List batchesList one page of inventory batches, optionally for one location or variant, or matching a search.
Update batchChange 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 IDorder_idnumberRequired
The Shopify order ID.
Line item IDline_item_idnumberRequired
The Shopify line item ID in that order.
Batch IDinventory_batch_idnumberRequired
The batch the units came from, from List batches.
QuantityquantitynumberRequired
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 IDlocation_idnumberRequired
The Shopify location ID where the batch is stocked.
Variant IDvariant_idnumberRequired
The Shopify product variant ID the batch belongs to.
QuantityquantitynumberRequired
How many units are in the batch.At least 0.
Expiry dateexpiry_datedate
When the batch expires.
Received datereceived_datedate
When the batch was received.
Batch namebatch_nametext
A name for the batch.
Batch numberbatch_numbertext
The batch or lot number.
Barcodebarcodetext
The batch's barcode.
Invoice numberinvoice_numbertext
The supplier invoice number.
Descriptiondescriptiontext
A description of the batch.
Adjust Shopify inventoryenable_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 IDidnumberRequired
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 IDidnumberRequired
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 IDidnumberRequired
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 IDorder_idnumberRequired
The Shopify order ID.
Line item IDline_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 IDlocation_idnumber
Only batches at this Shopify location ID.
Variant IDvariant_idnumber
Only batches of this Shopify variant ID.
Searchsearchtext
Words to find in the batch name, batch number, barcode, invoice number, description, product title or variant title.
Pagepagenumber
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 IDidnumberRequired
The batch's ID, from List batches.
Location IDlocation_idnumberRequired
The Shopify location ID where the batch is stocked.
Variant IDvariant_idnumberRequired
The Shopify product variant ID the batch belongs to.
QuantityquantitynumberRequired
How many units are in the batch.At least 0.
Expiry dateexpiry_datedate
When the batch expires.
Received datereceived_datedate
When the batch was received.
Batch namebatch_nametext
A name for the batch.
Batch numberbatch_numbertext
The batch or lot number.
Barcodebarcodetext
The batch's barcode.
Invoice numberinvoice_numbertext
The supplier invoice number.
Descriptiondescriptiontext
A description of the batch.
Adjust Shopify inventoryenable_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
  }
}

On this page