AlmondTill/G3N API

Sell items together as a kit

Declare a kit’s recipe — which components and how many go into the kit variant — then assemble kits from component stock, or break them back into parts, in one all-or-nothing movement each way.

Catalog · a play in 3 steps.

The steps

  1. Write the recipe line — the component and its quantity in the kit. — createVariantComponent
  2. Assemble kits — components go down, finished kits come up, value carries over exactly. — buildStock
  3. Break kits back into components when you need the parts. — breakStock

The calls

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

createVariantComponent

createVariantComponent — mutation · Create a new kit recipe line — which component (and how many) goes into a kit variant at your organization.

Example request

mutation ExampleCreateVariantComponent($input: NewVariantComponentInput!) {
  createVariantComponent(input: $input) {
    id
    sysId
    type
    caption
    status
    parentId
    rootId
    createdAt
    updatedAt
    revisionNum
    revision
    componentVariantId
    quantity
  }
}

Variables:

{
  "input": {
    "caption": "Blue jeans",
    "variantId": "01900000-0000-7000-8000-8415e73b0000",
    "componentVariantId": "01900000-0000-7000-8000-02c180840000"
  }
}

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

Example response

{
  "data": {
    "createVariantComponent": {
      "id": "01900000-0000-7000-8000-37386ae00000",
      "sysId": "VC-EXMP-0000-000F",
      "type": "VariantComponent",
      "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",
      "componentVariantId": "01900000-0000-7000-8000-02c180840000",
      "quantity": 1
    }
  },
  "extensions": {
    "at": {
      "callId": "01EXAMPLE-CALL-ID",
      "version": {
        "requested": {
          "name": "genesis",
          "number": 0
        },
        "serviced": {
          "name": "genesis",
          "number": 0
        }
      }
    }
  }
}

buildStock

buildStock — mutation · Assemble kits — consume component stock to produce finished kit stock, per the kit’s recipe.

Example request

mutation ExampleBuildStock($input: BuildStockInput!) {
  buildStock(input: $input) {
    kit {
      inventoryItem {
        id
        sysId
        type
        caption
        status
        parentId
        rootId
        createdAt
        updatedAt
        revisionNum
        revision
        logicalFacilityId
        styleType
        controlClass
        onHandQty
        reservedQty
        inTransitQty
        damagedQty
        heldQty
        onOrderQty
        availableQty
      }
    }
  }
}

Variables:

{
  "input": {
    "inventoryItemId": "01900000-0000-7000-8000-9307d9650000",
    "quantity": "2",
    "caption": "Blue jeans"
  }
}

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

Example response

{
  "data": {
    "buildStock": {
      "kit": {
        "inventoryItem": {
          "id": "01900000-0000-7000-8000-37386ae00000",
          "sysId": "IV-EXMP-0000-000F",
          "type": "InventoryItem",
          "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",
          "logicalFacilityId": "01900000-0000-7000-8000-8026f71c0000",
          "styleType": "<style type>",
          "controlClass": "<control class>",
          "onHandQty": "<on hand qty>",
          "reservedQty": "<reserved qty>",
          "inTransitQty": "<in transit qty>",
          "damagedQty": "<damaged qty>",
          "heldQty": "<held qty>",
          "onOrderQty": "<on order qty>",
          "availableQty": "<available qty>"
        }
      }
    }
  },
  "extensions": {
    "at": {
      "callId": "01EXAMPLE-CALL-ID",
      "version": {
        "requested": {
          "name": "genesis",
          "number": 0
        },
        "serviced": {
          "name": "genesis",
          "number": 0
        }
      }
    }
  }
}

breakStock

breakStock — mutation · Disassemble kits — break finished kits back into their component stock.

Example request

mutation ExampleBreakStock($input: BreakStockInput!) {
  breakStock(input: $input) {
    kit {
      inventoryItem {
        id
        sysId
        type
        caption
        status
        parentId
        rootId
        createdAt
        updatedAt
        revisionNum
        revision
        logicalFacilityId
        styleType
        controlClass
        onHandQty
        reservedQty
        inTransitQty
        damagedQty
        heldQty
        onOrderQty
        availableQty
      }
    }
  }
}

Variables:

{
  "input": {
    "inventoryItemId": "01900000-0000-7000-8000-9307d9650000",
    "quantity": "2",
    "caption": "Blue jeans"
  }
}

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

Example response

{
  "data": {
    "breakStock": {
      "kit": {
        "inventoryItem": {
          "id": "01900000-0000-7000-8000-37386ae00000",
          "sysId": "IV-EXMP-0000-000F",
          "type": "InventoryItem",
          "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",
          "logicalFacilityId": "01900000-0000-7000-8000-8026f71c0000",
          "styleType": "<style type>",
          "controlClass": "<control class>",
          "onHandQty": "<on hand qty>",
          "reservedQty": "<reserved qty>",
          "inTransitQty": "<in transit qty>",
          "damagedQty": "<damaged qty>",
          "heldQty": "<held qty>",
          "onOrderQty": "<on order qty>",
          "availableQty": "<available qty>"
        }
      }
    }
  },
  "extensions": {
    "at": {
      "callId": "01EXAMPLE-CALL-ID",
      "version": {
        "requested": {
          "name": "genesis",
          "number": 0
        },
        "serviced": {
          "name": "genesis",
          "number": 0
        }
      }
    }
  }
}