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

# Introduction

> Everything you need to know before making your first API call

## Overview

The Pharmachain Partner API is a RESTful API. All requests and responses
use JSON. It is designed for HMO platforms and healthtech products that
need to search for medicines, submit fulfilment requests, and track orders
on behalf of enrollees.

<CardGroup cols={2}>
  <Card title="Search medicines" icon="magnifying-glass" href="/api-reference/endpoint/search">
    Find drugs by name and get a ranked list of pharmacies with stock,
    pricing, and delivery estimates.
  </Card>

  <Card title="Create a request" icon="bag-shopping" href="/api-reference/endpoint/create">
    Submit a medicine fulfilment request for an enrollee and kick off
    the pharmacy workflow.
  </Card>

  <Card title="Get request status" icon="location-dot" href="/api-reference/endpoint/get">
    Poll for the current status and full timeline of any active
    medicine request.
  </Card>

  <Card title="Cancel a request" icon="ban" href="/api-reference/endpoint/delete">
    Cancel a pending request before it progresses to dispensing.
  </Card>

  <Card title="Webhooks" icon="webhook" href="/api-reference/endpoint/webhook">
    Receive real-time push notifications when a request status changes —
    no polling required.
  </Card>
</CardGroup>

## Base URLs

```
Sandbox:    https://sandbox-api.pharmachains.ai/v1
Production: https://api.pharmachains.ai/v1
```

<Tip>
  Always develop and test against the sandbox URL. Switch to production
  only when your integration is stable.
</Tip>

## Authentication

All endpoints require a Bearer token in the `Authorization` header.

```http theme={null}
Authorization: Bearer YOUR_API_KEY
```

See the [Authentication guide](/development) for how to generate keys,
manage scopes, and rotate credentials.

## Request format

All `POST` and `PUT` requests must include a JSON body and the
`Content-Type` header.

```http theme={null}
Content-Type: application/json
Authorization: Bearer YOUR_API_KEY
```

`GET` and `DELETE` requests use path parameters or query strings — no body required.

## Response format

Every response follows the same envelope structure.

**Success:**

```json theme={null}
{
  "success": true,
  "data": { }
}
```

**Error:**

```json theme={null}
{
  "success": false,
  "error": {
    "code": "medicine_not_found",
    "message": "No results found for the specified query and location.",
    "status": 404
  }
}
```

## Versioning

The current API version is **v1**, included in every base URL. When
breaking changes are introduced, a new version will be released and
all partners will receive advance notice before the old version is deprecated.
