> ## 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.

# Webhooks

> Register webhooks for real-time pharmacy order and stock notifications

# Webhooks (External Pharmacy API)

Register webhooks to receive real-time notifications when pharmacy orders are created, updated, or when stock levels change.

## List Webhooks

```bash theme={null}
GET /v1/external_pharmacy_api/webhooks/
```

### Response

```json theme={null}
[
  {
    "uid": "sub-abc123",
    "target": "https://your-system.com/webhooks/rxscale",
    "notification_type": "pharmacy_order_created"
  }
]
```

## Register Webhook

```bash theme={null}
POST /v1/external_pharmacy_api/webhooks/
```

### Request Body

```json theme={null}
{
  "target": "https://your-system.com/webhooks/rxscale",
  "notification_type": "pharmacy_order_created"
}
```

### Response

```json theme={null}
{
  "uid": "sub-abc123",
  "target": "https://your-system.com/webhooks/rxscale",
  "notification_type": "pharmacy_order_created",
  "signing_secret": "whsec_abc123..."
}
```

<Warning>
  The `signing_secret` is only returned once during creation. Store it securely — you'll need it to verify webhook signatures. See [Webhook Security](/webhooks/security) for details.
</Warning>

## Remove Webhook

```bash theme={null}
DELETE /v1/external_pharmacy_api/webhooks/{subscription_uid}
```

Returns `204 No Content` on success.

## Available Event Types

| Event Type                   | Description                              |
| ---------------------------- | ---------------------------------------- |
| `pharmacy_order_created`     | A new pharmacy order has been created    |
| `pharmacy_order_updated`     | An existing order's status has changed   |
| `pharmacy_sku_stock_updated` | Stock level changed for one of your SKUs |

See [Webhook Events](/webhooks/events) for full payload details.
