Meet Toki Operator

Docs/Wallet SDK

Reviews

Show product reviews, ratings and review carousels, and let customers write, vote on and delete reviews.

Every review belongs to a review group, which has its own review form and rules; most stores have one group. Only approved reviews appear on your storefront, and products in a product group share their reviews. Product IDs are Shopify's numeric product IDs, such as {{ product.id }} in Liquid.

read

getReviewGroups#

tokiWallet.getReviewGroups()→ Promise<{ groups: ReviewGroup[] }>

Lists the review groups shown on your storefront, with the settings of their review forms.

Groups come in the order your reviews widget shows them as tabs. Use a group's reviewGroupId with the other review methods, and its settings.storefront to build your own review form: which fields to show, their labels, and your custom questions.

Returns

Promise<{ groups: ReviewGroup[] }>
  • groupsReviewGroup[]
    3 fields per item
    • reviewGroupIdstring
    • namestring

      The group's name. With more than one group, your reviews widget shows each as a tab.

    • settingsobject
      1 field
      • storefrontReviewFormSettings

        What the review form asks for, and how reviews show on your storefront.

        18 fields
        • allowRatingboolean

          Whether customers rate products from 1 to 5 stars. When it's on, ask for a rating and show stars.

        • allowProsConsboolean

          Whether customers can add pros and cons. When it's on, ask for them and show them.

        • allowMediaboolean

          Whether customers can add photos and videos to reviews. When it's on, show each review's media.

        • showIncentivizedReviewBadgeboolean

          Whether to mark reviews that earned a reward, see incentive.

        • submitButtonTextstring

          Text of the button that opens the review form, such as Write A Review.

        • modalTitlestring

          Title of the review form, such as Share your thoughts.

        • ratingLabelstring

          Label above the stars, such as Rate your experience.

        • headlineLabelstring

          Label of the headline field, such as Add a headline.

        • headlinePlaceholderstring

          Placeholder of the headline field.

        • bodyLabelstring

          Label of the review text field, such as Write a review.

        • bodyPlaceholderstring

          Placeholder of the review text field.

        • customQuestionsPosition"before" | "after"

          Whether your custom questions come before or after the rating, headline and review text.

        • formsReviewForm[]

          The review forms that hold your custom questions, in order.

          3 fields per item
          • idstring

            Answers refer to the form by this ID, as formId.

          • productConditionobject | null

            The products the form applies to; null for every product. Otherwise type: "product" with eight lists of strings: includedProductIds, includedProductTypes, includedProductTags, includedProductCollectionIds, and the same four starting with excluded. A product matches when it meets an included rule, or there are none, and no excluded rule. IDs are numeric or GIDs, and product types ignore case.

          • formobject

            The form's questions.

            2 fields
            • fieldsobject[]

              The questions and text blocks, in order. A question has an id, a type (single-choice, multiple-choice, written-answer, date-input or files-input), a label and required, and choice questions have options, each with an id and a label. visibleCondition shows a question only after certain answers or for certain products. Text blocks have type: "text".

            • style"single-form" | "carousel"

              single-form shows all questions at once, and carousel one at a time.

        • showCustomQuestionFiltersboolean

          Whether shoppers can filter reviews by answers to choice questions, see questionFilters.

        • showCustomQuestionAggregationsboolean

          Whether to show summarized answers, see customQuestionAggregations.

        • customQuestionAggregationsTitlestring

          Heading above the summarized answers, such as Rating Summary.

        • replyAuthorNamestring

          The name your replies are signed with. When it's empty, your reviews widget uses Brand representative.

        • replyAuthorAvatarUrlstring

          URL of the picture shown with your replies, or an empty string.

Example
const { groups } = await tokiWallet.getReviewGroups()
Result
{
  "groups": [
    {
      "reviewGroupId": "6f1c9a3e-2b4d-4c8e-9f7a-1d2e3f4a5b6c",
      "name": "Reviews",
      "settings": {
        "storefront": {
          "allowRating": true,
          "allowProsCons": true,
          "allowMedia": true,
          "showIncentivizedReviewBadge": true,
          "submitButtonText": "Write A Review",
          "modalTitle": "Share your thoughts",
          "ratingLabel": "Rate your experience",
          "headlineLabel": "Add a headline",
          "headlinePlaceholder": "Summarize your experience",
          "bodyLabel": "Write a review",
          "bodyPlaceholder": "Tell us what you like or dislike",
          "customQuestionsPosition": "after",
          "forms": [
            {
              "id": "2c7d9e1f-4a6b-4c8d-9e0f-1a2b3c4d5e6f",
              "productCondition": {
                "type": "product",
                "includedProductIds": [],
                "includedProductTypes": [
                  "Hoodies"
                ],
                "includedProductTags": [],
                "includedProductCollectionIds": [],
                "excludedProductIds": [],
                "excludedProductTypes": [],
                "excludedProductTags": [],
                "excludedProductCollectionIds": []
              },
              "form": {
                "fields": [
                  {
                    "id": "1043873301842",
                    "type": "single-choice",
                    "label": "How does it fit?",
                    "required": true,
                    "options": [
                      {
                        "id": "558120934770",
                        "label": "Runs small"
                      }
                    ]
                  }
                ],
                "style": "single-form"
              }
            }
          ],
          "showCustomQuestionFilters": true,
          "showCustomQuestionAggregations": true,
          "customQuestionAggregationsTitle": "Rating Summary",
          "replyAuthorName": "The Cloud Team",
          "replyAuthorAvatarUrl": ""
        }
      }
    }
  ]
}

getReviewGroupReviews#

tokiWallet.getReviewGroupReviews({ reviewGroupId, … })→ Promise<ReviewList>

Lists a review group's approved reviews, 5 per page, with search, filters and sorting.

Pass a productId for a product's reviews, including those of the products that share reviews with it through a product group; totalCount then tells you how many there are. Without it, you get the reviews of every product in the group. For the product's average rating, use getReviewGroupReviewsSummary.

With onlyMine: true, you get the signed-in customer's own reviews in the group instead, including those waiting for your approval. For a signed-in customer, viewerVote shows their vote on each review.

Options

one object
  • reviewGroupIdstringRequired

    The review group, from getReviewGroups.

  • productIdstring

    Only this product's reviews, as a numeric Shopify product ID such as {{ product.id }} in Liquid.

  • pagenumberdefault 1

    The page, from 1.

  • sort"most-recent" | "oldest" | "highest-rating" | "lowest-rating" | "with-media" | "verified-purchase"default "most-recent"

    with-media puts reviews with photos or videos first, and verified-purchase reviews by verified buyers, newest first after that.

  • ratingnumber

    Only reviews with this many stars, from 1 to 5.

  • searchstring

    Words to look for in the reviews, including the answers to your custom questions. Reviews with any of the words match. Use at least 3 characters.

  • withMediabooleandefault false

    true lists only reviews with photos or videos.

  • questionFilters{ formId: string; questionId: string; optionId: string }[]

    Only reviews with these answers to your custom questions; a review must match every filter. Each filter names a form, one of its choice questions and an option, by their ids in the group's settings.storefront.forms, with one filter per question. For groups with showCustomQuestionFilters on.

  • onlyMinebooleandefault false

    true lists the signed-in customer's own reviews.

Returns

Promise<ReviewList>
  • reviewsReview[]
    15 fields per item
    • reviewIdstring
    • reviewGroupIdstring
    • productIdstring

      The reviewed product's numeric Shopify product ID.

    • ratingnumber | null

      Stars from 1 to 5; null for a review without a rating.

    • contentReviewContent
      7 fields
      • headlinestring | nullOptional

        A short title.

      • bodystring

        The review text.

      • prosstring | nullOptional

        What the reviewer liked. Show pros and cons when the group's allowProsCons is on.

      • consstring | nullOptional

        What the reviewer didn't like.

      • locationstring | nullOptional

        The flag emoji of the reviewer's country, to show next to their name.

      • locationCodestring | nullOptional

        The reviewer's country code, such as US.

      • formsReviewFormAnswers[]

        Answers to your custom questions, one entry per review form.

        2 fields per item
        • formIdstring

          The form's id in the group's settings.storefront.forms.

        • answersReviewAnswer[]
          6 fields per item
          • idstring

            The question's id.

          • type"single-choice" | "multiple-choice" | "written-answer" | "date-input" | "files-input"
          • labelstring

            The question.

          • valuestring | string[]

            An option id for a single choice question, an array of option ids for multiple choice, an array of file URLs for a file question, otherwise the answer text.

          • displayValuestring

            The answer as shoppers see it, such as the chosen option's label or a date such as May 1, 2026.

          • scale{ type: "position" | "score"; options: { id: string; label: string }[] }Optional

            Scale questions only: show the answer as a marker along the scale (position) or as a score such as 4 out of 5 (score).

    • user{ name: string | null } | null

      Who wrote it: show user.name, such as Anna K., or Anonymous when there's no name.

    • verifiedboolean

      Whether the reviewer bought the product. Your storefront shows a Verified buyer badge.

    • status"pending" | "approved" | "rejected"

      Only approved reviews appear on your storefront.

    • createdAtstring

      When the review was written, as an ISO 8601 date-time.

    • votesSummary{ upvoteCount: number; downvoteCount: number }

      How many customers found the review helpful, and how many didn't.

    • repliesCountnumber

      How many replies the review has. getReviewDetails returns them.

    • mediaReviewMedia[]

      Photos and videos, in display order. Show them when the group's allowMedia is on.

      3 fields per item
      • type"image" | "video"
      • smallstring

        URL of a thumbnail, at most 128 pixels wide or high. For a video, the video's URL.

      • largestring

        URL of the full-size photo, or of the video.

    • incentiveobject | null

      The reward the reviewer earned for the review, or null. Mark these reviews as incentivized when the group's showIncentivizedReviewBadge is on.

      2 fields
      • incentiveType"loyalty_points" | "coupon" | "free_product" | "other"

        loyalty_points for points, coupon for a discount or free shipping, free_product for a free gift.

      • rewardTypestring

        The kind of reward, such as asset (points), discount, free-shipping or gift.

    • fieldsHighlights{ headline: string[]; body: string[]; pros: string[]; cons: string[] }Optional

      With a search: the search terms found in each field, in lowercase, to highlight them.

    • viewerVote"upvote" | "downvote" | null

      The signed-in customer's vote on the review; null when they haven't voted.

  • totalCountnumber | null

    How many reviews match, across all pages; null without a productId.

Example
const { reviews, totalCount } =
  await tokiWallet.getReviewGroupReviews({
    reviewGroupId: "6f1c9a3e-2b4d-4c8e-9f7a-1d2e3f4a5b6c",
    productId: "8123456789012",
    sort: "highest-rating",
  })
Result
{
  "reviews": [
    {
      "reviewId": "3d8e5f2a-7c1b-4e9d-8a6f-2b4c6d8e0f1a",
      "reviewGroupId": "6f1c9a3e-2b4d-4c8e-9f7a-1d2e3f4a5b6c",
      "productId": "8123456789012",
      "rating": 5,
      "content": {
        "headline": "Softest hoodie I own",
        "body": "Great fit, and it stays soft after a dozen washes.",
        "pros": "The fabric",
        "cons": null,
        "location": "🇺🇸",
        "locationCode": "US",
        "forms": [
          {
            "formId": "2c7d9e1f-4a6b-4c8d-9e0f-1a2b3c4d5e6f",
            "answers": [
              {
                "id": "1043873301842",
                "type": "single-choice",
                "label": "How does it fit?",
                "value": "558120934771",
                "displayValue": "True to size"
              }
            ]
          }
        ]
      },
      "user": {
        "name": "Anna K."
      },
      "verified": true,
      "status": "approved",
      "createdAt": "2026-09-18T14:22:31.000Z",
      "votesSummary": {
        "upvoteCount": 4,
        "downvoteCount": 0
      },
      "repliesCount": 1,
      "media": [
        {
          "type": "image",
          "small": "https://cdn.buildwithtoki.com/kq3…/5e7a1c3d.jpeg",
          "large": "https://cdn.buildwithtoki.com/Zt8…/5e7a1c3d.jpeg"
        }
      ],
      "incentive": {
        "incentiveType": "loyalty_points",
        "rewardType": "asset"
      },
      "viewerVote": null
    }
  ],
  "totalCount": 23
}
read

getReviewGroupReviewsSummary#

tokiWallet.getReviewGroupReviewsSummary({ reviewGroupId, productId, withMedia? })→ Promise<ReviewSummary>

Returns a product's review counts, average rating, rating breakdown and summarized custom question answers.

totalCount counts the product's approved reviews in this group, and reviewCountsByGroup in each group shown on your storefront, including the products that share reviews with it. averageRating and ratingAggregation cover the product's approved reviews in all those groups, like the rating at the top of your reviews widget. customQuestionAggregations is filled when the group shows summarized answers (showCustomQuestionAggregations).

Options

one object
  • reviewGroupIdstringRequired

    The review group, from getReviewGroups.

  • productIdstringRequired

    The numeric Shopify product ID, such as {{ product.id }} in Liquid.

  • withMediabooleandefault false

    true counts only reviews with photos or videos in totalCount, reviewCountsByGroup and customQuestionAggregations.

Returns

Promise<ReviewSummary>
  • totalCountnumber

    The product's approved reviews in this group.

  • averageRatingnumber | null

    The average stars, from 1 to 5; null until a review has a rating.

  • ratingAggregation{ rating: number; count: number }[]

    How many reviews have each rating, from 5 stars down to 1.

  • reviewCountsByGroupRecord<string, number>

    The product's approved reviews in each group shown on your storefront, by reviewGroupId, as your reviews widget shows them on its tabs.

  • customQuestionAggregationsReviewQuestionSummary[]

    Summarized answers to the choice questions asked for the product.

    10 fields per item
    • formIdstring
    • questionIdstring
    • labelstring

      The question.

    • type"value" | "score" | "position"

      How to show the result: an option's label (value), a score such as 3.8 out of 5 (score), or a marker along a scale (position).

    • responseCountnumber

      How many reviews answered the question.

    • options{ id: string; label: string; count: number }[]

      Each option with the number of reviews that chose it, in the question's order.

    • valuestringOptional

      With value: the most chosen option for a multiple choice question, or the option closest to the average answer for a single choice question.

    • averageScorenumberOptional

      With score: the average score, from 1 to maxScore, to one decimal place.

    • maxScorenumberOptional

      With score: the highest score, the number of options.

    • averagePositionnumberOptional

      With position: the average position, from 0 at the first option to 1 at the last.

Example
const summary =
  await tokiWallet.getReviewGroupReviewsSummary({
    reviewGroupId: "6f1c9a3e-2b4d-4c8e-9f7a-1d2e3f4a5b6c",
    productId: "8123456789012",
  })
Result
{
  "totalCount": 23,
  "averageRating": 4.608695652173913,
  "ratingAggregation": [
    {
      "rating": 5,
      "count": 16
    }
  ],
  "reviewCountsByGroup": {
    "6f1c9a3e-2b4d-4c8e-9f7a-1d2e3f4a5b6c": 23
  },
  "customQuestionAggregations": [
    {
      "formId": "2c7d9e1f-4a6b-4c8d-9e0f-1a2b3c4d5e6f",
      "questionId": "1043873301842",
      "label": "How does it fit?",
      "type": "value",
      "responseCount": 18,
      "options": [
        {
          "id": "558120934770",
          "label": "Runs small",
          "count": 3
        }
      ],
      "value": "True to size"
    }
  ]
}
read

getReviewDetails#

tokiWallet.getReviewDetails({ reviewGroupId, reviewId })→ Promise<ReviewDetails>

Returns a review with its replies.

Lists include each review's repliesCount; use this method to show the replies themselves.

Options

one object
  • reviewGroupIdstringRequired

    The review's group, from getReviewGroups.

  • reviewIdstringRequired

Returns

Promise<ReviewDetails>
  • reviewReview
    14 fields
    • reviewIdstring
    • reviewGroupIdstring
    • productIdstring

      The reviewed product's numeric Shopify product ID.

    • ratingnumber | null

      Stars from 1 to 5; null for a review without a rating.

    • contentReviewContent
      7 fields
      • headlinestring | nullOptional

        A short title.

      • bodystring

        The review text.

      • prosstring | nullOptional

        What the reviewer liked. Show pros and cons when the group's allowProsCons is on.

      • consstring | nullOptional

        What the reviewer didn't like.

      • locationstring | nullOptional

        The flag emoji of the reviewer's country, to show next to their name.

      • locationCodestring | nullOptional

        The reviewer's country code, such as US.

      • formsReviewFormAnswers[]

        Answers to your custom questions, one entry per review form.

        2 fields per item
        • formIdstring

          The form's id in the group's settings.storefront.forms.

        • answersReviewAnswer[]
          6 fields per item
          • idstring

            The question's id.

          • type"single-choice" | "multiple-choice" | "written-answer" | "date-input" | "files-input"
          • labelstring

            The question.

          • valuestring | string[]

            An option id for a single choice question, an array of option ids for multiple choice, an array of file URLs for a file question, otherwise the answer text.

          • displayValuestring

            The answer as shoppers see it, such as the chosen option's label or a date such as May 1, 2026.

          • scale{ type: "position" | "score"; options: { id: string; label: string }[] }Optional

            Scale questions only: show the answer as a marker along the scale (position) or as a score such as 4 out of 5 (score).

    • user{ name: string | null } | null

      Who wrote it: show user.name, such as Anna K., or Anonymous when there's no name.

    • verifiedboolean

      Whether the reviewer bought the product. Your storefront shows a Verified buyer badge.

    • status"pending" | "approved" | "rejected"

      Only approved reviews appear on your storefront.

    • createdAtstring

      When the review was written, as an ISO 8601 date-time.

    • votesSummary{ upvoteCount: number; downvoteCount: number }

      How many customers found the review helpful, and how many didn't.

    • repliesCountnumber

      How many replies the review has. getReviewDetails returns them.

    • mediaReviewMedia[]

      Photos and videos, in display order. Show them when the group's allowMedia is on.

      3 fields per item
      • type"image" | "video"
      • smallstring

        URL of a thumbnail, at most 128 pixels wide or high. For a video, the video's URL.

      • largestring

        URL of the full-size photo, or of the video.

    • incentiveobject | null

      The reward the reviewer earned for the review, or null. Mark these reviews as incentivized when the group's showIncentivizedReviewBadge is on.

      2 fields
      • incentiveType"loyalty_points" | "coupon" | "free_product" | "other"

        loyalty_points for points, coupon for a discount or free shipping, free_product for a free gift.

      • rewardTypestring

        The kind of reward, such as asset (points), discount, free-shipping or gift.

    • fieldsHighlights{ headline: string[]; body: string[]; pros: string[]; cons: string[] }Optional

      With a search: the search terms found in each field, in lowercase, to highlight them.

  • repliesReviewReply[]

    Your replies, oldest first. Your reviews widget signs them with the group's replyAuthorName, or Brand representative when it's empty.

    3 fields per item
    • reviewReplyIdstring
    • content{ body: string }

      The reply.

    • createdAtstring

      When you replied, as an ISO 8601 date-time.

Example
const { review, replies } =
  await tokiWallet.getReviewDetails({
    reviewGroupId: "6f1c9a3e-2b4d-4c8e-9f7a-1d2e3f4a5b6c",
    reviewId: "3d8e5f2a-7c1b-4e9d-8a6f-2b4c6d8e0f1a",
  })
Result
{
  "review": {
    "reviewId": "3d8e5f2a-7c1b-4e9d-8a6f-2b4c6d8e0f1a",
    "reviewGroupId": "6f1c9a3e-2b4d-4c8e-9f7a-1d2e3f4a5b6c",
    "productId": "8123456789012",
    "rating": 5,
    "content": {
      "headline": "Softest hoodie I own",
      "body": "Great fit, and it stays soft after a dozen washes.",
      "pros": "The fabric",
      "cons": null,
      "location": "🇺🇸",
      "locationCode": "US",
      "forms": [
        {
          "formId": "2c7d9e1f-4a6b-4c8d-9e0f-1a2b3c4d5e6f",
          "answers": [
            {
              "id": "1043873301842",
              "type": "single-choice",
              "label": "How does it fit?",
              "value": "558120934771",
              "displayValue": "True to size"
            }
          ]
        }
      ]
    },
    "user": {
      "name": "Anna K."
    },
    "verified": true,
    "status": "approved",
    "createdAt": "2026-09-18T14:22:31.000Z",
    "votesSummary": {
      "upvoteCount": 4,
      "downvoteCount": 0
    },
    "repliesCount": 1,
    "media": [
      {
        "type": "image",
        "small": "https://cdn.buildwithtoki.com/kq3…/5e7a1c3d.jpeg",
        "large": "https://cdn.buildwithtoki.com/Zt8…/5e7a1c3d.jpeg"
      }
    ],
    "incentive": {
      "incentiveType": "loyalty_points",
      "rewardType": "asset"
    }
  },
  "replies": [
    {
      "reviewReplyId": "a1b2c3d4-e5f6-4a7b-8c9d-0e1f2a3b4c5d",
      "content": {
        "body": "Thank you, Anna! Enjoy your hoodie."
      },
      "createdAt": "2026-09-19T09:05:12.000Z"
    }
  ]
}

getOtherProductReviews#

tokiWallet.getOtherProductReviews({ reviewGroupId, productId, page? })→ Promise<{ reviews: ProductReview[]; totalCount: number }>

Lists a review group's approved reviews of other products, 5 per page, each with its product.

Use it to fill a product page that has no reviews yet with reviews of your other products, newest first. For a signed-in customer, viewerVote shows their vote on each review.

Options

one object
  • reviewGroupIdstringRequired

    The review group, from getReviewGroups.

  • productIdstringRequired

    The product you're showing, as a numeric Shopify product ID. Its own reviews are left out.

  • pagenumberdefault 1

    The page, from 1.

Returns

Promise<{ reviews: ProductReview[]; totalCount: number }>
  • reviewsProductReview[]

    Reviews with the product they're about.

    16 fields per item
    • reviewIdstring
    • reviewGroupIdstring
    • productIdstring

      The reviewed product's numeric Shopify product ID.

    • ratingnumber | null

      Stars from 1 to 5; null for a review without a rating.

    • contentReviewContent
      7 fields
      • headlinestring | nullOptional

        A short title.

      • bodystring

        The review text.

      • prosstring | nullOptional

        What the reviewer liked. Show pros and cons when the group's allowProsCons is on.

      • consstring | nullOptional

        What the reviewer didn't like.

      • locationstring | nullOptional

        The flag emoji of the reviewer's country, to show next to their name.

      • locationCodestring | nullOptional

        The reviewer's country code, such as US.

      • formsReviewFormAnswers[]

        Answers to your custom questions, one entry per review form.

        2 fields per item
        • formIdstring

          The form's id in the group's settings.storefront.forms.

        • answersReviewAnswer[]
          6 fields per item
          • idstring

            The question's id.

          • type"single-choice" | "multiple-choice" | "written-answer" | "date-input" | "files-input"
          • labelstring

            The question.

          • valuestring | string[]

            An option id for a single choice question, an array of option ids for multiple choice, an array of file URLs for a file question, otherwise the answer text.

          • displayValuestring

            The answer as shoppers see it, such as the chosen option's label or a date such as May 1, 2026.

          • scale{ type: "position" | "score"; options: { id: string; label: string }[] }Optional

            Scale questions only: show the answer as a marker along the scale (position) or as a score such as 4 out of 5 (score).

    • user{ name: string | null } | null

      Who wrote it: show user.name, such as Anna K., or Anonymous when there's no name.

    • verifiedboolean

      Whether the reviewer bought the product. Your storefront shows a Verified buyer badge.

    • status"pending" | "approved" | "rejected"

      Only approved reviews appear on your storefront.

    • createdAtstring

      When the review was written, as an ISO 8601 date-time.

    • votesSummary{ upvoteCount: number; downvoteCount: number }

      How many customers found the review helpful, and how many didn't.

    • repliesCountnumber

      How many replies the review has. getReviewDetails returns them.

    • mediaReviewMedia[]

      Photos and videos, in display order. Show them when the group's allowMedia is on.

      3 fields per item
      • type"image" | "video"
      • smallstring

        URL of a thumbnail, at most 128 pixels wide or high. For a video, the video's URL.

      • largestring

        URL of the full-size photo, or of the video.

    • incentiveobject | null

      The reward the reviewer earned for the review, or null. Mark these reviews as incentivized when the group's showIncentivizedReviewBadge is on.

      2 fields
      • incentiveType"loyalty_points" | "coupon" | "free_product" | "other"

        loyalty_points for points, coupon for a discount or free shipping, free_product for a free gift.

      • rewardTypestring

        The kind of reward, such as asset (points), discount, free-shipping or gift.

    • fieldsHighlights{ headline: string[]; body: string[]; pros: string[]; cons: string[] }Optional

      With a search: the search terms found in each field, in lowercase, to highlight them.

    • viewerVote"upvote" | "downvote" | null

      The signed-in customer's vote on the review; null when they haven't voted.

    • productobject
      4 fields
      • productIdstring
      • titlestring
      • imageUrlstring | null
      • urlstring | null

        The product's page in your store.

  • totalCountnumber

    How many reviews there are, across all pages.

Example
const { reviews } =
  await tokiWallet.getOtherProductReviews({
    reviewGroupId: "6f1c9a3e-2b4d-4c8e-9f7a-1d2e3f4a5b6c",
    productId: "8123456789012",
  })
Result
{
  "reviews": [
    {
      "reviewId": "3d8e5f2a-7c1b-4e9d-8a6f-2b4c6d8e0f1a",
      "reviewGroupId": "6f1c9a3e-2b4d-4c8e-9f7a-1d2e3f4a5b6c",
      "productId": "8123456789099",
      "rating": 5,
      "content": {
        "headline": "Comfy all day",
        "body": "I wear these joggers to work and to the gym.",
        "location": "🇨🇦",
        "locationCode": "CA",
        "forms": []
      },
      "user": {
        "name": "Marco R."
      },
      "verified": true,
      "status": "approved",
      "createdAt": "2026-09-18T14:22:31.000Z",
      "votesSummary": {
        "upvoteCount": 4,
        "downvoteCount": 0
      },
      "repliesCount": 0,
      "media": [],
      "incentive": {
        "incentiveType": "loyalty_points",
        "rewardType": "asset"
      },
      "viewerVote": null,
      "product": {
        "productId": "8123456789099",
        "title": "Cloud Joggers",
        "imageUrl": "https://cdn.shopify.com/s/files/1/0612/3456/7890/files/cloud-joggers.jpg",
        "url": "https://example.com/products/cloud-joggers"
      }
    }
  ],
  "totalCount": 389
}
read

getReviewsCarousel#

tokiWallet.getReviewsCarousel({ … })→ Promise<ReviewCarousel>

Picks approved reviews from across your products for a carousel or testimonials section.

By default, you get the 6 newest approved reviews from every group shown on your storefront; the options narrow the choice, and a review must match all of them. totalCount and averageRating describe all approved reviews in the chosen groups, for a line such as 4.7 stars from 412 reviews.

Options

one object
  • reviewGroupIdsstring[]default []

    Only reviews in these groups. An empty list means every group shown on your storefront.

  • reviewIdsstring[]default []

    Only these reviews, up to 100. For reviews you imported, their ID on the platform they came from works too.

  • productIdsstring[]default []

    Only reviews of these products, up to 100, by Shopify product ID, numeric or as a GID.

  • productVendorstring

    Only reviews of products from this vendor.

  • productTagsstring[]default []

    Only reviews of products with any of these tags.

  • minimumRatingnumber

    Only reviews with at least this many stars, from 1 to 5.

  • withPhotosbooleandefault false

    true picks only reviews with photos.

  • limitnumberdefault 6

    How many reviews to pick, up to 30. With 0, you get only totalCount and averageRating.

  • randombooleandefault false

    true picks reviews in random order instead of newest first.

  • fillEmptybooleandefault false

    true picks from all reviews in the chosen groups when none match the other options.

Returns

Promise<ReviewCarousel>
  • totalCountnumber

    Approved reviews in the chosen groups.

  • averageRatingnumber | null

    Their average stars, from 1 to 5; null until a review has a rating.

  • reviewsCarouselReview[]
    9 fields per item
    • reviewIdstring
    • reviewGroupIdstring
    • createdAtstring

      When the review was written, as an ISO 8601 date-time.

    • ratingnumber | null

      Stars from 1 to 5.

    • headlinestring | null
    • bodystring

      The whole review text.

    • authorNamestring | null

      The reviewer's name as your storefront shows it, such as Anna K.; null for anonymous reviews.

    • photos{ small: string; large: string }[]

      The review's photos: small is a thumbnail URL and large the full-size photo.

    • productobject
      4 fields
      • productIdstring
      • titlestring | null
      • imageUrlstring | null
      • urlstring | null

        The product's page in your store.

Example
const { reviews } = await tokiWallet.getReviewsCarousel({
  minimumRating: 4,
  withPhotos: true,
  limit: 10,
})
Result
{
  "totalCount": 412,
  "averageRating": 4.711165048543689,
  "reviews": [
    {
      "reviewId": "3d8e5f2a-7c1b-4e9d-8a6f-2b4c6d8e0f1a",
      "reviewGroupId": "6f1c9a3e-2b4d-4c8e-9f7a-1d2e3f4a5b6c",
      "createdAt": "2026-09-18T14:22:31.000Z",
      "rating": 5,
      "headline": "Softest hoodie I own",
      "body": "Great fit, and it stays soft after a dozen washes.",
      "authorName": "Anna K.",
      "photos": [
        {
          "small": "https://cdn.buildwithtoki.com/kq3…/5e7a1c3d.jpeg",
          "large": "https://cdn.buildwithtoki.com/Zt8…/5e7a1c3d.jpeg"
        }
      ],
      "product": {
        "productId": "8123456789012",
        "title": "Cloud Hoodie",
        "imageUrl": "https://cdn.shopify.com/s/files/1/0612/3456/7890/files/cloud-hoodie.jpg",
        "url": "https://example.com/products/cloud-hoodie"
      }
    }
  ]
}

getCustomerReviewProducts#

tokiWallet.getCustomerReviewProducts({ reviewGroupId, mode? })→ Promise<{ products: CustomerReviewProduct[] }>

Lists the products the customer has reviewed in a group, and optionally those they can review next.

By default, you get each product the customer has reviewed in the group, with their review. With mode: "reviewed_and_reviewable", you also get the products from their orders in this store that they can review next. Products come most recently purchased first.

submitUrl and reviewUrl open Toki's review page, signed in as the customer, to write the review or edit it. Get them when you show them: they're valid for 2 hours.

Options

one object
  • reviewGroupIdstringRequired

    The review group, from getReviewGroups.

  • mode"reviewed" | "reviewed_and_reviewable"default "reviewed"

    reviewed_and_reviewable adds the products the customer can review next.

Returns

Promise<{ products: CustomerReviewProduct[] }>
  • productsCustomerReviewProduct[]
    6 fields per item
    • productIdstring

      The numeric Shopify product ID.

    • productTitlestring
    • productImageUrlstring | null
    • reviewobject | null

      The customer's review of the product; null for products to review next.

      5 fields
      • reviewIdstring
      • ratingnumber | null
      • status"pending" | "approved"

        pending while the review waits for your approval.

      • contentReviewContent
        7 fields
        • headlinestring | nullOptional

          A short title.

        • bodystring

          The review text.

        • prosstring | nullOptional

          What the reviewer liked. Show pros and cons when the group's allowProsCons is on.

        • consstring | nullOptional

          What the reviewer didn't like.

        • locationstring | nullOptional

          The flag emoji of the reviewer's country, to show next to their name.

        • locationCodestring | nullOptional

          The reviewer's country code, such as US.

        • formsReviewFormAnswers[]

          Answers to your custom questions, one entry per review form.

          2 fields per item
          • formIdstring

            The form's id in the group's settings.storefront.forms.

          • answersReviewAnswer[]
            6 fields per item
            • idstring

              The question's id.

            • type"single-choice" | "multiple-choice" | "written-answer" | "date-input" | "files-input"
            • labelstring

              The question.

            • valuestring | string[]

              An option id for a single choice question, an array of option ids for multiple choice, an array of file URLs for a file question, otherwise the answer text.

            • displayValuestring

              The answer as shoppers see it, such as the chosen option's label or a date such as May 1, 2026.

            • scale{ type: "position" | "score"; options: { id: string; label: string }[] }Optional

              Scale questions only: show the answer as a marker along the scale (position) or as a score such as 4 out of 5 (score).

      • createdAtstring

        ISO 8601 date-time.

    • reviewUrlstring | null

      A link to edit the review on Toki's review page; null for products to review next.

    • submitUrlstring | null

      A link to review the product on Toki's review page; null for reviewed products.

Example
const { products } =
  await tokiWallet.getCustomerReviewProducts({
    reviewGroupId: "6f1c9a3e-2b4d-4c8e-9f7a-1d2e3f4a5b6c",
    mode: "reviewed_and_reviewable",
  })
Result
{
  "products": [
    {
      "productId": "8123456789012",
      "productTitle": "Cloud Hoodie",
      "productImageUrl": "https://cdn.shopify.com/s/files/1/0612/3456/7890/files/cloud-hoodie.jpg",
      "review": null,
      "reviewUrl": null,
      "submitUrl": "https://api.buildwithtoki.com/…"
    }
  ]
}

createReview#

tokiWallet.createReview({ reviewGroupId, productId, content, … })→ Promise<ReviewDetails>

Submits the customer's review of a product, or updates the review they already wrote.

The group's moderation rule sets the status: pending until you approve the review, or approved right away when the group approves reviews automatically by rating. When the customer has ordered the product, Toki links the review to their latest order of it, so it shows as verified. A new review sends a Toki Review Created event to your connected integrations, and an approved one counts toward the Reviews rewards in your program.

Each customer has one review per product in a group: when they already have a pending or approved review, it's updated with the new rating and content, and keeps its status.

It rejects with Review forms do not match this product when content.forms doesn't answer the forms that apply to the product, and with You are not eligible to submit a review for this product. when the group's rules don't allow the review.

Options

one object
  • reviewGroupIdstringRequired

    The review group, from getReviewGroups.

  • productIdstringRequired

    The numeric Shopify product ID, such as {{ product.id }} in Liquid.

  • ratingnumber

    Stars, a whole number from 1 to 5. Ask for a rating when the group's allowRating is on.

  • contentReviewContentInputRequired

    What the customer wrote.

    5 fields
    • headlinestring

      A short title, up to 100 characters.

    • bodystringRequired

      The review, up to 5,000 characters.

    • prosstring

      What the customer liked, up to 100 characters.

    • consstring

      What they didn't like, up to 100 characters.

    • formsReviewFormAnswers[]default []

      Answers to your custom questions: one entry for each of the group's forms that applies to the product, in the order of settings.storefront.forms.

      2 fields per item
      • formIdstringRequired

        The form's id.

      • answersReviewAnswerInput[]Required

        One per answered question. Answer every required question shown to the customer.

        5 fields per item
        • idstringRequired

          The question's id.

        • type"single-choice" | "multiple-choice" | "written-answer" | "date-input"Required

          The question's type.

        • valuestring | string[]Required

          An option id for a single choice question, an array of option ids for multiple choice, an ISO 8601 date such as 2026-05-01 for a date, otherwise the answer text.

        • labelstringRequired

          The question's label.

        • displayValuestringRequired

          The answer as shoppers see it, such as the chosen option's label.

  • authorNamestring

    The name to show with the review; your storefront shows the first name and last initial, such as Anna K. Without it, the review shows the customer's first name.

  • isAnonymousbooleandefault false

    true shows the review as Anonymous.

Returns

Promise<ReviewDetails>

The saved review.

  • reviewReview
    15 fields
    • reviewIdstring
    • reviewGroupIdstring
    • productIdstring

      The reviewed product's numeric Shopify product ID.

    • ratingnumber | null

      Stars from 1 to 5; null for a review without a rating.

    • contentReviewContent
      7 fields
      • headlinestring | nullOptional

        A short title.

      • bodystring

        The review text.

      • prosstring | nullOptional

        What the reviewer liked. Show pros and cons when the group's allowProsCons is on.

      • consstring | nullOptional

        What the reviewer didn't like.

      • locationstring | nullOptional

        The flag emoji of the reviewer's country, to show next to their name.

      • locationCodestring | nullOptional

        The reviewer's country code, such as US.

      • formsReviewFormAnswers[]

        Answers to your custom questions, one entry per review form.

        2 fields per item
        • formIdstring

          The form's id in the group's settings.storefront.forms.

        • answersReviewAnswer[]
          6 fields per item
          • idstring

            The question's id.

          • type"single-choice" | "multiple-choice" | "written-answer" | "date-input" | "files-input"
          • labelstring

            The question.

          • valuestring | string[]

            An option id for a single choice question, an array of option ids for multiple choice, an array of file URLs for a file question, otherwise the answer text.

          • displayValuestring

            The answer as shoppers see it, such as the chosen option's label or a date such as May 1, 2026.

          • scale{ type: "position" | "score"; options: { id: string; label: string }[] }Optional

            Scale questions only: show the answer as a marker along the scale (position) or as a score such as 4 out of 5 (score).

    • user{ name: string | null } | null

      Who wrote it: show user.name, such as Anna K., or Anonymous when there's no name.

    • verifiedboolean

      Whether the reviewer bought the product. Your storefront shows a Verified buyer badge.

    • status"pending" | "approved" | "rejected"

      Only approved reviews appear on your storefront.

    • createdAtstring

      When the review was written, as an ISO 8601 date-time.

    • votesSummary{ upvoteCount: number; downvoteCount: number }

      How many customers found the review helpful, and how many didn't.

    • repliesCountnumber

      How many replies the review has. getReviewDetails returns them.

    • mediaReviewMedia[]

      Photos and videos, in display order. Show them when the group's allowMedia is on.

      3 fields per item
      • type"image" | "video"
      • smallstring

        URL of a thumbnail, at most 128 pixels wide or high. For a video, the video's URL.

      • largestring

        URL of the full-size photo, or of the video.

    • incentiveobject | null

      The reward the reviewer earned for the review, or null. Mark these reviews as incentivized when the group's showIncentivizedReviewBadge is on.

      2 fields
      • incentiveType"loyalty_points" | "coupon" | "free_product" | "other"

        loyalty_points for points, coupon for a discount or free shipping, free_product for a free gift.

      • rewardTypestring

        The kind of reward, such as asset (points), discount, free-shipping or gift.

    • fieldsHighlights{ headline: string[]; body: string[]; pros: string[]; cons: string[] }Optional

      With a search: the search terms found in each field, in lowercase, to highlight them.

    • viewerVote"upvote" | "downvote" | null

      The signed-in customer's vote on the review; null when they haven't voted.

  • repliesReviewReply[]

    Your replies, oldest first. Your reviews widget signs them with the group's replyAuthorName, or Brand representative when it's empty.

    3 fields per item
    • reviewReplyIdstring
    • content{ body: string }

      The reply.

    • createdAtstring

      When you replied, as an ISO 8601 date-time.

Example
const { review } = await tokiWallet.createReview({
  reviewGroupId: "6f1c9a3e-2b4d-4c8e-9f7a-1d2e3f4a5b6c",
  productId: "8123456789077",
  rating: 5,
  content: {
    headline: "Warm and soft",
    body: "Thick enough for winter hikes.",
  },
})
Result
{
  "review": {
    "reviewId": "7a9c1e3b-5d7f-4b2a-8c4e-6f8a0b2c4d6e",
    "reviewGroupId": "6f1c9a3e-2b4d-4c8e-9f7a-1d2e3f4a5b6c",
    "productId": "8123456789077",
    "rating": 5,
    "content": {
      "headline": "Warm and soft",
      "body": "Thick enough for winter hikes.",
      "location": "🇺🇸",
      "locationCode": "US",
      "forms": []
    },
    "user": {
      "name": "Anna K."
    },
    "verified": true,
    "status": "pending",
    "createdAt": "2026-10-02T18:40:07.000Z",
    "votesSummary": {
      "upvoteCount": 0,
      "downvoteCount": 0
    },
    "repliesCount": 0,
    "media": [],
    "incentive": null,
    "viewerVote": null
  },
  "replies": []
}

voteReview#

tokiWallet.voteReview({ reviewGroupId, reviewId, voteType })→ Promise<ReviewDetails>

Records the customer's vote on whether a review is helpful.

Each customer has one vote per review: voting the same way again takes it back, and voting the other way changes it. The resolved review's viewerVote and votesSummary show the result.

Options

one object
  • reviewGroupIdstringRequired

    The review's group, from getReviewGroups.

  • reviewIdstringRequired
  • voteType"upvote" | "downvote"Required

    upvote when the customer found the review helpful, downvote when they didn't.

Returns

Promise<ReviewDetails>

The review with the customer's vote.

  • reviewReview
    15 fields
    • reviewIdstring
    • reviewGroupIdstring
    • productIdstring

      The reviewed product's numeric Shopify product ID.

    • ratingnumber | null

      Stars from 1 to 5; null for a review without a rating.

    • contentReviewContent
      7 fields
      • headlinestring | nullOptional

        A short title.

      • bodystring

        The review text.

      • prosstring | nullOptional

        What the reviewer liked. Show pros and cons when the group's allowProsCons is on.

      • consstring | nullOptional

        What the reviewer didn't like.

      • locationstring | nullOptional

        The flag emoji of the reviewer's country, to show next to their name.

      • locationCodestring | nullOptional

        The reviewer's country code, such as US.

      • formsReviewFormAnswers[]

        Answers to your custom questions, one entry per review form.

        2 fields per item
        • formIdstring

          The form's id in the group's settings.storefront.forms.

        • answersReviewAnswer[]
          6 fields per item
          • idstring

            The question's id.

          • type"single-choice" | "multiple-choice" | "written-answer" | "date-input" | "files-input"
          • labelstring

            The question.

          • valuestring | string[]

            An option id for a single choice question, an array of option ids for multiple choice, an array of file URLs for a file question, otherwise the answer text.

          • displayValuestring

            The answer as shoppers see it, such as the chosen option's label or a date such as May 1, 2026.

          • scale{ type: "position" | "score"; options: { id: string; label: string }[] }Optional

            Scale questions only: show the answer as a marker along the scale (position) or as a score such as 4 out of 5 (score).

    • user{ name: string | null } | null

      Who wrote it: show user.name, such as Anna K., or Anonymous when there's no name.

    • verifiedboolean

      Whether the reviewer bought the product. Your storefront shows a Verified buyer badge.

    • status"pending" | "approved" | "rejected"

      Only approved reviews appear on your storefront.

    • createdAtstring

      When the review was written, as an ISO 8601 date-time.

    • votesSummary{ upvoteCount: number; downvoteCount: number }

      How many customers found the review helpful, and how many didn't.

    • repliesCountnumber

      How many replies the review has. getReviewDetails returns them.

    • mediaReviewMedia[]

      Photos and videos, in display order. Show them when the group's allowMedia is on.

      3 fields per item
      • type"image" | "video"
      • smallstring

        URL of a thumbnail, at most 128 pixels wide or high. For a video, the video's URL.

      • largestring

        URL of the full-size photo, or of the video.

    • incentiveobject | null

      The reward the reviewer earned for the review, or null. Mark these reviews as incentivized when the group's showIncentivizedReviewBadge is on.

      2 fields
      • incentiveType"loyalty_points" | "coupon" | "free_product" | "other"

        loyalty_points for points, coupon for a discount or free shipping, free_product for a free gift.

      • rewardTypestring

        The kind of reward, such as asset (points), discount, free-shipping or gift.

    • fieldsHighlights{ headline: string[]; body: string[]; pros: string[]; cons: string[] }Optional

      With a search: the search terms found in each field, in lowercase, to highlight them.

    • viewerVote"upvote" | "downvote" | null

      The signed-in customer's vote on the review; null when they haven't voted.

  • repliesReviewReply[]

    Your replies, oldest first. Your reviews widget signs them with the group's replyAuthorName, or Brand representative when it's empty.

    3 fields per item
    • reviewReplyIdstring
    • content{ body: string }

      The reply.

    • createdAtstring

      When you replied, as an ISO 8601 date-time.

Example
const { review } = await tokiWallet.voteReview({
  reviewGroupId: "6f1c9a3e-2b4d-4c8e-9f7a-1d2e3f4a5b6c",
  reviewId: "3d8e5f2a-7c1b-4e9d-8a6f-2b4c6d8e0f1a",
  voteType: "upvote",
})
Result
{
  "review": {
    "reviewId": "3d8e5f2a-7c1b-4e9d-8a6f-2b4c6d8e0f1a",
    "reviewGroupId": "6f1c9a3e-2b4d-4c8e-9f7a-1d2e3f4a5b6c",
    "productId": "8123456789012",
    "rating": 5,
    "content": {
      "headline": "Softest hoodie I own",
      "body": "Great fit, and it stays soft after a dozen washes.",
      "pros": "The fabric",
      "cons": null,
      "location": "🇺🇸",
      "locationCode": "US",
      "forms": [
        {
          "formId": "2c7d9e1f-4a6b-4c8d-9e0f-1a2b3c4d5e6f",
          "answers": [
            {
              "id": "1043873301842",
              "type": "single-choice",
              "label": "How does it fit?",
              "value": "558120934771",
              "displayValue": "True to size"
            }
          ]
        }
      ]
    },
    "user": {
      "name": "Anna K."
    },
    "verified": true,
    "status": "approved",
    "createdAt": "2026-09-18T14:22:31.000Z",
    "votesSummary": {
      "upvoteCount": 5,
      "downvoteCount": 0
    },
    "repliesCount": 1,
    "media": [
      {
        "type": "image",
        "small": "https://cdn.buildwithtoki.com/kq3…/5e7a1c3d.jpeg",
        "large": "https://cdn.buildwithtoki.com/Zt8…/5e7a1c3d.jpeg"
      }
    ],
    "incentive": {
      "incentiveType": "loyalty_points",
      "rewardType": "asset"
    },
    "viewerVote": "upvote"
  },
  "replies": [
    {
      "reviewReplyId": "a1b2c3d4-e5f6-4a7b-8c9d-0e1f2a3b4c5d",
      "content": {
        "body": "Thank you, Anna! Enjoy your hoodie."
      },
      "createdAt": "2026-09-19T09:05:12.000Z"
    }
  ]
}

deleteReview#

tokiWallet.deleteReview({ reviewGroupId, reviewId })→ Promise<void>

Deletes one of the customer's reviews.

The review leaves your storefront, and the customer can review the product again.

Options

one object
  • reviewGroupIdstringRequired

    The review's group, from getReviewGroups.

  • reviewIdstringRequired

Returns

Promise<void>

Nothing, once it's done.

Example
await tokiWallet.deleteReview({
  reviewGroupId: "6f1c9a3e-2b4d-4c8e-9f7a-1d2e3f4a5b6c",
  reviewId: "3d8e5f2a-7c1b-4e9d-8a6f-2b4c6d8e0f1a",
})