Skip to main content

API keys

All requests to the Pharmachain Partner API must include your API key as a Bearer token in the Authorization header.
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.

Error reference

Rate limits

If your integration requires higher production limits, contact your Pharmachain account manager at support@pharmachains.ai.