Skip to navigation

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.

ProductionSandbox
PurposeReal compliance dataIntegration testing & development
Broker calls / emailsRealSimulated — never sent
DataYours, persistentDisposable test data
API keysProduction keysSandbox keys

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:

curl -s "$TG/v1/sandbox/fixtures" -H "Authorization: Bearer $TG_KEY" \
| jq -r '.data[] | "\(.key)\t\(.title)"'
curl -s "$TG/v1/sandbox/fixtures/coi-compliant/file?subcontractorId=$SUB_ID" \
-H "Authorization: Bearer $TG_KEY" -o coi-compliant.pdf

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 1Meachoccurrence/1M each occurrence / 2M aggregate and an additional-insured endorsement. Upload with documentCategory=insurance.

SampleWhat’s on itWhat happens
coi-compliantGL, auto, umbrella and workers comp with standard limits, additional insured and waiver; broker phone (202) 555-0100 confirms on the simulated call.Passes the default profile and typical 1M/1M/2M requirements; the simulated broker call verifies it, so the requirement ends compliant.
coi-gl-onlyA certificate with only a GL policy (1M/1M / 2M, additional insured).Meets the default GL requirement; any auto, umbrella or workers comp requirement stays missing.
coi-low-limitsGL each occurrence 500,000andaggregate500,000 and aggregate 1,000,000, under a 1M/1M / 2M requirement.Fails the GL limits check: non-compliant.
coi-low-auto-limitAll lines present but the auto combined single limit is $500,000.Passes the default GL profile; fails any $1M auto liability requirement.
coi-expiredEvery policy ended 30 days before the download date.Coverage is recorded as expired and the requirement reads expired.
coi-expiring-20-daysEvery policy expires 20 days after the download date.Compliant for now, with an “expiring soon” warning and renewal reminders.
coi-expiring-45-daysEvery policy expires 45 days after the download date.Compliant, inside the 60-day “expiring soon” window.
coi-missing-endorsementsAll lines, but the ADDL INSD and SUBR WVD columns are blank and the remarks don’t mention either.Fails the additional-insured endorsement check: non-compliant.
coi-endorsement-pageGL and auto, with a second page carrying an additional-insured endorsement form (CG 20 10) naming the certificate holder.Additional insured is proven by the attached endorsement page: compliant.
coi-name-mismatchThe insured printed is “Northgate Sample Mechanical Inc”, not this subcontractor.The insured-name check flags the mismatch; with “require name match” on, the coverage goes to review.
coi-renewalSame lines and limits as “Compliant, all lines” with new policy numbers and a new one-year term.Upload after the compliant sample: the new policies replace the old ones and the sub stays compliant.
coi-auto-onlyA certificate with only an auto policy.Adds auto coverage only; it doesn’t replace an existing GL certificate, and a GL requirement stays as it was.
coi-canceled-on-callA clean all-lines certificate whose broker phone is (202) 555-0101.Document checks pass, then the simulated broker call reports the policy canceled: non-compliant.
coi-broker-unreachableA clean all-lines certificate whose broker phone is (202) 555-0102.Compliant pending verification; after the call attempts, producer outreach is needed.

Other documents

SampleUpload asWhat’s on itWhat happens
w9-goodtax_form / w9An IRS Form W-9 in the sub’s name, classification checked, EIN, signed and dated.Every W-9 check passes and the name matches the sub: compliant.
w9-unsignedtax_form / w9A filled-in W-9 with a blank signature and date.The “Signed” and “Dated” checks fail: non-compliant.
w9-state-formtax_form / w9A state vendor substitute form instead of the IRS W-9.The reader can’t say it is the official IRS form, so it goes to TradeGuard review.
osha-10training_cert / osha_cardAn OSHA 10-hour construction card for a worker at the sub.Passes an OSHA 10 requirement; fails one that requires OSHA 30.
osha-30training_cert / osha_cardAn OSHA 30-hour construction card for a worker at the sub.Passes OSHA 10 and OSHA 30 requirements.
first-aid-currenttraining_cert / first_aid_cprA First Aid / CPR / AED certificate issued about 4 months ago, valid 2 years.Compliant, with its printed expiration tracked.
first-aid-expiredtraining_cert / first_aid_cprA First Aid / CPR / AED certificate whose printed expiration passed about 70 days ago.The “Not expired” check fails: expired.
lift-cardtraining_cert / lift_safetyA MEWP / aerial lift operator qualification for scissor and boom lifts.Every lift check passes: compliant.
safety-policysafety_policy / safety_policyA two-page written safety program in the sub’s name, signed by the owner.Compliant.
safety-policy-templatesafety_policy / safety_policyA safety program template with “[COMPANY NAME]” placeholders and no signature.The “Company named” check fails and no name can be matched: non-compliant until a real policy is uploaded.
wc-exemption-flworkers_compensation_exemption / wc_exemptionA Florida certificate of election to be exempt, state-stamped, valid 2 years.Compliant, with its printed expiration tracked.
wc-exemption-ks-affidavitworkers_compensation_exemption / wc_exemptionA notarized owner affidavit of exemption (Kansas has no state certificate).The reader can’t call it an official state document, so it goes to TradeGuard review.
agreementagreement / agreementA master subcontract agreement between your organization and the sub, signed by both.Compliant.
agreement-unsignedagreement / agreementThe same agreement with both signature lines blank.The “Signed by the sub” check fails: non-compliant.
wrong-type-w9-as-oshatraining_cert / osha_cardA W-9 meant to be uploaded as an OSHA card, to show what happens with the wrong kind of document.The reader says it isn’t an OSHA card, so it goes to TradeGuard review.
licenselicenseA contractor license file in the sub’s name.Stored for your records; not read. Licenses are checked against state records by the license report.
background-checkbackground_checkA clear background check report for the sub’s owner.Stored for your records; not read.

“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):

License numberWhat the sandbox answers
SANDBOX-VALID-1Active license, expires in about a year, no discipline. Passes.
SANDBOX-EXPIRED-1Expired license (ended about 90 days ago). Fails.
SANDBOX-SUSPENDED-1Suspended license. Fails.
SANDBOX-DISCIPLINARY-1Active license with two past disciplinary actions on record.
SANDBOX-NOTFOUND-1Not found in the state’s license records. Fails.
SANDBOX-UNSUPPORTED-1The state can’t be checked automatically, so it needs manual verification.
anything elseTreated as an active, valid license.

Secretary of State: put one of these words anywhere in the subcontractor’s legal (company) name, e.g. Acme INACTIVE Roofing LLC:

Word in the nameWhat the sandbox answers
INACTIVEThe business is found but is no longer active (dissolved). Fails.
NOMATCHNo business with that name is registered in the state. Fails.
MISMATCHA business is found, but under a different legal name, so the name check flags it.
none of theseFound as an active business with exactly that name.

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:

Producer phoneSimulated outcome
(202) 555-0100Broker verifies all policies → coverage active → compliant
(202) 555-0101Broker reports the policy canceled → coverage canceled → non_compliant
(202) 555-0102No answer → retries, then compliance.producer_outreach_needed

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:

POST /v1/sandbox/coverages/:coverageId/verification
{ "status": "active" }

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 conversation id
curl -s "$TG/v1/sandbox/conversations?subcontractorId=$SUB_ID" -H "Authorization: Bearer $TG_KEY" | jq '.data[0].id'
# The broker replies with a sample certificate (verified with no call once that broker is on file)
curl -s -X POST "$TG/v1/sandbox/conversations/$CONVERSATION_ID/simulate-reply" \
-H "Authorization: Bearer $TG_KEY" -H "Content-Type: application/json" \
-d '{"from": "broker", "attachmentSampleKey": "coi-compliant"}'
# Our email bounced
curl -s -X POST "$TG/v1/sandbox/conversations/$CONVERSATION_ID/simulate-bounce" -H "Authorization: Bearer $TG_KEY"

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

  1. Create a subcontractor and enroll it in a compliance profile.
  2. Register a webhook endpoint in the webhook portal (POST /v1/webhooks/portal returns a link to it; needs webhooks:write) — the sandbox delivers real webhooks.
  3. Download the coi-compliant sample for the subcontractor and upload it (category insurance).
  4. 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).
  5. 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.