Quickstart
This guide runs one personal auto quote in the sandbox. Sandbox prices are synthetic, so they aren’t carrier prices.
Before you start
Create a sandbox key on the Developer sandbox page of the portal. It starts with trv_sandbox_. Put it in an environment variable for the examples below:
Every request goes to https://api.truvo.com/v1/ with the key as a bearer token. See Keys and environments.
Check what your key can do
The response gives the line, the environment, a JSON Schema of the facts the line requires, and the action types your key can use.
A sandbox key gets the same states as a live key. The request below uses a Texas address, which every line covers.
The response also gives Truvo’s quote disclosure in quote_disclosure. Before you ask for quotes, show the person its text as written and ask whether they agree.
Start a quote request
Send the facts for one line. This personal auto request has one driver and one vehicle, and every value in it is synthetic. In the sandbox, it returns one quote; see What the sandbox returns.
In this body:
quote_disclosure_versionis theversionfromquote_disclosurein the first step, andquote_disclosure_acceptedistrueonce the person agrees. Their yes covers the quote and contact by phone, text, and email, and for auto it lets carriers check credit. Truvo runs no credit check. See The quote disclosure.- Every request needs the person’s email and a US phone number.
- For auto, driver 1 is the named insured, and the API takes the applicant’s date of birth from driver 1.
- Money values are integer amounts in US cents:
10000000is $100,000.00.
The API answers 202 with a quote request whose status is in_progress. Save its id, which starts with qreq_.
Wait for the result
Quotes arrive one at a time. Prefer: wait=20 holds the read open for up to 20 seconds, and the read answers as soon as the request changes. Set since_version to the version from the 202 answer, so a change you haven’t seen yet answers at once.
If the status is still in_progress, read it again with the new version in since_version. A request in progress already lists the quotes so far. Once it’s completed, the quotes list gives the ID and the version of each quote. Get quote results has a loop that does this, and compares it with webhooks and quick polling.