Submit a filing
A filing is the record you submit to Valley Insurance after a policy is bound, so we can report it to the state and collect the required taxes and fees. This recipe walks through the whole process: find the state, upload your document, create the filing, then track it.
If you only need the taxes and fees for a policy, and aren't ready to actually file, use Price a policy instead. This recipe is for when you're ready to submit.
Run it as a script
Want to see this whole recipe run end to end before writing your own integration? The Overview has downloadable, self-contained scripts, one for Node and one for bash, that do exactly what steps 1 through 4 below describe, against the real API. See Run the whole flow for the download links, requirements, and a warning that it creates a real test filing.
Step 1: find the state and its requirements
Call GET /partner/filing-states to list the states your account can file
in, along with each state's requirements and the id you'll need later as
filingStateId.
Response (one entry, trimmed):
Before you upload anything, read the descriptionNb/descriptionEd that
matches your filingType and gather every document listed in the matching
filesNb/filesEd array. Full breakdown of both fields, plus a worked
California example, in
State pricing and requirements.
Filter to one state with ?state=WA, or check enabledStates on
GET /partner/me to see which states your account can
file in at all. If a state you need isn't in your enabledStates, contact
us at gina@valleyinsllc.com to request access before you build against it.
Use descriptionNb / filesNb when your filingType is NEW_BUSINESS or
NEW_BUSINESS_RENEWAL. Use descriptionEd / filesEd for
ENDORSEMENT_ADDITIONAL or ENDORSEMENT_RETURN.
Step 2: upload your document
Ask for a signed upload URL, then PUT your file to it.
Response:
Now upload the actual file bytes to uploadUrl:
Keep storagePath from the response. You'll use it as filePath in the
next step.
UploadUserFileDTO also accepts an optional filingId, for attaching a
file to a filing that already exists. For a brand-new filing, leave it out
and pass storagePath in /create-filing instead (step 3).
Step 3: create the filing
Required fields:
Common optional fields: endorsementNumber and endorsementEffectiveDate
(for endorsement filings), policyFee, inspectionFee, carriersFee,
lgtValue, fmtValue, declaredPaymentMethod (ACH, WIRE, CHECK,
PENDING_INVOICE, or INVOICED), and userNotes.
The response is the created filing:
filingState is a lightweight summary (id, name, stateAbbr), not the
full rate configuration. If you need the price, get it from /calculate
before or after filing, don't try to derive it from this response.
Save id, that's what you'll poll in step 4.
Step 4: track the filing
Returns the same filing shape as step 3, with the current status:
Don't assume filings move through these five statuses in a fixed order.
Treat status as "the current state," and poll it rather than predicting
what comes next.
List your filings (recover a lost id)
If you didn't save the id from step 3, or you need to look up a filing
from a while back, call GET /partner/filings instead of guessing. It
returns your own filings only, paginated.
Response:
Each entry in items is the same filing object returned by /create-filing
and GET /partner/{id} (with the lightweight filingState summary, no rate
snapshots).
To page through results, keep incrementing offset by limit and
requesting again. Once offset + limit >= total, you've reached the last
page.