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 null rather than left out.
  • A level with no extended data configured carries no ExtendedData at all.
  • Values keep their type in GAINS: text is returned as a string and a number as a number.

Supported endpoints

EndpointWhere ExtendedData can appearWebhook
GET /locationsEach locationNone
GET /inventory/policiesItem, and each of its LocationsInventoryPolicyUpdate
GET /inventory/service-levelItem, and each of its LocationsNone
GET /demand-planning/forecast/weeklyItem, and each of its LocationsForecastWeeklyUpdate
GET /demand-planning/forecast/monthlyItem, and each of its LocationsForecastMonthlyUpdate
GET /demand-planning/forecast/monthly-aggregateItem, and each of its LocationsNone
GET /demand-planning/demand-historyEach recordNone
GET /replenishment/purchase-ordersOrder header, and each of its LineItemsPOSubmit
GET /replenishment/transfer-ordersOrder header, and each of its LineItemsTOSubmit
GET /replenishment/work-ordersOrder header, and each of its LineItemsWOSubmit
GET /replenishment/production-ordersOrder header, and each of its LineItemsProductionOrderSubmit
GET /replenishment/requisitionsEach requisitionNone

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=midwest does not match Midwest.
  • 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


Did this page help you?