# AffinityRx docs Guides and reference for platforms and practices that send compounded prescriptions to pharmacies. All guides, the API reference index, error codes and the changelog (one document): https://docs.affinityrx.com/llms-full.txt Append .md to any documentation URL to get that page as markdown, for example /guides/send-an-order.md, /api/orders.create.md, or /errors/invalid-order.md. ## Send an order Send each order in one request: POST /v1/orders. The request creates, signs and submits the order. It contains: - An Idempotency-Key header (required). - practiceId. A platform key must send it. A practice key can omit it. - prescriber { npi, firstName, lastName }. - signatureAttestation: true. - shipping { optionId, destination? }. - The patient. Affinity finds the patient again by patient.externalId. - 1-20 prescriptions for one pharmacy. Send Affinity-Version: 2026-11-01 and Authorization: Bearer with every request. The key sets Test or Live mode. Guide: https://docs.affinityrx.com/guides/send-an-order.md Get started: https://docs.affinityrx.com/guides.md Webhooks: https://docs.affinityrx.com/guides/receive-order-updates.md API reference: https://docs.affinityrx.com/api.md Errors: https://docs.affinityrx.com/errors.md Changelog: https://docs.affinityrx.com/changelog.md OpenAPI: https://docs.affinityrx.com/openapi.json ## Connect an AI agent (MCP) An AI agent that supports MCP connects to https://api.affinityrx.com/v1/mcp. The person signs in to Affinity and allows the agent; no API key is needed. The agent creates orders that wait for the person to approve them in the Affinity app. Nothing goes to the pharmacy before the person clicks Send. Guide: https://docs.affinityrx.com/guides/connect-an-ai-agent.md ## Feedback If a response or a page is wrong or unclear, send `POST /v1/feedback` with an `Idempotency-Key`, a short message and the `requestId` from the response. Do not include patient information. Set `message` to a description of the problem. Include `pageUrl` for a documentation problem. Omit `requestId` when no error response exists. Do not include patient information. Use your API key when available. A `202` response confirms receipt. For `429`, wait for `Retry-After` before you retry. ## Guides - [Get started](https://docs.affinityrx.com/guides/index.md) - [Choose a medication](https://docs.affinityrx.com/guides/choose-a-medication/index.md) - [Connect an AI agent (MCP)](https://docs.affinityrx.com/guides/connect-an-ai-agent/index.md) - [Find and cancel orders](https://docs.affinityrx.com/guides/find-and-cancel-orders/index.md) - [Practices](https://docs.affinityrx.com/guides/practices/index.md) - [Receive order updates](https://docs.affinityrx.com/guides/receive-order-updates/index.md) - [Send an order](https://docs.affinityrx.com/guides/send-an-order/index.md) - [Test and Live mode, and IDs](https://docs.affinityrx.com/guides/test-and-live-mode/index.md) ## Pages - [guides](https://docs.affinityrx.com/guides/llms.txt)