> ## Documentation Index
> Fetch the complete documentation index at: https://docs.stockful.app/llms.txt
> Use this file to discover all available pages before exploring further.

# Actions

> All Stockful actions available in Shopify Flow

Stockful provides 9 actions you can use in Flow workflows. Query actions return data for use in subsequent steps. Write actions update Stockful settings. Integration actions connect to external services.

## Query actions

These actions return structured data that you can reference in conditions and subsequent actions within your workflow.

### Get forecast

Get inventory forecast data for a variant including velocity, days of supply, and reorder recommendations.

**Inputs:**

| Field      | Required | Description            |
| ---------- | -------- | ---------------------- |
| Product    | Yes      | The product to query   |
| Variant ID | Yes      | The numeric variant ID |

**Returns:**

| Field                     | Type    | Description                                                    |
| ------------------------- | ------- | -------------------------------------------------------------- |
| velocity                  | Float   | Sales velocity in units per day                                |
| days\_of\_supply          | Float   | Estimated days of stock remaining                              |
| reorder\_point            | Integer | Quantity at which to reorder                                   |
| reorder\_quantity         | Integer | Suggested order quantity                                       |
| projected\_stockout\_date | Text    | Date when stock is projected to run out                        |
| abc\_class                | Text    | ABC revenue classification (A, B, or C)                        |
| stock\_status             | Text    | Current stock status (healthy, low, out\_of\_stock, overstock) |
| sell\_through\_rate       | Float   | Sell-through rate between 0 and 1                              |
| total\_sold\_30d          | Integer | Units sold in last 30 days                                     |
| available                 | Integer | Current available quantity                                     |

### Get inventory health

Get inventory health metrics for a variant including stock status, ABC class, and sell-through rate.

**Inputs:**

| Field      | Required | Description            |
| ---------- | -------- | ---------------------- |
| Product    | Yes      | The product to query   |
| Variant ID | Yes      | The numeric variant ID |

**Returns:**

| Field               | Type    | Description                                                    |
| ------------------- | ------- | -------------------------------------------------------------- |
| stock\_status       | Text    | Current stock status (healthy, low, out\_of\_stock, overstock) |
| abc\_class          | Text    | ABC revenue classification (A, B, or C)                        |
| sell\_through\_rate | Float   | Sell-through rate between 0 and 1                              |
| days\_of\_supply    | Float   | Estimated days of stock remaining                              |
| available           | Integer | Current available quantity                                     |
| velocity            | Float   | Sales velocity in units per day                                |

### Get stock by location

Get inventory levels for a variant across all tracked locations.

**Inputs:**

| Field      | Required | Description            |
| ---------- | -------- | ---------------------- |
| Product    | Yes      | The product to query   |
| Variant ID | Yes      | The numeric variant ID |

**Returns:**

| Field            | Type    | Description                          |
| ---------------- | ------- | ------------------------------------ |
| total\_available | Integer | Total available across all locations |
| location\_count  | Integer | Number of locations with stock data  |
| items            | List    | Per-location stock data (see below)  |

Each item in the `items` list contains:

| Field            | Type    | Description                       |
| ---------------- | ------- | --------------------------------- |
| location         | Text    | Location name                     |
| available        | Integer | Current available quantity        |
| velocity         | Float   | Sales velocity in units per day   |
| days\_of\_supply | Float   | Estimated days of stock remaining |
| stock\_status    | Text    | Current stock status              |
| reorder\_point   | Integer | Calculated reorder point          |

### Get reorder list

Get all variants that are at or below their reorder point, with forecast context for each.

**Inputs:**

| Field         | Required | Description                                                  |
| ------------- | -------- | ------------------------------------------------------------ |
| Location name | No       | Filter to a specific location. Leave empty for all locations |

**Returns:**

| Field        | Type    | Description                                          |
| ------------ | ------- | ---------------------------------------------------- |
| total\_count | Integer | Total number of variants needing reorder             |
| items        | List    | Variants at or below their reorder point (see below) |

Each item in the `items` list contains:

| Field             | Type    | Description                       |
| ----------------- | ------- | --------------------------------- |
| product\_title    | Text    | Product title                     |
| variant\_title    | Text    | Variant title                     |
| sku               | Text    | Variant SKU                       |
| location          | Text    | Location name                     |
| available         | Integer | Current available quantity        |
| reorder\_point    | Integer | Calculated reorder point          |
| reorder\_quantity | Integer | Suggested reorder quantity        |
| velocity          | Float   | Sales velocity in units per day   |
| days\_of\_supply  | Float   | Estimated days of stock remaining |
| abc\_class        | Text    | ABC revenue classification        |
| stock\_status     | Text    | Current stock status              |

<Tip>
  The "Get reorder list" action doesn't require a product or variant - it returns all variants that need reordering across your entire inventory. Use it in scheduled workflows to generate regular reorder reports.
</Tip>

### Get transfer suggestion

Suggest an inventory transfer between locations to balance stock for a variant.

**Inputs:**

| Field      | Required | Description            |
| ---------- | -------- | ---------------------- |
| Product    | Yes      | The product to query   |
| Variant ID | Yes      | The numeric variant ID |

**Returns:**

| Field                  | Type    | Description                             |
| ---------------------- | ------- | --------------------------------------- |
| has\_suggestion        | Boolean | Whether a viable transfer was found     |
| from\_location         | Text    | Source location name                    |
| to\_location           | Text    | Destination location name               |
| suggested\_quantity    | Integer | Suggested quantity to transfer          |
| from\_available        | Integer | Available stock at source location      |
| to\_available          | Integer | Available stock at destination location |
| from\_days\_of\_supply | Float   | Days of supply at source location       |
| to\_days\_of\_supply   | Float   | Days of supply at destination location  |

## Write actions

These actions update Stockful settings for a variant. They affect how forecasts and reorder points are calculated.

### Set safety stock

Set the safety stock override in days for a variant, affecting reorder point calculations.

**Inputs:**

| Field             | Required | Description                                                       |
| ----------------- | -------- | ----------------------------------------------------------------- |
| Product           | Yes      | The product to update                                             |
| Variant ID        | Yes      | The numeric variant ID                                            |
| Safety stock days | Yes      | Safety stock buffer in days (e.g. 5 for five days of extra stock) |

**Returns:**

| Field               | Type    | Description                               |
| ------------------- | ------- | ----------------------------------------- |
| success             | Boolean | Whether the safety stock was applied      |
| variant\_id         | Text    | The variant ID that was updated           |
| safety\_stock\_days | Integer | The safety stock in days that was applied |

### Set lead time

Set the lead time override in days for a variant, affecting reorder point calculations.

**Inputs:**

| Field          | Required | Description                               |
| -------------- | -------- | ----------------------------------------- |
| Product        | Yes      | The product to update                     |
| Variant ID     | Yes      | The numeric variant ID                    |
| Lead time days | Yes      | Lead time in days (e.g. 14 for two weeks) |

**Returns:**

| Field            | Type    | Description                            |
| ---------------- | ------- | -------------------------------------- |
| success          | Boolean | Whether the lead time was applied      |
| variant\_id      | Text    | The variant ID that was updated        |
| lead\_time\_days | Integer | The lead time in days that was applied |

### Set demand adjustment

Adjust the demand forecast percentage for a variant to account for expected changes in sales.

**Inputs:**

| Field              | Required | Description                                                   |
| ------------------ | -------- | ------------------------------------------------------------- |
| Product            | Yes      | The product to update                                         |
| Variant ID         | Yes      | The numeric variant ID                                        |
| Adjustment percent | Yes      | Demand adjustment percentage (e.g. 20 for +20%, -30 for -30%) |

**Returns:**

| Field              | Type    | Description                                       |
| ------------------ | ------- | ------------------------------------------------- |
| success            | Boolean | Whether the adjustment was applied                |
| variant\_id        | Text    | The variant ID that was adjusted                  |
| demand\_adjustment | Float   | The demand adjustment percentage that was applied |

<Tip>
  Use demand adjustments ahead of known sales events. For example, set +50% before Black Friday for your bestsellers, then reset to 0% after the event.
</Tip>

## Integration actions

### Send Slack message

Send a custom message to a Slack channel using the shop's connected Slack workspace.

**Inputs:**

| Field   | Required | Description                                                        |
| ------- | -------- | ------------------------------------------------------------------ |
| Channel | Yes      | Slack channel name to send the message to (e.g. #inventory-alerts) |
| Title   | No       | Optional header for the message (defaults to "Stockful Alert")     |
| Message | Yes      | The message text to send (supports Slack mrkdwn formatting)        |

**Returns:**

| Field     | Type    | Description                       |
| --------- | ------- | --------------------------------- |
| delivered | Boolean | Whether the message was delivered |
| error     | Text    | Error message if delivery failed  |

<Note>
  This action requires a Slack workspace connected in Stockful's notification settings. If Slack isn't connected, the action will return `delivered: false` with an error message.
</Note>
