Product reviews
A product review is about one thing you sell, and it carries its own rating. Someone reading a product page sees what buyers of that product said, not an average across your whole catalogue.
Register the product
A product needs a slug — lowercase, hyphenated, stable. It is the name you will use everywhere afterwards, so pick something that will not change when the marketing copy does. Add it from your dashboard, or over the API:
curl -X POST https://trueavis.com/api/admin/products \
-H "Authorization: Bearer sk_your_secret_key" \
-H "Content-Type: application/json" \
-d '{
"slug": "birth-certificate-translation",
"name": "Birth certificate translation",
"url": "https://your-site.com/birth-certificate-translation"
}'Invite a buyer
Add productSlug to the invitation. The product must already exist — an unknown slug is refused with a 404 rather than quietly creating a review that belongs to nothing.
curl -X POST https://trueavis.com/api/admin/invitations \
-H "Authorization: Bearer sk_your_secret_key" \
-H "Content-Type: application/json" \
-d '{
"customerEmail": "[email protected]",
"orderRef": "ORDER-1042",
"productSlug": "birth-certificate-translation",
"baseUrl": "https://your-site.com"
}'The invitation decides the product, not the form
Show them on the product page
Point the widget at the same slug:
<div data-trueavis data-key="pk_your_public_key"
data-product="birth-certificate-translation"></div>
<script src="https://trueavis.com/trueavis.js" async></script>That shows the rating and reviews for this product alone. For a compact score next to a price or in a catalogue tile, add data-mode="badge".
How a product review is counted
| Where | Included? |
|---|---|
| That product’s own rating | Yes — this is its rating. |
The project rating (data-scope="site") | No. Site scope means the business itself. |
| The project rating (default, no scope) | Yes. The default merges everything. |
So one product review can appear in two numbers at once: its own, and the catch-all average. That is deliberate, but it means a shop with one popular product will see that product dominate the site-wide figure. If you would rather keep them apart, give your business-level widget data-scope="site" and let each product keep its own score.
An order with several products
Mint one invitation per product. Each is a separate link, each can be spent once, and each produces a review about the thing it was issued for. Re-sending the same combination of customer, order and product returns a 409 instead of a second link, so a retried job cannot inflate anyone’s rating.