Extended Data - Outbound
Receive extended data with outbound reads and webhooks, and filter outbound reads by it.
Extended data adds attributes of your choosing to what GAINS sends you, alongside the standard fields: for example a planner's region, a cost centre, or the identifier a record carries in your ERP. The attributes can come from GAINS itself, or from data you loaded with inbound extended data.
Extended data is configured per GAINS instance. Your GAINS representative sets up which attributes each endpoint returns, and the API label each one is returned under. Until that is done, responses carry no ExtendedData.
Extended data is configured per outbound subject, and applies to every interface that delivers that subject: the GET endpoint and, where one exists, the matching webhook. For example, extended data configured for purchase orders appears both in GET /replenishment/purchase-orders and in the POSubmit webhook (DataType purchase_order).
To see what is configured for your instance, call GET /extended-data. Its Outbound section lists, for each configured payload, the ApiLabel of every attribute and whether it IsAvailableAsQueryParam, that is, whether it can be used as a filter.
Reading extended data
Each record that has extended data configured carries an ExtendedData object, holding one entry per attribute, keyed by its API label. On endpoints whose records are nested, it can be configured at each level. For example, an inventory policy can carry it for the item and for each of its locations:
{
"DataType": "inventory_policy",
"Data": [
{
"ItemCode": "ASM-7701",
"ItemDescription": "Hub assembly, front",
"Locations": [
{
"LocationCode": "CHI01",
"LocationName": "Chicago DC",
"InventoryPolicy": {
"AdjustedOrq": 120,
"MinimumOrq": 50,
"IncrementalOrq": 10,
"CalcOrq": 118,
"Rsq": 0,
"RsqOverride": 0,
"CalcSs": 34,
"AdjustedSs": 40,
"SsOverride": 0,
"ServiceLevel": 0.95,
"ServiceLevelMinimum": 0.9,
"InventoryClass": "A",
"StockIndicator": "S",
"LeadTime": 2.0,
"ForecastError": 0.18,
"AvgLTTotalDemand": 96
},
"ExtendedData": {
"Region": "Midwest",
"PlannerCode": null
}
}
],
"ExtendedData": {
"ItemWeightClass": "Heavy"
}
}
],
"Paging": {
"NextCursor": null,
"CurrentDataCount": 1
}
}What to expect in ExtendedData:
- Every record at a configured level carries it, with the same set of keys. An attribute with no value for that record is returned as
nullrather than left out. - A level with no extended data configured carries no
ExtendedDataat all. - Values keep their type in GAINS: text is returned as a string and a number as a number.
Supported endpoints
| Endpoint | Where ExtendedData can appear | Webhook |
|---|---|---|
GET /locations | Each location | None |
GET /inventory/policies | Item, and each of its Locations | InventoryPolicyUpdate |
GET /inventory/service-level | Item, and each of its Locations | None |
GET /demand-planning/forecast/weekly | Item, and each of its Locations | ForecastWeeklyUpdate |
GET /demand-planning/forecast/monthly | Item, and each of its Locations | ForecastMonthlyUpdate |
GET /demand-planning/forecast/monthly-aggregate | Item, and each of its Locations | None |
GET /demand-planning/demand-history | Each record | None |
GET /replenishment/purchase-orders | Order header, and each of its LineItems | POSubmit |
GET /replenishment/transfer-orders | Order header, and each of its LineItems | TOSubmit |
GET /replenishment/work-orders | Order header, and each of its LineItems | WOSubmit |
GET /replenishment/production-orders | Order header, and each of its LineItems | ProductionOrderSubmit |
GET /replenishment/requisitions | Each requisition | None |
See Trigger filters for using extended data in a webhook filter (ExtendedData.<ApiLabel>).
Filtering by extended data
An attribute your GAINS representative has made available as a filter can be passed as a query parameter named after its API label, on any of the endpoints above:
GET /api/v1/inventory/policies?Region=Midwest&InventoryClass=A- Matching is exact. The value is compared exactly and is case-sensitive:
Region=midwestdoes not matchMidwest. - Several filters combine with AND, with each other and with the endpoint's standard parameters.
- Only text attributes filter. A filter on a number or date attribute is ignored, without an error.
- A parameter that is not a filterable attribute is ignored, without an error. A misspelled label therefore returns unfiltered results, so check the label if a filter seems to have no effect.
Related
Updated about 11 hours ago
