Sandbox Guide
The TradeGuard Sandbox
TradeGuard runs two environments on the same API: production, where real compliance work happens, and sandbox, a fully isolated environment for building and testing your integration. The sandbox never makes real phone calls and never sends real emails — broker verification is simulated — and it ships with sample documents that produce every compliance outcome on demand, so you can exercise your entire integration without a single real certificate of insurance.
Environments and API keys
Every organization has a sandbox; there is nothing to request or enable. Your dashboard login works in both environments — the Sandbox mode switch on Settings → API Keys moves the whole dashboard between them (an orange banner shows while you’re in sandbox), and the first switch creates your sandbox.
Both environments are served by the same base URL. The API key decides which one a request reaches:
- Keys created while in sandbox are sandbox keys: they only ever see and change sandbox data.
- Keys created while in production are production keys: they only ever see and change production data.
- Sandbox data is stored separately from production data. Object ids are per environment — your sandbox organization, subcontractors and documents have their own ids, and a sandbox key asking for a production id gets a
404.
Each environment’s Settings page lists only its own keys. Key responses include an environment field so your tooling can tell them apart. Webhook endpoints are per environment too: register your test endpoint while in sandbox and it receives sandbox events only.
Sample documents — every outcome, on demand
The sandbox doesn’t read real documents. It reads sample documents instead: realistic test files with known outcomes, made for the subcontractor you download them for. Think of them as test credit card numbers, but for certificates and paperwork.
- Built for your sub. Each sample prints that subcontractor’s name and business address (a dummy address if none is on file) and dates counted from the day you download it. An “expired” sample is always expired, and an “expiring in about 20 days” sample always is.
- Everything else is dummy. Agents, insurers, policy numbers, tax ID numbers and people on the samples are made up. Your organization’s name is printed as the certificate holder.
- Same checks as production. When you upload a sample, the sandbox skips the AI reading step and uses the reading the sample was made with. Everything after that (coverage records, compliance checks, verification calls, webhooks) runs the same code as production.
Download a sample
In the dashboard: switch to Sandbox, open a subcontractor, and click Sample documents. Pick a sample to download it, then upload it on the same page.
With the API: list the samples, then download one for a subcontractor with your sandbox key:
Upload it with the sample’s documentCategory (and documentType, when it has one), both listed by GET /v1/sandbox/fixtures. Without subcontractorId, the sample is made for a dummy subcontractor named Sandbox Demo Roofing LLC.
A download made for a subcontractor is named after them, for example Example Tile & Stone LLC - coi-compliant.pdf, so a sample made for one sub is easy to tell from another’s. The name is in the Content-Disposition header (use curl -OJ to keep it).
Certificates of insurance
Each one is a filled-in ACORD 25 certificate. Results are against Sandbox Standard Requirements, the default profile every new sandbox starts with: General Liability with 2M aggregate and an additional-insured endorsement. Upload with documentCategory=insurance.
Other documents
“Goes to TradeGuard review” means the document waits for a person to look at it, as it would in production. “Stored only” files are kept for your records and never read.
Uploading anything else
Any other file uploaded in the sandbox fails with the message “Sandbox only reads sample documents. Download one from Sample documents on this sub’s page.” The same message is on the document as metadata.statusReason, so your integration can show it.
The six original fixture COI files (recognized by their exact contents) still work, so older test scripts keep passing.
Uploading the same file twice for the same subcontractor returns the existing document — TradeGuard deduplicates identical file content per subcontractor. A sample downloaded twice on the same day for the same subcontractor is the same file. This is real API behavior worth handling in your integration; use another sample, another day’s download, or another subcontractor to create a fresh record.
License and Secretary of State test values
The license and Secretary of State checks read the subcontractor record, not a document, so they have their own test values. In the sandbox these checks never call the real services and are never charged. Set a value on the subcontractor (in the dashboard with Edit, or with PATCH /v1/subcontractors/{subcontractorId}), then run the check (Run report on the sub page, or POST /v1/subcontractors/{subcontractorId}/reports). GET /v1/sandbox/fixtures returns the same list as testValues, and the dashboard shows it in Sample documents.
License number (any state; any ending works, e.g. SANDBOX-VALID-42):
Secretary of State: put one of these words anywhere in the subcontractor’s legal (company) name, e.g. Acme INACTIVE Roofing LLC:
Sandbox answers say so: the run’s adapterMode is fixture, license results have no source link (sourceUrl is null), and the dashboard labels them Sandbox test answer instead of linking anywhere.
Magic phone numbers — simulated broker verification
A passing COI is compliant_pending_verification until the broker confirms the policy — in production, that’s a real phone call. In sandbox, the producer phone number on the certificate decides the simulated call’s outcome:
The sample certificates already carry these numbers, so the lifecycle plays out on its own.
In the sandbox the first simulated verification runs as soon as the document is processed, at any hour. Automated retries after a no-answer follow the broker’s business hours, as in production: 9am–5pm Monday–Friday in the broker’s local time (taken from the phone’s area code), skipping major US holidays. The magic phones are (202) Washington, DC numbers, so in the sandbox that is 9am–5pm ET. To re-run a verification immediately, use POST /v1/subcontractors/:subId/documents/:docId/verify-coverage.
Simulating verification outcomes directly
For scripted control — or to reset a scenario — set a coverage’s verification status explicitly:
Accepted statuses: unverified, active, inactive, expired, canceled. This records a coverage event, emits a coverage.updated webhook with "source": "sandbox_simulation" and "simulated": true, and queues compliance re-checks — the same downstream behavior as a real verification.
Simulating email replies and bounces
Sandbox never sends or receives real email. To see what happens when a subcontractor or its broker writes back, simulate it on the sub’s email conversation:
The response’s intake.status says what TradeGuard did: documents (the attachment was read like any emailed document), reply (queued for a person to read), bounce, or auto_reply. In the web app, the same tools are under Simulate email on a sub’s page while you’re in Sandbox. See Broker-sent certificates.
The end-to-end journey to build against
- Create a subcontractor and enroll it in a compliance profile.
- Register a webhook endpoint in the webhook portal (
POST /v1/webhooks/portalreturns a link to it; needswebhooks:write) — the sandbox delivers real webhooks. - Download the
coi-compliantsample for the subcontractor and upload it (categoryinsurance). - Watch the webhook sequence:
document.validated→document.extracted→coverage.updated→compliance.status_changed(compliant_pending_verification) → after the simulated broker call,coverage.updated+compliance.status_changed(compliant). - Repeat with the other samples until your integration handles every branch.
When you’re ready to go live, create a production API key from the production side of the dashboard and swap it in — same base URL, identical API surface.
