Overview
Introduction
The goal of this guide is to help you quickly integrate with the 1099Policy API while familiarizing you with the concepts central to understanding how our API works. By the end of this guide, you'll be able to integrate our API and give independent contractors on your platform access to workers comp and liability insurance coverage, on-demand.
For additional details, you can refer to our API documentation. If you have questions, message us at support@1099policy.com.
We have example apps written in Node and Python (Java and Ruby coming soon) available at our Github repository. You can follow the repo README instructions to run the example app locally. As you experiment with the app functionality locally, refer back to this step-by-step guide to better understand the different parts of the app. Alternatively, you can read through this guide first before testing out the app locally.
Product Definitions
Below are some helpful definitions you need to know before you get started.
API Keys
There are two keys you'll use to authenticate with the 1099Policy API.
Term | Definition |
---|---|
public_key | a non-sensitive, public identifier that you use for acquiring a limited time access_token for connecting with the 1099Policy API. |
secret | a private identifier that is paired with client_id and required for fetching quotes and binding coverage. |
Both can be found in the API Keys page of your dashboard. Note that the secret
key is specific to the
API environment (e.g., sandbox, production) which you can learn more about below.
API Environments
Term | Definition |
---|---|
sandbox | A stateful sandbox environment used for testing credentials and your integration |
production | Production API environment that's required to place insurance coverage with our partner carriers. |
Use our sandbox
environment to build out and test your integration with simulated and live users,
respectively. Once you’re ready to go live, you’ll move to our Production environment.
Define the type of job
The job
object is a key building block to every policy we bind. It's used to define the job classification and the contract duration for the role to be filled by the independent contractor. You can see a list of the 600+ job classifications
eligible for coverage via the 1099Policy API on our job classification
page.
Let's start by creating a test job
object. Remember to replace the secret key below with your test secret key.
# Set your secret key: remember to change this to your live secret key in production
# See your keys here: https://dashboard.1099Policy.com/keys
ten99policy.api_key = "t9k_test_4eC39HqLyjWDarjtT1zdp7dc"
job = ten99policy.Jobs.create(
name="Truck driver",
description="Requires a truck",
duration_hours=20,
wage=100,
years_experience=20,
wage_type="flatfee",
entity_id="en_FwZfQRe4aW",
category_code="jc_MTqpkbkp6G" #see jobs dashboard for category code, https://dashboard.1099policy.com/jobs
)
In the response, you'll receive an id
which you'll use together with a contractor id
to request an insurance quote –
find additional details below.
Create an independent contractor
The contractor
object represents the real life independent contractor on your platform. The contractor
object is persisted, so you can use the same contractor
ID to secure insurance coverage in the future.
# Set your secret key: remember to change this to your live secret key in production
# See your keys here: https://dashboard.1099Policy.com/keys
ten99policy.api_key = "t9k_test_4eC39HqLyjWDarjtT1zdp7dc"
contractor = = ten99policy.Contractors.create(
first_name="Contractor",
last_name="Name",
email="contractor.name@gmail.com",
phone="51231203",
address={
"line1": "1 Kearny",
"locality": "San Francisco",
"region": "CA",
"postalcode": 94104
}
)
Take note of the contractor id
that gets returned since, as noted above, it's used along with the job id
to quote and
bind coverage.
All personally identifiable information is encrypted in transit and at rest.
Retrieve a quote and bind insurance
Once you have both the job
and the contractor
objects created, you're ready to request an insurance quote by creating a quote
object. You'll need to specify the coverage type to request a quote. You can find the complete list of available coverage types in our full reference API documentation
# Set your secret key: remember to change this to your live secret key in production
# See your keys here: https://dashboard.1099Policy.com/keys
ten99policy.api_key = "t9k_test_4eC39HqLyjWDarjtT1zdp7dc"
quote = ten99policy.Quotes.create(
job_id="jb_jsb9KEcTpc",
contractor_id="cn_yJBbMeq9QA",
coverage_type="workers-comp"
)
The quote response includes details useful for helping the contractor make a decision about whether the coverage is right for them, including net_rate
, and eligibility, e.g., eligible
.
#RETRIEVE QUOTE RESPONSE
{
"id":"qt_4M7sjSqdam",
"job":"jb_2S4VtMrU5A",
"contractor":"cn_uYV8mobcjo",
"coverage_type":"workers-comp",
"quote_json":"{'wc_code': 5191, 'state': 'CA', 'waiver_of_subrogation': 'yes', 'minimum_premium': 100000, 'premium': 321800, 'net_rate': 589, 'ca_class_code_tier': 'Territory 1', 'flat_payroll': None, 'min_payroll': 5460000, 'max_payroll': 13910000, 'notes': 'Used Minimum Payroll', 'net_rate_llc': None}",
"net_rate":589,
"eligible":true,
"created":1635842424
}
The final step in the process is binding coverage which returns a policy id
in the response along with a pdf of your coverage details.
# Set your secret key: remember to change this to your live secret key in production
# See your keys here: https://dashboard.1099Policy.com/keys
ten99policy.api_key = "t9k_test_4eC39HqLyjWDarjtT1zdp7dc"
policy = ten99policy.Policies.create(
quote_id="qt_4M7sjSqdam",
is_active=True
)
#RETRIEVE BOUND POLICY RESPONSE
{
"id":"pl_FjWRbxoUr9",
"is_active":true,
"quote":"qt_YnQQ5tFbc5",
"pdf_url":"http://ten99policy.s3.amazonaws.com/1099policy-coi-sample.pdf",
"expiration_date":1677500095,
"effective_date":1645964095,
"created":1635429537
}
Note that the response includes links to the certificate of insurance ACORD forms which can be persisted and used to prove coverage as needed.
Conclusion
Well done! You now know what it takes to provide independent contractors on your platform the insurance coverage they need and that the contracting enterprises demand.