Toki.

Docs/Merchants/Integrations & API

Postscript

Postscript is an SMS marketing tool for Shopify stores. Once connected, every Toki event for a customer lands on their Postscript subscriber record as a custom event, together with their up-to-date loyalty properties, so you can start Postscript automations and build segments on loyalty data. The same connection powers the Postscript: SMS sign up reward, which pays customers for texting a keyword to your Postscript number, and adds ready-made discount links to subscribers that turn points into a discount with one tap.

What you need from Postscript

Toki asks for one key and, optionally, one email address.

Field in TokiWhat it isWhere to find it
API KeyYour shop's Private API Key in Postscript. It lets Toki read and update your subscribers and create events, so treat it like a password.In Postscript, open your account settings and go to the API section. Copy the private key, not the public key.
Email (optional)An email address that belongs to one of your Postscript subscribers. Toki uses it to send one sample of every Toki event right after you connect, so the events already exist in Postscript when you build your first automation.Use a test subscriber whose email you know, such as your own, rather than a real customer.

Access the key needs

Toki uses the key to find your subscribers by email address or phone number, update their subscriber properties, create custom events, and read your account's webhook settings.

Connect Postscript

  1. In the Toki app, open Integrations.
  2. On the Postscript row, click Install.
  3. On the Install Postscript page, paste your API Key.
  4. Optionally, enter the Email of a test subscriber.
  5. Click Save in the bar at the top of the page.

Toki checks the key with Postscript as you save. If Postscript does not accept it, the message appears on the page and the connection is not completed until you fix it. The same goes for the Email: it has to match a subscriber in your Postscript account.

When you enter an Email, Toki sends one sample of every Toki event for that subscriber, with sample values. If the address is not a member of your program yet, Toki adds it as a member so the samples have someone to belong to; an address that is new to Toki gets the name "Test User". Once the samples have arrived in Postscript, you can delete that member like any other; see Member profile. The sample values are also written to that subscriber's Toki properties in Postscript, which is why a test subscriber is the better choice. You can add the Email later on the Manage Postscript page and save to send the samples then.

The install, manage, and uninstall flow is the same for every integration; see Integrations and your API key.

Change or disconnect

To replace the key, click Manage on the Postscript row, paste the new key into API Key on the Manage Postscript page, and click Save. Toki checks the new key the same way.

To disconnect, click Uninstall on the row and confirm. Toki deletes the key it stored and stops sending events. Nothing changes in your Postscript account: the events and subscriber properties already sent stay there, and discount links Toki has already written to subscribers keep working.

What Toki sends to Postscript

Each time something happens to a customer in Toki, such as earning points, reaching a tier, or redeeming a reward, Toki sends it to Postscript as a custom event on that customer's subscriber record, and refreshes the customer's Toki subscriber properties in the same go. The complete list of events, the details each one carries, and the properties are in Toki events and properties in your email and SMS tools.

Two things are specific to Postscript:

  • Toki only sends events for customers who already exist as subscribers in your Postscript account. Toki finds the subscriber by the customer's email address, so the customer needs the same email address in Toki and on their Postscript subscriber record. A customer who is not a subscriber yet gets no events, and Toki never adds anyone to your Postscript list through this feed. Suspended members get no events while the suspension lasts.
  • Subscriber properties are a fixed set with readable names, such as Toki Points balance and Toki Tier Name, rather than the toki_ names used in other tools. In a message, use a property as a merge tag with its name exactly as it appears on a subscriber's profile in Postscript, for example {Subscriber Properties - Toki Points balance}. The full set is listed under "How each tool stores the data" in the reference above. Toki Tier Name is a dash (-) for a customer without a tier.

Event names in Postscript

Postscript event names have no spaces. Events keep their Toki name without the "Toki " in front and without spaces: Points Earned in a Toki campaign or workflow is PointsEarned in Postscript, Challenge Completed is ChallengeCompleted, Voting Activity Completed is VotingActivityCompleted. Two events have their own Postscript names:

In TokiIn Postscript
Membership UnlockedRewardTierEarned
Referred a FriendReferralCompleted

In Flow Builder, Postscript shows each event with the name of the partner that sent it in front, so Toki's events start with Toki's name and a dash, followed by the event, such as PointsEarned.

How event details look in Postscript

The details attached to an event arrive with capitalized words instead of underscores: amount is Amount, toki_order_amount is Toki Order Amount, toki_tier_name is Toki Tier Name. Every event also carries the customer's Toki subscriber properties, so an automation started by any event can use the current balance or tier right away.

Survey, quiz, and poll answers reach Postscript as details on the VotingActivityCompleted event, one per question, named after the question's alias.

Discount links funded by points

Each time a customer earns points, Toki also writes up to four subscriber properties: Toki 5USD Discount link, Toki 10USD Discount link, Toki 20USD Discount link, and Toki 50USD Discount link, with your store's currency code in place of USD. A link appears for every amount the customer's current balance of your default store credit covers at your points conversion rate. A customer whose points are worth 12 in your store's currency gets the 5 and 10 links; one whose points are worth 60 gets all four.

Put a link in a Postscript text. When the customer taps it:

  1. Toki deducts the points worth that amount from their balance.
  2. Toki creates a discount code for that amount in your Shopify store, for that customer only and usable once.
  3. The customer lands on your store with the discount code applied.

Each amount works once per customer. After they have used their 10 link, Toki writes no new 10 link for them, and opening the old one only takes them to your store's home page. The links have no expiry date.

Rewards and features that use Postscript

Postscript: SMS sign up reward

This reward gives customers points for joining your Postscript list by text message. In the catalog it reads "Customers earn store credit for signing up to your Postscript list."

  1. Open Loyalty. In Ways to Earn, click Add new activity.
  2. Under Integrations, pick Postscript: SMS sign up. If the catalog shows "For this reward, you need to install an external integration", click Install integration, connect Postscript, and come back.
  3. In the Rules card, fill in the two fields below.
  4. Set up the reward, set Status to Active, and click Save.
FieldWhat it does
SMS TextThe message customers send. The wallet shows it, copies it, or pre-fills it in the customer's messaging app. It has to include the keyword Postscript recognizes for your shop, so that Postscript subscribes the customer when the text comes in; the field's hint says "You must have some PostScript reference in it for the subscription to work."
Phone numberThe toll-free number or short code of your Postscript account that customers text.

Here is what happens for the customer:

  1. If Toki has no phone number for them yet, the wallet asks "Please provide your phone number". They enter it and click Submit; the number is saved to their member profile.
  2. On a phone, the wallet says "Click the button below to send the message" and shows Send SMS, which opens their messaging app with your number and the SMS Text filled in. On a computer, the wallet says "Copy the text below" with a Copy text button, then "and text it to the following number" with a Copy number button.
  3. The wallet shows "Waiting for SMS". Once Toki finds the customer on your Postscript list, it completes the reward and the wallet switches to the reward's completed screen.

Toki looks for the customer on your Postscript list when they open the reward on a new visit to your store, by the phone number they entered or by their email address. A customer who is already on your Postscript list completes the reward as soon as they open it. Completions of this reward type are approved automatically, and each customer can complete it once.

Other places you will see Postscript

  • Gift card delivery set to External sends the gift card events to Postscript; see Gift card delivery.
  • The Send Custom External Event workflow action can send an event you name to Postscript; see Workflow actions.
  • Customers' Apple Wallet pass links reach Postscript as Toki Apple Download Link; see Wallet passes.

Typical setups built on Toki events

You build the automations and segments in Postscript; Toki supplies the events and properties. These are the combinations merchants use most:

You want to…Start from this event in PostscriptUseful data
Welcome new membersAccountCreatedSubscriber properties Toki Referral Link and Toki Points balance
Congratulate a customer on a new tierRewardTierEarnedToki Tier Name and Toki Tier Rewards
Win back a customer who dropped out of a tierMembershipLostEvent detail Toki Tier Name
Confirm points as they come inPointsEarnedEvent detail Amount (the points just earned); subscriber property Toki Points balance
Deliver a discount code a customer earnedRewardCreatedEvent details Toki Code, Toki Type, and Toki Value
Thank a customer whose friend placed an orderReferralCompletedEvent details Toki Referee Email and Toki Order Amount
Text your top tier onlyAny campaignSegment on the subscriber property Toki Tier Name
Let customers turn points into a discountAny campaignSubscriber properties Toki 5USD Discount link and the other three amounts
Get more wallet passes installedAny campaignSubscriber property Toki Apple Download Link

Use AccountCreated for welcome automations: it fires when the customer's loyalty account is created, so the automation runs for new members only.

In Postscript, Toki events work as automation triggers in Flow Builder. An event and its details show up there once Toki has sent that event at least once, which is what the Email samples are for. Event details can narrow a flow as trigger filters and go into messages as merge tags, and Postscript's subscriber filters can use the Toki subscriber properties.

Subscriber properties work in messages as merge tags too, and in segments and automation filters.

Troubleshooting

The key is not accepted when you save. "API Key is required" means the field is empty. "Error from Postscript: …" or "Provided Api key is invalid…" means Postscript did not accept the key: copy the private key again from your Postscript account, and check that it is not the public key.

"Subscriber with provided email not found" when you save. The Email you entered is not a subscriber in your Postscript account. Enter the email of an existing subscriber, or leave the field empty.

Events or Toki properties are not showing up in Postscript. Open Integrations and check that the Postscript row shows Installed; Toki only sends events to connected tools. The customer has to exist as a subscriber in Postscript with the same email address they have in Toki, and must not be suspended. Properties travel with events, so a customer who has not triggered any event since you connected has no Toki properties yet.

A Postscript: SMS sign up reward is not completing. Check that the Postscript row shows Installed and the reward's Status is Active. The text the customer sends has to contain your Postscript keyword, and the phone number they entered in the wallet has to be the one they text from. Toki looks them up on your Postscript list again when they open the reward on their next visit to your store. If sign-ups still do not complete, chat with us and we'll check the connection with you.

Related

Didn't find what you need? Chat with us — a human answers, usually within the hour.