AlmondTill/G3N API

Create an item — style, product and variant in one pass

One pass births the whole sellable family — the style, its product and the variant — reviewed before anything is created, so nothing is born half-made.

Catalog · a play in 2 steps.

The steps

  1. Fill the item wizard — the style, the product and the variant together — and review what will be created. — createItem
  2. Or build the family part by part when the wizard does not fit — the style first, then its product. — createStyle, createProduct

The calls

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

createItem

createItem — mutation · Create a new item — a full style/product/variant family at your organization.

Example request

mutation ExampleCreateItem($input: NewItemInput!) {
  createItem(input: $input) {
    style {
      id
      sysId
      type
      caption
      status
      parentId
      rootId
      createdAt
      updatedAt
      revisionNum
      revision
      styleType
      brandId
      sizeRunId
      seasonIds
      tagIds
      code
      taxCategory
    }
  }
}

Variables:

{
  "input": {
    "caption": "Blue jeans",
    "product": {
      "caption": "Blue jeans",
      "rrp": [
        {
          "currency": "USD",
          "amount": "10.00"
        }
      ]
    },
    "variant": {
      "caption": "Blue jeans"
    }
  }
}

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

Example response

{
  "data": {
    "createItem": {
      "style": {
        "id": "01900000-0000-7000-8000-37386ae00000",
        "sysId": "ST-EXMP-0000-000F",
        "type": "Style",
        "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",
        "styleType": "simple",
        "brandId": "01900000-0000-7000-8000-4067736b0000",
        "sizeRunId": "01900000-0000-7000-8000-d314eddc0000",
        "seasonIds": [
          "01900000-0000-7000-8000-92b52b220000"
        ],
        "tagIds": [
          "01900000-0000-7000-8000-decd62770000"
        ],
        "code": "BJ-001",
        "taxCategory": "standard"
      }
    }
  },
  "extensions": {
    "at": {
      "callId": "01EXAMPLE-CALL-ID",
      "version": {
        "requested": {
          "name": "genesis",
          "number": 0
        },
        "serviced": {
          "name": "genesis",
          "number": 0
        }
      }
    }
  }
}

createStyle

createStyle — mutation · Create a new style — the top of a product family at your organization.

Example request

mutation ExampleCreateStyle($input: NewStyleInput!) {
  createStyle(input: $input) {
    id
    sysId
    type
    caption
    status
    parentId
    rootId
    createdAt
    updatedAt
    revisionNum
    revision
    styleType
    brandId
    sizeRunId
    seasonIds
    tagIds
    code
    taxCategory
  }
}

Variables:

{
  "input": {
    "caption": "Blue jeans",
    "styleType": "simple"
  }
}

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

Example response

{
  "data": {
    "createStyle": {
      "id": "01900000-0000-7000-8000-37386ae00000",
      "sysId": "ST-EXMP-0000-000F",
      "type": "Style",
      "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",
      "styleType": "simple",
      "brandId": "01900000-0000-7000-8000-4067736b0000",
      "sizeRunId": "01900000-0000-7000-8000-d314eddc0000",
      "seasonIds": [
        "01900000-0000-7000-8000-92b52b220000"
      ],
      "tagIds": [
        "01900000-0000-7000-8000-decd62770000"
      ],
      "code": "BJ-001",
      "taxCategory": "standard"
    }
  },
  "extensions": {
    "at": {
      "callId": "01EXAMPLE-CALL-ID",
      "version": {
        "requested": {
          "name": "genesis",
          "number": 0
        },
        "serviced": {
          "name": "genesis",
          "number": 0
        }
      }
    }
  }
}

createProduct

createProduct — mutation · Create a new product — the sellable middle of a family at your organization.

Example request

mutation ExampleCreateProduct($input: NewProductInput!) {
  createProduct(input: $input) {
    id
    sysId
    type
    caption
    status
    parentId
    rootId
    createdAt
    updatedAt
    revisionNum
    revision
    tagIds
    code
  }
}

Variables:

{
  "input": {
    "caption": "Blue jeans",
    "styleId": "01900000-0000-7000-8000-2f797c8b0000",
    "rrp": [
      {
        "currency": "USD",
        "amount": "10.00"
      }
    ]
  }
}

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

Example response

{
  "data": {
    "createProduct": {
      "id": "01900000-0000-7000-8000-37386ae00000",
      "sysId": "PD-EXMP-0000-000F",
      "type": "Product",
      "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",
      "tagIds": [
        "01900000-0000-7000-8000-decd62770000"
      ],
      "code": "BJ-001"
    }
  },
  "extensions": {
    "at": {
      "callId": "01EXAMPLE-CALL-ID",
      "version": {
        "requested": {
          "name": "genesis",
          "number": 0
        },
        "serviced": {
          "name": "genesis",
          "number": 0
        }
      }
    }
  }
}