AlmondTill/G3N API

Keep shelves replenished

Set how reorder suggestions are computed for a scope, read the maths per item, and see what to reorder — nothing is ordered until you raise the purchase orders.

Procurement · a play in 3 steps.

The steps

  1. Set how suggestions are computed for the scope. — createReplenishmentConfig
  2. Read the reorder maths per item — min/max, lead times, safety stock. — replenishmentParameters
  3. See what to reorder from your sales pace and stock levels. — replenishmentSuggestions

The calls

Every operation this use case runs, in the order it first appears, with the request and the response its reference page shows.

createReplenishmentConfig

createReplenishmentConfig — mutation · Create a new replenishment settings — how reorder suggestions are computed for a scope at your organization.

Example request

mutation ExampleCreateReplenishmentConfig($input: NewReplenishmentConfigInput!) {
  createReplenishmentConfig(input: $input) {
    id
    sysId
    type
    caption
    status
    parentId
    rootId
    createdAt
    updatedAt
    revisionNum
    revision
    organizationId
    logicalFacilityId
    categoryId
    styleId
    seasonId
    brandId
    replenishEnabled
    minUnits
    maxUnits
    daysOfSupplyTarget
    safetyStockUnits
    reorderMultipleUnits
    reviewCadenceDays
    abcClassOverride
    reserveFloorUnits
    transferableExcess
    allocationWeight
  }
}

Variables:

{
  "input": {
    "caption": "Blue jeans"
  }
}

Send it with the envelope naming the version: "extensions": {"at": {"version": {"name":"genesis","number":0}}}.

Example response

{
  "data": {
    "createReplenishmentConfig": {
      "id": "01900000-0000-7000-8000-37386ae00000",
      "sysId": "RP-EXMP-0000-000F",
      "type": "ReplenishmentConfig",
      "caption": "Blue jeans",
      "status": "active",
      "parentId": "01900000-0000-7000-8000-065235280000",
      "rootId": "01900000-0000-7000-8000-a093dd800000",
      "createdAt": "2027-01-31T00:00:00.000Z",
      "updatedAt": "2027-01-31T00:00:00.000Z",
      "revisionNum": 1,
      "revision": "01900000-0000-7000-8000-b7960e180000",
      "organizationId": "01900000-0000-7000-8000-44b781470000",
      "logicalFacilityId": "01900000-0000-7000-8000-8026f71c0000",
      "categoryId": "01900000-0000-7000-8000-786111a40000",
      "styleId": "01900000-0000-7000-8000-2f797c8b0000",
      "seasonId": "01900000-0000-7000-8000-45de25e50000",
      "brandId": "01900000-0000-7000-8000-4067736b0000",
      "replenishEnabled": true,
      "minUnits": "<min units>",
      "maxUnits": "<max units>",
      "daysOfSupplyTarget": 1,
      "safetyStockUnits": "<safety stock units>",
      "reorderMultipleUnits": "<reorder multiple units>",
      "reviewCadenceDays": 1,
      "abcClassOverride": "A",
      "reserveFloorUnits": "<reserve floor units>",
      "transferableExcess": true,
      "allocationWeight": 1
    }
  },
  "extensions": {
    "at": {
      "callId": "01EXAMPLE-CALL-ID",
      "version": {
        "requested": {
          "name": "genesis",
          "number": 0
        },
        "serviced": {
          "name": "genesis",
          "number": 0
        }
      }
    }
  }
}

replenishmentParameters

replenishmentParameters — query · The reorder maths per item — min/max, lead times, safety stock — that replenishment suggestions use.

Example request

query ExampleReplenishmentParameters($variantId: ID!, $logicalFacilityId: ID!) {
  replenishmentParameters(variantId: $variantId, logicalFacilityId: $logicalFacilityId) {
    variantId
    logicalFacilityId
    organizationId
    matchedConfigIds
  }
}

Variables:

{
  "variantId": "01900000-0000-7000-8000-8415e73b0000",
  "logicalFacilityId": "01900000-0000-7000-8000-8026f71c0000"
}

Example response

{
  "data": {
    "replenishmentParameters": {
      "variantId": "01900000-0000-7000-8000-8415e73b0000",
      "logicalFacilityId": "01900000-0000-7000-8000-8026f71c0000",
      "organizationId": "01900000-0000-7000-8000-44b781470000",
      "matchedConfigIds": [
        "01900000-0000-7000-8000-f68ff4590000"
      ]
    }
  },
  "extensions": {
    "at": {
      "callId": "01EXAMPLE-CALL-ID",
      "version": {
        "requested": null,
        "serviced": {
          "name": "genesis",
          "number": 0
        }
      }
    }
  }
}

replenishmentSuggestions

replenishmentSuggestions — query · What to reorder — suggested purchase quantities from your sales pace and stock levels.

Example request

query ExampleReplenishmentSuggestions($logicalFacilityId: ID) {
  replenishmentSuggestions(logicalFacilityId: $logicalFacilityId) {
    purchaseOrders {
      orgVendorId
      organizationId
      currency
      estimatedTotal
      orderMinimum
      orderMinimumShortfall
      annotations
    }
  }
}

Variables:

{
  "logicalFacilityId": "01900000-0000-7000-8000-8026f71c0000"
}

Example response

{
  "data": {
    "replenishmentSuggestions": {
      "purchaseOrders": [
        {
          "orgVendorId": "01900000-0000-7000-8000-f885fa720000",
          "organizationId": "01900000-0000-7000-8000-44b781470000",
          "currency": "USD",
          "estimatedTotal": "10.00",
          "orderMinimum": "<order minimum>",
          "orderMinimumShortfall": "<order minimum shortfall>",
          "annotations": [
            "<annotations>"
          ]
        }
      ]
    }
  },
  "extensions": {
    "at": {
      "callId": "01EXAMPLE-CALL-ID",
      "version": {
        "requested": null,
        "serviced": {
          "name": "genesis",
          "number": 0
        }
      }
    }
  }
}