Skip to main content

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.

API keys

All requests to the Pharmachain Partner API must include your API key as a Bearer token in the Authorization header.
Authorization: Bearer YOUR_API_KEY
Generate and manage your keys from Settings → API keys in the Partner Portal.
Treat your API key like a password. Never commit it to version control, never include it in frontend or mobile code. Rotate it immediately if you suspect it has been exposed.

Environments

Pharmachain provides two environments. Use sandbox while building and testing — no real pharmacy orders will be placed.

Sandbox

https://sandbox-api.pharmachains.ai/v1Safe for development and testing. Returns realistic mock data. No real pharmacies or fulfilment involved.

Production

https://api.pharmachains.ai/v1Live environment. Requests are routed to real verified pharmacies and fulfilled end-to-end.
Your sandbox and production API keys are different. You’ll find both in the Partner Portal under Settings → API keys.

Key rotation

You can generate a new key at any time without downtime.
  1. In the Partner Portal, go to Settings → API keys.
  2. Click Generate new key — your existing key stays active.
  3. Update the key in your production environment variables.
  4. Confirm the new key is working.
  5. Revoke the old key.
Never delete the old key before confirming the new one is live. Both keys are valid simultaneously during the switchover window.

Scopes

Each API key can be scoped to specific permissions. When generating a key, select only the scopes your integration requires.
ScopeWhat it allows
medicines:searchQuery medicine availability across pharmacies
requests:createSubmit new medicine fulfilment requests
requests:readRead request status and timeline
requests:cancelCancel pending requests
webhooks:manageRegister and manage webhook endpoints

Error reference

HTTP statusError codeMeaning
401invalid_api_keyKey is missing, malformed, or has been revoked
401expired_api_keyKey has passed its expiry date — rotate immediately
403insufficient_scopeKey does not have permission for this action
429rate_limit_exceededYou’ve exceeded the allowed request rate

Rate limits

EnvironmentRequests / minuteRequests / day
Sandbox605,000
Production300100,000
If your integration requires higher production limits, contact your Pharmachain account manager at support@pharmachains.ai.