Configuring Webhooks
Create, update and delete webhook configurations: destination URL, authorization, triggers and delivery settings.
For the triggers themselves, see Webhooks.
A webhook configuration names a destination URL, how to authenticate to it, which triggers it reports, and how it batches and retries. Create one or more with POST /webhook/settings. The body is an array, and every element becomes a new configuration:
POST /api/v1/webhook/settings
Content-Type: application/json[
{
"Name": "ERP orders",
"Active": true,
"Authorization": {
"Basic": {
"Username": "gains-webhooks",
"Password": "Vq7#pL2m-Xr9"
}
},
"Url": "https://erp.example.com/gains/webhooks",
"PayloadMaxItems": 100,
"PayloadInterval": 60,
"Triggers": {
"POSubmit": {
"Enabled": true,
"Filter": "ReceivingLocation IN ('CHI01', 'DC-EAST')"
},
"TOSubmit": {
"Enabled": true
},
"TaskStatusUpdate": {
"Enabled": true,
"Filter": "Status IN ('Completed', 'Failed', 'RejectedFailedProcessing')"
}
},
"RetryHandling": {
"Attempts": 3,
"Gap": 10
},
"FieldNamingConvention": "PASCAL_CASE"
}
]The response returns each new configuration with the Id you use to change it later. Secrets are masked:
{
"Status": "success",
"Reason": "New webhook(s) configured. Any updates to a webhook configuration should use the PUT method.",
"TotalConfigurations": 1,
"NewConfigurations": [
{
"Id": 3,
"Name": "ERP orders",
"Active": true,
"Authorization": {
"Basic": {
"Username": "gains-webhooks",
"Password": "******"
}
},
"Url": "https://erp.example.com/gains/webhooks",
"PayloadMaxItems": 100,
"PayloadInterval": 60,
"Triggers": {
"POSubmit": {
"Enabled": true,
"Filter": "ReceivingLocation IN ('CHI01', 'DC-EAST')"
},
"TOSubmit": {
"Enabled": true,
"Filter": null
},
"TaskStatusUpdate": {
"Enabled": true,
"Filter": "Status IN ('Completed', 'Failed', 'RejectedFailedProcessing')"
}
},
"RetryHandling": {
"Attempts": 3,
"Gap": 10
},
"ConfigurationMode": "v2",
"PreferencesUpdated": "2026-10-21 09:42:17",
"FieldNamingConvention": "PASCAL_CASE"
}
]
}When a request enables InventoryPolicyUpdate, ForecastWeeklyUpdate or ForecastMonthlyUpdate for the first time, Reason adds that notifications for the trigger may take up to 15 minutes to begin.
Managing configurations
| Task | Endpoint |
|---|---|
List every configuration (204 when there is none) | GET /webhook/settings |
| Add configurations | POST /webhook/settings |
| Replace one configuration | PUT /webhook/settings/{ConfigurationId} |
| Change some settings of one configuration | PATCH /webhook/settings/{ConfigurationId} |
| Delete one configuration | DELETE /webhook/settings/{ConfigurationId} |
| See earlier versions of your configurations | GET /webhook/settings/history |
POST always adds configurations; it never changes an existing one.
PUTreplaces the whole configuration. A setting you leave out takes its default,Triggersleft out means no triggers, andAuthorizationleft out removes authorization. Send every secret again.PATCHchanges only what you send. Everything you omit keeps its stored value, secrets included, so you can change a URL or a trigger without resending credentials.TriggersandRetryHandlingare replaced as a whole when present, so send every trigger you want to keep.
{
"Active": false
}Settings
| Setting | Type | Rules | Default |
|---|---|---|---|
Name | string | Up to 255 characters. Your own label, so you can tell configurations apart. | none |
Active | boolean | true delivers payloads. An active configuration needs a Url and at least one enabled trigger. | false |
Url | string | The destination. Up to 2048 characters; see Destination URL below. | none |
Authorization | object | How GAINS Connect authenticates to your URL; see Authorization below. | none |
PayloadMaxItems | integer | The most records in one payload, 1 to 500. | 100 |
PayloadInterval | integer | Seconds to wait after a successful payload before sending the next, 0 to 3600. | 60 |
RetryHandling.Attempts | integer | Retries after a failed delivery, 0 to 5. | 0 |
RetryHandling.Gap | integer | Minutes between tries, 1 to 120. | 10 |
FieldNamingConvention | string | PASCAL_CASE (ItemCode) or CAMEL_CASE (itemCode) for the field names of the payloads you receive. | PASCAL_CASE |
Triggers | object | Keyed by setting name. Each entry has Enabled (boolean) and an optional Filter; see Webhook Filters. | none |
What PayloadMaxItems counts depends on the trigger: orders for the order triggers, SKU-locations for the inventory policy and forecast triggers, and task status changes for TaskStatusUpdate.
The read-only fields of a configuration are Id, ConfigurationMode and PreferencesUpdated, the time it was last changed.
Authorization
Authorization takes exactly one of four schemes, or {} for none.
| Scheme | What GAINS Connect sends | Required fields | Use it when |
|---|---|---|---|
Header | Value as the Authorization header, exactly as given | Value | Your endpoint accepts a fixed API key or a token that does not expire. |
Basic | HTTP Basic authentication built from the username and password | Username, Password | Your endpoint accepts HTTP Basic authentication. |
OAuth2ClientCredentials | A bearer token it obtains from your identity provider with a client ID and secret | TokenUrl, ClientId, ClientSecret | Your identity provider issues tokens to clients with a secret. |
OAuth2PrivateKeyJwt | A bearer token it obtains by signing a JWT client assertion with your private key | TokenUrl, ClientId, PrivateKey | Your identity provider authenticates clients by certificate instead of a secret. |
Header and Basic send the same credential with every delivery, so you rotate it yourself. The OAuth 2.0 schemes send a short-lived token that GAINS Connect renews before it expires. Both OAuth 2.0 schemes have further optional fields for identity providers that need them. OAuth 2.0 Webhook Destinations describes each field, how tokens are obtained and renewed, and gives examples for Microsoft Entra ID and Oracle NetSuite.
Secrets (Value, Password, ClientSecret, PrivateKey) are stored encrypted and never returned:
- A read shows each secret as
******. Sending******back is refused, so usePATCHand leave the secret out to keep it. - In a
PATCH, the same scheme member changes only the fields you send. Naming a different scheme replaces the old one and needs all of its required fields, and{}removes authorization. - A secret that reads
******(re-enter)can no longer be used. Deliveries for that configuration fail until you send the secret again withPATCH.
Destination URL
Use an https address that can be reached from the internet, and point Url at the final address: redirects are not followed. Put credentials in Authorization, never in the URL.
Multiple configurations
You can have several configurations, each with its own URL, authorization, triggers, filters and batching. Use them to send the same event to more than one system, or to split one trigger's records between destinations with filters. For example, two configurations that both enable InventoryPolicyUpdate, one with the filter LocationCode IN ('CHI01', 'DC-EAST') and the other with LocationCode NOT IN ('CHI01', 'DC-EAST'), divide the policy changes between two systems.
Configurations deliver independently: a destination that is down delays only its own payloads.
Updated about 9 hours ago
