TrueRoute Developers

Errors

Every refusal is JSON { "error": "<code>", "message": "<text>" }. Branch on error; handle a code you do not know by its category. message is safe to log and never carries patient data.

Categories

CategoryMeaningDo
invalid_requestthe request is malformed or breaks a rulefix it; resubmit with a new Idempotency-Key
accessthe key, signature, scope, grant or environment does not allow itfix the credential or ask for the scope or grant
refuseda well-formed request a business or compliance rule refusesnothing was executed; change what the code names
not_foundno such resource for this credentialcheck the id and the clinic
conflictthe state moved (a price, a quote, another request)follow the code: re-quote or read by id
retryablerate limited, in flight, or a TrueRoute faultretry the SAME key and bytes after a pause

Retry only a 429 or a 5xx (and a 409 request_in_flight). A body over its limit is refused before it is read: 413 request_too_large; handle it as refused.

What a module POST outcome means

OutcomeExecutedDo
2xxyesStore the body. A replay of the same key returns the same body.
4xx access / invalid_request / refused / not_foundnoFix the request; resubmit with a NEW Idempotency-Key.
409 request_in_flightno (not yet)Retry the SAME key and bytes.
409 other conflict codesnoFollow the code: re-quote, or read the resource by id or externalOrderId.
429, 5xx, timeout, unparseable 2xxunknownTreat as ambiguous. Retry the SAME key and bytes, or read by externalOrderId to reconcile.

Order contract codes

CodeCategory
artifact_hash_mismatchinvalid_request
artifact_too_largeinvalid_request
authentication_failedaccess
billing_mode_unresolvedrefused
bundle_band_not_approvedrefused
bundle_component_vendor_id_missingrefused
bundle_not_resolvedrefused
bundle_package_not_readyrefused
bundle_package_underfilledrefused
clinic_price_missingrefused
clinical_release_conflictconflict
clinical_release_not_permittedrefused
clinical_release_requiredinvalid_request
clinical_release_window_expiredrefused
controlled_substance_out_of_scoperefused
dose_not_on_ladderinvalid_request
environment_mismatchaccess
external_order_id_conflictconflict
funding_amount_mismatchinvalid_request
funding_collection_conflictconflict
funding_collection_exhaustedrefused
funding_evidence_mismatchinvalid_request
funding_evidence_not_permittedinvalid_request
funding_evidence_requiredinvalid_request
funding_not_affirmedinvalid_request
funding_not_collectedrefused
funding_reversal_after_dispatchrefused
funding_split_does_not_balanceinvalid_request
funding_timestamp_implausibleinvalid_request
gate_rejectedrefused
idempotency_key_requiredinvalid_request
idempotency_key_reuseinvalid_request
insufficient_scopeaccess
integration_suspendedaccess
internal_errorretryable
invalid_days_supplyinvalid_request
missing_fieldinvalid_request
multiple_prescriptions_not_supportedinvalid_request
npi_mismatchinvalid_request
npi_verification_synthetic_not_liverefused
office_use_not_supportedinvalid_request
order_already_fundedconflict
order_not_foundnot_found
order_not_releasablerefused
passthrough_quote_not_permittedrefused
pharmacy_not_offeredrefused
prescriber_clinic_not_grantedaccess
prescriber_grant_scope_missingaccess
prescriber_identity_collisionconflict
prescriber_not_foundnot_found
price_changedconflict
pricing_not_configuredrefused
product_not_availablerefused
product_not_foundnot_found
provider_inactiverefused
provider_not_on_filerefused
quantity_requiredinvalid_request
quantity_unit_mismatchinvalid_request
quote_expiredconflict
quote_input_mismatchinvalid_request
quote_not_foundnot_found
rate_limitedretryable
regimen_line_mismatchinvalid_request
regimen_not_permittedinvalid_request
regimen_requiredinvalid_request
regimen_shipping_service_not_offeredrefused
release_artifact_mismatchinvalid_request
release_not_affirmedinvalid_request
release_precedes_signatureinvalid_request
release_timestamp_implausibleinvalid_request
request_in_flightretryable
script_artifact_too_largerefused
signature_expiredaccess
signature_requiredaccess
signature_timestamp_implausibleinvalid_request
structured_match_not_affirmedinvalid_request
text_too_longinvalid_request
timestamp_out_of_windowaccess
transport_cannot_carry_orderrefused
unauthorizedaccess
unknown_fieldinvalid_request
unsupported_fieldinvalid_request
unsupported_funding_methodinvalid_request
unsupported_media_typeinvalid_request
unsupported_release_methodinvalid_request
upstream_signing_not_enabledaccess

Module codes

Module routes also answer the shared codes above where they apply, with these statuses.

CodeStatusCategoryMeaning
aoe_answer_missing400invalid_requestA required ask-at-order-entry question from the catalog has no answer.
appointment_not_found404not_foundNo such appointment for this clinic.
appointment_not_modifiable422refusedThe appointment is in a state that cannot be rescheduled or cancelled (completed, cancelled, inside the vendor cutoff).
appointment_slot_unavailable422refusedThe slot is no longer available. List slots again.
authority_mode_mismatch400invalid_requestThe order's declared clinicalAuthorityMode is not the clinic's recorded arrangement. The mode is declared so the caller knows who is responsible; it is never chosen by the body.
authority_mode_not_enabled422refusedThe trueeval_supplied authority mode has no recorded activation for this clinic and state.
authority_mode_state_restricted422refusedThe clinic's clinical authority mode may not order for a patient in this state until counsel rules (the trueeval_supplied mode is held for New York, New Jersey, Rhode Island and Maryland).
billing_arrangement_missing422refusedNo billing arrangement is recorded for this (integration or grant, module). Who pays is never taken from the request.
cancel_target_ambiguous400invalid_requestA cancel names neither or both of journeyId and externalOrderId. Name exactly one.
card_on_file_required422refusedThe arrangement makes the clinic the payer under standard_billed and the clinic has no valid card on file, or ordering is paused for an uncollected recovery (TR-471). Never answered under passthrough.
clinic_id_required400invalid_requestEvery module request names clinicId: in the signed body of a POST, in the query of a GET.
clinic_mapping_pending403refusedThe clinic mapping was requested and is awaiting (or was refused) TrueRoute operator approval.
clinic_not_leaf403accessThe named clinicId is a brand or parent organization. Module requests act for one clinic only.
clinic_suspended_by_consumer403refusedThe consumer's own lock for this clinic is suspended or archived. New orders are refused; results and critical facts for existing orders continue.
clinician_assertion_not_enabled403refusedThis integration's counsel gate for registering clinicians is OFF (the default). Clinicians are registered in the console instead.
clinician_licence_state422refusedThe clinician holds no in-date licence (with a recorded expiry) for the patient's state.
clinician_not_authorized422refusedThe clinician is not active at this clinic, not linked to this integration or grant, or not permitted under the authority mode.
clinician_not_found404not_foundNo clinician with this id is registered to the clinic.
clinician_npi_conflict409conflictThe NPI is already registered at this clinic under a different externalClinicianId.
clinician_selection_required422refusedclinicianId was omitted and the server cannot derive exactly one eligible clinician. Name one from GET /v1/modules/clinicians.
collection_device_not_found404not_foundNo such collection device in the catalog.
collection_device_required400invalid_requestThe device_kit rail needs a collectionDevice (device and setting); other rails must send null.
collection_rail_not_offered_for_lab400invalid_requestThe collection rail cannot carry a specimen for this lab, or for one of the tests named.
connect_session_not_found404not_foundNo such connect session, or it expired.
connection_already_active409conflictThe patient already has an active connection for this source. Disconnect it first.
critical_ack_clinician_invalid400invalid_requestAn acknowledgement names at most one of clinicianId / externalClinicianId, and a clinical follow-up names exactly one (the clinician who made it). Only escalated_to_responsible_clinician may name neither.
critical_ack_not_permitted403refusedThis acknowledgement may not be recorded over the API: the clinic is under trueeval_supplied authority on an integration not flagged trueEvalOwnedConsumer; or the action is escalated_to_responsible_clinician and the escalation owner is not consumer; or the named clinician is not a result reader at this clinic; or the fact is on an UNMATCHED result (not yet bound to an order), which reads owner trueroute because TrueRoute is finding the ordering clinician, and is not acknowledged over the API until it is bound.
critical_already_acknowledged409conflictThe statement conflicts with one already recorded: a second escalated_to_responsible_clinician, a receipt after a clinical follow-up, or a second, different clinical follow-up. A replay with the same Idempotency-Key is not this code. Read the fact.
critical_contact_missing422refusedThe ordering clinician has no 24/7 critical-value contact on record (CLIA 42 CFR 493.1291(g)). No diagnostic order is placed for a clinician the performing lab could not reach.
critical_escalation_owner_missing422refusedNo critical escalation owner is recorded for this clinic. No diagnostic order is placed without one.
critical_escalation_owner_not_permitted422refusedThe clinic is under trueeval_supplied authority with escalation owner consumer, which only an integration a TrueRoute operator has flagged trueEvalOwnedConsumer may run. Every other integration's trueeval_supplied clinics need owner trueroute.
critical_fact_not_found404not_foundNo such critical fact for this clinic.
device_connection_not_found404not_foundNo such device connection for this clinic.
device_setting_not_permitted422refusedThe collection device's cleared settings do not include the requested setting (e.g. an in-clinic-only device ordered at_home).
device_source_not_supported422refusedThe device source is not offered on this rail now.
diagnosis_code_invalid400invalid_requestA diagnosis code is not a valid, billable ICD-10-CM code in effect on the order date.
document_not_found404not_foundNo document is stored for this version or requisition.
external_org_id_conflict409conflictA mapping for this externalOrgId already exists for this integration and environment.
grant_missing403accessThe named clinicId is neither this integration's clinic nor a leaf clinic it holds an active, in-window grant for (or the grant lacks this scope).
invalid_brand400invalid_requestdescribed in the modules handoff provided with your credentials
invalid_demographics400invalid_requestA demographics field is missing or malformed (date, state, postal code, E.164 phone).
invalid_identifier400invalid_requestAn id is not a well-formed TrueRoute id, or an external id is empty, too long or not printable.
invalid_time_window400invalid_requestA from/to window is reversed, open on both ends, or longer than the route allows.
invoice_not_found404not_foundNo such invoice record for this clinic.
journey_not_found404not_foundNo such journey (or externalOrderId) for this clinic.
kit_shipment_not_found404not_foundNo such kit shipment for this clinic.
lab_bill_type_not_permitted422refusedThe performing lab may not bill the clinic arrangement's bill type (client, patient or third_party) for a patient in this state under the current lab compliance policy, or the policy has no rule for that state and bill type (an unknown state and bill type is refused). E.g. New York and New Jersey: patient or insurer billing only.
lab_billing_conditions_unmet422refusedThe patient's state allows this bill type only with conditions the clinic arrangement does not record: pass-through pricing with no markup, and the performing lab disclosed to the patient (e.g. California client billing).
module_not_enabled403refusedThe clinic does not hold this module. Toggled per clinic by an operator; default OFF.
module_suspended403refusedThe module or rail is suspended. New orders are refused; results, corrections, critical escalation, reads, cancellations and refunds continue.
order_closed422refusedThe lab order is closed (cancelled, refused by the lab, resulted, or its specimen is with the lab): no collection visit can be booked or moved for it.
order_not_cancellable422refusedThe lab order has passed the point of cancellation (specimen received, or already resulted or cancelled).
patient_contact_missing422refusedA mobile draw needs the patient's email address and a 10-digit US phone number, and the patient reference lacks one (invalidFields). Update the patient's demographics, then book again.
patient_facing_brand_missing422refusedThe clinic has no patient-facing brand, and this rail has a patient-facing surface.
patient_ref_conflict409conflictA reference for this externalPatientId already exists with different demographics. Never merged or overwritten; append a demographics version to the existing reference.
patient_ref_not_found404not_foundNo patient reference with this id or externalPatientId exists for this integration, environment and clinic.
patient_state_not_served422refusedThe lab, rail or test cannot serve the patient's state.
payment_method_required422refusedUnder standard_billed, the derived payer has no usable payment method on file at TrueRoute. Never answered under passthrough.
quote_not_orderable422refusedThe quote's eligibility is ineligible or unknown, or a test on it is unpriced. An unknown is never ordered or charged.
rail_capability_unavailable422refusedThe rail does not offer this operation (see RailCapabilities): e.g. booking on a walk-in-only rail, or priority: stat on a rail whose statPriority is false.
rail_not_enabled403refusedThe clinic holds the module but not this rail (lab, collection rail or device rail).
readiness_not_live422refusedThe module or rail is not live for this environment (setup_required, or sandbox-only on a live key). GET /v1/modules/availability names the blockers.
responsible_party_missing422refusedThe clinic has no declared responsible party for critical values. No diagnostic order is placed without one.
result_not_found404not_foundNo such result for this clinic.
result_version_not_found404not_foundNo such version of this result.
return_url_not_registered400invalid_requestA device connect returnUrl is not on the integration's registered return-URL allowlist.
site_not_found404not_foundNo such collection site on this rail.
slot_not_found404not_foundNo such slot, or it expired. List slots again.
test_not_found404not_foundNo such test in this lab's catalog.
test_not_orderable422refusedA test is in the lab catalog but not orderable for this clinic now (not approved, not priced, or withdrawn).
tests_empty400invalid_requestA quote or order names no tests.
vendor_unavailable503retryableThe vendor could not be reached BEFORE anything was sent. Retry with the same Idempotency-Key and bytes. (A send whose outcome is unknown is never this code: it is an accepted request whose state is ambiguous.)