AlmondTill/G3N API

Price differently for a customer group

Name the customers who get special pricing, give them a price list, and put the prices on it — the till and the storefront pick the right price by who is buying.

Pricing & money · a play in 3 steps.

The steps

  1. Name the group of customers who get the special prices. — createCustomerPriceGroup
  2. Create the price list the group buys from. — createPriceList
  3. Put each variant’s price, in its currency, on the list. — createPriceListEntry

The calls

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

createCustomerPriceGroup

createCustomerPriceGroup — mutation · Create a new customer price group — named customers who get special pricing at your organization.

Example request

mutation ExampleCreateCustomerPriceGroup($input: NewCustomerPriceGroupInput!) {
  createCustomerPriceGroup(input: $input) {
    id
    sysId
    type
    caption
    status
    parentId
    rootId
    createdAt
    updatedAt
    revisionNum
    revision
    organizationIds
    priceListId
  }
}

Variables:

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

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

Example response

{
  "data": {
    "createCustomerPriceGroup": {
      "id": "01900000-0000-7000-8000-37386ae00000",
      "sysId": "PG-EXMP-0000-000F",
      "type": "CustomerPriceGroup",
      "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",
      "organizationIds": [
        "01900000-0000-7000-8000-60e064dc0000"
      ],
      "priceListId": "01900000-0000-7000-8000-7844e9fb0000"
    }
  },
  "extensions": {
    "at": {
      "callId": "01EXAMPLE-CALL-ID",
      "version": {
        "requested": {
          "name": "genesis",
          "number": 0
        },
        "serviced": {
          "name": "genesis",
          "number": 0
        }
      }
    }
  }
}

createPriceList

createPriceList — mutation · Create a new price list — a named set of prices at your organization.

Example request

mutation ExampleCreatePriceList($input: NewPriceListInput!) {
  createPriceList(input: $input) {
    id
    sysId
    type
    caption
    status
    parentId
    rootId
    createdAt
    updatedAt
    revisionNum
    revision
    organizationIds
    startAt
    endAt
    orgCustomerId
  }
}

Variables:

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

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

Example response

{
  "data": {
    "createPriceList": {
      "id": "01900000-0000-7000-8000-37386ae00000",
      "sysId": "PB-EXMP-0000-000F",
      "type": "PriceList",
      "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",
      "organizationIds": [
        "01900000-0000-7000-8000-60e064dc0000"
      ],
      "startAt": "2027-01-31T00:00:00.000Z",
      "endAt": "2027-01-31T00:00:00.000Z",
      "orgCustomerId": "01900000-0000-7000-8000-ba56ff800000"
    }
  },
  "extensions": {
    "at": {
      "callId": "01EXAMPLE-CALL-ID",
      "version": {
        "requested": {
          "name": "genesis",
          "number": 0
        },
        "serviced": {
          "name": "genesis",
          "number": 0
        }
      }
    }
  }
}

createPriceListEntry

createPriceListEntry — mutation · Create a new one price on a price list — a variant’s price in a currency at your organization.

Example request

mutation ExampleCreatePriceListEntry($input: NewPriceListEntryInput!) {
  createPriceListEntry(input: $input) {
    id
    sysId
    type
    caption
    status
    parentId
    rootId
    createdAt
    updatedAt
    revisionNum
    revision
    startAt
    endAt
  }
}

Variables:

{
  "input": {
    "caption": "Blue jeans",
    "priceListId": "01900000-0000-7000-8000-7844e9fb0000",
    "target": {
      "kind": "variant",
      "variantId": "01900000-0000-7000-8000-8415e73b0000"
    },
    "value": {
      "kind": "fixed",
      "price": {
        "currency": "USD",
        "amount": "10.00"
      }
    },
    "endAt": "2027-01-31T00:00:00.000Z"
  }
}

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

Example response

{
  "data": {
    "createPriceListEntry": {
      "id": "01900000-0000-7000-8000-37386ae00000",
      "sysId": "PE-EXMP-0000-000F",
      "type": "PriceListEntry",
      "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",
      "startAt": "2027-01-31T00:00:00.000Z",
      "endAt": "2027-01-31T00:00:00.000Z"
    }
  },
  "extensions": {
    "at": {
      "callId": "01EXAMPLE-CALL-ID",
      "version": {
        "requested": {
          "name": "genesis",
          "number": 0
        },
        "serviced": {
          "name": "genesis",
          "number": 0
        }
      }
    }
  }
}