Queue Trustpilot review invitations for every Shopify order

By General Input

Every new order queues a Trustpilot review invitation timed to land about a week after checkout, and logs it to your tracking sheet.

Integrations

  • Trustpilot
  • Shopify
  • Google Sheets

Type

Deterministic Code

Categories

  • Marketing
  • Operations

Poll my Shopify store for order events. Each time a new order comes in, I want a Trustpilot review invitation queued automatically, so nobody on my team has to remember to ask for reviews.

Before anything else, filter the order out if it is cancelled, if it is fully refunded, or if it has no customer email address on it. Skip those orders silently and do not log them as invitations. From every remaining order, take the buyer's email address, their first name, and the order number.

Resolve my Trustpilot business unit once using Find Business Unit with my store's domain, then call List Invitation Templates to get the invitation email templates available to that business unit. Pick the template I have configured by name, falling back to the first available template if that name is not found. Do not create a new template.

Then call Send Email Invitations for that business unit. Pass the buyer's email address and first name as the recipient, pass the chosen template, and pass the order number as the reference id so every review that comes back ties to a real purchase. Set the preferred send time to roughly seven days after the order was placed, so the invitation lands after the parcel has arrived rather than at checkout.

After each invitation is queued, use Google Sheets Append Values to add a row to my tracking tab recording the order number, the customer email, the scheduled send date, and the template that was used.

Two implementation notes. The Trustpilot invitation endpoints live on a different host from the main API, https://invitations-api.trustpilot.com/v1, and they are private endpoints, so they need a bearer token minted through the client credentials exchange rather than the plain api key header. Also keep track of which order numbers have already been invited, so a re-polled order never produces a duplicate invitation. If Trustpilot rejects an individual invitation, log the failure and keep processing the remaining orders.

Related prompts

Explore more prompts
Call overdue Xero customers with an AI collections agentLocal listing health board for every location you manageLet support send one-off Loops emails without an engineerStop cold emails to anyone with a live deal in PipedriveiMessage campaign console with pre-flight checks and delivery boardLinkedIn Ads budget pacing dashboard for every client accountFront desk appointment confirmation board for the next 3 daysGive your team Looker numbers without buying more seatsBuild audience segments from product usage and push to LoopsTurn the people who engage with your posts into Pipedrive leads