Submitting 837P professional claims from Medplum with Stedi

A practical guide to sending Medplum Claim resources to payers through Stedi's $stedi-submit-claim operation, with the prerequisites, setup sequence, data mapping, security controls and rejected claim handling.

On this page

How Medplum submits 837P claims through Stedi

Professional claims are built in Medplum as Claim resources, but they reach payers through a clearinghouse, and the supported path described for this topic is the $stedi-submit-claim operation. That operation sends the claim to Stedi, and the correlation identifiers returned in the response are written back to the Claim so the billing team can match later acknowledgments and remittances to the original record. Your team should treat the write-back as a control: a claim that was sent but has no stored correlation identifier is hard to trace when a payer question arrives weeks later. Before build starts, confirm the exact request parameters, the response fields that carry correlation identifiers, and the Claim extension or field where they are stored against the current Stedi and Medplum documentation, since the shapes must be verified during scoping rather than assumed.

Several parts of this path stay with your billing team and are not handled by the operation itself. Payer enrollment and the Stedi payer configuration for each payer you bill must be in place before any test claim is sent. Claim content, including diagnosis and procedure coding, rendering provider identifiers, place of service and the subscriber and dependent details that come from the Coverage resource, must be correct on the Claim before submission. Work on claims the clearinghouse or payer rejects, including corrections, resubmissions and appeals, also remains with your team, and you should decide in advance who owns the queue of rejected claims, how a rejection is reclassified, and how the original Claim is linked to any corrected version.

Plan verification around a payer test or sandbox path, a set of synthetic claims covering each payer and each claim type you bill, and a reconciliation check that every submitted Claim carries the stored correlation identifiers. Because the Claim contains protected health information, the submission bot's credentials, logging and retry behavior need the same review as other ePHI flows, and the business associate terms with Stedi should be in place before live data is sent. Ask Stedi and your Medplum implementation partner to confirm how duplicate submissions are prevented if a request times out after the claim has reached the clearinghouse.

What you need in place before the first claim is sent

Four things have to be settled before a Claim resource can reach a payer through Stedi: where Medplum runs, which Stedi account and credentials the integration uses, whether provider and payer records are clean enough to pass validation, and whether the network and secret store let the server make the call. Each one is a decision with a cost and a compliance consequence, so confirm them in writing before the build starts.

Medplum hosting and BAA

Choose between a Medplum Cloud plan and a self-hosted deployment in your own cloud account. The Medplum pricing page lists standard BAA and MSA agreements on paid cloud plans, and self-hosting is offered as a free Community option or custom-priced Enterprise Self-Hosted. Either way, claim data is ePHI, so confirm who signs the BAA, who operates the server and who holds the database backups before any test claim is sent.

Medplum pricing

Stedi account and agreement terms

Open a Stedi account and confirm its agreement and BAA terms directly with Stedi, since those terms are not covered by Medplum's pricing page. Ask which environments are available for testing, how API keys are issued and rotated, and what Stedi retains about submitted claims. Record the answers in your vendor file before any production key is created.

API key ownership and rotation

Issue the Stedi API key to a named service identity, store it only in the secret store, and give test and production keys separate names. The Medplum Bot or operation that calls $stedi-submit-claim should read the key at runtime, never from a Bot source file or a project config value that every admin can view. Agree on a rotation procedure and who performs it before go-live.

Provider and payer data quality

A claim is rejected for missing or inconsistent data before a payer ever sees it. Confirm that each billing Organization has a valid tax ID and NPI, that the rendering and billing Practitioner records match, and that every payer identifier used in the Coverage and Claim resources matches the payer list Stedi supports. Ask the payer for its own companion guide when a payer has specific billing rules.

Network egress and secret access

The Medplum server, or the Bot runtime if it runs elsewhere, must reach Stedi's API over outbound HTTPS, and the firewall rules, proxy settings and DNS must allow that path in production. Test the route from the same subnet and container image that will run in production, and confirm that outbound logging does not record request bodies containing patient identifiers.

Business associate flow-down

If you are a covered entity or a business associate, the HIPAA rules require a written business associate contract that requires the business associate to comply with the Security Rule and to report security incidents. Check that your contract chain covers Medplum, your hosting provider and Stedi, and that each subcontractor that handles ePHI accepts the same terms. Your compliance lead should confirm this before claim data flows.

45 CFR 164.314

How a claim moves from Medplum to the payer and back

The flow starts when a billing user or workflow marks a Claim resource ready in the client's Medplum environment. The $stedi-submit-claim operation then sends the claim to Stedi, the external clearinghouse, which forwards the 837P to the payer. The response returns correlation identifiers, and those identifiers are written back to the Claim so the team can trace it later. Check the trust boundary: everything inside the client's environment stays under its control, while the claim data crossing into Stedi is the point where the client's data-sharing agreements and controls must apply.

Claim submission path from Medplum through Stedi to the payer, with the trust boundary marked.

Configuring the submission path in the order it should be built

This sequence moves a Medplum claim from a coded draft to a controlled first production batch, with a named check at each step so the team can see that submission, identifiers and payer responses behave as expected before volume grows. The steps assume a Stedi account and a Medplum deployment that your team already operates.

  1. Confirm the claim is complete and coded

    Before any call leaves Medplum, the team checks that each Claim resource carries the patient, subscriber, provider, payer, service lines, diagnosis codes and procedure codes that the payer expects for a professional claim. Coding review and charge capture usually sit with your billing staff, while the Medplum build side confirms that the FHIR fields are populated from the encounter and not typed in by hand. The step closes when a sample set of claims passes a written completeness checklist that the billing lead has signed off on, and any claim missing a required element is held out of the queue.

  2. Store the Stedi credential in a secret store

    The Stedi API key is placed in the secret store your organization already uses, such as a cloud key vault or a managed secrets service, and the Medplum server or Bot reads it at runtime through its configuration. The key must not appear in source code, Bot code, Git history, container images or logs. Your security team should confirm who can read and rotate the secret and whether access is logged. The step is done when a search of the code repository and build artifacts finds no copy of the key, and the rotation procedure has been tested once in a non-production environment.

  3. Create a test configuration and confirm the endpoint

    The team sets up a separate test configuration that points the submission code at Stedi's test environment rather than production, with a test API key and test payer or sample data where Stedi provides them. Confirm the exact endpoint, key format and test payer identifiers in Stedi's current documentation, since these details are not restated here. The step closes when a deliberately simple test claim reaches the test environment and returns a response that the code parses without error, and the test and production configurations are stored separately so they cannot be mixed up.

  4. Call the submit operation on a reviewed test claim

    A clinician or billing analyst selects one completed Claim and runs the $stedi-submit-claim operation against the test configuration. The operation builds the X12 837P transaction from the FHIR Claim, sends it to Stedi and returns the transaction response. Review the outgoing content for the patient, payer and charge details before running it, and record who approved the test. The step is complete when the call returns a response without a server error and the team has compared the sent data to the source encounter for accuracy.

  5. Verify correlation identifiers on the claim

    After the test submission, check that the identifiers returned by Stedi, including the transaction and claim-level correlation values the integration writes back, are stored on the Claim resource itself. These identifiers are what later 277CA acknowledgments and 835 remittances will be matched against, so a claim without them cannot be reconciled. Confirm the exact field names and where they are written against the build you are running. The check passes when a reviewed test claim shows its identifiers visible on the Claim, and a repeat lookup by identifier returns that same Claim.

  6. Handle a deliberately rejected test claim

    Before production, submit one test claim designed to fail a validation rule, such as a missing required element, so the team can see how a rejection is returned, stored and surfaced. Confirm that the rejected claim is marked clearly on the Claim, that the reason is captured in a form a billing user can act on, and that the claim does not silently disappear from the work queue. Review payer-specific requirements with the payer's companion guide as well. The step closes when the team has written down the expected rejection path and the owner who will work each rejection type.

  7. Move to production with a controlled first batch

    Switch the production configuration to the production Stedi key and endpoint, through the same change process used for other production secrets and configuration. Submit a small, deliberately chosen first batch of claims that have been reviewed by billing staff, rather than the full queue. Compare the Claim resources, identifiers and acknowledgments for that batch against expectations before releasing the rest of the queue. The sequence is complete when the first batch has been reconciled, the identifiers are present on every claim in it, and the billing lead has approved the wider release in writing.

Which claim data must be correct before it can reach the payer

This table maps the Medplum Claim elements that feed provider, patient, subscriber, payer, service line, diagnosis and charge data to the 837P content they populate. Read the Medplum source column to see which record supplies each value, and treat the 837P segment column as a starting point to confirm against the Stedi 837P specification you are using.

Claim dataMedplum source837P content it feedsCheck before submission
Billing providerOrganization referenced from Claim provider, with NPI and tax ID identifiersBilling provider loop (NM1 with billing provider role) and tax ID referenceConfirm NPI and tax ID type match the payer enrollment record
Rendering providerPractitioner referenced from Claim careTeam or item performerRendering provider name and NPI in the service line loopConfirm the Practitioner has an NPI identifier and a name split into family and given parts
PatientPatient resource referenced from Claim patientPatient demographics in the subscriber or patient loop, including date of birth and addressConfirm name, birth date and address match the card and the payer's eligibility response
Subscriber and relationshipCoverage resource, including subscriber and relationship to subscriberSubscriber loop and patient-to-subscriber relationship codeConfirm subscriber identity and member ID come from the active Coverage, not a stale one
PayerCoverage payor reference to an Organization with a payer identifierPayer name and payer ID in the submitter or receiver loopConfirm the payer ID matches the identifier your Stedi account routes to
Primary and secondary coverageMultiple Coverage resources with order or sequence values on the Claim insurance elementsOther subscriber and other payer loops for secondary claimsConfirm the sequence matches the payer's coordination of benefits order
Diagnosis codesClaim diagnosis elements referencing ICD-10-CM codes, often sourced from Condition recordsHealth care diagnosis codes and pointers from each service lineConfirm codes are valid for the date of service and linked to the correct lines
Service lines and chargesClaim item elements with procedure code, modifiers, units, unit price and diagnosis pointersService line loop with procedure, charge amount, units and place of serviceConfirm total charge equals the sum of line charges and that every line has a diagnosis pointer

How to handle rejected and unanswered claims

A clearinghouse rejection happens before the claim reaches the payer, so no payer has adjudicated it and nothing has been accepted for payment. The signal appears in the response to the submission call or in an acknowledgment that follows, depending on how the integration is configured. Confirm the exact response structure and error codes with Stedi before you write alerting rules.

  • Where the signal appears: the submission response or the first X12 acknowledgment, which should be stored against the Claim together with its correlation ID.
  • Who owns the fix: the billing team corrects data problems in Medplum, such as subscriber, diagnosis or rendering provider fields, while the platform team fixes mapping or envelope errors.
  • Correct the source, then resend: update the Claim or the resources it references so the next transmission reflects the correction.
  • What must not happen: do not resend an unchanged payload in a loop, and do not create a second Claim resource for the same encounter.
  • Keep the history: link each rejected attempt to the Claim so auditors can see what was sent, when and why it failed.

Before resubmitting, check that every rejected attempt has a stored status and that each encounter has only one live Claim.

Security controls for claims that carry PHI

A 837P claim carries protected health information from the moment it leaves Medplum, so the controls around the Stedi key, the submit operation, logs and vendor contracts all matter. Each card below covers one control point in the submission path and what to confirm before claims go live.

Stedi API key storage and rotation

The Stedi API key authorizes every claim your Medplum Bot or server sends, so it belongs in a secrets store, not in Bot source code or a shared configuration file. Confirm who can read the key and how it is replaced. Ask for a rotation procedure that covers the Medplum Bot secret, the deployment environment and any CI/CD pipeline that holds a copy, and test that a rotated key works before the old one is revoked.

Least-privilege access to the submit operation

Only the service identity that builds and sends claims should be able to call the $stedi-submit-claim operation. Human users who review claims need read access to Claim resources, not the ability to submit them. Check that your access policies separate these roles, and test with a non-admin account that a submission attempt is refused.

Claim record access and minimum necessary data

Claim resources hold patient identity, diagnoses and service dates, which HIPAA treats as ePHI under the Security Rule's access control and integrity standards. Limit which roles can read Claim, Patient and Coverage records together, and confirm that the claim payload includes only the data the payer requires. Document the list of roles and the reason for each.

PHI kept out of logs and errors

Bot logs, server error responses and Stedi rejection messages can all echo patient names, member IDs or diagnosis codes. Configure logging so claim payloads are not written in full, and check that error handlers return a claim identifier rather than the claim body. Test a deliberately malformed claim and review what appears in the server log and in the user-facing message.

Audit trail for every submission

Each submission should leave a record of who or what sent the claim, when, the Medplum resource it came from and the correlation identifiers returned and written back to the Claim. Medplum's AuditEvent records and your log pipeline should both capture this, and the retention period should match your own record-keeping policy. Confirm that you can reconstruct any claim's submission history on request.

Business associate contract chain

Under 45 CFR 164.314, your business associate contract must require Stedi to follow the Security Rule, pass the same terms to any subcontractor handling ePHI, and report security incidents to you. Ask Stedi for its BAA, its subcontractor list and terms, and evidence of its controls. HIPAA has no certification, so an auditor's report or a questionnaire answer is evidence to review, not a compliance badge.

45 CFR 164.314 text

Common submission failures and how to fix them

This table lists the failures teams hit most often when sending 837P claims from Medplum Claim resources through Stedi, with the likely cause, the check that confirms it and the fix for each. Read it before go-live and use it as a triage sheet when a claim is rejected or a duplicate appears.

FailureLikely causeCheck and fix
Missing or mismatched provider identifiersThe billing provider NPI, tax ID or taxonomy on the Claim does not match the organization enrolled with the payer, or the rendering practitioner is missing from the Claim.Compare each identifier on the Claim with the payer enrollment record and the Stedi payer rejection detail. Correct the source Organization or Practitioner resource, then resubmit with a new claim version.
Subscriber or patient details do not match the payer recordName, date of birth, member ID or relationship to subscriber differs from what the payer holds, often from a Coverage resource that was not updated.Run an eligibility check on the same Coverage before submitting and compare returned demographics. Fix the Patient or Coverage data at the source, not on the outbound claim alone.
Wrong payer identifierThe payer ID used for routing does not match the payer for that patient's coverage, or a payer name was selected instead of its identifier.Confirm the payer ID against Stedi's payer list for the target payer and check the Coverage payor reference. Update the mapping and re-test with one claim before bulk sending.
Correlation IDs do not write back to the ClaimThe response from the $stedi-submit-claim operation was not stored, the write-back step failed silently, or a Bot or retry overwrote the field.Search the Claim for the stored correlation identifier after a successful submission. If it is absent, check the Bot or operation logs and the server error for the failed write, then add an alert for any submitted claim without an identifier.
Duplicate submissions after a timeoutThe client retried after a network timeout without knowing the first request had been accepted by Stedi and the payer.Query the Claim and the Stedi transaction history by correlation ID before any retry. Make resubmission conditional on a stored status, and treat an unknown result as pending until confirmed.
Test and production credentials differTest API keys or payer configuration were deployed to production, or production keys were missing from the self-hosted environment configuration.Confirm which Stedi environment each deployment calls and that keys are stored per environment. Send a test claim to the test environment after any key rotation, and restrict production keys to the production deployment.

Testing claims and keeping the integration working through upgrades

Test the claim submission path with a controlled set of claims before any production claim leaves the building, and record what each test claim is expected to return. Build the test set around the cases that break 837P submissions in practice: a single-line professional claim, a multi-line claim with different diagnosis pointers, a claim with a secondary payer, a claim with a corrected or replacement indicator, and a claim for a payer that rejects missing rendering provider data. For each case, store the input Claim resource, the expected Stedi response (accepted for submission, rejected at the front end, or rejected by the payer) and the correlation IDs the $stedi-submit-claim operation should write back to the Claim. Agree the test plan, the payer list used for sandbox or test payers, and the pass criteria in writing before the build starts, including who signs off that the expected responses match the payer rules your team has confirmed with each payer and with Stedi's documentation.

Re-run the same suite after every change that touches the path: a Medplum server upgrade, a database migration, a Bot that maps charges to Claim resources, a change to the Stedi credentials or the mapping from Coverage, and any update to a payer's requirements. Self-hosted Medplum must be upgraded through each minor version in sequence, and skipping versions causes startup failures, so plan the test run after each step rather than only after the final one. Medplum's upgrading guide notes that post-deploy data migrations can run for hours or days on large datasets, so confirm with your platform team whether test claims can be written during a migration window and which claims in flight should be checked for duplicate submission afterwards. Keep the suite under version control next to the Bot code so that a failing test identifies the change that caused it.

Monitor the submission path in production with the same fields the tests check. Compare the count of submitted claims, the count of rejections and the correlation IDs written back to the Claim against the test baseline after each upgrade step. Ask your team to confirm how rejected claims are routed to a work queue, who reviews them and how a corrected claim is resubmitted without creating a duplicate. Review the expected responses at least when Medplum or Stedi publishes a change that affects them, and confirm with Stedi how it notifies integrators of changes to its API or to payer rules before you rely on that notice.

Questions billing and IT leaders ask before submitting claims from Medplum

What drives the cost and effort of building 837P submission from Medplum?

The biggest drivers are the number of payers you bill, how many provider and location records need clean data, how much of your charge capture already lives in Medplum as Claim-ready resources, and how many rejection paths your team wants to handle in code. Costs fall into two groups: one-time build work (mapping Claim resources to the 837P content, the Stedi integration, correlation ID storage, and rejection queues) and recurring work (payer rule changes, monitoring, and support). Ask any partner to price these as separate line items in a written scope, and ask which payers, claim types and integrations are included.

How long does it take to reach a first accepted claim from Medplum?

The timeline depends mostly on client-side readiness rather than on the code itself. Payer enrollment for the Stedi account, provider identifiers, test payer access and the validation of your sample claims often take longer than the integration build, and they run on the payers' schedules. Your team should confirm with Stedi and each target payer what testing is available and how long enrollment takes before setting any date. A written plan should show which milestones depend on outside parties.

What must our organization supply before a claim submission build starts?

Plan to supply the following before the build begins:

  • Payer enrollment or confirmation for each payer you will bill, with the payer IDs your billing team uses
  • Billing provider and rendering provider records, including NPI and tax identifiers, and the Medplum Practitioner, Organization and Location data that feeds them
  • Stedi API credentials, stored in a secrets system you control, and test payer access
  • Sample claims from your practice management or billing history, so the team can test realistic edge cases
  • A named owner for payer rules and rejection triage on your side

Confirm the exact list with the vendor and with each payer before work starts.

Can our internal team build 837P submission from Medplum alone?

An internal team with FHIR, integration and revenue cycle experience can build it, but the work spans three skill sets that rarely sit in one group: FHIR data modeling in Medplum, X12 claim rules and payer requirements, and security controls for protected health information. The most common gap is the billing knowledge needed to interpret rejections and payer-specific rules. Many organizations keep ownership of payer rules and billing logic in-house and bring in outside engineers for the Medplum data mapping and the integration. A written scope should state who owns each part after go-live.

Do we need a business associate agreement with the clearinghouse?

If the clearinghouse receives, maintains or transmits electronic protected health information on your behalf, a business associate contract is generally required under the HIPAA Security Rule. The rule requires that the contract obligate the business associate to comply with the Security Rule, flow the same terms to subcontractors that handle ePHI, and report security incidents, including breaches of unsecured PHI. Confirm with your privacy or legal team whether your Stedi agreement covers these terms, and whether your Medplum hosting arrangement needs its own agreement. Medplum states that paid cloud plans include standard BAA and MSA agreements, and self-hosted deployments need agreements that match your own hosting setup.

How are ongoing payer changes handled after the claims flow is live?

Payer rules change through companion guide updates, new payer requirements, and rejection pattern changes, so the work does not end at go-live. Plan for a named owner who reviews payer changes, a regression set of sample claims that runs after each change, and a rejection dashboard that shows new error patterns. Ask any partner whether ongoing payer rule maintenance, monitoring and upgrades are included in a fixed-scope build or offered as a separate retainer, and what triggers a change request. Also plan for Medplum upgrades, since the mapping code must be retested against each release.

What happens to rejected claims, and who fixes them?

Rejections arrive at several points: a clearinghouse may reject a claim before it reaches the payer, the payer may send a 277CA acknowledgment that rejects it, or a remittance may deny it later. Each stage needs a route to a person who can correct the data, resubmit, or appeal. Ask your team to decide which errors are fixed in Medplum data, which go to billing staff, and which require payer contact. Store correlation IDs on the claim so each rejection links back to a specific submission. A written scope should define the work queue and the audit trail for each corrected claim.

How DeployOpen scopes and delivers the claim submission build

DeployOpen plans, implements, tests and documents the path from Medplum Claim resources to Stedi inside infrastructure you control, so your team knows exactly what the claim pipeline does before it sends its first 837P. Engagements are fixed-scope, with scope, deliverables and timelines agreed in writing before work starts.

How we scope

  • The written scope lists which Claim resources, billing providers and payers the 837P pipeline covers in your Medplum deployment.
  • Scope defines how the $stedi-submit-claim call is triggered, including whether it runs from a Bot, an application or a manual action.
  • Scope sets the rejected claim and correlation ID handling expected, so payer-specific rules are agreed before build starts.

How we build

  • We build the Stedi connection, credential handling and Medplum writeback of correlation IDs onto each Claim, in your environment.
  • We test submissions against Stedi's test paths and payer rules you confirm, then document the results for your billing and compliance reviewers.
  • We configure the rejected claim workflow so front-desk and billing staff see the payer reason and the next step for each claim.

How we hand over

  • Handover includes the build documentation, configuration records, test evidence and a walkthrough with the team that will run the pipeline.
  • Runbooks cover resubmission steps, credential rotation and how to trace a claim from Medplum to Stedi and back using stored identifiers.
  • We prepare the access and audit evidence your security and compliance teams need to review the submission path.

How we support

  • Ongoing support, upgrades and continuous testing are available as a retainer, covering changes to payer rules and Medplum releases.
  • Retainer scope is agreed in writing, so you know what is covered when a payer requirement or Stedi interface changes.
  • Ask for the retainer terms and response expectations in your quote, and confirm them against your own operating model.

Sources and further reading

Talk to our team.

Tell us what you're working on, whether it's a deployment, an audit, a security test or a cyber range. You'll speak with an engineer who can help you scope it.

  • 30-minute call: free, with no obligation.
  • NDA on request: we can sign before you share details.
  • Clear next steps: a scope and plan after the call.