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.

In the office

Where it starts: the office’s New item page.

Step 1. Fill the item wizard — the style, the product and the variant together — and review what will be created.

Step 2. Or build the family part by part when the wizard does not fit — the style first, then its product. Open Styles.

For developers — the calls

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

graphql
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:

json
{
  "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

json
{
  "data": {
    "createItem": {
      "style": {
        "id": "01900000-0000-7000-8000-5467ec760000",
        "sysId": "ST-EXMP-0000-000F",
        "type": "Style",
        "caption": "Blue jeans",
        "status": "active",
        "parentId": "01900000-0000-7000-8000-eacdfcfd0000",
        "rootId": "01900000-0000-7000-8000-a1295a650000",
        "createdAt": "2027-01-31T00:00:00.000Z",
        "updatedAt": "2027-01-31T00:00:00.000Z",
        "revisionNum": 0,
        "revision": "01900000-0000-7000-8000-53c6eea90000",
        "styleType": "simple",
        "brandId": "01900000-0000-7000-8000-6d1c7e960000",
        "sizeRunId": "01900000-0000-7000-8000-53fab2990000",
        "seasonIds": [
          "01900000-0000-7000-8000-14f06c780000"
        ],
        "tagIds": [
          "01900000-0000-7000-8000-f88354330000"
        ],
        "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

graphql
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:

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

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

Example response

json
{
  "data": {
    "createStyle": {
      "id": "01900000-0000-7000-8000-5467ec760000",
      "sysId": "ST-EXMP-0000-000F",
      "type": "Style",
      "caption": "Blue jeans",
      "status": "active",
      "parentId": "01900000-0000-7000-8000-eacdfcfd0000",
      "rootId": "01900000-0000-7000-8000-a1295a650000",
      "createdAt": "2027-01-31T00:00:00.000Z",
      "updatedAt": "2027-01-31T00:00:00.000Z",
      "revisionNum": 0,
      "revision": "01900000-0000-7000-8000-53c6eea90000",
      "styleType": "simple",
      "brandId": "01900000-0000-7000-8000-6d1c7e960000",
      "sizeRunId": "01900000-0000-7000-8000-53fab2990000",
      "seasonIds": [
        "01900000-0000-7000-8000-14f06c780000"
      ],
      "tagIds": [
        "01900000-0000-7000-8000-f88354330000"
      ],
      "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

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

Variables:

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

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

Example response

json
{
  "data": {
    "createProduct": {
      "id": "01900000-0000-7000-8000-529c60cc0000",
      "sysId": "PD-EXMP-0000-000F",
      "type": "Product",
      "caption": "Blue jeans",
      "status": "active",
      "parentId": "01900000-0000-7000-8000-5467ec760000",
      "rootId": "01900000-0000-7000-8000-a1295a650000",
      "createdAt": "2027-01-31T00:00:00.000Z",
      "updatedAt": "2027-01-31T00:00:00.000Z",
      "revisionNum": 0,
      "revision": "01900000-0000-7000-8000-53c6eea90000",
      "tagIds": [
        "01900000-0000-7000-8000-f88354330000"
      ],
      "code": "BJ-001"
    }
  },
  "extensions": {
    "at": {
      "callId": "01EXAMPLE-CALL-ID",
      "version": {
        "requested": {
          "name": "genesis",
          "number": 0
        },
        "serviced": {
          "name": "genesis",
          "number": 0
        }
      }
    }
  }
}