Meet Toki Operator

Docs/Manage API

Shop catalogues

Merchant shops, products, variants and community channels with cursor pagination.

shops#

Lists the current merchant's shops, ordered by domain and ID.

Arguments

  • reverseBoolean

    Reverse the sort order.

  • ids[String!]

    Only these shop IDs; an empty list returns none.

  • searchString

    Text in the shop name or domain, ignoring case.

Returns

TokiMerchantShopConnection!

A page of TokiMerchantShop in nodes, with pageInfo for the next page. Each item:

A shop belonging to the current merchant.

  • idID!
  • nameString!

    Shop display name; use its domain when empty.

  • domainString!

    Shop domain.

query Shops($first: Int) {
  shops(first: $first) {
    nodes {
      id
      name
      domain
    }
    pageInfo {
      hasNextPage
      endCursor
    }
  }
}
Variables
{
  "first": 10
}
Response
{
  "data": {
    "shops": {
      "nodes": [
        {
          "id": "a223cf82-a323-4115-a023-cc5ca123cdef",
          "name": "Gold",
          "domain": "your-store.myshopify.com"
        }
      ],
      "pageInfo": {
        "hasNextPage": true,
        "endCursor": "Y3Vyc29yOjE5"
      }
    }
  }
}

communityChannels#

Lists top-level community channels, ordered by name and ID.

Arguments

  • reverseBoolean

    Reverse the sort order.

  • ids[String!]

    Only these channel IDs; an empty list returns none.

  • searchString

    Case-insensitive channel name search.

Returns

TokiCommunityChannelConnection!

A page of TokiCommunityChannel in nodes, with pageInfo for the next page. Each item:

A non-deleted top-level community channel owned by the current merchant.

  • idID!
  • nameString!

    Channel name.

query CommunityChannels($first: Int) {
  communityChannels(first: $first) {
    nodes {
      id
      name
    }
    pageInfo {
      hasNextPage
      endCursor
    }
  }
}
Variables
{
  "first": 10
}
Response
{
  "data": {
    "communityChannels": {
      "nodes": [
        {
          "id": "32e84272-33e8-4405-a0e8-3f4c31e840df",
          "name": "Gold"
        }
      ],
      "pageInfo": {
        "hasNextPage": true,
        "endCursor": "Y3Vyc29yOjE5"
      }
    }
  }
}

products#

Lists products from connected merchant shops with native source pagination. Search uses each platform's product search. Review previews use currentShopOnly.

Arguments

  • searchString

    Case-insensitive text to match against the record label.

  • ids[String!]

    Restrict results to these source IDs. An empty list returns none. Load selected records separately from search results.

  • currentShopOnlyBoolean

    Restrict products to the current shop, for review previews.

Returns

TokiCatalogProductConnection!

A page of TokiCatalogProductEdgeNode in nodes, with pageInfo for the next page. Each item:

A product or variant from one of the merchant's shops.

  • idString!

    Numeric product or variant ID in its source platform.

  • titleString!

    Product title in the source platform.

  • variantTitleString

    Shopify variant title, including Default Title; null for products and WooCommerce variant IDs without a title.

  • productIdString!

    Numeric product ID.

  • variantIdString!

    Numeric variant ID; for a product this is its first variant, or its own ID when none exists.

  • shopIdString!

    Owning Toki shop ID.

  • domainString!

    Owning shop domain, used for grouping.

query Products($first: Int) {
  products(first: $first) {
    nodes {
      id
      title
      variantTitle
      productId
    }
    pageInfo {
      hasNextPage
      endCursor
    }
  }
}
Variables
{
  "first": 10
}
Response
{
  "data": {
    "products": {
      "nodes": [
        {
          "id": "29f6e2dd-28f6-414a-a7f6-dfb726f6de24",
          "title": "Summer double points",
          "variantTitle": "Variant title",
          "productId": "86d5a49e-87d5-4631-a4d5-a17885d5a30b"
        }
      ],
      "pageInfo": {
        "hasNextPage": true,
        "endCursor": "Y3Vyc29yOjE5"
      }
    }
  }
}

productVariants#

Lists product variants across connected merchant shops. Cursors retain source positions, including variants beyond a product's first 250 variants.

Arguments

  • searchString

    Case-insensitive text to match against the record label.

  • ids[String!]

    Restrict results to these source IDs. An empty list returns none. Load selected records separately from search results.

  • currentShopOnlyBoolean

    Restrict products to the current shop, for review previews.

Returns

TokiCatalogProductConnection!

A page of TokiCatalogProductEdgeNode in nodes, with pageInfo for the next page. Each item:

A product or variant from one of the merchant's shops.

  • idString!

    Numeric product or variant ID in its source platform.

  • titleString!

    Product title in the source platform.

  • variantTitleString

    Shopify variant title, including Default Title; null for products and WooCommerce variant IDs without a title.

  • productIdString!

    Numeric product ID.

  • variantIdString!

    Numeric variant ID; for a product this is its first variant, or its own ID when none exists.

  • shopIdString!

    Owning Toki shop ID.

  • domainString!

    Owning shop domain, used for grouping.

query ProductVariants($first: Int) {
  productVariants(first: $first) {
    nodes {
      id
      title
      variantTitle
      productId
    }
    pageInfo {
      hasNextPage
      endCursor
    }
  }
}
Variables
{
  "first": 10
}
Response
{
  "data": {
    "productVariants": {
      "nodes": [
        {
          "id": "2526a0ae-2626-4241-a326-9d8824269f1b",
          "title": "Summer double points",
          "variantTitle": "Variant title",
          "productId": "4bafe69f-4aaf-450c-adaf-e9c54cafe832"
        }
      ],
      "pageInfo": {
        "hasNextPage": true,
        "endCursor": "Y3Vyc29yOjE5"
      }
    }
  }
}
query

reviewPreviewProductContext#

Returns product metadata used to evaluate conditional review form fields in the current Shopify shop.

Arguments

  • productIdString!Required

    Shopify product ID in the current shop.

Returns

TokiReviewPreviewProductContextPayload!

Product context for review form previews.

  • productIdString!

    Shopify product ID.

  • titleString

    Product title.

  • imageUrlString

    Product image URL, if available.

  • productTypeString

    Shopify product type.

  • tags[String!]

    Product tags.

  • collectionIds[String!]

    Collection IDs containing the product.

query ReviewPreviewProductContext($productId: String!) {
  reviewPreviewProductContext(productId: $productId) {
    productId
    title
    imageUrl
    productType
    tags
    collectionIds
  }
}
Variables
{
  "productId": "715a7427-705a-4294-a35a-774d725a75ba"
}
Response
{
  "data": {
    "reviewPreviewProductContext": {
      "productId": "715a7427-705a-4294-a35a-774d725a75ba",
      "title": "Summer double points",
      "imageUrl": "https://example.com/toki/webhooks",
      "productType": "Product type",
      "tags": [
        "Tags"
      ],
      "collectionIds": [
        "97cc7ee7-96cc-4d54-a9cc-820d98cc807a"
      ]
    }
  }
}