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

# Overview

> External Pharmacy API for pharmacy integrations

# External Pharmacy API

The External Pharmacy API enables pharmacies to manage their orders, update stock levels, and receive real-time notifications about order changes.

## Base Path

```
/v1/external_pharmacy_api
```

## Interactive API Documentation (Swagger)

A live Swagger UI is available for exploring and testing endpoints directly in your browser:

```
https://api.rxscale.com/v1/external_pharmacy_api/apidocs
```

<Tip>
  The Swagger UI lets you try out API calls interactively. Authenticate with your API key to test against real data.
</Tip>

## Authentication

All endpoints require an API key via the `X-API-Key` header. See [Authentication](/authentication) for details.

### API Key Scoping

API keys can be scoped to either a single pharmacy or an entire pharmacy group:

* **Single-pharmacy keys** are tied to one specific pharmacy. All requests are automatically scoped to that pharmacy, and no additional parameters are needed.
* **Group-wide keys** cover all pharmacies within a pharmacy group. When using a group-wide API key, the `pharmacy_uid` query parameter is **required** on most endpoints to specify which pharmacy you are operating on.

```bash theme={null}
# Group-wide API key: pharmacy_uid is required
GET /v1/external_pharmacy_api/pharmacy_orders/?pharmacy_uid=your-pharmacy-uid

# Single-pharmacy API key: no pharmacy_uid needed
GET /v1/external_pharmacy_api/pharmacy_orders/
```

<Warning>
  If you use a group-wide API key and omit the `pharmacy_uid` parameter on an endpoint that requires it, the request will return an error.
</Warning>

## Available Endpoints

| Method   | Endpoint                                | Description                                |
| -------- | --------------------------------------- | ------------------------------------------ |
| `GET`    | `/pharmacy_orders/`                     | List pharmacy orders                       |
| `GET`    | `/pharmacy_orders/{uid}`                | Get order details                          |
| `PATCH`  | `/pharmacy_orders/{uid}/status`         | Update order status                        |
| `PATCH`  | `/pharmacy_orders/{uid}/complete_order` | Complete an order                          |
| `GET`    | `/payouts`                              | List projected and routed pharmacy payouts |
| `GET`    | `/pharmacy_skus/`                       | List pharmacy SKUs                         |
| `PATCH`  | `/pharmacy_skus/{uid}`                  | Update SKU (price, stock, external\_id)    |
| `PATCH`  | `/pharmacy_skus/{uid}/stock`            | Update stock level                         |
| `PATCH`  | `/pharmacy_skus/{uid}/external_id`      | Update external ID                         |
| `GET`    | `/webhooks/`                            | List webhook subscriptions                 |
| `POST`   | `/webhooks/`                            | Register a webhook                         |
| `DELETE` | `/webhooks/{uid}`                       | Remove a webhook                           |

## Required Permissions

| Endpoint                  | Required Permission                   |
| ------------------------- | ------------------------------------- |
| List/View orders          | `orders_read`                         |
| List payouts              | `orders_read`                         |
| Update or complete orders | `orders_write`                        |
| List SKUs                 | `stock_read`                          |
| Update SKU data           | `stock_write` or `pharmacy_sku_write` |
| Manage webhooks           | `webhooks_read` / `webhooks_write`    |
