# Webhooks

Flow Retail provides the capability to register webhooks that trigger on specific events.

### [Dispatching and error handling](https://developer.flowretail.com/docs/flowretail/am1t908kos2l9-webhooks#dispatching-and-error-handling) <a href="#dispatching-and-error-handling" id="dispatching-and-error-handling"></a>

Webhooks are dispatched instantly and retried up to 10 times upon failure.

If the server receiving the webhook fails to respond within 10 seconds, a timeout occurs, and the job is retried.

If the server responds with an HTTP status code below 300, the job is marked as OK and removed from the queue. For status codes from 400 to 499, the job is marked as an error but still removed from the queue and not retried.

All other status codes prompt the webhook to retry the job up to 10 times.

## Order <a href="#order" id="order"></a>

### **Order is settled**

This is triggered when an order is fully paid.

**Payload:**

```json
{
  "action": "ORDER_SETTLED",
  "tenant": {
    "Id": 7,
    "Uid": "7"
  },
  "store": {
    "Id": 1,
    "Uid": "70"
  },
  "order": {
    "Id": 7123,
    "Uid": "700"
  },
  "tenantUser": {
    "Id": 7,
    "Uid": "9"
  }
}
```

### Order is delivered <a href="#order-is-delivered" id="order-is-delivered"></a>

This is triggered when an order is fully delivered. This means that all the orderlines on the order is delivered.

**Payload:**

```json
{
  "action": "ORDER_DELIVERED",
  "tenant": {
    "Id": 7,
    "Uid": "7"
  },
  "store": {
    "Id": 1,
    "Uid": "70"
  },
  "order": {
    "Id": 7123,
    "Uid": "700"
  },
  "tenantUser": {
    "Id": 7,
    "Uid": "9"
  }
}
```

### Order handling state is updated <a href="#order-handling-state-is-updated" id="order-handling-state-is-updated"></a>

This is triggered when an order handling state is changed

**Payload:**

```json
{
  "action": "ORDER_HANDLING_STATE_CHANGED",
  "tenant": {
    "Id": 7,
    "Uid": "7"
  },
  "store": {
    "Id": 1,
    "Uid": "70"
  },
  "order": {
    "Id": 7123,
    "Uid": "700"
  },
  "orderHandling": {
    "Id": 71234,
    "Uid": "7000"
  },
  "tenantUser": {
    "Id": 7,
    "Uid": "9"
  }
}
```

## Customer <a href="#customer" id="customer"></a>

### **Customer created**

This will be triggered when a new customer is created.

**Payload:**

```json
{
  "action": "CUSTOMER_CREATE",
  "tenant": {
    "Id": 7,
    "Uid": "7"
  },
  "customer": {
    "Id": 32,
    "Uid": "1000"
  },
  "tenantUser": {
    "Id": 14,
    "Uid": "0f18eb09-3444-4c97-9043-638346e61af3"
  }
}
```

### **Customer update**

This will be triggered when a customer is updated.

**Payload:**

```json
{
  "action": "CUSTOMER_UPDATE",
  "tenant": {
    "Id": 7,
    "Uid": "7"
  },
  "customer": {
    "Id": 32,
    "Uid": "1000"
  },
  "tenantUser": {
    "Id": 14,
    "Uid": "0f18eb09-3444-4c97-9043-638346e61af3"
  }
}
```

## Product <a href="#product" id="product"></a>

### **Product create**

This is triggered when a new product is created

**Payload:**

```json
{
  "action": "PRODUCT_CREATE",
  "tenant": {
    "Id": 7,
    "Uid": "7"
  },
  "tenantUser": {
    "Id": 7,
    "Uid": "7"
  },
  "product": {
    "Id": 75666,
    "Uid": "71233"
  }
}
```

### **Product update**

This is triggered when the basic data on a product is changed or updated. It will *not* be triggered if a stock or a price in a pricelist is changed for a product.

**Payload:**

```json
{
  "action": "PRODUCT_UPDATE",
  "tenant": {
    "Id": 7,
    "Uid": "7"
  },
  "tenantUser": {
    "Id": 7,
    "Uid": "7"
  },
  "product": {
    "Id": 75666,
    "Uid": "71233"
  }
}
```

### **Product Media change**

This is triggered when a media for a product is added, updated or deleted.

**Payload:**

```
{    "action": "PRODUCT_MEDIA_CHANGE",    "tenant": {        "Id": 7,        "Uid": "7"    },    "product": {        "Id": 2,        "Uid": "3"    },    "productMedia": {        "Id": 4,        "Uid": "5"    },    "tenantUser": {        "Id": 7,        "Uid": "7"    }}
```

#### [Till](https://developer.flowretail.com/docs/flowretail/am1t908kos2l9-webhooks#till) <a href="#till" id="till"></a>

[**Till Open**](https://developer.flowretail.com/docs/flowretail/am1t908kos2l9-webhooks#till-open)

This is triggered after a till has been opened.

**Payload:**

```
{    "action": "TILL_OPEN",    "tenant": {        "Id": 7,        "Uid": "7"    },    "store": {        "Id": 1,        "Uid": "7"    },    "till": {        "Id": 73,        "Uid": "722"    },    "tenantUser": {        "Id": 7,        "Uid": "7"    },    "cashReport": {        "Id": 7212,        "Uid": "74533"    },    "date": "2022-10-18"}
```

[**Till Close**](https://developer.flowretail.com/docs/flowretail/am1t908kos2l9-webhooks#till-close)

This is triggered after a till is closed.

**Payload:**

```
{    "action": "TILL_CLOSE",    "tenant": {        "Id": 7,        "Uid": "7"    },    "store": {        "Id": 1,        "Uid": "7"    },    "till": {        "Id": 73,        "Uid": "722"    },    "tenantUser": {        "Id": 7,        "Uid": "7"    },    "cashReport": {        "Id": 7212,        "Uid": "74533"    },    "date": "2022-10-18"}
```

#### [Pricelist](https://developer.flowretail.com/docs/flowretail/am1t908kos2l9-webhooks#pricelist) <a href="#pricelist" id="pricelist"></a>

[**Price Create**](https://developer.flowretail.com/docs/flowretail/am1t908kos2l9-webhooks#price-create)

This is triggered after a new price is added to a pricelist.

**Payload:**

```
{    "action": "PRICE_CREATE",    "tenant": {        "Id": 7,        "Uid": "7"    },    "pricelist": {        "Id": 1,        "Uid": "7"    },    "price": {        "Id": 73,        "Uid": "722"    },    "tenantUser": {        "Id": 7,        "Uid": "7"    }}
```

[**Price Update**](https://developer.flowretail.com/docs/flowretail/am1t908kos2l9-webhooks#price-update)

This is triggered when a price is updated on a pricelist

**Payload:**

```
{    "action": "PRICE_UPDATE",    "tenant": {        "Id": 7,        "Uid": "7"    },    "pricelist": {        "Id": 1,        "Uid": "7"    },    "price": {        "Id": 73,        "Uid": "722"    },    "tenantUser": {        "Id": 7,        "Uid": "7"    }}
```

#### [Stock change](https://developer.flowretail.com/docs/flowretail/am1t908kos2l9-webhooks#stock-change) <a href="#stock-change" id="stock-change"></a>

This is triggered when the stock changes for a product.

**Payload:**

```
{    "action": "STOCK_CHANGE",    "tenant": {        "Id": 7,        "Uid": "7"    },    "store": {        "Id": 1,        "Uid": "7"    },    "warehouse": {        "Id": 73,        "Uid": "722"    },    "product": {        "Id": 73,        "Uid": "722"    },    "tenantUser": {        "Id": 7,        "Uid": "7"    }}
```

#### [Purchase order received](https://developer.flowretail.com/docs/flowretail/am1t908kos2l9-webhooks#purchase-order-received) <a href="#purchase-order-received" id="purchase-order-received"></a>

This is triggered when a pruchase order is fully received

**Payload:**

```
{    "action": "PURCHASE_RECEIVED",    "tenant": {        "Id": 7,        "Uid": "flow-demo"    },    "store": {        "Id": 1,        "Uid": "flow-demo-store"    },    "purchaseOrder": {        "Id": 521,        "Uid": "87667e5b-dbd4-4ebf-b082-90506f039074"    },    "tenantUser": {        "Id": 7,        "Uid": "d2d0748f-33ee-4823-aa81-e89fbbe6cea7"    }}
```

#### [Product Media Change](https://developer.flowretail.com/docs/flowretail/am1t908kos2l9-webhooks#product-media-change-1) <a href="#product-media-change-1" id="product-media-change-1"></a>

This is triggered when a product media is changed

**Payload:**

{% code overflow="wrap" lineNumbers="true" fullWidth="false" %}

```json
{    "action": "PRODUCT_MEDIA_CHANGED",    "tenant": {        "Id": 7,        "Uid": "flow-demo"    },    "product": {        "Id": 1,        "Uid": "flow-demo-product"    },    "productMedia": {        "Id": 521,        "Uid": "87667e5b-dbd4-4ebf-b082-90506f039074"    },    "tenantUser": {        "Id": 7,        "Uid": "d2d0748f-33ee-4823-aa81-e89fbbe6cea7"    }}
```

{% endcode %}

#### [Order receipt settled](https://developer.flowretail.com/docs/flowretail/am1t908kos2l9-webhooks#order-receipt-settled) <a href="#order-receipt-settled" id="order-receipt-settled"></a>

This is triggered when a order receipt is settled

**Payload:**

```
{    "action": "ORDER_RECEIPT_SETTLED",    "tenant": {        "Id": 7,        "Uid": "flow-demo"    },    "store": {        "Id": 1,        "Uid": "flow-demo-store"    },    "order": {        "Id": 521,        "Uid": "87667e5b-dbd4-4ebf-b082-90506f039074"    },    "orderReceipt": {        "Id": 7,        "Uid": "d2d0748f-33ee-4823-aa81-e89fbbe6cea7"    },    "tenantUser": {        "Id": 7,        "Uid": "d2d0748f-33ee-4823-aa81-e89fbbe6cea7"    }}
```


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.flowretail.com/docs/developers/webhooks.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
