Affinity connects software platforms and healthcare practices to a network of compounding pharmacies. One API request creates, signs and sends a prescription order; Affinity tracks it until delivery.
- API documentation: docs.affinityrx.com
- API contract: api.affinityrx.com/v1/openapi.json.
The current
Affinity-Versionis2026-10-28. - Use a Test key while you build. Test orders go to a test pharmacy.
Each SDK is generated from the API contract with Fern.
| Language | Repository | Install |
|---|---|---|
| TypeScript | affinity-typescript | npm install @affinity-health/sdk@next |
| Python | affinity-python | From GitHub, tag v0.4.1 |
| Go | affinity-go | go get github.com/affinity-health/affinity-go@v0.4.2 |
| Java | affinity-java | From GitHub, tag v0.4.1 |
| C# | affinity-csharp | From GitHub, tag v0.4.1 |
The TypeScript SDK is a beta on npm's next tag. The other SDKs are not on a package registry yet;
each README shows how to install from GitHub. More about the contract:
affinity-openapi.
Every write takes an idempotency key. Save it with the order before you send it, and send the same key when you retry, so a retry never creates a second order.
- A provider is an individual clinician or prescriber.
- A practice is the customer organization and API tenant.
The SDKs are for trusted servers. Never put an Affinity API key in a browser, a mobile application, a public repository or a log.
Report a vulnerability to support@affinityrx.com with "Security" in the subject. Do not open a
public issue.