Get started
Sandbox
Your own test business, made in a click. Test keys, fictional customers, and texts you read instead of receive.
Your sandbox is a copy of your business for testing, and you make it yourself. It is not a mock: it runs the released API, and the ledger rules, the idempotency checks and the rate limits all behave exactly as they do live.
https://api.sandbox.trovy.caGet one
In your Trovy dashboard open Integrations → Developer API and press Create sandbox. A second business appears beside your real one, named after it ("Sunny Threads (Sandbox)"), under the same sign-in. Anyone on your team can do it, it changes nothing in your real business, and there is one per business.
It starts ready to call:
- The Developer API is already on, and its page is where you create test keys:
trv_test_…for your server,trv_pk_test_…for the sign-up form. - It has your currency and timezone, and a copy of your rewards program's rules (your oldest active program's), so a redemption delay or an expiry behaves in testing as it will live. The copy is already linked to the sandbox's Developer API; your real business needs that one step when it goes live. Change the copy as much as you like.
- One customer is already linked. Their id is shown on that page, with a copy
button. Pass it as
customerIdand you can call/v1/earnbefore you have built anything else.
What is different
No text reaches a real phone. A sandbox never sends a text. The message it would have sent comes back in the response instead:
{
"sms": { "status": "preview", "preview": "Sunny Threads: Maria, you just earned $3.00 in instant rewards!…" }
}That is how you test the wording your customers will read. The wording is your business's own: edit it in the dashboard under Settings → Message Templates, and see what went out, and whether it arrived, under Settings → Logs. A live business never returns a preview.
Only fictional phone numbers. The sign-up form in a sandbox accepts a number Trovy
would text live (a US or Canadian area code, or Sint Maarten's 721) followed by
555-0100 to 555-0199, the range reserved for fiction, and refuses everything else.
+1 416 555 0123 works; your own mobile does not. It means a sandbox
can never enrol, text or look up a real person, whoever ends up holding your test key.
The sign-up code is on the screen. In a sandbox the form shows you the text it
would have sent, code included, so you can type it in. For automated tests a sandbox
also accepts the fixed code 000000. Live there is no such code, and none is ever
shown.
It is API-only. A sandbox has no till: no cashier accounts, no Shopify or Square connection, no QR join page. Customers reach it through the sign-up form and nowhere else.
Each host takes only its own keys. api.sandbox.trovy.ca refuses a live key and
api.trovy.ca refuses a test key, both as API_KEY_INVALID and before anything is
looked up. There is no way to cross over by accident.
What is the same
- Every error code, every status, every limit.
- The ledger. A refund claws back exactly as it will live.
- Idempotency. A replayed key returns the first result, and a reused key with a
different body is still
409 IDEMPOTENCY_MISMATCH. - Currency. Your sandbox counts in the same unit as your business.
Try-it in the reference
The API reference can send real requests against the sandbox with a test key you paste in. It is deliberately blocked against production: a documentation page is not a place to move a real customer's rewards.
Going live
-
Your organization's owner opens Integrations → Developer API on the real business and presses Switch on the Developer API. No email, no waiting.
-
Link your rewards program to the Developer API. In Campaigns, edit the program your orders should earn under and tick Developer API under Where it runs. Switching the API on links none, and until one is linked every earn answers
409 NO_ACTIVE_PROGRAM. Your sandbox's copy was linked for you, which is why it worked there.A program can run in several places at once, and a reward can be spent wherever its program runs. Leave the till ticked as well if customers should earn and spend the same reward at the counter and in your app. The API lists and redeems only the rewards of programs that run on it.
-
Create a
trv_live_secret key and atrv_pk_live_publishable key on that page, and list your real domains in the publishable key's allowed origins. Add each website and then press Save websites: a key with no saved websites loads nowhere. -
Swap the keys. With the SDK nothing else changes, because it picks the host from the key. If you call the API directly, change the host to
api.trovy.ca. -
Check before the first order.
GET /v1/businesswith the live key should show yourprogram(notnull), yourcurrencyand yourtimezone. The currency cannot change once the business has transacted: if it is wrong, email developers@trovy.ca before you record anything. Read the texts your customers will get, under Settings → Message Templates.
Keep using the sandbox afterwards. Every change you make to an earn or redeem path is worth running there first, where a mistake costs nobody a reward.