Webhook Filters

Restrict a webhook trigger to the records you want with a filter expression.

A filter restricts a trigger to the records you want. It is a text expression on the trigger's Filter; a trigger with no filter sends every record.

{
  "InventoryPolicyUpdate": {
    "Enabled": true,
    "Filter": "InventoryClass IN ('A', 'B') AND ServiceLevel >= 0.95"
  },
  "TaskStatusUpdate": {
    "Enabled": true,
    "Filter": "TaskType = 'InboundDemandTrans' AND Status = 'Completed'"
  }
}

Writing a condition

A filter is one condition, or several joined by AND or OR. A condition is a field, an operator and a value: LocationCode = 'CHI01'.

OperatorMeaningField types
=EqualAll
!=Not equalAll
>, >=, <, <=Greater than, at least, less than, at mostNumbers, dates, text
INEqual to one of a listNumbers, text
NOT INEqual to none of a listNumbers, text
  • Write IN and NOT IN in capitals, with one space in NOT IN. AND and OR can be in any case, with a space on each side.
  • Use either AND or OR in a filter, not both. There are no parentheses for grouping. To express A AND (B OR C), use an IN list where you can: InventoryClass = 'A' AND LocationCode IN ('CHI01', 'DC-EAST').
  • Quote a value that contains a space, with single or double quotes: VendorName = 'Acme Supplies'. An unquoted value must be a single word. A value cannot contain the quote character that encloses it.
  • Write an IN list in parentheses, items separated by commas: ReceivingLocation IN ('CHI01', 'DC-EAST'). A comma inside a quoted item is part of the value.
  • Write numbers plain: 1500, not 1,500 or '1500 units'.
  • Write dates as YYYY-MM-DD and date-times as YYYY-MM-DDTHH:MM:SS, with the T: StatusUpdatedOn >= '2026-10-01T00:00:00'.
  • Text comparison is exact and case-sensitive. Status = 'completed' does not match Completed, and >/< on text compare alphabetically, character by character, so '10000' < '2000'.
  • A record with no value in the field never matches, whatever the operator, including != and NOT IN.
  • Each condition is limited to 1024 characters.

Fields you can filter on

A filter can use any field of the trigger's payload, at any level, by its PascalCase name and without a path: ItemCode, LocationCode and InventoryClass for an inventory policy, header and line item fields alike for an order (ReceivingLocation, BuyerCode). Webhook Payload Samples shows the fields of each payload. Write field names exactly as the samples show them, whatever FieldNamingConvention your destination uses.

To filter on extended data, write ExtendedData. followed by the attribute's API label, exactly as configured: ExtendedData.PlannerCode = 'PL-07'. GET /extended-data lists the labels for each payload, and Extended Data - Outbound explains them.

  • An extended data attribute is compared as the type of its value in GAINS: a number numerically, a date as a date, anything else as exact text.

Validation when you save

GAINS Connect checks every filter when you save the configuration and refuses one it could not apply, with a 400 naming the trigger and the problem: an unknown field, an operator the field's type does not take, a value that is not a valid number or date for the field, or a syntax error. For a misspelled extended data reference, the message suggests the correct spelling or lists the labels configured.

Filters are set per trigger in a webhook configuration; see Configuring Webhooks.


Did this page help you?