> ## Documentation Index
> Fetch the complete documentation index at: https://docs.rxscale.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Notifications

> Understand what notifications are available and how to subscribe to them

# Notifications

RxScale sends notifications to keep pharmacies, doctors, and admins informed about important events. This page explains what types of notifications are available, what triggers them, and who receives them.

## Notification Types

### Pharmacy Order Notifications

These notifications are sent when something happens with a pharmacy order.

| Event                  | What Triggers It                              | Who Receives It |
| ---------------------- | --------------------------------------------- | --------------- |
| Pharmacy order created | A new order is assigned to the pharmacy.      | Pharmacy staff  |
| Pharmacy order updated | An existing order's status or details change. | Pharmacy staff  |

**Why it matters:** These notifications help pharmacies stay on top of incoming orders and status changes, so they can process orders promptly.

### Stock Level Change Notifications

| Event               | What Triggers It                                                                               | Who Receives It        |
| ------------------- | ---------------------------------------------------------------------------------------------- | ---------------------- |
| Stock level changed | A product's stock level at the pharmacy is updated (for example, after an order is fulfilled). | Pharmacy staff, admins |

**Why it matters:** Keeping track of stock levels helps pharmacies avoid running out of medication and ensures orders can be fulfilled without delays.

### Prescription Notifications

| Event                | What Triggers It                                                           | Who Receives It |
| -------------------- | -------------------------------------------------------------------------- | --------------- |
| Prescription created | A new prescription is created in the system.                               | Doctors, admins |
| Prescription updated | A prescription's status changes (for example, approved, signed, declined). | Doctors, admins |
| Prescription printed | A prescription is printed (for example, for records or delivery).          | Admins          |

**Why it matters:** Doctors need to know when new prescriptions are waiting for their review, and admins need visibility into the prescription lifecycle.

### Order Notifications

| Event         | What Triggers It                     | Who Receives It |
| ------------- | ------------------------------------ | --------------- |
| Order created | A new order is placed.               | Admins          |
| Order updated | An order's status or details change. | Admins          |

**Why it matters:** Admins can monitor the overall order flow and intervene quickly if an order gets stuck or needs attention.

## How to Subscribe to Notifications

Notifications are delivered via **webhooks**. A webhook is a URL on your system that RxScale calls whenever an event occurs. To receive notifications:

1. **Set up a webhook endpoint.** Create a URL on your system that can receive HTTP POST requests from RxScale.
2. **Register the webhook.** Use the RxScale admin panel or API to register your webhook URL and select the events you want to receive.
3. **Start receiving notifications.** Whenever a subscribed event occurs, RxScale will send a POST request to your webhook URL with the event details.

<Note>
  Webhook setup requires technical configuration. If you need help, work with your development team or contact RxScale support.
</Note>

## What a Notification Looks Like

When an event occurs, RxScale sends a JSON payload to your webhook URL. The payload includes:

* **Event type** -- What happened (for example, `pharmacy_order_created`).
* **Timestamp** -- When the event occurred.
* **Data** -- The relevant details about the order, prescription, or other object involved.

## Tips for Managing Notifications

* **Subscribe only to events you need.** This keeps your system focused and avoids unnecessary processing.
* **Monitor your webhook endpoint.** Make sure your endpoint is available and responding. RxScale may retry failed deliveries, but persistent failures could cause you to miss notifications.
* **Process notifications quickly.** Acknowledge the webhook request promptly to avoid timeouts. Handle any heavy processing asynchronously.

## Frequently Asked Questions

<AccordionGroup>
  <Accordion title="Can I receive notifications by email instead of webhooks?">
    Currently, real-time notifications are delivered via webhooks. Some email notifications may be available depending on your account configuration. Contact the support team for details.
  </Accordion>

  <Accordion title="What happens if my webhook endpoint is down?">
    RxScale will retry the delivery. If the endpoint remains unavailable, the notification may be lost. It is important to keep your webhook endpoint running and monitored.
  </Accordion>

  <Accordion title="Can I test notifications before going live?">
    Yes, you can use the development environment to test webhook notifications. See the API documentation for development base URLs.
  </Accordion>
</AccordionGroup>

## Related Topics

* [Webhooks Overview](/webhooks/overview) -- Technical details on how webhooks work.
* [Webhook Events](/webhooks/events) -- Full list of webhook event types and payload formats.
* [Webhook Security](/webhooks/security) -- How to verify webhook signatures.
