---
title: "Create or update hook configuration"
method: POST
path: "/api/orders/hook/config"
tags: ["Order hook"]
---

# Create or update hook configuration

`POST /api/orders/hook/config`

Configures filtering rules applied to orders hook. Learn more with the [orders hook guide](https://developers.vtex.com/vtex-rest-api/docs/orders-feed#hook).

There are two types of filtering that can be used: 

 - `FromWorkflow`: filters orders by status.

 - `FromOrders`: uses JSONata expressions to filter orders according to any property in the orders JSON document.

 This enables stores to filter delivered orders and orders in which products have been added or removed, for example.

To learn more, access the [JSONata documentation](https://docs.jsonata.org/overview.html) and test filtering JSONata expressions with our [expressions API](https://developers.vtex.com/docs/api-reference/orders-api#post-/api/orders/expressions/jsonata).

## Headers

- `Content-Type` string, required
- `Accept` string, required

## Request body

- HookConfigurationRequest
  - `filter` HookFilter, required
    - `type` string, required — Determines what orders appear in the hook and how they are filtered. As shown in the examples above, there are two ways: - `FromWorkflow`: the hook will receive order updates only when there is a change or update in the [order status](https://help.vtex.com/en/tutorial/order-flow-and-status--tutorials_196). You must send at least one value for the `status` field to determine by which status the orders will be filtered. - `FromOrders`: the hook will receive order updates when there is a change in the order. In this case, orders can be filtered by any property, according to JSONata expressions passed in the `expression` field. You must send the request with values for the `expression` and `disableSingleFire` fields.
    - `status` string[] — List of order statuses that should be included in the hook. This should only be used in case `type` is `FromWorkflow`.
    - `expression` string — JSONata query expression that defines what conditions must be met for an order to be included in the hook. This should only be used in case `type` is `FromOrders`.
    - `disableSingleFire` boolean — Sets a limit to how many times a specific order shows on the hook, after it first meets filtering conditions. Using the `FromOrders` type configuration with JSONata filtering expressions might cause orders to appear more than once on a feed, whenever changes are made to that order. If this field is `false` orders will appear in the hook only once. Send this field if you want to filter `FromOrders`.
  - `hook` Hook, required
    - `url` string, required
    - `headers` Headers, required
      - `key` string, required

## Response `200`

OK

- HookConfiguration
  - `Domain` string, required
  - `OrderId` string, required
  - `State` string, required
  - `LastState` string, required
  - `LastChange` string, required
  - `CurrentChange` string, required
  - `Origin` Origin2, required
    - `Account` string, required
    - `Key` string, required

---

[API](https://skmtc.net/vtex/apis/orders-api.md) · [All operations](https://skmtc.net/vtex/apis/orders-api/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/vtex/orders-api/revisions/ea03e98721e5/schema)
