Sandbox & environments
Build against seeded test data, simulate vendor replies, then switch to production by changing one key.
Every Trimline account has two separate environments: a sandbox for building and testing, and production for your real data. Both use the same base URL. The key you send decides which environment handles the request.
What’s different in the sandbox
Sandbox (tl_test_) | Production (tl_live_) | |
|---|---|---|
| Data | Seeded demo company with 24 vendors | Your connected mailboxes and books |
| Approved drafts | Marked sent, never emailed | Sent from your mailbox |
| Vendor replies | Simulated, on demand | Real |
| Savings | Never invoiced | Invoiced after confirmation |
| Rate limit | 25 requests / 10 s | 100 requests / 10 s |
Responses include "livemode": false for sandbox objects, so you can assert on it in tests.
Seeded data
The sandbox starts with a fictional 60-person company called Northwind Labs (test). It has vendors across CRM, design, analytics and security, renewals spread over the next twelve months, and two negotiations already in progress. To restore that starting state at any time:
curl -X POST https://api.trimline.tech/v1/test_helpers/reset \
-H "Authorization: Bearer $TRIMLINE_TEST_KEY"
Simulating vendor activity
In production, negotiations move forward when vendors reply. In the sandbox you trigger those replies yourself, so you can test every branch of your integration.
curl -X POST https://api.trimline.tech/v1/test_helpers/negotiations/neg_8Hk2Pq/simulate_reply \
-H "Authorization: Bearer $TRIMLINE_TEST_KEY" \
-H "Content-Type: application/json" \
-d '{ "outcome": "counter_offer", "discount_percent": 12 }'
outcomerequiredenum | One of counter_offer, accept, decline, request_call or no_reply. Each one produces the same events and drafts as the real thing. |
discount_percentnumber | The discount the simulated rep offers. Only used with counter_offer and accept. |
Moving to production
- Switch your server’s key from
tl_test_totl_live_. No code changes are needed. - Register your production webhook endpoint separately. Webhook endpoints belong to one environment.
- Check the scopes on your live key. Grant
drafts:writeonly if your integration is meant to send email.
Something unclear or missing? Email developers@trimline.tech.