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

# Real-time availability

> Take an item off sale, or put it back, on every channel with one call.

When a store runs out of something, customers should not be able to order it anywhere. One call to `POST /availability` marks items sold out at one store, several stores, or every store, on every channel or only the ones you choose.

Unavailable items stay on the menu, shown as sold out, and cannot be ordered. They come back when you mark them available again, when the `until` time passes, or when a quantity update restocks them.

## One item, one store

```bash theme={null}
curl -X POST https://api.lulacommerce.com/v1/availability \
  -H "Authorization: Bearer $TOKEN" \
  -H "Content-Type: application/json" \
  -H "Idempotency-Key: $(uuidgen)" \
  -d '{
    "external_ids": ["028400090858"],
    "store_ids": ["ext:0142"],
    "available": false,
    "reason": "out_of_stock"
  }'
```

## Every store, back automatically

Omit `store_ids` to apply the change to every store. Set `until` and the items return to available on their own.

```json theme={null}
{
  "external_ids": ["028400090858", "028400090865"],
  "available": false,
  "reason": "supply_issue",
  "until": "2027-03-02T12:00:00Z"
}
```

## Specific channels

Pass `channels` to limit the change, for example to keep an item on your own storefront while removing it from marketplaces.

```json theme={null}
{
  "external_ids": ["028400090858"],
  "store_ids": ["ext:0142"],
  "channels": ["doordash", "ubereats", "grubhub"],
  "available": false,
  "reason": "out_of_stock"
}
```

## Back in stock

```json theme={null}
{
  "external_ids": ["028400090858"],
  "store_ids": ["ext:0142"],
  "available": true
}
```

## By ingredient

Link products to their components (ingredients) once, and one call covers every product that uses an ingredient. When the store runs out of grilled chicken, every chicken taco, bowl, and taquito comes off sale together, and comes back together.

```json theme={null}
{
  "component_ids": ["ING-CHKN-GRL"],
  "store_ids": ["ext:0142"],
  "available": false,
  "reason": "out_of_stock"
}
```

This is the natural connection point for an ingredient or inventory hub that already decides what each store can make.

## How changes reach each channel

| Channel | How it is applied |
| - | - |
| Lula Direct | Applied immediately on the storefront and at checkout |
| DoorDash, Uber Eats, Grubhub | Pushed through each marketplace's item availability API |

The response tells you which channels have applied the change. Track the rest with `GET /availability/{change_id}`, or subscribe to `item.availability_changed` to receive one event per store and channel as each one applies. If a marketplace rejects a change, the channel entry shows `failed` with the reason, and Lula retries automatically.

## Availability from quantities

If your systems already send on-hand quantities, you do not need a separate availability call. Updating a store item to `quantity: 0` marks it unavailable on every channel, and any positive quantity makes it available again. See [Pricebook sync](https://platform.lulacommerce.com/guides/pricebook-sync.md).

## Choosing the right tool

| Situation | Use |
| - | - |
| A store ran out | `POST /availability` with `store_ids` |
| An ingredient ran out | `POST /availability` with `component_ids` |
| A supplier shorted a region | `POST /availability` with the region's `store_ids` and `until` |
| Your POS tracks on-hand counts | `PATCH /stores/{store_id}/items/{external_id}` with `quantity` |
| Food safety recall | [`POST /recalls`](https://platform.lulacommerce.com/guides/recalls), which cannot be overridden by stock updates |
| Discontinued at a store | Store item `status: inactive`, which hides the item entirely |

## Changes made in the store

Clerks can also mark items sold out in the Lula store app. Those changes emit the same `item.availability_changed` event with `source: store_app`, so your systems stay in step whichever side made the change.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.