How Medplum consumes Stripe, Cal.com and DocuSign webhooks
A clinic or digital health team that wants payment, booking or signature events to update Medplum records without manual entry should know the supported route first: the source application calls a Medplum Bot through the $execute endpoint. Medplum publishes Bot webhook templates for Stripe payments, Cal.com scheduling and DocuSign e-signature, and the Medplum consuming webhooks docs describe the general pattern of a SaaS product triggering a Bot this way. The docs establish the pattern and the templates' existence. They do not, in the material available here, settle the details your build depends on, such as exactly which event types each template handles, how the payload is shaped, or how the sender is authenticated.
Before building, confirm those points against the current template source and your own test events. Check which Stripe, Cal.com and DocuSign events the template processes, and which events your workflow needs but the template skips. Confirm how each sender's signature or shared secret is validated inside the Bot, and where that secret is stored and rotated. Ask whether the $execute call requires a client identity with a specific access policy, and which Project and Bot your team will own. Also confirm which Medplum version your deployment runs, because Bot behavior and templates can change between releases, and self-hosted upgrades must follow the sequence described in the Medplum upgrading guide.
Treat the template as a starting point, not a finished integration. The mapping from a Stripe charge, a Cal.com booking or a DocuSign envelope status to FHIR resources such as Encounter, Appointment, Invoice or Consent is a clinical and data governance decision, and it needs sign-off from the people who own those records. Plan for retries and duplicate deliveries, and for events that arrive before the matching Patient exists. Test each path with sandbox events from the vendor and record the results, because a payment or signature event that updates the wrong record is harder to correct than one that is delayed.
What a webhook integration needs before the first Bot runs
A webhook integration touches four Medplum pieces and three vendor accounts before any payload arrives. Each card below is a prerequisite that has to be in place, and confirmed, before the first Bot runs against a live Stripe, Cal.com or DocuSign event.
A running Medplum release line
Confirm which Medplum deployment you run, Cloud or self-hosted, and which release line it is on before you write any Bot code. The latest release at research time was 5.2.5, published on October 15, 2026, and Medplum ships patch versions weekly, so pin the version your team tests against. Self-hosted servers must move through each minor version in sequence, so a webhook build made on one line may need an upgrade plan before it reaches production.
Upgrade guideA Bot with explicit execution settings
The Bot is the receiving end of every webhook, so decide its execution settings before you wire up any vendor. Set the Bot's project, its access policy and the environment it runs in, then confirm it returns a clear response for malformed payloads. Plan a test Bot per vendor so a failure in one payload format does not block the other two.
A dedicated sender identity
Create a ClientApplication or equivalent machine identity that the SaaS sender uses to call the Bot's $execute endpoint. Give it only the access policy the Bot needs, and do not reuse a clinician or administrator login. Medplum supports client credentials for server-to-server access, so confirm which credential type your deployment and vendor flow can present.
A reachable HTTPS endpoint
The vendor must reach the Medplum server over HTTPS at the address that exposes $execute. Check the load balancer, ingress, TLS certificate and any IP allow rules between the public internet and the Bot route. For self-hosted deployments, confirm the endpoint is reachable from the vendor's egress, not just from your internal network, and test it with a non-clinical sample event.
Vendor accounts with webhook rights
Stripe, Cal.com and DocuSign each need an account and role that can create webhook subscriptions or connect events to an endpoint. Confirm with each vendor which plan, role or admin permission is required, and who on your side owns the account. Ask each vendor for its current signing options, since the method used to verify sender signatures differs and changes over time.
Signature verification plan
Before go-live, agree how the Bot will confirm each request came from the vendor. Stripe, Cal.com and DocuSign each document their own signing approach, so the Bot logic must read the right header and secret for each source. Store each signing secret in your secrets store rather than in Bot source, and have the team confirm each vendor's current scheme before the first live event.
Self-hosted path and ownership
If the deployment is self-hosted, the execution backend, secrets handling and monitoring for Bots follow the Medplum Bots and automation guidance. Name an owner for the webhook route, the Bot and the vendor subscription, and record who receives alerts when a delivery fails. Ownership gaps are the most common reason a working test integration stops syncing after a change.
Consuming webhooks docsConfiguring a webhook Bot and the sender in sequence
This sequence connects a SaaS tool to a Medplum Bot so that an event in the vendor's system triggers Bot logic and produces a verified resource in your Medplum project. Each step ends with a check you can run before moving on.
Create the Bot from the documented template
In your Medplum project, create a Bot for the webhook you need, starting from the matching template in Medplum's integration documentation. Templates are listed for Stripe payments, Acuity Scheduling and Cal.com scheduling, and DocuSign and Dropbox Sign e-signature. Confirm the Bot's name, the project it belongs to, and the access policy that governs it. The step is done when the Bot appears in the project's Bots list and you can open its code and deployment settings.
Set up sender access with client credentials
Create a ClientApplication and a client credentials login for the sender, so the SaaS tool or a relay you control can authenticate to the Medplum $execute endpoint without a user session. Give the client only the access policy it needs to run this Bot. Record the client ID and secret in your secrets manager, not in the vendor's configuration screen where other administrators can read them. Confirm the sender's credentials by requesting a token in a test call, which should return a valid access token rather than an authorization error. Check the current authentication documentation for any supported alternative method before you choose one.
Verify the payload signature in the Bot
Before the Bot writes any resource, make it verify the sender. Stripe, Cal.com and DocuSign each sign or authenticate deliveries in their own way, so confirm the scheme in each vendor's current developer documentation and store the signing secret as a Bot secret. Have the Bot reject any request whose signature fails and return an error without creating resources. The check is a deliberately altered test payload that the Bot refuses, alongside a correctly signed payload it accepts.
Register the Bot endpoint with the SaaS tool
In the SaaS tool's webhook settings, add the endpoint that calls the Bot's $execute operation for your project and select only the event types the Bot handles. Ask the vendor's administrator to confirm which events are sent in test mode and which in live mode, and register each mode separately if you use both. Save the endpoint and record the signing secret the vendor shows at creation. The step is done when the endpoint is listed as active in the vendor's console.
Send a test event from the vendor
Use the vendor's built-in test delivery or a sandbox action, such as a test payment, a test booking, or a test envelope, to fire one event at the endpoint. Open the delivery log in the SaaS tool and confirm the response code. A success response from the Bot confirms the call reached Medplum, passed authentication and signature checks, and ran to completion. If the response is an error, read the Bot's log in Medplum before changing anything else in the vendor console.
Confirm the resource in the Medplum project
Search the project for the resource the Bot creates or updates, such as an Encounter, Appointment, Invoice-related record or DocumentReference, depending on the template you used. Compare the stored values with the test event: identifiers, timestamps, status and the patient match. Repeat the check for an update event, such as a refund or reschedule, so you know the Bot handles changes and not only creation. The sequence is complete when both events produce the expected resources and the Bot's execution logs show no unhandled errors.
How Stripe, Cal.com and DocuSign events map to FHIR resources
This table proposes a candidate FHIR resource for each SaaS event family and the fields that tie it to a patient or practitioner. Treat every mapping as a design choice to validate against your own data model, because Medplum's documentation does not prescribe these resource choices. Use the rows to start the mapping discussion, then confirm each one with your clinical and billing owners before building Bots.
| Event family | Candidate FHIR resource | Identifying fields to carry | Validate before building |
|---|---|---|---|
| Stripe payment events (payment succeeded, failed, refunded) | Invoice, Account or PaymentNotice | Stripe customer ID mapped to a Patient or RelatedPerson reference, invoice ID, amount and currency | Whether your billing model uses Invoice, Account or PaymentNotice, and who owns the financial record |
| Stripe subscription or customer change events | Account or Coverage-adjacent custom resource | Customer ID, subscription status, linked Organization or Patient | Whether membership or self-pay status belongs in FHIR at all or in a separate system |
| Cal.com booking created, rescheduled, cancelled | Appointment | Booking UID, start and end times, attendee email matched to a Patient, host matched to a Practitioner | How attendee identity is matched and what happens when no Patient exists yet |
| Cal.com booking outcome linked to care delivery | Encounter (created or updated when the visit occurs) | Appointment reference, Patient, Practitioner, status and class | When an Encounter should exist, since a booking alone may not represent a clinical encounter |
| DocuSign envelope completed or declined | Consent, DocumentReference or Task | Envelope ID, signer email matched to a Patient or RelatedPerson, template or document type | Whether the signature is a legal consent record, a stored document, or a follow-up action for staff |
| DocuSign signer-level events (sent, delivered, signed) | Task or Provenance | Recipient identity, envelope ID, timestamp | Whether intermediate signer states need storage or only the final outcome |
Mapping webhook payloads to FHIR without losing identity
The core decision in this section is how a Bot finds the right Patient when a Stripe, Cal.com or DocuSign payload carries no MRN. These payloads usually contain an email address, a customer ID, a booking attendee, or metadata that your own checkout or booking flow attached. None of these is a clinical identifier, so treat each as a lookup key with a known confidence level, not as proof of identity. Before go-live, decide which field your team controls end to end, for example a Medplum Patient identifier you write into Stripe customer metadata or a Cal.com booking field, and make that the primary key. Email addresses change and can be shared, so use them only as a fallback that routes to human review. Store the external identifier on the Patient or on a dedicated resource with its system URL, so the match is repeatable and auditable.
Every event needs an idempotency key stored before any FHIR write. Stripe and DocuSign deliver events with their own identifiers, and senders retry when they do not receive a timely success response, so the same event can arrive more than once and not always in order. Record the sender's event ID, the event type and a hash of the payload in a dedicated log, and have the Bot check that log first. Out-of-order delivery matters for status changes, such as a booking that is rescheduled after it was cancelled or a signature envelope that completes before a sent notice is processed. Compare the event timestamp or the resource's current state before overwriting it. Confirm with each vendor how long it retries, what it signs and how it orders events, since these details differ between products and change over time.
Verifying senders and limiting what a webhook Bot can change
A webhook endpoint in Medplum accepts requests from the internet and can write clinical or scheduling data, so the Bot must prove each request came from the vendor before it touches a resource. The controls below work together: verify the sender, narrow what the Bot can do, keep secrets out of code, restrict where requests can come from, and record what arrived.
Verify each vendor signature inside the Bot
Each vendor signs its webhook requests with a scheme of its own, typically an HMAC computed over the raw request body with a shared secret. The Bot should recompute that signature from the exact bytes received, compare it in constant time, and check any timestamp the vendor includes to reject replayed requests. Run this check first, before any read or write, and reject the request on failure. Confirm the current signing and timestamp rules in each vendor's developer documentation, since they differ between Stripe, Cal.com and DocuSign and can change.
Consuming webhooks docsKeep the Bot's access policy narrow
A Bot runs under its own identity, so its access policy decides what a compromised or misrouted webhook could change. Grant it write access only to the resource types the flow needs, such as Appointment or Task for a scheduling event, and read access only where it must look something up. Avoid project-admin roles and broad wildcard access. Review the policy whenever a new event type is added, because each new event often brings a new write path.
Store signing secrets outside code
Signing secrets belong in the platform's secret handling, not in Bot source, a repository or a config file that travels with a deployment. Bot secrets are read at run time, so rotation becomes a configuration change rather than a code release. Ask who can view and change each secret, and document the rotation process for each vendor, including how a secret is replaced without dropping events that arrive during the change.
Restrict the endpoint by source where published
Some vendors publish the IP ranges their webhooks are sent from. Where a vendor does, restrict inbound traffic at the load balancer, gateway or firewall to those ranges, and treat the list as something to check against current vendor documentation before each change. Source restriction supplements signature checks and does not replace them, because published ranges change and a signature still proves the sender. If a vendor publishes no ranges, rely on signature verification and say so in the design record.
Log every received event for audit
Record each received event with its vendor, event type, event identifier, receive time, verification result and the outcome of the Bot run. Log the verification result even for rejected requests, since repeated failures can reveal a misconfigured secret or an attack. Keep the log content minimal: store identifiers and outcomes, not full payloads, unless your retention rules require the payload. Check how Medplum AuditEvents and your log platform handle these entries before relying on them as the audit trail.
Confirm the BAA position before PHI arrives
Vendor webhooks often carry customer names, email addresses, appointment details or payment context that may be protected health information when linked to a care relationship. Keep payloads free of PHI unless the business associate agreement position for that vendor and that product tier is confirmed in writing. Where it is not confirmed, have the Bot fetch the needed detail from Medplum using the event identifier, so the vendor payload carries only the reference. Ask each vendor and your compliance team to confirm this before the flow goes live.
Testing payment, booking and signature flows before go-live
Test each webhook source end to end before any production traffic reaches the Bot, because the main risks are duplicate writes, unsigned requests and gaps in the audit trail rather than the happy-path payload. Start with Stripe in test mode, using a test-mode endpoint and test-mode signing secret so that events from test payments cannot reach production Patient, Encounter or Invoice-related resources. For Cal.com and DocuSign, request sandbox or test accounts and confirm with each vendor how their test environment signs requests and whether it sends the same event types as production. Confirm these details in the vendor's documentation or with their support team for your account, since the signing mechanism and event names are the first things that differ between environments.
Replay captured events against the Bot's $execute endpoint in a non-production Medplum project. Run each event twice, and confirm that the second delivery updates or skips the existing resource instead of creating a new one. Check that the identifier you use to match each event, such as the Stripe event ID, the Cal.com booking UID or the DocuSign envelope ID, is stored on the FHIR resource so that retries can be detected. Then send requests with a missing or invalid signature header and confirm that the Bot rejects them before it writes anything. Ask the engineering lead to record the rejection path in the test evidence.
Confirm the audit trail for each test run by checking that the Bot execution and every resource write appear in the Medplum AuditEvent history for the test project, with the correct actor and timestamp. Sign-off should come from the security or compliance owner who approves the data flow, plus the clinical or operations lead who owns the workflow, and the test record should list the events replayed, the duplicates tested and the rejected requests. Keep this evidence with the change record, since a reviewer will ask for it during the go-live review.
Common webhook failures and how to fix them
This table lists the failures teams most often hit when Stripe, Cal.com or DocuSign webhooks reach a Medplum Bot, with the likely cause and the fix for each. Read it as a triage guide: match the symptom you see, check the cause in your own environment, then apply the fix before changing anything else.
| Failure | Likely cause | Fix |
|---|---|---|
| Signature verification rejects valid events | The Bot validates the sending service's signature against the wrong signing secret, or it hashes a re-serialized body instead of the raw request body | Confirm the signing secret for each endpoint in the sender's dashboard, store it as a Bot secret, and verify against the exact raw body the sender posted |
| Bot never runs after the webhook arrives | The sending application calls the wrong $execute URL, or the access identity used for the call lacks permission to execute that Bot | Check the Bot ID and project in the URL, confirm the calling identity's access policy allows execution, and test with a manual $execute call first |
| Duplicate resources after retries | Senders retry deliveries when they do not receive a timely success response, and the Bot creates a new record on every attempt | Use the sender's event ID as an idempotency key, search for an existing resource with that identifier before creating one, and return success quickly |
| Payload has no patient identifier | Stripe customer, Cal.com booking or DocuSign envelope data does not carry your Medplum Patient ID unless you set it when the object was created | Store the Medplum Patient reference in sender metadata at creation time, or map from a shared identifier, and route events that cannot be matched to a review queue |
| Endpoint unreachable from the sender | TLS certificate problems, a firewall or proxy blocking inbound requests, or a hostname that does not resolve publicly | Confirm the endpoint has a valid public certificate chain, allow the sender's source ranges where the sender publishes them, and test from outside your network |
| Timeouts on slow writes | The Bot performs several sequential FHIR writes or waits on a slow downstream call before responding, so the sender gives up | Acknowledge the event first, move heavy work to a separate Bot or queue, and keep each request to a small number of writes |
Questions buyers ask before connecting SaaS webhooks to Medplum
What drives the cost of connecting Stripe, Cal.com or DocuSign webhooks to Medplum?
The cost follows the number of event types, how much each payload must be mapped to FHIR resources, how reliably the sender can be identified and matched to existing patients or practitioners, and how much testing and compliance review the flows need. Each webhook source adds its own setup in the vendor account, a Bot to receive and transform the event, and test cases for success, failure and duplicate deliveries. Setup is largely one-time work, while the vendor accounts, Medplum subscriptions and any ongoing maintenance recur. A quote should list each event type, the target FHIR resources, the identity matching rule, the test plan and the review steps, so you can compare the scope directly with your own estimate.
How long does a webhook integration with Medplum usually take?
Duration depends on how many sources and event types are involved, how complex the payload mapping is, and how quickly your team can provide vendor accounts, sample payloads and sign-off on the data model. A single source with a few events and a clear mapping is typically simpler than several sources feeding the same Patient or Encounter records. Plan extra time for sandbox testing with the vendor, for failure handling, and for any review your compliance team requires before production. Ask the provider for a written timeline tied to the agreed scope, with the dependencies you must supply listed as milestones.
What must our team provide before the work starts?
Most integrations need three things from your side: administrator access to each SaaS account that will send webhooks (Stripe, Cal.com or DocuSign), named data owners who can confirm which records each event should create or update, and Medplum admin access in the project where the Bots will run. You should also provide sample event payloads from sandbox or test accounts, a list of the patient identity fields you trust for matching, and the people who will approve production cutover. Ask the provider to confirm this list in the written scope so that gaps are found before build time is spent.
Can an internal team build these webhook integrations alone?
An internal team with experience in FHIR, Medplum Bots and the relevant SaaS APIs can build simple flows on its own, especially if it follows the documented patterns for consuming webhooks. The harder parts are usually verifying the sender, handling retries and duplicate deliveries, mapping payloads to the right resources without creating duplicate patients, and documenting controls for a compliance review. If your team lacks one of these skills, or has limited time to test, a partner can cover that part under a fixed-scope agreement. Either way, the deciding factors are staff capacity, the number of sources and the level of evidence your reviewers expect.
How do identity matching and payload mapping affect the work?
Matching is often the largest engineering decision. A Stripe customer, a Cal.com booking and a DocuSign envelope each identify a person differently, and none of them guarantees a match to a Medplum Patient. Your team needs a rule for which identifiers are trusted, what happens when no match or several matches are found, and where unmatched events are held for review. Mapping decisions include which FHIR resource represents each event, such as a payment, an appointment or a signed document, and how the source's identifiers are stored so the record can be traced back. Agree these rules with the data owners before building, because changing them later can require reprocessing records.
Does a Medplum Cloud plan change the work compared with self-hosting?
Yes. On Medplum Cloud, the platform team does not run the servers, so the work centers on Bots, subscriptions to the source systems and the configuration in your Medplum project. Medplum's pricing page lists standard BAA and MSA agreements for paid cloud plans, which matter when webhook payloads carry protected health information. On a self-hosted deployment, your team also owns the endpoint that receives webhooks, network exposure, secrets, upgrades and monitoring. Medplum publishes an upgrade requirement that each minor version be applied in sequence, and that work must be scheduled around the integrations. Confirm which plan and hosting model you use before the scope is written, since the two produce different responsibilities and different evidence for a compliance review.
What should we check on compliance and security before going live?
Before go-live, confirm how each webhook is authenticated, how the payload is logged, which people can view the resulting records, and how failed or unmatched events are handled. Your security team will also want to know which data leaves the source SaaS product and whether those vendors have agreements covering the data you send. Medplum's compliance documentation states that compliance is a shared responsibility between Medplum and its customers, so your own controls and evidence remain your duty. DeployOpen prepares systems, controls and evidence for compliance assessments, but independent auditors and certification bodies issue any audit report or attestation. Ask the provider to list these checks in the written scope.
How a SaaS webhook reaches a Medplum Bot
The flow starts at the SaaS vendor, which sends an HTTPS event to the Medplum $execute endpoint for a specific Bot. That request crosses the trust boundary into the Medplum deployment, where the Bot must verify the sender before it maps the payload to FHIR resources and writes them to the project. Check the signature step first, because the Bot is the only place that can reject a forged or replayed event before data changes. The Bot then returns a response to the sender, which tells the vendor whether to retry.
Path of one SaaS webhook from the vendor into a Medplum Bot and project.
How DeployOpen scopes and delivers the webhook integration
DeployOpen starts every webhook integration with a written scope that names the event types to consume from each source, the Medplum resources each event will create or update, the verification method for each sender, the test cases and the handover items. For a build that touches Stripe, Cal.com and DocuSign, the scope should list each event by its name in the source product, the Bot that handles it, the FHIR resources it reads and writes, and who owns the signing secrets and the Bot endpoint URLs. Fixed-scope agreements like this set deliverables and timelines before work begins, so the buyer can compare the scope against its own team's effort and against other quotes. DeployOpen does not publish a price list, so the quote follows from this written scope.
Delivery happens in the client's own infrastructure. DeployOpen implements the Bots, subscription wiring and any sender verification inside the Medplum deployment the client runs, whether on AWS, Kubernetes or another environment the client controls. The client's team reviews the configuration of webhook endpoints, Bot secrets and access policies, and confirms that the Bot identity can write only the resource types the scope names. Testing covers replayed sender payloads, rejected signatures, duplicate deliveries and retries, and each test result is recorded against the scope so the handover shows what was verified. Confirm with your own security team which logs must be retained for these events, because that setting follows your environment, not the template.
Once the integration is live, ongoing support is available through a retainer, which covers monitoring of failed deliveries, updates when a source product changes its payload or signing method, and retesting after Medplum upgrades. Ask any partner, DeployOpen included, to state in writing which of these items are one-time and which recur, and what triggers a change request. Before you sign, confirm the vendor-side details for each source product, including the current webhook signing method and event names, directly with Stripe, Cal.com and DocuSign, since those settings are theirs to change and the scope should reflect the versions you actually run. DeployOpen is a Chainscore Labs company.

