Properties
| Name | Type | Description |
|---|---|---|
| externalOrderId | object | Your order identifier, unique within the practice and mode. A failed or cancelled order keeps it, so send a new one for a replacement order. |
| patient | object | |
| practiceId | string | Required with a platform API key. Send a child practice ID. Independent practice keys can omit this field to use their own practice. |
| prescriber | object | |
| prescriptions | array | The 1 to 20 prescriptions approved for this patient. |
| shipping | object | The shipping option and destination. |
| signatureAttestation | boolean | Must be true to attest that the named prescriber approved and signed these prescriptions. |
JSON Schema
{
"$schema": "https://json-schema.org/draft/2020-12/schema",
"$id": "https://artifacts.apis.io/affinityrx-com/json-schema/affinityrx-com-order-input-schema.json",
"title": "OrderInput",
"x-generated": "2026-11-23",
"x-method": "derived",
"x-generator": "derive-json-schema.py",
"x-source": "openapi/affinityrx-com-openapi.json#/components/schemas/OrderInput",
"type": "object",
"properties": {
"externalOrderId": {
"anyOf": [
{
"type": "string",
"maxLength": 128,
"pattern": "^\\s*[^\\s\\x00-\\x08\\x0a-\\x1f\\x7f-\\x9f](?:[^\\x00-\\x08\\x0a-\\x1f\\x7f-\\x9f]*[^\\s\\x00-\\x08\\x0a-\\x1f\\x7f-\\x9f])?\\s*$",
"description": "Text with at least one visible character."
},
{
"type": "null"
}
],
"description": "Your order identifier, unique within the practice and mode. A failed or cancelled order keeps it, so send a new one for a replacement order."
},
"patient": {
"$ref": "#/$defs/PatientInput"
},
"practiceId": {
"type": "string",
"pattern": "^prac_[0-7][0-9a-hjkmnp-tv-z]{25}$",
"description": "Required with a platform API key. Send a child practice ID. Independent practice keys can omit this field to use their own practice."
},
"prescriber": {
"$ref": "#/$defs/PrescriberInput"
},
"prescriptions": {
"type": "array",
"items": {
"$ref": "#/$defs/PrescriptionInput"
},
"description": "The 1 to 20 prescriptions approved for this patient.",
"minItems": 1,
"maxItems": 20
},
"shipping": {
"type": "object",
"properties": {
"optionId": {
"type": "string",
"pattern": "^shp_[0-7][0-9a-hjkmnp-tv-z]{25}$",
"description": "The shipping option identifier from the medication's shippingOptions."
},
"destination": {
"$ref": "#/$defs/ShippingDestinationInput"
}
},
"required": [
"optionId"
],
"additionalProperties": false,
"description": "The shipping option and destination."
},
"signatureAttestation": {
"type": "boolean",
"description": "Must be true to attest that the named prescriber approved and signed these prescriptions."
}
},
"required": [
"patient",
"prescriptions",
"shipping",
"signatureAttestation"
],
"additionalProperties": false,
"$defs": {
"AddressInput": {
"type": "object",
"properties": {
"line1": {
"type": "string",
"maxLength": 200,
"pattern": "^\\s*[^\\s\\x00-\\x08\\x0a-\\x1f\\x7f-\\x9f](?:[^\\x00-\\x08\\x0a-\\x1f\\x7f-\\x9f]*[^\\s\\x00-\\x08\\x0a-\\x1f\\x7f-\\x9f])?\\s*$",
"description": "The street address."
},
"line2": {
"anyOf": [
{
"type": "string",
"pattern": "^\\s*(?:[^\\s\\x00-\\x08\\x0a-\\x1f\\x7f-\\x9f](?:[^\\x00-\\x08\\x0a-\\x1f\\x7f-\\x9f]*[^\\s\\x00-\\x08\\x0a-\\x1f\\x7f-\\x9f])?\\s*)?$",
"maxLength": 200
},
{
"type": "null"
}
],
"description": "The apartment or suite, or null when there is none. Empty text, N/A, NA, none and - count as null. See notes, TBD and unknown return 422."
},
"city": {
"type": "string",
"maxLength": 100,
"pattern": "^\\s*[^\\s\\x00-\\x08\\x0a-\\x1f\\x7f-\\x9f](?:[^\\x00-\\x08\\x0a-\\x1f\\x7f-\\x9f]*[^\\s\\x00-\\x08\\x0a-\\x1f\\x7f-\\x9f])?\\s*$",
"description": "The city name."
},
"state": {
"type": "string",
"pattern": "^\\s*(?:[Aa][Ll]|[Aa][Kk]|[Aa][Zz]|[Aa][Rr]|[Cc][Aa]|[Cc][Oo]|[Cc][Tt]|[Dd][Ee]|[Dd][Cc]|[Ff][Ll]|[Gg][Aa]|[Hh][Ii]|[Ii][Dd]|[Ii][Ll]|[Ii][Nn]|[Ii][Aa]|[Kk][Ss]|[Kk][Yy]|[Ll][Aa]|[Mm][Ee]|[Mm][Dd]|[Mm][Aa]|[Mm][Ii]|[Mm][Nn]|[Mm][Ss]|[Mm][Oo]|[Mm][Tt]|[Nn][Ee]|[Nn][Vv]|[Nn][Hh]|[Nn][Jj]|[Nn][Mm]|[Nn][Yy]|[Nn][Cc]|[Nn][Dd]|[Oo][Hh]|[Oo][Kk]|[Oo][Rr]|[Pp][Aa]|[Rr][Ii]|[Ss][Cc]|[Ss][Dd]|[Tt][Nn]|[Tt][Xx]|[Uu][Tt]|[Vv][Tt]|[Vv][Aa]|[Ww][Aa]|[Ww][Vv]|[Ww][Ii]|[Ww][Yy]|[Aa][Ss]|[Gg][Uu]|[Mm][Pp]|[Pp][Rr]|[Vv][Ii]|[Aa][Aa]|[Aa][Ee]|[Aa][Pp])\\s*$",
"description": "The two-letter US state or territory code, such as TX, in any letter case. Affinity stores and returns it in upper case."
},
"postalCode": {
"type": "string",
"pattern": "^\\s*\\d{5}(?:[ -]?\\d{4})?\\s*$",
"description": "The US ZIP code: 78701, or ZIP+4 as 78701-1234, 78701 1234 or 787011234. Affinity stores and returns 78701 or 78701-1234."
}
},
"required": [
"line1",
"city",
"state",
"postalCode"
],
"additionalProperties": false,
"description": "The US mailing address."
},
"PatientInput": {
"type": "object",
"properties": {
"address": {
"$ref": "#/$defs/AddressInput"
},
"allergies": {
"type": "array",
"items": {
"type": "object",
"properties": {
"category": {
"type": "string",
"enum": [
"drug",
"food",
"insect",
"latex",
"mold",
"pet",
"pollen"
],
"description": "The allergy category."
},
"display": {
"type": "string",
"maxLength": 200,
"pattern": "^\\s*[^\\s\\x00-\\x1f\\x7f-\\x9f](?:[^\\x00-\\x1f\\x7f-\\x9f]*[^\\s\\x00-\\x1f\\x7f-\\x9f])?\\s*$",
"minLength": 1,
"description": "The reported allergy name. A whole-value no-allergy statement (NKDA, NKFA, none, unknown, denies, no, N/A and the same kind of phrase) returns 422, ignoring case, dots, hyphens, slashes, spaces and a trailing period. Send `[]` instead."
}
},
"required": [
"category",
"display"
],
"additionalProperties": false
},
"description": "The reported allergies. Send `[]` when the patient reports no new allergies.",
"maxItems": 50
},
"dateOfBirth": {
"type": "string",
"pattern": "^\\s*(?:(19|20)\\d\\d-(0[1-9]|1[0-2])-(0[1-9]|[12]\\d|3[01]))\\s*$",
"description": "A real calendar date in YYYY-MM-DD format, with a year from 1900 through 2099, today or earlier in UTC. Surrounding spaces are removed."
},
"email": {
"type": "string",
"maxLength": 254,
"pattern": "^\\s*[^\\s@\\x00-\\x1f\\x7f-\\x9f]+@[^\\s@\\x00-\\x1f\\x7f-\\x9f]+\\.[^\\s@\\x00-\\x1f\\x7f-\\x9f]+\\s*$",
"description": "The patient's email address."
},
"firstName": {
"type": "string",
"maxLength": 60,
"pattern": "^\\s*[^\\s\\x00-\\x08\\x0a-\\x1f\\x7f-\\x9f](?:[^\\x00-\\x08\\x0a-\\x1f\\x7f-\\x9f]*[^\\s\\x00-\\x08\\x0a-\\x1f\\x7f-\\x9f])?\\s*$",
"description": "The first name. N/A, TBD, unknown and none return 422."
},
"sex": {
"type": "string",
"enum": [
"female",
"male",
"unknown"
],
"description": "The patient's sex as sent to the pharmacy."
},
"lastName": {
"type": "string",
"maxLength": 60,
"pattern": "^\\s*[^\\s\\x00-\\x08\\x0a-\\x1f\\x7f-\\x9f](?:[^\\x00-\\x08\\x0a-\\x1f\\x7f-\\x9f]*[^\\s\\x00-\\x08\\x0a-\\x1f\\x7f-\\x9f])?\\s*$",
"description": "The last name. N/A, TBD, unknown and none return 422."
},
"middleName": {
"anyOf": [
{
"type": "string",
"pattern": "^\\s*(?:[^\\s\\x00-\\x08\\x0a-\\x1f\\x7f-\\x9f](?:[^\\x00-\\x08\\x0a-\\x1f\\x7f-\\x9f]*[^\\s\\x00-\\x08\\x0a-\\x1f\\x7f-\\x9f])?\\s*)?$",
"maxLength": 60
},
{
"type": "null"
}
],
"description": "The patient's middle name, or null when there is none. Empty text counts as null."
},
"phone": {
"type": "string",
"maxLength": 40,
"pattern": "^[\\s\\x28\\x29\\x2d\\x2e֊־᐀᠆‐‑‒–—―⸗⸚⸺⸻⹀⹝〜〰゠︱︲﹘﹣-𐺭]*(?:\\+[\\s\\x28\\x29\\x2d\\x2e֊־᐀᠆‐‑‒–—―⸗⸚⸺⸻⹀⹝〜〰゠︱︲﹘﹣-𐺭]*1[\\s\\x28\\x29\\x2d\\x2e֊־᐀᠆‐‑‒–—―⸗⸚⸺⸻⹀⹝〜〰゠︱︲﹘﹣-𐺭]*|1[\\s\\x28\\x29\\x2d\\x2e֊־᐀᠆‐‑‒–—―⸗⸚⸺⸻⹀⹝〜〰゠︱︲﹘﹣-𐺭]*)?(?:[0-9][\\s\\x28\\x29\\x2d\\x2e֊־᐀᠆‐‑‒–—―⸗⸚⸺⸻⹀⹝〜〰゠︱︲﹘﹣-𐺭]*){10}$",
"description": "A US phone number: 10 digits, with or without +1 or 1 before them. Spaces, dashes, dots and parentheses are allowed, such as (512) 555-0100. Affinity stores and returns +15125550100."
},
"externalId": {
"anyOf": [
{
"type": "string",
"maxLength": 128,
"pattern": "^\\s*[^\\s\\x00-\\x08\\x0a-\\x1f\\x7f-\\x9f](?:[^\\x00-\\x08\\x0a-\\x1f\\x7f-\\x9f]*[^\\s\\x00-\\x08\\x0a-\\x1f\\x7f-\\x9f])?\\s*$",
"description": "Text with at least one visible character."
},
{
"type": "null"
}
],
"description": "Your patient identifier within the practice and mode. Omit it and id to create a new patient for each order. With id, send the saved patient's externalId or omit it. If the saved patient has none, this value is added to it."
},
"id": {
"type": "string",
"pattern": "^pat_[0-7][0-9a-hjkmnp-tv-z]{25}$",
"description": "The pat_ ID of a saved patient of the order's practice, in the same Test or Live mode. The order reuses that patient and updates it from the sent fields. Send all other patient fields as usual. GET /v1/orders returns the patientId of each order. An unknown ID, or an ID of a different practice or mode, returns 404 not_found."
}
},
"required": [
"address",
"allergies",
"dateOfBirth",
"email",
"firstName",
"sex",
"lastName",
"phone"
],
"additionalProperties": false,
"description": "The patient details that the pharmacy receives."
},
"PrescriberInput": {
"type": "object",
"properties": {
"phone": {
"anyOf": [
{
"type": "string",
"maxLength": 40,
"pattern": "^(?:\\s*|[\\s\\x28\\x29\\x2d\\x2e֊־᐀᠆‐‑‒–—―⸗⸚⸺⸻⹀⹝〜〰゠︱︲﹘﹣-𐺭]*(?:\\+[\\s\\x28\\x29\\x2d\\x2e֊־᐀᠆‐‑‒–—―⸗⸚⸺⸻⹀⹝〜〰゠︱︲﹘﹣-𐺭]*1[\\s\\x28\\x29\\x2d\\x2e֊־᐀᠆‐‑‒–—―⸗⸚⸺⸻⹀⹝〜〰゠︱︲﹘﹣-𐺭]*|1[\\s\\x28\\x29\\x2d\\x2e֊־᐀᠆‐‑‒–—―⸗⸚⸺⸻⹀⹝〜〰゠︱︲﹘﹣-𐺭]*)?(?:[0-9][\\s\\x28\\x29\\x2d\\x2e֊־᐀᠆‐‑‒–—―⸗⸚⸺⸻⹀⹝〜〰゠︱︲﹘﹣-𐺭]*){10})$"
},
{
"type": "null"
}
],
"description": "A US phone number: 10 digits, with or without +1 or 1 before them. Spaces, dashes, dots and parentheses are allowed, such as (512) 555-0100. Affinity stores and returns +15125550100. Empty text counts as null. When the phone is omitted, null or blank, the order uses the practice phone."
},
"address": {
"$ref": "#/$defs/AddressInput"
},
"firstName": {
"type": "string",
"maxLength": 60,
"pattern": "^\\s*[^\\s\\x00-\\x08\\x0a-\\x1f\\x7f-\\x9f](?:[^\\x00-\\x08\\x0a-\\x1f\\x7f-\\x9f]*[^\\s\\x00-\\x08\\x0a-\\x1f\\x7f-\\x9f])?\\s*$",
"description": "The first name."
},
"lastName": {
"type": "string",
"maxLength": 60,
"pattern": "^\\s*[^\\s\\x00-\\x08\\x0a-\\x1f\\x7f-\\x9f](?:[^\\x00-\\x08\\x0a-\\x1f\\x7f-\\x9f]*[^\\s\\x00-\\x08\\x0a-\\x1f\\x7f-\\x9f])?\\s*$",
"description": "The last name."
},
"npi": {
"type": "string",
"pattern": "^\\s*(?:\\d{10})\\s*$",
"description": "The prescribing clinician's 10-digit National Provider Identifier (NPI). Surrounding spaces are removed."
}
},
"required": [
"firstName",
"lastName",
"npi"
],
"additionalProperties": false,
"description": "Required with an API key. Send the prescribing clinician's NPI, firstName and lastName. Session callers can omit this field to sign with their own profile."
},
"PrescriptionInput": {
"type": "object",
"properties": {
"compoundingReason": {
"anyOf": [
{
"type": "string",
"pattern": "^\\s*(?:[^\\s\\x00-\\x08\\x0a-\\x1f\\x7f-\\x9f](?:[^\\x00-\\x08\\x0a-\\x1f\\x7f-\\x9f]*[^\\s\\x00-\\x08\\x0a-\\x1f\\x7f-\\x9f])?\\s*)?$",
"maxLength": 200
},
{
"type": "null"
}
],
"description": "One of the medication's compoundingReasons values, required when the medication's requirements include it. Another value returns 422. Empty text counts as null."
},
"daysSupply": {
"type": [
"integer",
"null"
],
"minimum": 1,
"maximum": 365,
"description": "The number of days the prescribed quantity lasts, required when the medication's requirements include it. Null counts as not sent."
},
"directions": {
"type": "string",
"maxLength": 2000,
"pattern": "^\\s*[^\\s\\x00-\\x08\\x0b\\x0c\\x0e-\\x1f\\x7f-\\x9f](?:[^\\x00-\\x08\\x0b\\x0c\\x0e-\\x1f\\x7f-\\x9f]*[^\\s\\x00-\\x08\\x0b\\x0c\\x0e-\\x1f\\x7f-\\x9f])?\\s*$",
"description": "The prescriber's directions for use, as the clinician wrote them. None, N/A, NA, TBD, unknown and see notes return 422."
},
"medicationId": {
"type": "string",
"pattern": "^med_[0-7][0-9a-hjkmnp-tv-z]{25}$",
"description": "The medication's public identifier from the current catalog."
},
"notes": {
"anyOf": [
{
"type": "string",
"pattern": "^\\s*(?:[^\\s\\x00-\\x08\\x0b\\x0c\\x0e-\\x1f\\x7f-\\x9f](?:[^\\x00-\\x08\\x0b\\x0c\\x0e-\\x1f\\x7f-\\x9f]*[^\\s\\x00-\\x08\\x0b\\x0c\\x0e-\\x1f\\x7f-\\x9f])?\\s*)?$",
"maxLength": 1000
},
{
"type": "null"
}
],
"description": "The prescriber's additional notes to the pharmacy. Empty text counts as null."
},
"quantity": {
"type": "integer",
"minimum": 1,
"maximum": 10000,
"description": "The prescribed quantity in quantityUnit, not a count of fills. With a fill, send a whole number of fills in units: two fills of 30 tablets is 60. A vial's unit is vial, so 2 is two vials."
},
"refills": {
"type": "integer",
"minimum": 0,
"maximum": 99,
"description": "The number of authorized refills in addition to the first fill. It cannot be more than the medication's maxRefills: a larger value returns 422 invalid_order."
},
"substitutionPermitted": {
"type": "boolean",
"description": "Whether the prescriber permits substitution; defaults to true when omitted.",
"default": true
}
},
"required": [
"directions",
"medicationId",
"quantity",
"refills"
],
"additionalProperties": false
},
"ShippingDestinationAddressInput": {
"type": "object",
"properties": {
"type": {
"$ref": "#/$defs/ShippingDestinationAddressType"
},
"address": {
"$ref": "#/$defs/AddressInput"
}
},
"required": [
"type",
"address"
],
"additionalProperties": false
},
"ShippingDestinationAddressType": {
"type": "string",
"enum": [
"address"
],
"description": "Use patient, practice or address to select the shipping destination."
},
"ShippingDestinationInput": {
"description": "Defaults to the patient's address. State restrictions and pharmacy coverage use the destination's state.",
"oneOf": [
{
"$ref": "#/$defs/ShippingDestinationPatientInput"
},
{
"$ref": "#/$defs/ShippingDestinationPracticeInput"
},
{
"$ref": "#/$defs/ShippingDestinationAddressInput"
}
]
},
"ShippingDestinationPatientInput": {
"type": "object",
"properties": {
"type": {
"$ref": "#/$defs/ShippingDestinationPatientType"
}
},
"required": [
"type"
],
"additionalProperties": false
},
"ShippingDestinationPatientType": {
"type": "string",
"enum": [
"patient"
],
"description": "Use patient, practice or address to select the shipping destination."
},
"ShippingDestinationPracticeInput": {
"type": "object",
"properties": {
"type": {
"$ref": "#/$defs/ShippingDestinationPracticeType"
}
},
"required": [
"type"
],
"additionalProperties": false
},
"ShippingDestinationPracticeType": {
"type": "string",
"enum": [
"practice"
],
"description": "Use patient, practice or address to select the shipping destination."
}
}
}
Work with this as data
Every JSON Schema here is available over the APIs.io API and to AI agents over MCP.
MCP server
One button, every client — Claude, Cursor, VS Code and the rest.
https://apis.io/mcp
Tools for schemas
4 MCP tools reach this
find_json_schemasBrowse and filter every JSON Schema in the catalog.apis_io_searchSTART HERE — APIs, providers and tags for one query, each with its total.resolveTurn a domain, URL or GitHub org into the provider it belongs to.find_cohortsEvery scored population of providers in the catalog.
Call it yourself
curl for this page
This JSON Schema
curl "https://apis.io/api/v1/json-schemas/affinityrx-com-order-input"
All schemas
curl "https://apis.io/api/v1/json-schemas?limit=25"
Calls without X-API-Key need no key. Calls with it need a paid plan — get a key.
Get an API key
Free tier, no form to fill in. Signing in shares your email address with us — we store it to create your key and to recognise you if you sign in with another provider. By signing up you are subscribing to the APIs.io and API Evangelist newsletters — you can unsubscribe from any issue. See our Privacy Policy and Terms.
A second provider on the same verified email joins the account you already have.