Parchment Health uses webhooks to notify your application in real-time when events happen in your account. This guide will help you integrate with our webhook system to receive and process event notifications.Documentation Index
Fetch the complete documentation index at: https://docs.parchmenthealth.io/llms.txt
Use this file to discover all available pages before exploring further.
Overview
- Delivery: HTTP POST requests to your configured endpoint
- Retry Logic: Up to 3 attempts with exponential backoff (see Retry Behavior)
- Request Timeout: 10 seconds per attempt
- Supported Events: Prescription lifecycle events
How Webhooks Work
- An event occurs in Parchment (e.g., a prescription is created)
- Parchment sends an HTTPS POST request to your webhook endpoint
- Your application processes the event
- Your endpoint returns a 2xx status code to confirm receipt
How to Activate Webhooks
Provide your webhook endpoint
Contact Parchment support at hello@parchment.health with:
- Your webhook endpoint URL (must be HTTPS)
- Your partner ID
Receive your webhook secret
Parchment registers your endpoint and provides a confirmation with your webhook secret. This secret is shown only once — store it securely.
Implement your webhook handler
Build an endpoint that verifies the signature and routes events by type. Here’s a complete Node.js example:See Webhook Signature Verification for Python examples and more details.
Webhook Endpoint Requirements
Your webhook endpoint must:- Use HTTPS with a valid SSL certificate
- Return a
2xxresponse within 10 seconds — process events asynchronously if needed - Handle retries idempotently — use the
event_idto prevent duplicate processing
Request Headers
Every webhook request includes the following headers:| Header | Value | Description |
|---|---|---|
Content-Type | application/json | Payload is always JSON |
X-Webhook-Signature | t=<timestamp>,v1=<hmac-sha256> | Signature used to verify authenticity — see Webhook Signature Verification |
User-Agent | Parchment-Webhooks/1.0 | Identifies requests originating from Parchment |
Retry Behavior
Parchment automatically retries failed webhook deliveries using exponential backoff.Retry Schedule
Each event is attempted up to 3 times. A request is considered failed if it does not return a2xx status code within the 10-second timeout, or if a network error occurs.
| Attempt | Delay Before Attempt | Cumulative Time |
|---|---|---|
| 1 | Immediate | 0s |
| 2 | 1 second after attempt 1 fails | ~1s |
| 3 | 2 seconds after attempt 2 fails | ~3s |
Retryable vs. Non-Retryable Responses
Parchment distinguishes between transient and permanent failures to avoid pointless retries: Retryable (will retry up to the limit):- Network errors (connection refused, DNS failure, TLS errors)
- Request timeouts (no response within 10 seconds)
408 Request Timeout429 Too Many Requests- Any
5xxserver error
- Any other
4xxclient error (e.g.400,401,403,404)
A
4xx response (other than 408 / 429) signals a problem with your endpoint configuration — bad signature handling, wrong auth, missing route — that retrying won’t fix. Fix the endpoint and contact Parchment support if you need the event re-sent.When Retries Stop
Parchment stops retrying a webhook event as soon as any one of the following occurs:- Successful delivery — your endpoint returns a
2xxstatus code. - Non-retryable response — your endpoint returns a
4xxother than408or429. The event fails immediately with no further attempts. - Retry budget exhausted — all 3 attempts have failed with retryable errors.
Idempotency
Because retries can occasionally result in duplicate deliveries (e.g. if your endpoint returned a non-2xx status but still processed the event), your handler must be idempotent. Use the top-levelevent.id field from the payload as an idempotency key and skip any event ID you have already processed.
Rate Limiting
If your endpoint needs to throttle Parchment, return429 Too Many Requests. Parchment will back off and retry according to the schedule above.
Event Types
Parchment sends webhooks for these event types:| Event Type | Description | Status |
|---|---|---|
prescription.created | A new prescription was created | Live |
prescription.updated | A prescription was modified | Coming Soon |
prescription.ceased | A prescription was ceased | Coming Soon |
prescription.reissued | A prescription was reissued | Coming Soon |

