Skip to main content
Complete reference of all webhook events sent by Parchment, including payload structures and examples.

Event Structure

All webhooks follow this standard structure:
{
  "event_type": "prescription.created",
  "event_id": "evt_4e2ba4c9ed6b0a849c41f5bd8d526273",
  "timestamp": "2025-12-16T19:13:09.468Z",
  "data": {
    "organization_id": "7fa84d2b-26d7-4c71-9b5b-e591eff97e7d",
    "patient_id": "f03b972b-53ea-452d-ae48-024817f6c3b0",
    "partner_patient_id": "1523402100149593750",
    "user_id": "8e1c9bab-6614-4723-8981-87c8fa026dae",
    // Event-specific fields
  }
}

Root Event Fields

FieldTypeDescription
event_typestringEvent type (e.g., prescription.created)
event_idstringUnique event identifier (format: evt_xxx)
timestampstringISO 8601 timestamp when event was created
dataobjectEvent data including context and event-specific information

Data Object (Common Fields)

FieldTypeDescription
organization_idstringParchment organization ID (UUID)
patient_idstringParchment patient ID (UUID)
partner_patient_idstringYour internal patient ID
user_idstringID of the user (prescriber) who triggered the event (UUID)

Prescription Events

prescription.created

Sent when a new prescription is created in Parchment.
{
  "event_type": "prescription.created",
  "event_id": "evt_4e2ba4c9ed6b0a849c41f5bd8d526273",
  "timestamp": "2025-12-16T19:13:09.468Z",
  "data": {
    "organization_id": "7fa84d2b-26d7-4c71-9b5b-e591eff97e7d",
    "patient_id": "f03b972b-53ea-452d-ae48-024817f6c3b0",
    "partner_patient_id": "1523402100149593750",
    "user_id": "8e1c9bab-6614-4723-8981-87c8fa026dae",
    "scid": "2TM1XV0RP246R1WG45"
  }
}
Data Fields:
FieldTypeDescription
organization_idstringUUID of the organization where the prescription was created
patient_idstringParchment’s internal patient ID (UUID)
partner_patient_idstringYour system’s patient ID (as provided during patient creation)
user_idstringUUID of the user (prescriber) who created the prescription
scidstringScript Control Identifier - the unique identifier for the prescription in the eRx system
When to expect:
  • After a prescription is successfully created via the Parchment portal or iFrame
  • Sent immediately after prescription creation is complete
Common use cases:
  • Update your system with the new prescription SCID
  • Use the SCID to fetch full prescription details via the Get Patient Prescriptions API endpoint
  • Sync prescription data to your platform
  • Trigger follow-up workflows (e.g., patient notifications)
The webhook provides the SCID (Script Control Identifier) which you can use to retrieve the complete prescription details by calling the Get Patient Prescriptions API endpoint with the partner_patient_id.

Event Filtering

By Event Type

Process only specific event types:
app.post('/webhook', (req, res) => {
  const event = req.body;

  switch (event.event_type) {
    case 'prescription.created':
      handlePrescriptionCreated(event);
      break;

    case 'prescription.dispensed':
      handlePrescriptionDispensed(event);
      break;

    case 'prescription.cancelled':
      handlePrescriptionCancelled(event);
      break;

    // Handle other events...
  }

  res.status(200).json({ received: true });
});

Idempotency

Always use event_id to prevent duplicate processing: