Webhooks

Get notified when GAINS data changes: the webhook triggers, the DataType each sends, and the steps to set one up.

Webhooks let GAINS notify your systems when something happens, instead of you polling for it: GAINS Connect sends an HTTP POST to a URL you choose each time orders are submitted, inventory policies or forecasts change, or one of your inbound tasks changes status. This page lists the triggers and the steps to set one up; the pages below cover each step.

Triggers

A trigger is the kind of event a webhook reports. You enable triggers per webhook configuration, and each payload carries the records of one trigger only. The payload's DataType names the subject of those records, not the trigger: both forecast triggers send forecast.

TriggerSetting nameDataType
Submission of purchase ordersPOSubmitpurchase_order
Submission of transfer ordersTOSubmittransfer_order
Submission of work ordersWOSubmitwork_order
Submission of production ordersProductionOrderSubmitproduction_order
Changes to a SKU-location's inventory policyInventoryPolicyUpdateinventory_policy
Changes to a SKU-location's weekly forecastForecastWeeklyUpdateforecast
Changes to a SKU-location's monthly forecastForecastMonthlyUpdateforecast
Changes to the status of an inbound taskTaskStatusUpdatetask
  • The setting name is what you write in Triggers, in filters and in the Trigger parameters of the webhook endpoints. Webhook history reports triggers in underscored spelling, such as po_submit.
  • If you subscribe to both forecast triggers, tell their payloads apart by the length of their buckets, as Webhook Payload Samples describes.

Setting up a webhook

StepPage
Create a configuration: URL, authorization, triggers, batchingConfiguring Webhooks
Use OAuth 2.0 to authenticate deliveriesOAuth 2.0 Webhook Destinations
Send only the records you wantWebhook Filters
See what each trigger sendsWebhook Payload Samples
Build the endpoint that receives webhooksReceiving Webhooks
Follow deliveries, retries and resendsDelivery & Recovery

Payloads

Every delivery is a JSON body in which DataType names the subject and Data holds the records. Webhook Payload Samples shows the payload of each trigger and the conventions every payload follows.

Related


Did this page help you?