{
  "openapi": "3.1.0",
  "info": {
    "title": "Affinity API",
    "version": "2026-09-28",
    "contact": {
      "email": "support@joinaffinityai.com",
      "name": "Affinity API Support"
    },
    "description": "Affinity API for practices and software platforms connecting to the pharmacy network.",
    "license": {
      "name": "Apache 2.0",
      "url": "https://www.apache.org/licenses/LICENSE-2.0.html"
    }
  },
  "paths": {
    "/v1/practices/{practiceId}/locations": {
      "get": {
        "tags": [
          "Locations"
        ],
        "operationId": "listPracticeLocations",
        "parameters": [
          {
            "in": "path",
            "name": "practiceId",
            "required": true,
            "schema": {
              "type": "string",
              "pattern": "^prac_[0-7][0-9a-hjkmnp-tv-z]{25}$",
              "examples": [
                "prac_01j2y8m6jcc9tt24af5pw9x1bc"
              ]
            }
          },
          {
            "in": "query",
            "name": "limit",
            "required": false,
            "schema": {
              "default": 25,
              "maximum": 100,
              "minimum": 1,
              "type": "integer"
            }
          },
          {
            "in": "query",
            "name": "startingAfter",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string",
                  "pattern": "^loc_[0-7][0-9a-hjkmnp-tv-z]{25}$",
                  "examples": [
                    "loc_01j2y8m6jcc9tt24af5pw9x1bc"
                  ]
                },
                {
                  "type": "null"
                }
              ]
            }
          },
          {
            "in": "query",
            "name": "endingBefore",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string",
                  "pattern": "^loc_[0-7][0-9a-hjkmnp-tv-z]{25}$",
                  "examples": [
                    "loc_01j2y8m6jcc9tt24af5pw9x1bc"
                  ]
                },
                {
                  "type": "null"
                }
              ]
            }
          },
          {
            "in": "query",
            "name": "status",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string",
                  "enum": [
                    "active",
                    "archived"
                  ]
                },
                {
                  "type": "null"
                }
              ]
            }
          },
          {
            "in": "header",
            "name": "Affinity-Version",
            "required": false,
            "schema": {
              "type": "string"
            },
            "description": "Selects the HTTP API contract for this request only. When omitted, API-key requests use their service account’s stored version. Does not change the stored default."
          }
        ],
        "security": [
          {
            "bearerAuth": []
          },
          {
            "affinityApiKey": []
          }
        ],
        "responses": {
          "200": {
            "description": "HTTP 200",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ListPracticeLocationsResponse"
                }
              }
            }
          },
          "400": {
            "description": "HTTP 400",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "401": {
            "description": "HTTP 401",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "403": {
            "description": "HTTP 403",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "404": {
            "description": "HTTP 404",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "409": {
            "description": "HTTP 409",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "429": {
            "description": "HTTP 429",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          }
        },
        "description": "Requires locations:read on a practice key or an authorized platform key. Lists active and archived locations by name, with cursor pagination. Use status to filter. Location records are shared between Test and Live for the same practice.",
        "summary": "List locations",
        "x-pier-pagination": {
          "cursorField": "id",
          "kind": "cursor"
        },
        "x-visibility": "public"
      },
      "post": {
        "tags": [
          "Locations"
        ],
        "operationId": "createPracticeLocation",
        "parameters": [
          {
            "in": "path",
            "name": "practiceId",
            "required": true,
            "schema": {
              "type": "string",
              "pattern": "^prac_[0-7][0-9a-hjkmnp-tv-z]{25}$",
              "examples": [
                "prac_01j2y8m6jcc9tt24af5pw9x1bc"
              ]
            }
          },
          {
            "in": "header",
            "name": "Affinity-Version",
            "required": false,
            "schema": {
              "type": "string"
            },
            "description": "Selects the HTTP API contract for this request only. When omitted, API-key requests use their service account’s stored version. Does not change the stored default."
          },
          {
            "in": "header",
            "name": "Idempotency-Key",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "security": [
          {
            "bearerAuth": []
          },
          {
            "affinityApiKey": []
          }
        ],
        "responses": {
          "200": {
            "description": "HTTP 200",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CreatePracticeLocationResponse"
                }
              }
            }
          },
          "400": {
            "description": "HTTP 400",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "401": {
            "description": "HTTP 401",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "403": {
            "description": "HTTP 403",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "404": {
            "description": "HTTP 404",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "409": {
            "description": "HTTP 409",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "429": {
            "description": "HTTP 429",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          }
        },
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CreatePracticeLocationRequest"
              }
            }
          },
          "required": true
        },
        "description": "Requires locations:write and Idempotency-Key for API keys. Creates an active location with a unique name in this practice. Locations are shared between Test and Live. Use the returned ID for Team location access.",
        "summary": "Create location",
        "x-visibility": "public"
      }
    },
    "/v1/practices/{practiceId}/locations/{locationId}": {
      "get": {
        "tags": [
          "Locations"
        ],
        "operationId": "getPracticeLocation",
        "parameters": [
          {
            "in": "path",
            "name": "practiceId",
            "required": true,
            "schema": {
              "type": "string",
              "pattern": "^prac_[0-7][0-9a-hjkmnp-tv-z]{25}$",
              "examples": [
                "prac_01j2y8m6jcc9tt24af5pw9x1bc"
              ]
            }
          },
          {
            "in": "path",
            "name": "locationId",
            "required": true,
            "schema": {
              "type": "string",
              "pattern": "^loc_[0-7][0-9a-hjkmnp-tv-z]{25}$",
              "examples": [
                "loc_01j2y8m6jcc9tt24af5pw9x1bc"
              ]
            }
          },
          {
            "in": "header",
            "name": "Affinity-Version",
            "required": false,
            "schema": {
              "type": "string"
            },
            "description": "Selects the HTTP API contract for this request only. When omitted, API-key requests use their service account’s stored version. Does not change the stored default."
          }
        ],
        "security": [
          {
            "bearerAuth": []
          },
          {
            "affinityApiKey": []
          }
        ],
        "responses": {
          "200": {
            "description": "HTTP 200",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/GetPracticeLocationResponse"
                }
              }
            }
          },
          "400": {
            "description": "HTTP 400",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "401": {
            "description": "HTTP 401",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "403": {
            "description": "HTTP 403",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "404": {
            "description": "HTTP 404",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "409": {
            "description": "HTTP 409",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "429": {
            "description": "HTTP 429",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          }
        },
        "description": "Requires locations:read. Returns one active or archived location in the authorized practice.",
        "summary": "Read location",
        "x-visibility": "public"
      },
      "patch": {
        "tags": [
          "Locations"
        ],
        "operationId": "updatePracticeLocation",
        "parameters": [
          {
            "in": "path",
            "name": "practiceId",
            "required": true,
            "schema": {
              "type": "string",
              "pattern": "^prac_[0-7][0-9a-hjkmnp-tv-z]{25}$",
              "examples": [
                "prac_01j2y8m6jcc9tt24af5pw9x1bc"
              ]
            }
          },
          {
            "in": "path",
            "name": "locationId",
            "required": true,
            "schema": {
              "type": "string",
              "pattern": "^loc_[0-7][0-9a-hjkmnp-tv-z]{25}$",
              "examples": [
                "loc_01j2y8m6jcc9tt24af5pw9x1bc"
              ]
            }
          },
          {
            "in": "header",
            "name": "Affinity-Version",
            "required": false,
            "schema": {
              "type": "string"
            },
            "description": "Selects the HTTP API contract for this request only. When omitted, API-key requests use their service account’s stored version. Does not change the stored default."
          },
          {
            "in": "header",
            "name": "Idempotency-Key",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "security": [
          {
            "bearerAuth": []
          },
          {
            "affinityApiKey": []
          }
        ],
        "responses": {
          "200": {
            "description": "HTTP 200",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/UpdatePracticeLocationResponse"
                }
              }
            }
          },
          "400": {
            "description": "HTTP 400",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "401": {
            "description": "HTTP 401",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "403": {
            "description": "HTTP 403",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "404": {
            "description": "HTTP 404",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "409": {
            "description": "HTTP 409",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "429": {
            "description": "HTTP 429",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          }
        },
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/UpdatePracticeLocationRequest"
              }
            }
          },
          "required": true
        },
        "description": "Requires locations:write and Idempotency-Key for API keys. Updates only supplied fields; null clears optional contact and address fields. Archived locations cannot be updated. Changes apply to both Test and Live.",
        "summary": "Update location",
        "x-visibility": "public"
      }
    },
    "/v1/practices/{practiceId}/locations/{locationId}/archive": {
      "post": {
        "tags": [
          "Locations"
        ],
        "operationId": "archivePracticeLocation",
        "parameters": [
          {
            "in": "path",
            "name": "practiceId",
            "required": true,
            "schema": {
              "type": "string",
              "pattern": "^prac_[0-7][0-9a-hjkmnp-tv-z]{25}$",
              "examples": [
                "prac_01j2y8m6jcc9tt24af5pw9x1bc"
              ]
            }
          },
          {
            "in": "path",
            "name": "locationId",
            "required": true,
            "schema": {
              "type": "string",
              "pattern": "^loc_[0-7][0-9a-hjkmnp-tv-z]{25}$",
              "examples": [
                "loc_01j2y8m6jcc9tt24af5pw9x1bc"
              ]
            }
          },
          {
            "in": "header",
            "name": "Affinity-Version",
            "required": false,
            "schema": {
              "type": "string"
            },
            "description": "Selects the HTTP API contract for this request only. When omitted, API-key requests use their service account’s stored version. Does not change the stored default."
          },
          {
            "in": "header",
            "name": "Idempotency-Key",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "security": [
          {
            "bearerAuth": []
          },
          {
            "affinityApiKey": []
          }
        ],
        "responses": {
          "200": {
            "description": "HTTP 200",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ArchivePracticeLocationResponse"
                }
              }
            }
          },
          "400": {
            "description": "HTTP 400",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "401": {
            "description": "HTTP 401",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "403": {
            "description": "HTTP 403",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "404": {
            "description": "HTTP 404",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "409": {
            "description": "HTTP 409",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "429": {
            "description": "HTTP 429",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          }
        },
        "description": "Requires locations:write and Idempotency-Key for API keys. Retains the location and historical associations. Archived locations cannot receive new Team assignments. Repeating archive returns the archived location. Changes apply to both Test and Live.",
        "summary": "Archive location",
        "x-visibility": "public"
      }
    },
    "/v1/practices/{practiceId}/api-keys": {
      "post": {
        "tags": [
          "API Keys"
        ],
        "operationId": "createPlatformPracticeApiKey",
        "parameters": [
          {
            "in": "path",
            "name": "practiceId",
            "required": true,
            "schema": {
              "type": "string",
              "pattern": "^prac_[0-9a-hjkmnp-tv-z]{26}$"
            }
          },
          {
            "in": "header",
            "name": "Affinity-Version",
            "required": false,
            "schema": {
              "type": "string"
            },
            "description": "Selects the HTTP API contract for this request only. When omitted, API-key requests use their service account’s stored version. Does not change the stored default."
          },
          {
            "in": "header",
            "name": "Idempotency-Key",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "security": [
          {
            "bearerAuth": []
          },
          {
            "affinityApiKey": []
          }
        ],
        "responses": {
          "200": {
            "description": "HTTP 200",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CreatePlatformPracticeApiKeyResponse"
                }
              }
            }
          },
          "400": {
            "description": "HTTP 400",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "401": {
            "description": "HTTP 401",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "403": {
            "description": "HTTP 403",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "404": {
            "description": "HTTP 404",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "409": {
            "description": "HTTP 409",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "429": {
            "description": "HTTP 429",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          }
        },
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CreatePlatformPracticeApiKeyRequest"
              }
            }
          },
          "required": true
        },
        "description": "Creates a practice API key for a connected practice. Requires a platform key with service_keys:write and every requested scope. The practice key uses the platform key's Test or Live mode and cannot outlive it. Requires Idempotency-Key for safe retries; the secret is returned in the encrypted replay response for 24 hours.",
        "summary": "Create connected practice API key",
        "x-visibility": "public"
      }
    },
    "/v1/account": {
      "get": {
        "tags": [
          "Account"
        ],
        "operationId": "getAccount",
        "parameters": [
          {
            "in": "query",
            "name": "orgId",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string",
                  "pattern": "^acct_[0-7][0-9a-hjkmnp-tv-z]{25}$",
                  "examples": [
                    "acct_01j2y8m6jcc9tt24af5pw9x1bc"
                  ]
                },
                {
                  "type": "null"
                }
              ]
            }
          },
          {
            "in": "header",
            "name": "Affinity-Version",
            "required": false,
            "schema": {
              "type": "string"
            },
            "description": "Selects the HTTP API contract for this request only. When omitted, API-key requests use their service account’s stored version. Does not change the stored default."
          }
        ],
        "security": [
          {
            "bearerAuth": []
          },
          {
            "affinityApiKey": []
          }
        ],
        "responses": {
          "200": {
            "description": "HTTP 200",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/GetAccountResponse"
                }
              }
            }
          },
          "400": {
            "description": "HTTP 400",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "401": {
            "description": "HTTP 401",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "403": {
            "description": "HTTP 403",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "404": {
            "description": "HTTP 404",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "409": {
            "description": "HTTP 409",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "422": {
            "description": "HTTP 422",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "429": {
            "description": "HTTP 429",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          }
        },
        "description": "Returns the platform organization, request livemode, and effective access. API keys report scopes and the service_key role; dashboard sessions report membership permissions. operatingMode describes organization Live access, not the credential's Test/Live mode.",
        "summary": "Read account",
        "x-visibility": "public"
      }
    },
    "/v1/catalog/items": {
      "get": {
        "tags": [
          "Catalog"
        ],
        "operationId": "listCatalogItems",
        "parameters": [
          {
            "in": "query",
            "name": "view",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string",
                  "enum": [
                    "offers",
                    "medications"
                  ]
                },
                {
                  "type": "null"
                }
              ]
            }
          },
          {
            "in": "query",
            "name": "relatedToCatalogItemId",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string",
                  "pattern": "^cat_[0-7][0-9a-hjkmnp-tv-z]{25}$",
                  "examples": [
                    "cat_01j2y8m6jcc9tt24af5pw9x1bc"
                  ]
                },
                {
                  "type": "null"
                }
              ]
            }
          },
          {
            "in": "query",
            "name": "catalogKind",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string",
                  "enum": [
                    "prescription",
                    "otc"
                  ]
                },
                {
                  "type": "null"
                }
              ]
            }
          },
          {
            "in": "query",
            "name": "sort",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string",
                  "enum": [
                    "relevance",
                    "name_asc",
                    "name_desc"
                  ]
                },
                {
                  "type": "null"
                }
              ]
            }
          },
          {
            "in": "query",
            "name": "catalogItemId",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string",
                  "pattern": "^cat_[0-7][0-9a-hjkmnp-tv-z]{25}$",
                  "examples": [
                    "cat_01j2y8m6jcc9tt24af5pw9x1bc"
                  ]
                },
                {
                  "type": "null"
                }
              ]
            }
          },
          {
            "in": "query",
            "name": "availability",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string",
                  "enum": [
                    "all",
                    "orderable",
                    "unavailable"
                  ]
                },
                {
                  "type": "null"
                }
              ]
            }
          },
          {
            "in": "query",
            "name": "pharmacyIds",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "anyOf": [
                    {
                      "type": "string",
                      "pattern": "^pharm_[0-7][0-9a-hjkmnp-tv-z]{25}$",
                      "examples": [
                        "pharm_01j2y8m6jcc9tt24af5pw9x1bc"
                      ]
                    },
                    {
                      "type": "array",
                      "items": {
                        "type": "string",
                        "pattern": "^pharm_[0-7][0-9a-hjkmnp-tv-z]{25}$",
                        "examples": [
                          "pharm_01j2y8m6jcc9tt24af5pw9x1bc"
                        ]
                      },
                      "maxItems": 25
                    }
                  ]
                },
                {
                  "type": "null"
                }
              ]
            },
            "explode": true,
            "style": "form"
          },
          {
            "in": "query",
            "name": "dosageForms",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "anyOf": [
                    {
                      "type": "string",
                      "enum": [
                        "capsule",
                        "cream",
                        "gel",
                        "solution",
                        "spray",
                        "tablet",
                        "troche",
                        "unknown",
                        "vial"
                      ]
                    },
                    {
                      "type": "array",
                      "items": {
                        "type": "string",
                        "enum": [
                          "capsule",
                          "cream",
                          "gel",
                          "solution",
                          "spray",
                          "tablet",
                          "troche",
                          "unknown",
                          "vial"
                        ]
                      },
                      "maxItems": 12
                    }
                  ]
                },
                {
                  "type": "null"
                }
              ]
            },
            "explode": true,
            "style": "form"
          },
          {
            "in": "query",
            "name": "endingBefore",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string",
                  "pattern": "^cat_[0-7][0-9a-hjkmnp-tv-z]{25}$",
                  "examples": [
                    "cat_01j2y8m6jcc9tt24af5pw9x1bc"
                  ]
                },
                {
                  "type": "null"
                }
              ]
            }
          },
          {
            "in": "query",
            "name": "hideControlledSubstances",
            "required": false,
            "schema": {
              "type": "boolean"
            }
          },
          {
            "in": "query",
            "name": "hideUnpriced",
            "required": false,
            "schema": {
              "type": "boolean"
            }
          },
          {
            "in": "query",
            "name": "limit",
            "required": false,
            "schema": {
              "default": 25,
              "maximum": 100,
              "minimum": 1,
              "type": "integer"
            }
          },
          {
            "in": "query",
            "name": "orgId",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string",
                  "pattern": "^acct_[0-7][0-9a-hjkmnp-tv-z]{25}$",
                  "examples": [
                    "acct_01j2y8m6jcc9tt24af5pw9x1bc"
                  ]
                },
                {
                  "type": "null"
                }
              ]
            }
          },
          {
            "in": "query",
            "name": "practiceId",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string",
                  "pattern": "^prac_[0-7][0-9a-hjkmnp-tv-z]{25}$",
                  "examples": [
                    "prac_01j2y8m6jcc9tt24af5pw9x1bc"
                  ]
                },
                {
                  "type": "null"
                }
              ]
            }
          },
          {
            "in": "query",
            "name": "query",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ]
            }
          },
          {
            "in": "query",
            "name": "requirement",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string",
                  "enum": [
                    "all",
                    "office_use",
                    "patient_specific"
                  ]
                },
                {
                  "type": "null"
                }
              ]
            }
          },
          {
            "in": "query",
            "name": "routes",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "anyOf": [
                    {
                      "type": "string",
                      "enum": [
                        "injectable",
                        "nasal",
                        "oral",
                        "sublingual",
                        "topical",
                        "unknown"
                      ]
                    },
                    {
                      "type": "array",
                      "items": {
                        "type": "string",
                        "enum": [
                          "injectable",
                          "nasal",
                          "oral",
                          "sublingual",
                          "topical",
                          "unknown"
                        ]
                      },
                      "maxItems": 6
                    }
                  ]
                },
                {
                  "type": "null"
                }
              ]
            },
            "explode": true,
            "style": "form"
          },
          {
            "in": "query",
            "name": "startingAfter",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string",
                  "pattern": "^cat_[0-7][0-9a-hjkmnp-tv-z]{25}$",
                  "examples": [
                    "cat_01j2y8m6jcc9tt24af5pw9x1bc"
                  ]
                },
                {
                  "type": "null"
                }
              ]
            }
          },
          {
            "in": "header",
            "name": "Affinity-Version",
            "required": false,
            "schema": {
              "type": "string"
            },
            "description": "Selects the HTTP API contract for this request only. When omitted, API-key requests use their service account’s stored version. Does not change the stored default."
          }
        ],
        "security": [
          {
            "bearerAuth": []
          },
          {
            "affinityApiKey": []
          }
        ],
        "responses": {
          "200": {
            "description": "HTTP 200",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ListCatalogItemsResponse"
                }
              }
            }
          },
          "400": {
            "description": "HTTP 400",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "401": {
            "description": "HTTP 401",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "403": {
            "description": "HTTP 403",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "404": {
            "description": "HTTP 404",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "409": {
            "description": "HTTP 409",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "422": {
            "description": "HTTP 422",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "429": {
            "description": "HTTP 429",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          }
        },
        "description": "Lists catalog items for the authenticated account and mode. Use view=medications for priced prescription groups with offer counts, pharmacy counts, and strengths; the default view=offers returns individual offers. Use relatedToCatalogItemId to find offers for the same medication and route. When practiceId is supplied, a practice price overrides the platform price and missing overrides inherit the platform price.",
        "summary": "List catalog items",
        "x-pier-pagination": {
          "cursorField": "id",
          "kind": "cursor"
        },
        "x-visibility": "public"
      }
    },
    "/v1/pharmacies": {
      "get": {
        "tags": [
          "Catalog"
        ],
        "operationId": "listPharmacies",
        "parameters": [
          {
            "in": "query",
            "name": "endingBefore",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string",
                  "pattern": "^pharm_[0-7][0-9a-hjkmnp-tv-z]{25}$",
                  "examples": [
                    "pharm_01j2y8m6jcc9tt24af5pw9x1bc"
                  ]
                },
                {
                  "type": "null"
                }
              ]
            }
          },
          {
            "in": "query",
            "name": "limit",
            "required": false,
            "schema": {
              "default": 25,
              "maximum": 100,
              "minimum": 1,
              "type": "integer"
            }
          },
          {
            "in": "query",
            "name": "orgId",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string",
                  "pattern": "^acct_[0-7][0-9a-hjkmnp-tv-z]{25}$",
                  "examples": [
                    "acct_01j2y8m6jcc9tt24af5pw9x1bc"
                  ]
                },
                {
                  "type": "null"
                }
              ]
            }
          },
          {
            "in": "query",
            "name": "pharmacyId",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string",
                  "pattern": "^pharm_[0-7][0-9a-hjkmnp-tv-z]{25}$",
                  "examples": [
                    "pharm_01j2y8m6jcc9tt24af5pw9x1bc"
                  ]
                },
                {
                  "type": "null"
                }
              ]
            }
          },
          {
            "in": "query",
            "name": "query",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ]
            }
          },
          {
            "in": "query",
            "name": "shipsToState",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ]
            }
          },
          {
            "in": "query",
            "name": "startingAfter",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string",
                  "pattern": "^pharm_[0-7][0-9a-hjkmnp-tv-z]{25}$",
                  "examples": [
                    "pharm_01j2y8m6jcc9tt24af5pw9x1bc"
                  ]
                },
                {
                  "type": "null"
                }
              ]
            }
          },
          {
            "in": "header",
            "name": "Affinity-Version",
            "required": false,
            "schema": {
              "type": "string"
            },
            "description": "Selects the HTTP API contract for this request only. When omitted, API-key requests use their service account’s stored version. Does not change the stored default."
          }
        ],
        "security": [
          {
            "bearerAuth": []
          },
          {
            "affinityApiKey": []
          }
        ],
        "responses": {
          "200": {
            "description": "HTTP 200",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ListPharmaciesResponse"
                }
              }
            }
          },
          "400": {
            "description": "HTTP 400",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "401": {
            "description": "HTTP 401",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "403": {
            "description": "HTTP 403",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "404": {
            "description": "HTTP 404",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "409": {
            "description": "HTTP 409",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "422": {
            "description": "HTTP 422",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "429": {
            "description": "HTTP 429",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          }
        },
        "description": "Lists pharmacies available to the authenticated account, including approved invite-only relationships.",
        "summary": "List pharmacies",
        "x-pier-pagination": {
          "cursorField": "id",
          "kind": "cursor"
        },
        "x-visibility": "public"
      }
    },
    "/v1/catalog/items/{catalogItemId}/shipping-options": {
      "get": {
        "tags": [
          "Catalog"
        ],
        "operationId": "listShippingOptions",
        "parameters": [
          {
            "in": "path",
            "name": "catalogItemId",
            "required": true,
            "schema": {
              "type": "string",
              "pattern": "^cat_[0-7][0-9a-hjkmnp-tv-z]{25}$",
              "examples": [
                "cat_01j2y8m6jcc9tt24af5pw9x1bc"
              ]
            }
          },
          {
            "in": "query",
            "name": "destinationState",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "destinationType",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string",
                  "enum": [
                    "patient",
                    "practice"
                  ]
                },
                {
                  "type": "null"
                }
              ]
            }
          },
          {
            "in": "header",
            "name": "Affinity-Version",
            "required": false,
            "schema": {
              "type": "string"
            },
            "description": "Selects the HTTP API contract for this request only. When omitted, API-key requests use their service account’s stored version. Does not change the stored default."
          }
        ],
        "security": [
          {
            "bearerAuth": []
          },
          {
            "affinityApiKey": []
          }
        ],
        "responses": {
          "200": {
            "description": "HTTP 200",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ListShippingOptionsResponse"
                }
              }
            }
          },
          "400": {
            "description": "HTTP 400",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "401": {
            "description": "HTTP 401",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "403": {
            "description": "HTTP 403",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "404": {
            "description": "HTTP 404",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "409": {
            "description": "HTTP 409",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "422": {
            "description": "HTTP 422",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "429": {
            "description": "HTTP 429",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          }
        },
        "description": "Returns an array of at most 50 reviewed shipping services eligible for a catalog item, destination, and API mode. destinationState must be a USPS state or territory code. Each option has one temperature; pharmacy catalog summaries list all supported temperatures.",
        "summary": "List shipping options",
        "x-visibility": "public"
      }
    },
    "/v1/orders": {
      "get": {
        "tags": [
          "Orders"
        ],
        "operationId": "listOrders",
        "parameters": [
          {
            "in": "query",
            "name": "query",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string",
                  "maxLength": 200
                },
                {
                  "type": "null"
                }
              ]
            }
          },
          {
            "in": "query",
            "name": "externalOrderId",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string",
                  "minLength": 1,
                  "maxLength": 200,
                  "pattern": "\\S",
                  "allOf": [
                    {
                      "pattern": "^[^\\p{Cc}\\p{Cs}]*$"
                    }
                  ]
                },
                {
                  "type": "null"
                }
              ]
            }
          },
          {
            "in": "query",
            "name": "createdAfter",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ]
            }
          },
          {
            "in": "query",
            "name": "createdBefore",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ]
            }
          },
          {
            "in": "query",
            "name": "endingBefore",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string",
                  "pattern": "^ord_[0-7][0-9a-hjkmnp-tv-z]{25}$",
                  "examples": [
                    "ord_01j2y8m6jcc9tt24af5pw9x1bc"
                  ]
                },
                {
                  "type": "null"
                }
              ]
            }
          },
          {
            "in": "query",
            "name": "limit",
            "required": false,
            "schema": {
              "default": 25,
              "maximum": 100,
              "minimum": 1,
              "type": "integer"
            }
          },
          {
            "in": "query",
            "name": "orderId",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string",
                  "pattern": "^ord_[0-7][0-9a-hjkmnp-tv-z]{25}$",
                  "examples": [
                    "ord_01j2y8m6jcc9tt24af5pw9x1bc"
                  ]
                },
                {
                  "type": "null"
                }
              ]
            }
          },
          {
            "in": "query",
            "name": "patientId",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string",
                  "pattern": "^pat_[0-7][0-9a-hjkmnp-tv-z]{25}$",
                  "examples": [
                    "pat_01j2y8m6jcc9tt24af5pw9x1bc"
                  ]
                },
                {
                  "type": "null"
                }
              ]
            }
          },
          {
            "in": "query",
            "name": "patientExternalId",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ]
            }
          },
          {
            "in": "query",
            "name": "practiceId",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string",
                  "pattern": "^prac_[0-7][0-9a-hjkmnp-tv-z]{25}$",
                  "examples": [
                    "prac_01j2y8m6jcc9tt24af5pw9x1bc"
                  ]
                },
                {
                  "type": "null"
                }
              ]
            }
          },
          {
            "in": "query",
            "name": "sort",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string",
                  "enum": [
                    "newest",
                    "oldest"
                  ]
                },
                {
                  "type": "null"
                }
              ]
            }
          },
          {
            "in": "query",
            "name": "startingAfter",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string",
                  "pattern": "^ord_[0-7][0-9a-hjkmnp-tv-z]{25}$",
                  "examples": [
                    "ord_01j2y8m6jcc9tt24af5pw9x1bc"
                  ]
                },
                {
                  "type": "null"
                }
              ]
            }
          },
          {
            "in": "query",
            "name": "status",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string",
                  "enum": [
                    "blocked",
                    "cancelled",
                    "delivered",
                    "draft",
                    "partially_submitted",
                    "requires_provider_signature",
                    "processing",
                    "ready",
                    "rejected",
                    "shipped",
                    "submitted"
                  ]
                },
                {
                  "type": "null"
                }
              ]
            }
          },
          {
            "in": "header",
            "name": "Affinity-Version",
            "required": false,
            "schema": {
              "type": "string"
            },
            "description": "Selects the HTTP API contract for this request only. When omitted, API-key requests use their service account’s stored version. Does not change the stored default."
          },
          {
            "in": "header",
            "name": "Affinity-Actor-Id",
            "required": false,
            "schema": {
              "type": "string"
            },
            "description": "Required for user actors and optional for system actors. Omit both actor headers to use the authenticated service account as a system actor."
          },
          {
            "in": "header",
            "name": "Affinity-Actor-Type",
            "required": false,
            "schema": {
              "type": "string"
            },
            "description": "Use user when a person initiated the action and system for autonomous work. Omit both actor headers to default to system."
          }
        ],
        "security": [
          {
            "bearerAuth": []
          },
          {
            "affinityApiKey": []
          }
        ],
        "responses": {
          "200": {
            "description": "HTTP 200",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ListOrdersResponse"
                }
              }
            }
          },
          "400": {
            "description": "HTTP 400",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "401": {
            "description": "HTTP 401",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "403": {
            "description": "HTTP 403",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "404": {
            "description": "HTTP 404",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "409": {
            "description": "HTTP 409",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "422": {
            "description": "HTTP 422",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "429": {
            "description": "HTTP 429",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          }
        },
        "summary": "List orders",
        "x-pier-pagination": {
          "cursorField": "id",
          "kind": "cursor"
        },
        "x-visibility": "public"
      },
      "post": {
        "tags": [
          "Orders"
        ],
        "operationId": "createOrder",
        "parameters": [
          {
            "in": "header",
            "name": "Affinity-Version",
            "required": false,
            "schema": {
              "type": "string"
            },
            "description": "Selects the HTTP API contract for this request only. When omitted, API-key requests use their service account’s stored version. Does not change the stored default."
          },
          {
            "in": "header",
            "name": "Idempotency-Key",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "header",
            "name": "Affinity-Actor-Id",
            "required": false,
            "schema": {
              "type": "string"
            },
            "description": "Required for user actors and optional for system actors. Omit both actor headers to use the authenticated service account as a system actor."
          },
          {
            "in": "header",
            "name": "Affinity-Actor-Type",
            "required": false,
            "schema": {
              "type": "string"
            },
            "description": "Use user when a person initiated the action and system for autonomous work. Omit both actor headers to default to system."
          }
        ],
        "security": [
          {
            "bearerAuth": []
          },
          {
            "affinityApiKey": []
          }
        ],
        "responses": {
          "200": {
            "description": "HTTP 200",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CreateOrderResponse"
                }
              }
            }
          },
          "400": {
            "description": "HTTP 400",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "401": {
            "description": "HTTP 401",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "403": {
            "description": "HTTP 403",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "404": {
            "description": "HTTP 404",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "409": {
            "description": "HTTP 409",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "422": {
            "description": "HTTP 422",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "429": {
            "description": "HTTP 429",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "503": {
            "description": "HTTP 503",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          }
        },
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CreateOrderRequest"
              }
            }
          },
          "required": true
        },
        "description": "Creates one unsigned order with 1–20 prescriptions for one patient in one practice. Supply patientId or patient; inline patient creation requires patients:write. Prescriber is optional: select by npi, provider id, or integration-scoped externalId, or leave the draft unassigned until signing. First-use prescriber registration requires team:write. Legacy userId is supported but cannot be combined with prescriber. Idempotency-Key is required.",
        "summary": "Create order",
        "x-visibility": "public"
      }
    },
    "/v1/orders/{orderId}": {
      "get": {
        "tags": [
          "Orders"
        ],
        "operationId": "getOrder",
        "parameters": [
          {
            "in": "path",
            "name": "orderId",
            "required": true,
            "schema": {
              "type": "string",
              "pattern": "^ord_[0-7][0-9a-hjkmnp-tv-z]{25}$",
              "examples": [
                "ord_01j2y8m6jcc9tt24af5pw9x1bc"
              ]
            }
          },
          {
            "in": "header",
            "name": "Affinity-Version",
            "required": false,
            "schema": {
              "type": "string"
            },
            "description": "Selects the HTTP API contract for this request only. When omitted, API-key requests use their service account’s stored version. Does not change the stored default."
          },
          {
            "in": "header",
            "name": "Affinity-Actor-Id",
            "required": false,
            "schema": {
              "type": "string"
            },
            "description": "Required for user actors and optional for system actors. Omit both actor headers to use the authenticated service account as a system actor."
          },
          {
            "in": "header",
            "name": "Affinity-Actor-Type",
            "required": false,
            "schema": {
              "type": "string"
            },
            "description": "Use user when a person initiated the action and system for autonomous work. Omit both actor headers to default to system."
          }
        ],
        "security": [
          {
            "bearerAuth": []
          },
          {
            "affinityApiKey": []
          }
        ],
        "responses": {
          "200": {
            "description": "HTTP 200",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/GetOrderResponse"
                }
              }
            }
          },
          "400": {
            "description": "HTTP 400",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "401": {
            "description": "HTTP 401",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "403": {
            "description": "HTTP 403",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "404": {
            "description": "HTTP 404",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "409": {
            "description": "HTTP 409",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "422": {
            "description": "HTTP 422",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "429": {
            "description": "HTTP 429",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          }
        },
        "summary": "Read order",
        "x-visibility": "public"
      }
    },
    "/v1/orders/{orderId}/cancel": {
      "post": {
        "tags": [
          "Orders"
        ],
        "operationId": "cancelOrder",
        "parameters": [
          {
            "in": "path",
            "name": "orderId",
            "required": true,
            "schema": {
              "type": "string",
              "pattern": "^ord_[0-7][0-9a-hjkmnp-tv-z]{25}$",
              "examples": [
                "ord_01j2y8m6jcc9tt24af5pw9x1bc"
              ]
            }
          },
          {
            "in": "header",
            "name": "Affinity-Version",
            "required": false,
            "schema": {
              "type": "string"
            },
            "description": "Selects the HTTP API contract for this request only. When omitted, API-key requests use their service account’s stored version. Does not change the stored default."
          },
          {
            "in": "header",
            "name": "Idempotency-Key",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "header",
            "name": "Affinity-Actor-Id",
            "required": false,
            "schema": {
              "type": "string"
            },
            "description": "Required for user actors and optional for system actors. Omit both actor headers to use the authenticated service account as a system actor."
          },
          {
            "in": "header",
            "name": "Affinity-Actor-Type",
            "required": false,
            "schema": {
              "type": "string"
            },
            "description": "Use user when a person initiated the action and system for autonomous work. Omit both actor headers to default to system."
          }
        ],
        "security": [
          {
            "bearerAuth": []
          },
          {
            "affinityApiKey": []
          }
        ],
        "responses": {
          "200": {
            "description": "HTTP 200",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CancelOrderResponse"
                }
              }
            }
          },
          "400": {
            "description": "HTTP 400",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "401": {
            "description": "HTTP 401",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "403": {
            "description": "HTTP 403",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "404": {
            "description": "HTTP 404",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "409": {
            "description": "HTTP 409",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "422": {
            "description": "HTTP 422",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "429": {
            "description": "HTTP 429",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          }
        },
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CancelOrderRequest"
              }
            }
          },
          "required": true
        },
        "description": "Requests cancellation. HTTP 200 means the request was handled; check cancellation.status for confirmed, pending, partial, or failed. Only confirmed means the entire order is cancelled. Shipment possession makes a fulfillment cancellation too late.",
        "summary": "Cancel order",
        "x-visibility": "public"
      }
    },
    "/v1/orders/{orderId}/exceptions/{exceptionId}/actions": {
      "post": {
        "tags": [
          "Orders"
        ],
        "operationId": "actOnOrderException",
        "parameters": [
          {
            "in": "path",
            "name": "exceptionId",
            "required": true,
            "schema": {
              "type": "string",
              "pattern": "^fex_[0-7][0-9a-hjkmnp-tv-z]{25}$",
              "examples": [
                "fex_01j2y8m6jcc9tt24af5pw9x1bc"
              ]
            }
          },
          {
            "in": "path",
            "name": "orderId",
            "required": true,
            "schema": {
              "type": "string",
              "pattern": "^ord_[0-7][0-9a-hjkmnp-tv-z]{25}$",
              "examples": [
                "ord_01j2y8m6jcc9tt24af5pw9x1bc"
              ]
            }
          },
          {
            "in": "header",
            "name": "Affinity-Version",
            "required": false,
            "schema": {
              "type": "string"
            },
            "description": "Selects the HTTP API contract for this request only. When omitted, API-key requests use their service account’s stored version. Does not change the stored default."
          },
          {
            "in": "header",
            "name": "Idempotency-Key",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "header",
            "name": "Affinity-Actor-Id",
            "required": false,
            "schema": {
              "type": "string"
            },
            "description": "Required for user actors and optional for system actors. Omit both actor headers to use the authenticated service account as a system actor."
          },
          {
            "in": "header",
            "name": "Affinity-Actor-Type",
            "required": false,
            "schema": {
              "type": "string"
            },
            "description": "Use user when a person initiated the action and system for autonomous work. Omit both actor headers to default to system."
          }
        ],
        "security": [
          {
            "bearerAuth": []
          },
          {
            "affinityApiKey": []
          }
        ],
        "responses": {
          "200": {
            "description": "HTTP 200",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ActOnOrderExceptionResponse"
                }
              }
            }
          },
          "400": {
            "description": "HTTP 400",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "401": {
            "description": "HTTP 401",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "403": {
            "description": "HTTP 403",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "404": {
            "description": "HTTP 404",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "409": {
            "description": "HTTP 409",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "422": {
            "description": "HTTP 422",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "429": {
            "description": "HTTP 429",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          }
        },
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ActOnOrderExceptionRequest"
              }
            }
          },
          "required": true
        },
        "description": "Acknowledge, retry, contact, or resolve an order exception in the credential's Test/Live mode. assign_to_me requires a signed-in dashboard user; API keys receive 400 and may use acknowledge instead. Actor headers do not create a dashboard assignee.",
        "summary": "Handle order exception",
        "x-visibility": "public"
      }
    },
    "/v1/orders/{orderId}/events": {
      "get": {
        "tags": [
          "Orders"
        ],
        "operationId": "listOrderEvents",
        "parameters": [
          {
            "in": "query",
            "name": "endingBefore",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string",
                  "pattern": "^evt_[0-7][0-9a-hjkmnp-tv-z]{25}$",
                  "examples": [
                    "evt_01j2y8m6jcc9tt24af5pw9x1bc"
                  ]
                },
                {
                  "type": "null"
                }
              ]
            }
          },
          {
            "in": "query",
            "name": "limit",
            "required": false,
            "schema": {
              "default": 25,
              "maximum": 100,
              "minimum": 1,
              "type": "integer"
            }
          },
          {
            "in": "path",
            "name": "orderId",
            "required": true,
            "schema": {
              "type": "string",
              "pattern": "^ord_[0-7][0-9a-hjkmnp-tv-z]{25}$",
              "examples": [
                "ord_01j2y8m6jcc9tt24af5pw9x1bc"
              ]
            }
          },
          {
            "in": "query",
            "name": "startingAfter",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string",
                  "pattern": "^evt_[0-7][0-9a-hjkmnp-tv-z]{25}$",
                  "examples": [
                    "evt_01j2y8m6jcc9tt24af5pw9x1bc"
                  ]
                },
                {
                  "type": "null"
                }
              ]
            }
          },
          {
            "in": "header",
            "name": "Affinity-Version",
            "required": false,
            "schema": {
              "type": "string"
            },
            "description": "Selects the HTTP API contract for this request only. When omitted, API-key requests use their service account’s stored version. Does not change the stored default."
          },
          {
            "in": "header",
            "name": "Affinity-Actor-Id",
            "required": false,
            "schema": {
              "type": "string"
            },
            "description": "Required for user actors and optional for system actors. Omit both actor headers to use the authenticated service account as a system actor."
          },
          {
            "in": "header",
            "name": "Affinity-Actor-Type",
            "required": false,
            "schema": {
              "type": "string"
            },
            "description": "Use user when a person initiated the action and system for autonomous work. Omit both actor headers to default to system."
          }
        ],
        "security": [
          {
            "bearerAuth": []
          },
          {
            "affinityApiKey": []
          }
        ],
        "responses": {
          "200": {
            "description": "HTTP 200",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ListOrderEventsResponse"
                }
              }
            }
          },
          "400": {
            "description": "HTTP 400",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "401": {
            "description": "HTTP 401",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "403": {
            "description": "HTTP 403",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "404": {
            "description": "HTTP 404",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "409": {
            "description": "HTTP 409",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "422": {
            "description": "HTTP 422",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "429": {
            "description": "HTTP 429",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          }
        },
        "summary": "List order events",
        "x-pier-pagination": {
          "cursorField": "id",
          "kind": "cursor"
        },
        "x-visibility": "public"
      }
    },
    "/v1/webhook-endpoints": {
      "get": {
        "tags": [
          "Webhooks"
        ],
        "operationId": "listWebhookEndpoints",
        "parameters": [
          {
            "in": "query",
            "name": "endingBefore",
            "required": false,
            "schema": {
              "type": "string",
              "pattern": "^whe_[0-7][0-9a-hjkmnp-tv-z]{25}$",
              "examples": [
                "whe_01j2y8m6jcc9tt24af5pw9x1bc"
              ]
            }
          },
          {
            "in": "query",
            "name": "limit",
            "required": false,
            "schema": {
              "default": 25,
              "maximum": 100,
              "minimum": 1,
              "type": "integer"
            }
          },
          {
            "in": "query",
            "name": "startingAfter",
            "required": false,
            "schema": {
              "type": "string",
              "pattern": "^whe_[0-7][0-9a-hjkmnp-tv-z]{25}$",
              "examples": [
                "whe_01j2y8m6jcc9tt24af5pw9x1bc"
              ]
            }
          },
          {
            "in": "header",
            "name": "Affinity-Version",
            "required": false,
            "schema": {
              "type": "string"
            },
            "description": "Selects the HTTP API contract for this request only. When omitted, API-key requests use their service account’s stored version. Does not change the stored default."
          },
          {
            "in": "header",
            "name": "X-Affinity-Organization-Id",
            "required": false,
            "schema": {
              "type": "string"
            },
            "description": "Defaults to the API key organization. A platform may select a practice or pharmacy only with an explicit webhook grant in this mode. This changes the webhook owner, not the caller or event subscriptions."
          }
        ],
        "security": [
          {
            "bearerAuth": []
          },
          {
            "affinityApiKey": []
          }
        ],
        "responses": {
          "200": {
            "description": "HTTP 200",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ListWebhookEndpointsResponse"
                }
              }
            }
          },
          "400": {
            "description": "HTTP 400",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "401": {
            "description": "HTTP 401",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "403": {
            "description": "HTTP 403",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "404": {
            "description": "HTTP 404",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "409": {
            "description": "HTTP 409",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "422": {
            "description": "HTTP 422",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "429": {
            "description": "HTTP 429",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          }
        },
        "description": "Requires webhooks:read. Returns endpoints owned by the key organization, or the organization selected with X-Affinity-Organization-Id. Platform delegation requires a webhook grant in the key's mode.",
        "summary": "List endpoints",
        "x-pier-pagination": {
          "cursorField": "id",
          "kind": "cursor"
        },
        "x-visibility": "public"
      },
      "post": {
        "tags": [
          "Webhooks"
        ],
        "operationId": "createWebhookEndpoint",
        "parameters": [
          {
            "in": "header",
            "name": "Affinity-Version",
            "required": false,
            "schema": {
              "type": "string"
            },
            "description": "Selects the HTTP API contract for this request only. When omitted, API-key requests use their service account’s stored version. Does not change the stored default."
          },
          {
            "in": "header",
            "name": "X-Affinity-Organization-Id",
            "required": false,
            "schema": {
              "type": "string"
            },
            "description": "Defaults to the API key organization. A platform may select a practice or pharmacy only with an explicit webhook grant in this mode. This changes the webhook owner, not the caller or event subscriptions."
          },
          {
            "in": "header",
            "name": "Idempotency-Key",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "security": [
          {
            "bearerAuth": []
          },
          {
            "affinityApiKey": []
          }
        ],
        "responses": {
          "200": {
            "description": "HTTP 200",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CreateWebhookEndpointResponse"
                }
              }
            }
          },
          "400": {
            "description": "HTTP 400",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "401": {
            "description": "HTTP 401",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "403": {
            "description": "HTTP 403",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "404": {
            "description": "HTTP 404",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "409": {
            "description": "HTTP 409",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "422": {
            "description": "HTTP 422",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "429": {
            "description": "HTTP 429",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          }
        },
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CreateWebhookEndpointRequest"
              }
            }
          },
          "required": true
        },
        "description": "Requires webhooks:write and Idempotency-Key. Defaults to the API key organization. A platform can select a practice or pharmacy owner with X-Affinity-Organization-Id and an explicit webhook grant. For platform-owned endpoints, practiceIds narrows delivery to selected connected practices. An empty filter receives all otherwise-authorized events.",
        "summary": "Create endpoint",
        "x-visibility": "public"
      }
    },
    "/v1/webhook-endpoints/{endpointId}": {
      "patch": {
        "tags": [
          "Webhooks"
        ],
        "operationId": "updateWebhookEndpoint",
        "parameters": [
          {
            "in": "path",
            "name": "endpointId",
            "required": true,
            "schema": {
              "type": "string",
              "pattern": "^whe_[0-7][0-9a-hjkmnp-tv-z]{25}$",
              "examples": [
                "whe_01j2y8m6jcc9tt24af5pw9x1bc"
              ]
            }
          },
          {
            "in": "header",
            "name": "Affinity-Version",
            "required": false,
            "schema": {
              "type": "string"
            },
            "description": "Selects the HTTP API contract for this request only. When omitted, API-key requests use their service account’s stored version. Does not change the stored default."
          },
          {
            "in": "header",
            "name": "X-Affinity-Organization-Id",
            "required": false,
            "schema": {
              "type": "string"
            },
            "description": "Defaults to the API key organization. A platform may select a practice or pharmacy only with an explicit webhook grant in this mode. This changes the webhook owner, not the caller or event subscriptions."
          },
          {
            "in": "header",
            "name": "Idempotency-Key",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "security": [
          {
            "bearerAuth": []
          },
          {
            "affinityApiKey": []
          }
        ],
        "responses": {
          "200": {
            "description": "HTTP 200",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/UpdateWebhookEndpointResponse"
                }
              }
            }
          },
          "400": {
            "description": "HTTP 400",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "401": {
            "description": "HTTP 401",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "403": {
            "description": "HTTP 403",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "404": {
            "description": "HTTP 404",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "409": {
            "description": "HTTP 409",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "422": {
            "description": "HTTP 422",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "429": {
            "description": "HTTP 429",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          }
        },
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/UpdateWebhookEndpointRequest"
              }
            }
          },
          "required": true
        },
        "description": "Requires webhooks:write and Idempotency-Key. Updates an endpoint in the selected organization and mode. Omitted practiceIds preserves the filter; an empty array removes the practice filter. Subscription changes apply to newly generated events.",
        "summary": "Update endpoint",
        "x-visibility": "public"
      },
      "delete": {
        "tags": [
          "Webhooks"
        ],
        "operationId": "deleteWebhookEndpoint",
        "parameters": [
          {
            "in": "path",
            "name": "endpointId",
            "required": true,
            "schema": {
              "type": "string",
              "pattern": "^whe_[0-7][0-9a-hjkmnp-tv-z]{25}$",
              "examples": [
                "whe_01j2y8m6jcc9tt24af5pw9x1bc"
              ]
            }
          },
          {
            "in": "header",
            "name": "Affinity-Version",
            "required": false,
            "schema": {
              "type": "string"
            },
            "description": "Selects the HTTP API contract for this request only. When omitted, API-key requests use their service account’s stored version. Does not change the stored default."
          },
          {
            "in": "header",
            "name": "X-Affinity-Organization-Id",
            "required": false,
            "schema": {
              "type": "string"
            },
            "description": "Defaults to the API key organization. A platform may select a practice or pharmacy only with an explicit webhook grant in this mode. This changes the webhook owner, not the caller or event subscriptions."
          },
          {
            "in": "header",
            "name": "Idempotency-Key",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "security": [
          {
            "bearerAuth": []
          },
          {
            "affinityApiKey": []
          }
        ],
        "responses": {
          "200": {
            "description": "HTTP 200",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/DeleteWebhookEndpointResponse"
                }
              }
            }
          },
          "400": {
            "description": "HTTP 400",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "401": {
            "description": "HTTP 401",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "403": {
            "description": "HTTP 403",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "404": {
            "description": "HTTP 404",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "409": {
            "description": "HTTP 409",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "422": {
            "description": "HTTP 422",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "429": {
            "description": "HTTP 429",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          }
        },
        "summary": "Disable endpoint",
        "x-visibility": "public"
      }
    },
    "/v1/webhook-endpoints/{endpointId}/rotate-secret": {
      "post": {
        "tags": [
          "Webhooks"
        ],
        "operationId": "rotateWebhookEndpointSecret",
        "parameters": [
          {
            "in": "path",
            "name": "endpointId",
            "required": true,
            "schema": {
              "type": "string",
              "pattern": "^whe_[0-7][0-9a-hjkmnp-tv-z]{25}$",
              "examples": [
                "whe_01j2y8m6jcc9tt24af5pw9x1bc"
              ]
            }
          },
          {
            "in": "header",
            "name": "Affinity-Version",
            "required": false,
            "schema": {
              "type": "string"
            },
            "description": "Selects the HTTP API contract for this request only. When omitted, API-key requests use their service account’s stored version. Does not change the stored default."
          },
          {
            "in": "header",
            "name": "X-Affinity-Organization-Id",
            "required": false,
            "schema": {
              "type": "string"
            },
            "description": "Defaults to the API key organization. A platform may select a practice or pharmacy only with an explicit webhook grant in this mode. This changes the webhook owner, not the caller or event subscriptions."
          },
          {
            "in": "header",
            "name": "Idempotency-Key",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "security": [
          {
            "bearerAuth": []
          },
          {
            "affinityApiKey": []
          }
        ],
        "responses": {
          "200": {
            "description": "HTTP 200",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RotateWebhookEndpointSecretResponse"
                }
              }
            }
          },
          "400": {
            "description": "HTTP 400",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "401": {
            "description": "HTTP 401",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "403": {
            "description": "HTTP 403",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "404": {
            "description": "HTTP 404",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "409": {
            "description": "HTTP 409",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "422": {
            "description": "HTTP 422",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "429": {
            "description": "HTTP 429",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          }
        },
        "summary": "Rotate signing secret",
        "x-visibility": "public"
      }
    },
    "/v1/webhook-endpoints/{endpointId}/test": {
      "post": {
        "tags": [
          "Webhooks"
        ],
        "operationId": "testWebhookEndpoint",
        "parameters": [
          {
            "in": "path",
            "name": "endpointId",
            "required": true,
            "schema": {
              "type": "string",
              "pattern": "^whe_[0-7][0-9a-hjkmnp-tv-z]{25}$",
              "examples": [
                "whe_01j2y8m6jcc9tt24af5pw9x1bc"
              ]
            }
          },
          {
            "in": "header",
            "name": "Affinity-Version",
            "required": false,
            "schema": {
              "type": "string"
            },
            "description": "Selects the HTTP API contract for this request only. When omitted, API-key requests use their service account’s stored version. Does not change the stored default."
          },
          {
            "in": "header",
            "name": "X-Affinity-Organization-Id",
            "required": false,
            "schema": {
              "type": "string"
            },
            "description": "Defaults to the API key organization. A platform may select a practice or pharmacy only with an explicit webhook grant in this mode. This changes the webhook owner, not the caller or event subscriptions."
          },
          {
            "in": "header",
            "name": "Idempotency-Key",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "security": [
          {
            "bearerAuth": []
          },
          {
            "affinityApiKey": []
          }
        ],
        "responses": {
          "200": {
            "description": "HTTP 200",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/TestWebhookEndpointResponse"
                }
              }
            }
          },
          "400": {
            "description": "HTTP 400",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "401": {
            "description": "HTTP 401",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "403": {
            "description": "HTTP 403",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "404": {
            "description": "HTTP 404",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "409": {
            "description": "HTTP 409",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "422": {
            "description": "HTTP 422",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "429": {
            "description": "HTTP 429",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          }
        },
        "summary": "Send test event",
        "x-visibility": "public"
      }
    },
    "/v1/webhook-events": {
      "get": {
        "tags": [
          "Webhooks"
        ],
        "operationId": "listWebhookEvents",
        "parameters": [
          {
            "in": "query",
            "name": "endingBefore",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string",
                  "pattern": "^evt_[0-7][0-9a-hjkmnp-tv-z]{25}$",
                  "examples": [
                    "evt_01j2y8m6jcc9tt24af5pw9x1bc"
                  ]
                },
                {
                  "type": "null"
                }
              ]
            }
          },
          {
            "in": "query",
            "name": "limit",
            "required": false,
            "schema": {
              "default": 25,
              "maximum": 100,
              "minimum": 1,
              "type": "integer"
            }
          },
          {
            "in": "query",
            "name": "status",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string",
                  "enum": [
                    "all",
                    "delivered",
                    "failed",
                    "pending"
                  ]
                },
                {
                  "type": "null"
                }
              ]
            }
          },
          {
            "in": "query",
            "name": "startingAfter",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string",
                  "pattern": "^evt_[0-7][0-9a-hjkmnp-tv-z]{25}$",
                  "examples": [
                    "evt_01j2y8m6jcc9tt24af5pw9x1bc"
                  ]
                },
                {
                  "type": "null"
                }
              ]
            }
          },
          {
            "in": "header",
            "name": "Affinity-Version",
            "required": false,
            "schema": {
              "type": "string"
            },
            "description": "Selects the HTTP API contract for this request only. When omitted, API-key requests use their service account’s stored version. Does not change the stored default."
          },
          {
            "in": "header",
            "name": "X-Affinity-Organization-Id",
            "required": false,
            "schema": {
              "type": "string"
            },
            "description": "Defaults to the API key organization. A platform may select a practice or pharmacy only with an explicit webhook grant in this mode. This changes the webhook owner, not the caller or event subscriptions."
          }
        ],
        "security": [
          {
            "bearerAuth": []
          },
          {
            "affinityApiKey": []
          }
        ],
        "responses": {
          "200": {
            "description": "HTTP 200",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ListWebhookEventsResponse"
                }
              }
            }
          },
          "400": {
            "description": "HTTP 400",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "401": {
            "description": "HTTP 401",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "403": {
            "description": "HTTP 403",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "404": {
            "description": "HTTP 404",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "409": {
            "description": "HTTP 409",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "422": {
            "description": "HTTP 422",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "429": {
            "description": "HTTP 429",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          }
        },
        "summary": "List events",
        "x-pier-pagination": {
          "cursorField": "id",
          "kind": "cursor"
        },
        "x-visibility": "public"
      }
    },
    "/v1/webhook-events/{eventId}": {
      "get": {
        "tags": [
          "Webhooks"
        ],
        "operationId": "getWebhookEvent",
        "parameters": [
          {
            "in": "path",
            "name": "eventId",
            "required": true,
            "schema": {
              "type": "string",
              "pattern": "^evt_[0-7][0-9a-hjkmnp-tv-z]{25}$",
              "examples": [
                "evt_01j2y8m6jcc9tt24af5pw9x1bc"
              ]
            }
          },
          {
            "in": "header",
            "name": "Affinity-Version",
            "required": false,
            "schema": {
              "type": "string"
            },
            "description": "Selects the HTTP API contract for this request only. When omitted, API-key requests use their service account’s stored version. Does not change the stored default."
          },
          {
            "in": "header",
            "name": "X-Affinity-Organization-Id",
            "required": false,
            "schema": {
              "type": "string"
            },
            "description": "Defaults to the API key organization. A platform may select a practice or pharmacy only with an explicit webhook grant in this mode. This changes the webhook owner, not the caller or event subscriptions."
          }
        ],
        "security": [
          {
            "bearerAuth": []
          },
          {
            "affinityApiKey": []
          }
        ],
        "responses": {
          "200": {
            "description": "HTTP 200",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/GetWebhookEventResponse"
                }
              }
            }
          },
          "400": {
            "description": "HTTP 400",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "401": {
            "description": "HTTP 401",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "403": {
            "description": "HTTP 403",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "404": {
            "description": "HTTP 404",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "409": {
            "description": "HTTP 409",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "422": {
            "description": "HTTP 422",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "429": {
            "description": "HTTP 429",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          }
        },
        "summary": "Read event attempts",
        "x-visibility": "public"
      }
    },
    "/v1/webhook-events/{eventId}/replay": {
      "post": {
        "tags": [
          "Webhooks"
        ],
        "operationId": "replayWebhookEvent",
        "parameters": [
          {
            "in": "path",
            "name": "eventId",
            "required": true,
            "schema": {
              "type": "string",
              "pattern": "^evt_[0-7][0-9a-hjkmnp-tv-z]{25}$",
              "examples": [
                "evt_01j2y8m6jcc9tt24af5pw9x1bc"
              ]
            }
          },
          {
            "in": "header",
            "name": "Affinity-Version",
            "required": false,
            "schema": {
              "type": "string"
            },
            "description": "Selects the HTTP API contract for this request only. When omitted, API-key requests use their service account’s stored version. Does not change the stored default."
          },
          {
            "in": "header",
            "name": "X-Affinity-Organization-Id",
            "required": false,
            "schema": {
              "type": "string"
            },
            "description": "Defaults to the API key organization. A platform may select a practice or pharmacy only with an explicit webhook grant in this mode. This changes the webhook owner, not the caller or event subscriptions."
          },
          {
            "in": "header",
            "name": "Idempotency-Key",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "security": [
          {
            "bearerAuth": []
          },
          {
            "affinityApiKey": []
          }
        ],
        "responses": {
          "200": {
            "description": "HTTP 200",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ReplayWebhookEventResponse"
                }
              }
            }
          },
          "400": {
            "description": "HTTP 400",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "401": {
            "description": "HTTP 401",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "403": {
            "description": "HTTP 403",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "404": {
            "description": "HTTP 404",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "409": {
            "description": "HTTP 409",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "422": {
            "description": "HTTP 422",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "429": {
            "description": "HTTP 429",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          }
        },
        "summary": "Replay event",
        "x-visibility": "public"
      }
    },
    "/v1/orders/{orderId}/test-simulation": {
      "get": {
        "tags": [
          "Orders"
        ],
        "operationId": "getOrderTestSimulation",
        "parameters": [
          {
            "in": "path",
            "name": "orderId",
            "required": true,
            "schema": {
              "type": "string",
              "pattern": "^ord_[0-7][0-9a-hjkmnp-tv-z]{25}$",
              "examples": [
                "ord_01j2y8m6jcc9tt24af5pw9x1bc"
              ]
            }
          },
          {
            "in": "header",
            "name": "Affinity-Version",
            "required": false,
            "schema": {
              "type": "string"
            },
            "description": "Selects the HTTP API contract for this request only. When omitted, API-key requests use their service account’s stored version. Does not change the stored default."
          }
        ],
        "security": [
          {
            "bearerAuth": []
          },
          {
            "affinityApiKey": []
          }
        ],
        "responses": {
          "200": {
            "description": "HTTP 200",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/GetOrderTestSimulationResponse"
                }
              }
            }
          },
          "400": {
            "description": "HTTP 400",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "401": {
            "description": "HTTP 401",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "403": {
            "description": "HTTP 403",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "404": {
            "description": "HTTP 404",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "409": {
            "description": "HTTP 409",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "422": {
            "description": "HTTP 422",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "429": {
            "description": "HTTP 429",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          }
        },
        "description": "Requires orders:write. Available only in Test mode.",
        "summary": "Read Test order controls",
        "x-visibility": "public"
      },
      "put": {
        "tags": [
          "Orders"
        ],
        "operationId": "updateOrderTestSimulation",
        "parameters": [
          {
            "in": "path",
            "name": "orderId",
            "required": true,
            "schema": {
              "type": "string",
              "pattern": "^ord_[0-7][0-9a-hjkmnp-tv-z]{25}$",
              "examples": [
                "ord_01j2y8m6jcc9tt24af5pw9x1bc"
              ]
            }
          },
          {
            "in": "header",
            "name": "Affinity-Version",
            "required": false,
            "schema": {
              "type": "string"
            },
            "description": "Selects the HTTP API contract for this request only. When omitted, API-key requests use their service account’s stored version. Does not change the stored default."
          },
          {
            "in": "header",
            "name": "Idempotency-Key",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "security": [
          {
            "bearerAuth": []
          },
          {
            "affinityApiKey": []
          }
        ],
        "responses": {
          "200": {
            "description": "HTTP 200",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/UpdateOrderTestSimulationResponse"
                }
              }
            }
          },
          "400": {
            "description": "HTTP 400",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "401": {
            "description": "HTTP 401",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "403": {
            "description": "HTTP 403",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "404": {
            "description": "HTTP 404",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "409": {
            "description": "HTTP 409",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "422": {
            "description": "HTTP 422",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "429": {
            "description": "HTTP 429",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          }
        },
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/UpdateOrderTestSimulationRequest"
              }
            }
          },
          "required": true
        },
        "description": "Requires orders:write and Idempotency-Key. Configure before submission or queue a valid pharmacy event in manual mode. Events use normal order history and Test webhooks. Live requests are rejected.",
        "summary": "Configure Test order simulation",
        "x-visibility": "public"
      }
    },
    "/v1/catalog/items/{catalogItemId}/prescribing-options": {
      "get": {
        "tags": [
          "Catalog"
        ],
        "operationId": "retrievePrescribingOptions",
        "parameters": [
          {
            "in": "path",
            "name": "catalogItemId",
            "required": true,
            "schema": {
              "type": "string",
              "pattern": "^cat_[0-7][0-9a-hjkmnp-tv-z]{25}$",
              "examples": [
                "cat_01j2y8m6jcc9tt24af5pw9x1bc"
              ]
            }
          },
          {
            "in": "query",
            "name": "practiceId",
            "required": true,
            "schema": {
              "type": "string",
              "pattern": "^prac_[0-7][0-9a-hjkmnp-tv-z]{25}$",
              "examples": [
                "prac_01j2y8m6jcc9tt24af5pw9x1bc"
              ]
            }
          },
          {
            "in": "header",
            "name": "Affinity-Version",
            "required": false,
            "schema": {
              "type": "string"
            },
            "description": "Selects the HTTP API contract for this request only. When omitted, API-key requests use their service account’s stored version. Does not change the stored default."
          }
        ],
        "security": [
          {
            "bearerAuth": []
          },
          {
            "affinityApiKey": []
          }
        ],
        "responses": {
          "200": {
            "description": "HTTP 200",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RetrievePrescribingOptionsResponse"
                }
              }
            }
          },
          "400": {
            "description": "HTTP 400",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "401": {
            "description": "HTTP 401",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "403": {
            "description": "HTTP 403",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "404": {
            "description": "HTTP 404",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "409": {
            "description": "HTTP 409",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "429": {
            "description": "HTTP 429",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          }
        },
        "description": "Requires catalog:read. Returns reviewed SIG presets, guided patterns, quantity constraints and product requirements for a practice and mode. Revisions identify changed defaults. No patient-specific rationale or diagnosis is inferred.",
        "summary": "Retrieve prescribing options",
        "x-visibility": "public"
      }
    },
    "/v1/order-previews": {
      "post": {
        "tags": [
          "Orders"
        ],
        "operationId": "previewOrder",
        "parameters": [
          {
            "in": "header",
            "name": "Affinity-Version",
            "required": false,
            "schema": {
              "type": "string"
            },
            "description": "Selects the HTTP API contract for this request only. When omitted, API-key requests use their service account’s stored version. Does not change the stored default."
          }
        ],
        "security": [
          {
            "bearerAuth": []
          },
          {
            "affinityApiKey": []
          }
        ],
        "responses": {
          "200": {
            "description": "HTTP 200",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PreviewOrderResponse"
                }
              }
            }
          },
          "400": {
            "description": "HTTP 400",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "401": {
            "description": "HTTP 401",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "403": {
            "description": "HTTP 403",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "404": {
            "description": "HTTP 404",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "409": {
            "description": "HTTP 409",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "429": {
            "description": "HTTP 429",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          }
        },
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/PreviewOrderRequest"
              }
            }
          },
          "required": true
        },
        "description": "Requires orders:write and catalog:read. Supply exactly one of patientId, patientExternalId, or inline patient details. External-ID lookup additionally requires patients:read; inline details require patients:write. Resolves defaults and explicit edits for 1–20 prescriptions. Reuses stored patient details when identifiers match; otherwise previews inline details without creating a patient. Complete previews contain an orders.create input. Does not create records, reserve prices, sign, charge or transmit. No idempotency key is required. Creation and signing recheck current requirements.",
        "summary": "Preview an order",
        "x-visibility": "public"
      }
    },
    "/v1/orders/{orderId}/sign": {
      "post": {
        "tags": [
          "Orders"
        ],
        "operationId": "signOrder",
        "parameters": [
          {
            "in": "path",
            "name": "orderId",
            "required": true,
            "schema": {
              "type": "string",
              "pattern": "^ord_[0-7][0-9a-hjkmnp-tv-z]{25}$",
              "examples": [
                "ord_01j2y8m6jcc9tt24af5pw9x1bc"
              ]
            }
          },
          {
            "in": "header",
            "name": "Affinity-Version",
            "required": false,
            "schema": {
              "type": "string"
            },
            "description": "Selects the HTTP API contract for this request only. When omitted, API-key requests use their service account’s stored version. Does not change the stored default."
          },
          {
            "in": "header",
            "name": "Idempotency-Key",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "security": [
          {
            "bearerAuth": []
          },
          {
            "affinityApiKey": []
          }
        ],
        "responses": {
          "200": {
            "description": "HTTP 200",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SignOrderResponse"
                }
              }
            }
          },
          "400": {
            "description": "HTTP 400",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "401": {
            "description": "HTTP 401",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "403": {
            "description": "HTTP 403",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "404": {
            "description": "HTTP 404",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "409": {
            "description": "HTTP 409",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "422": {
            "description": "HTTP 422",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "429": {
            "description": "HTTP 429",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "503": {
            "description": "HTTP 503",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          }
        },
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/SignOrderRequest"
              }
            }
          },
          "required": true
        },
        "description": "Requires orders:sign, Idempotency-Key, signatureAttestation, and expectedRevision from the reviewed order. Existing integrations may send expectedVersions instead; supply exactly one. A stale revision returns 409 and requires renewed clinician review. Select prescriber by npi, provider id, or integration-scoped externalId, or inherit the draft's prescriber. First-use registration requires team:write. Actor headers are optional audit metadata with prescriber; legacy userId requires matching clinician actor headers. Signing does not submit to a pharmacy.",
        "summary": "Sign order",
        "x-visibility": "public"
      }
    },
    "/v1/orders/{orderId}/sign-and-submit": {
      "post": {
        "tags": [
          "Orders"
        ],
        "operationId": "signAndSubmitOrder",
        "parameters": [
          {
            "in": "path",
            "name": "orderId",
            "required": true,
            "schema": {
              "type": "string",
              "pattern": "^ord_[0-7][0-9a-hjkmnp-tv-z]{25}$",
              "examples": [
                "ord_01j2y8m6jcc9tt24af5pw9x1bc"
              ]
            }
          },
          {
            "in": "header",
            "name": "Affinity-Version",
            "required": false,
            "schema": {
              "type": "string"
            },
            "description": "Selects the HTTP API contract for this request only. When omitted, API-key requests use their service account’s stored version. Does not change the stored default."
          },
          {
            "in": "header",
            "name": "Idempotency-Key",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "security": [
          {
            "bearerAuth": []
          },
          {
            "affinityApiKey": []
          }
        ],
        "responses": {
          "202": {
            "description": "HTTP 202",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SignAndSubmitOrderResponse"
                }
              }
            }
          },
          "400": {
            "description": "HTTP 400",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "401": {
            "description": "HTTP 401",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "403": {
            "description": "HTTP 403",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "404": {
            "description": "HTTP 404",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "409": {
            "description": "HTTP 409",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "422": {
            "description": "HTTP 422",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "429": {
            "description": "HTTP 429",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "503": {
            "description": "HTTP 503",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          }
        },
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/SignAndSubmitOrderRequest"
              }
            }
          },
          "required": true
        },
        "description": "Requires orders:sign, Idempotency-Key, signatureAttestation, and expectedRevision from the reviewed order. Existing integrations may send expectedVersions instead; supply exactly one. A stale revision returns 409 and requires renewed clinician review. Select prescriber by npi, provider id, or externalId, or inherit the draft's prescriber. First-use registration requires team:write. Actor headers are optional with prescriber; legacy userId requires matching clinician actor headers. Signs the complete order, then attempts each submission. Signing remains committed if submission fails. Replay the same key after an uncertain response; retry reported submission failures through Submit order with a new key. Submitted means queued, not pharmacy acceptance.",
        "summary": "Sign and submit order",
        "x-visibility": "public"
      }
    },
    "/v1/orders/{orderId}/submit": {
      "post": {
        "tags": [
          "Orders"
        ],
        "operationId": "submitOrder",
        "parameters": [
          {
            "in": "path",
            "name": "orderId",
            "required": true,
            "schema": {
              "type": "string",
              "pattern": "^ord_[0-7][0-9a-hjkmnp-tv-z]{25}$",
              "examples": [
                "ord_01j2y8m6jcc9tt24af5pw9x1bc"
              ]
            }
          },
          {
            "in": "header",
            "name": "Affinity-Version",
            "required": false,
            "schema": {
              "type": "string"
            },
            "description": "Selects the HTTP API contract for this request only. When omitted, API-key requests use their service account’s stored version. Does not change the stored default."
          },
          {
            "in": "header",
            "name": "Idempotency-Key",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "security": [
          {
            "bearerAuth": []
          },
          {
            "affinityApiKey": []
          }
        ],
        "responses": {
          "202": {
            "description": "HTTP 202",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SubmitOrderResponse"
                }
              }
            }
          },
          "400": {
            "description": "HTTP 400",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "401": {
            "description": "HTTP 401",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "403": {
            "description": "HTTP 403",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "404": {
            "description": "HTTP 404",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "409": {
            "description": "HTTP 409",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "422": {
            "description": "HTTP 422",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "429": {
            "description": "HTTP 429",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "503": {
            "description": "HTTP 503",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          }
        },
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/SubmitOrderRequest"
              }
            }
          },
          "required": true
        },
        "description": "Requires orders:sign and Idempotency-Key. Queues signed prescriptions after rechecking authorization, signature integrity, billing, and fulfillment eligibility. Track pharmacy acceptance through order reads and webhooks. After a partial failure, retry submission with a new idempotency key; already queued prescriptions are not duplicated.",
        "summary": "Submit order",
        "x-visibility": "public"
      }
    },
    "/v1/orders/{orderId}/rejection": {
      "post": {
        "tags": [
          "Orders"
        ],
        "operationId": "rejectOrder",
        "parameters": [
          {
            "in": "path",
            "name": "orderId",
            "required": true,
            "schema": {
              "type": "string",
              "pattern": "^ord_[0-7][0-9a-hjkmnp-tv-z]{25}$",
              "examples": [
                "ord_01j2y8m6jcc9tt24af5pw9x1bc"
              ]
            }
          },
          {
            "in": "header",
            "name": "Affinity-Version",
            "required": false,
            "schema": {
              "type": "string"
            },
            "description": "Selects the HTTP API contract for this request only. When omitted, API-key requests use their service account’s stored version. Does not change the stored default."
          },
          {
            "in": "header",
            "name": "Idempotency-Key",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "security": [
          {
            "bearerAuth": []
          },
          {
            "affinityApiKey": []
          }
        ],
        "responses": {
          "200": {
            "description": "HTTP 200",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RejectOrderResponse"
                }
              }
            }
          },
          "400": {
            "description": "HTTP 400",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "401": {
            "description": "HTTP 401",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "403": {
            "description": "HTTP 403",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "404": {
            "description": "HTTP 404",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "409": {
            "description": "HTTP 409",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "422": {
            "description": "HTTP 422",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "429": {
            "description": "HTTP 429",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "503": {
            "description": "HTTP 503",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          }
        },
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/RejectOrderRequest"
              }
            }
          },
          "required": true
        },
        "description": "Requires orders:sign and Idempotency-Key. Select a prescriber or inherit the draft's prescriber. Legacy userId requires matching clinician actor headers. Supply expectedRevision from the reviewed order, or expectedVersions for existing integrations. Permanently rejects the complete unsigned order after checking its revision.",
        "summary": "Reject order",
        "x-visibility": "public"
      }
    },
    "/v1/practices/{practiceId}/users": {
      "post": {
        "tags": [
          "Team"
        ],
        "operationId": "registerUser",
        "parameters": [
          {
            "in": "path",
            "name": "practiceId",
            "required": true,
            "schema": {
              "type": "string",
              "pattern": "^prac_[0-7][0-9a-hjkmnp-tv-z]{25}$",
              "examples": [
                "prac_01j2y8m6jcc9tt24af5pw9x1bc"
              ]
            }
          },
          {
            "in": "header",
            "name": "Affinity-Version",
            "required": false,
            "schema": {
              "type": "string"
            },
            "description": "Selects the HTTP API contract for this request only. When omitted, API-key requests use their service account’s stored version. Does not change the stored default."
          },
          {
            "in": "header",
            "name": "Idempotency-Key",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "security": [
          {
            "bearerAuth": []
          },
          {
            "affinityApiKey": []
          }
        ],
        "responses": {
          "200": {
            "description": "HTTP 200",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RegisterUserResponse"
                }
              }
            }
          },
          "400": {
            "description": "HTTP 400",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "401": {
            "description": "HTTP 401",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "403": {
            "description": "HTTP 403",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "404": {
            "description": "HTTP 404",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "409": {
            "description": "HTTP 409",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "422": {
            "description": "HTTP 422",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "429": {
            "description": "HTTP 429",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "503": {
            "description": "HTTP 503",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          }
        },
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/RegisterUserRequest"
              }
            }
          },
          "required": true
        },
        "description": "Requires team:write and Idempotency-Key. Registers a practice member without an invitation. Test requires synthetic .test emails and Affinity Test NPIs. Live requires approved integration and practice access. Identity attestation records the integration's assertion; it does not verify login email or clinical credentials. Existing memberships and verified provider records are preserved. Use the returned user ID for orders and signing.",
        "summary": "Register user",
        "x-visibility": "public"
      }
    },
    "/v1/practices/{practiceId}/patients/{patientId}/addresses": {
      "get": {
        "tags": [
          "Patients"
        ],
        "operationId": "listPatientAddresses",
        "parameters": [
          {
            "in": "path",
            "name": "practiceId",
            "required": true,
            "schema": {
              "type": "string",
              "pattern": "^prac_[0-7][0-9a-hjkmnp-tv-z]{25}$",
              "examples": [
                "prac_01j2y8m6jcc9tt24af5pw9x1bc"
              ]
            }
          },
          {
            "in": "path",
            "name": "patientId",
            "required": true,
            "schema": {
              "type": "string",
              "pattern": "^pat_[0-7][0-9a-hjkmnp-tv-z]{25}$",
              "examples": [
                "pat_01j2y8m6jcc9tt24af5pw9x1bc"
              ]
            }
          },
          {
            "in": "query",
            "name": "status",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string",
                  "enum": [
                    "active",
                    "archived",
                    "all"
                  ]
                },
                {
                  "type": "null"
                }
              ]
            }
          },
          {
            "in": "query",
            "name": "startingAfter",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string",
                  "pattern": "^addr_[0-7][0-9a-hjkmnp-tv-z]{25}$",
                  "examples": [
                    "addr_01j2y8m6jcc9tt24af5pw9x1bc"
                  ]
                },
                {
                  "type": "null"
                }
              ]
            }
          },
          {
            "in": "query",
            "name": "endingBefore",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string",
                  "pattern": "^addr_[0-7][0-9a-hjkmnp-tv-z]{25}$",
                  "examples": [
                    "addr_01j2y8m6jcc9tt24af5pw9x1bc"
                  ]
                },
                {
                  "type": "null"
                }
              ]
            }
          },
          {
            "in": "query",
            "name": "limit",
            "required": false,
            "schema": {
              "default": 25,
              "maximum": 100,
              "minimum": 1,
              "type": "integer"
            }
          },
          {
            "in": "header",
            "name": "Affinity-Version",
            "required": false,
            "schema": {
              "type": "string"
            },
            "description": "Selects the HTTP API contract for this request only. When omitted, API-key requests use their service account’s stored version. Does not change the stored default."
          },
          {
            "in": "header",
            "name": "Affinity-Actor-Id",
            "required": false,
            "schema": {
              "type": "string"
            },
            "description": "Required for user actors and optional for system actors. Omit both actor headers to use the authenticated service account as a system actor."
          },
          {
            "in": "header",
            "name": "Affinity-Actor-Type",
            "required": false,
            "schema": {
              "type": "string"
            },
            "description": "Use user when a person initiated the action and system for autonomous work. Omit both actor headers to default to system."
          }
        ],
        "security": [
          {
            "bearerAuth": []
          },
          {
            "affinityApiKey": []
          }
        ],
        "responses": {
          "200": {
            "description": "HTTP 200",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ListPatientAddressesResponse"
                }
              }
            }
          },
          "400": {
            "description": "HTTP 400",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "401": {
            "description": "HTTP 401",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "403": {
            "description": "HTTP 403",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "404": {
            "description": "HTTP 404",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "409": {
            "description": "HTTP 409",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "429": {
            "description": "HTTP 429",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          }
        },
        "summary": "List delivery addresses",
        "x-pier-pagination": {
          "cursorField": "id",
          "kind": "cursor"
        },
        "x-visibility": "public"
      },
      "post": {
        "tags": [
          "Patients"
        ],
        "operationId": "createPatientAddress",
        "parameters": [
          {
            "in": "path",
            "name": "practiceId",
            "required": true,
            "schema": {
              "type": "string",
              "pattern": "^prac_[0-7][0-9a-hjkmnp-tv-z]{25}$",
              "examples": [
                "prac_01j2y8m6jcc9tt24af5pw9x1bc"
              ]
            }
          },
          {
            "in": "path",
            "name": "patientId",
            "required": true,
            "schema": {
              "type": "string",
              "pattern": "^pat_[0-7][0-9a-hjkmnp-tv-z]{25}$",
              "examples": [
                "pat_01j2y8m6jcc9tt24af5pw9x1bc"
              ]
            }
          },
          {
            "in": "header",
            "name": "Affinity-Version",
            "required": false,
            "schema": {
              "type": "string"
            },
            "description": "Selects the HTTP API contract for this request only. When omitted, API-key requests use their service account’s stored version. Does not change the stored default."
          },
          {
            "in": "header",
            "name": "Idempotency-Key",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "header",
            "name": "Affinity-Actor-Id",
            "required": false,
            "schema": {
              "type": "string"
            },
            "description": "Required for user actors and optional for system actors. Omit both actor headers to use the authenticated service account as a system actor."
          },
          {
            "in": "header",
            "name": "Affinity-Actor-Type",
            "required": false,
            "schema": {
              "type": "string"
            },
            "description": "Use user when a person initiated the action and system for autonomous work. Omit both actor headers to default to system."
          }
        ],
        "security": [
          {
            "bearerAuth": []
          },
          {
            "affinityApiKey": []
          }
        ],
        "responses": {
          "200": {
            "description": "HTTP 200",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CreatePatientAddressResponse"
                }
              }
            }
          },
          "400": {
            "description": "HTTP 400",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "401": {
            "description": "HTTP 401",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "403": {
            "description": "HTTP 403",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "404": {
            "description": "HTTP 404",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "409": {
            "description": "HTTP 409",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "429": {
            "description": "HTTP 429",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          }
        },
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CreatePatientAddressRequest"
              }
            }
          },
          "required": true
        },
        "description": "Returns the existing active address for a normalized duplicate. The first address becomes the default. API keys require Idempotency-Key.",
        "summary": "Save delivery address",
        "x-visibility": "public"
      }
    },
    "/v1/practices/{practiceId}/patients/{patientId}/addresses/{addressId}": {
      "patch": {
        "tags": [
          "Patients"
        ],
        "operationId": "updatePatientAddress",
        "parameters": [
          {
            "in": "path",
            "name": "practiceId",
            "required": true,
            "schema": {
              "type": "string",
              "pattern": "^prac_[0-7][0-9a-hjkmnp-tv-z]{25}$",
              "examples": [
                "prac_01j2y8m6jcc9tt24af5pw9x1bc"
              ]
            }
          },
          {
            "in": "path",
            "name": "patientId",
            "required": true,
            "schema": {
              "type": "string",
              "pattern": "^pat_[0-7][0-9a-hjkmnp-tv-z]{25}$",
              "examples": [
                "pat_01j2y8m6jcc9tt24af5pw9x1bc"
              ]
            }
          },
          {
            "in": "path",
            "name": "addressId",
            "required": true,
            "schema": {
              "type": "string",
              "pattern": "^addr_[0-7][0-9a-hjkmnp-tv-z]{25}$",
              "examples": [
                "addr_01j2y8m6jcc9tt24af5pw9x1bc"
              ]
            }
          },
          {
            "in": "header",
            "name": "Affinity-Version",
            "required": false,
            "schema": {
              "type": "string"
            },
            "description": "Selects the HTTP API contract for this request only. When omitted, API-key requests use their service account’s stored version. Does not change the stored default."
          },
          {
            "in": "header",
            "name": "Idempotency-Key",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "header",
            "name": "Affinity-Actor-Id",
            "required": false,
            "schema": {
              "type": "string"
            },
            "description": "Required for user actors and optional for system actors. Omit both actor headers to use the authenticated service account as a system actor."
          },
          {
            "in": "header",
            "name": "Affinity-Actor-Type",
            "required": false,
            "schema": {
              "type": "string"
            },
            "description": "Use user when a person initiated the action and system for autonomous work. Omit both actor headers to default to system."
          }
        ],
        "security": [
          {
            "bearerAuth": []
          },
          {
            "affinityApiKey": []
          }
        ],
        "responses": {
          "200": {
            "description": "HTTP 200",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/UpdatePatientAddressResponse"
                }
              }
            }
          },
          "400": {
            "description": "HTTP 400",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "401": {
            "description": "HTTP 401",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "403": {
            "description": "HTTP 403",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "404": {
            "description": "HTTP 404",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "409": {
            "description": "HTTP 409",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "429": {
            "description": "HTTP 429",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          }
        },
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/UpdatePatientAddressRequest"
              }
            }
          },
          "required": true
        },
        "summary": "Update delivery address",
        "x-visibility": "public"
      },
      "delete": {
        "tags": [
          "Patients"
        ],
        "operationId": "archivePatientAddress",
        "parameters": [
          {
            "in": "path",
            "name": "practiceId",
            "required": true,
            "schema": {
              "type": "string",
              "pattern": "^prac_[0-7][0-9a-hjkmnp-tv-z]{25}$",
              "examples": [
                "prac_01j2y8m6jcc9tt24af5pw9x1bc"
              ]
            }
          },
          {
            "in": "path",
            "name": "patientId",
            "required": true,
            "schema": {
              "type": "string",
              "pattern": "^pat_[0-7][0-9a-hjkmnp-tv-z]{25}$",
              "examples": [
                "pat_01j2y8m6jcc9tt24af5pw9x1bc"
              ]
            }
          },
          {
            "in": "path",
            "name": "addressId",
            "required": true,
            "schema": {
              "type": "string",
              "pattern": "^addr_[0-7][0-9a-hjkmnp-tv-z]{25}$",
              "examples": [
                "addr_01j2y8m6jcc9tt24af5pw9x1bc"
              ]
            }
          },
          {
            "in": "header",
            "name": "Affinity-Version",
            "required": false,
            "schema": {
              "type": "string"
            },
            "description": "Selects the HTTP API contract for this request only. When omitted, API-key requests use their service account’s stored version. Does not change the stored default."
          },
          {
            "in": "header",
            "name": "Idempotency-Key",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "header",
            "name": "Affinity-Actor-Id",
            "required": false,
            "schema": {
              "type": "string"
            },
            "description": "Required for user actors and optional for system actors. Omit both actor headers to use the authenticated service account as a system actor."
          },
          {
            "in": "header",
            "name": "Affinity-Actor-Type",
            "required": false,
            "schema": {
              "type": "string"
            },
            "description": "Use user when a person initiated the action and system for autonomous work. Omit both actor headers to default to system."
          }
        ],
        "security": [
          {
            "bearerAuth": []
          },
          {
            "affinityApiKey": []
          }
        ],
        "responses": {
          "200": {
            "description": "HTTP 200",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ArchivePatientAddressResponse"
                }
              }
            }
          },
          "400": {
            "description": "HTTP 400",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "401": {
            "description": "HTTP 401",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "403": {
            "description": "HTTP 403",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "404": {
            "description": "HTTP 404",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "409": {
            "description": "HTTP 409",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "429": {
            "description": "HTTP 429",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          }
        },
        "description": "Preserves the address ID and history. Archiving the default selects the oldest remaining active address. Existing orders remain unchanged.",
        "summary": "Archive delivery address",
        "x-visibility": "public"
      }
    },
    "/v1/practices/{practiceId}/patients/{patientId}/addresses/{addressId}/default": {
      "put": {
        "tags": [
          "Patients"
        ],
        "operationId": "setDefaultPatientAddress",
        "parameters": [
          {
            "in": "path",
            "name": "practiceId",
            "required": true,
            "schema": {
              "type": "string",
              "pattern": "^prac_[0-7][0-9a-hjkmnp-tv-z]{25}$",
              "examples": [
                "prac_01j2y8m6jcc9tt24af5pw9x1bc"
              ]
            }
          },
          {
            "in": "path",
            "name": "patientId",
            "required": true,
            "schema": {
              "type": "string",
              "pattern": "^pat_[0-7][0-9a-hjkmnp-tv-z]{25}$",
              "examples": [
                "pat_01j2y8m6jcc9tt24af5pw9x1bc"
              ]
            }
          },
          {
            "in": "path",
            "name": "addressId",
            "required": true,
            "schema": {
              "type": "string",
              "pattern": "^addr_[0-7][0-9a-hjkmnp-tv-z]{25}$",
              "examples": [
                "addr_01j2y8m6jcc9tt24af5pw9x1bc"
              ]
            }
          },
          {
            "in": "header",
            "name": "Affinity-Version",
            "required": false,
            "schema": {
              "type": "string"
            },
            "description": "Selects the HTTP API contract for this request only. When omitted, API-key requests use their service account’s stored version. Does not change the stored default."
          },
          {
            "in": "header",
            "name": "Idempotency-Key",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "header",
            "name": "Affinity-Actor-Id",
            "required": false,
            "schema": {
              "type": "string"
            },
            "description": "Required for user actors and optional for system actors. Omit both actor headers to use the authenticated service account as a system actor."
          },
          {
            "in": "header",
            "name": "Affinity-Actor-Type",
            "required": false,
            "schema": {
              "type": "string"
            },
            "description": "Use user when a person initiated the action and system for autonomous work. Omit both actor headers to default to system."
          }
        ],
        "security": [
          {
            "bearerAuth": []
          },
          {
            "affinityApiKey": []
          }
        ],
        "responses": {
          "200": {
            "description": "HTTP 200",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SetDefaultPatientAddressResponse"
                }
              }
            }
          },
          "400": {
            "description": "HTTP 400",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "401": {
            "description": "HTTP 401",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "403": {
            "description": "HTTP 403",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "404": {
            "description": "HTTP 404",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "409": {
            "description": "HTTP 409",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "429": {
            "description": "HTTP 429",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          }
        },
        "description": "Changes delivery selection for future drafts, without changing patient clinical location or existing signed orders.",
        "summary": "Set default delivery address",
        "x-visibility": "public"
      }
    },
    "/v1/practices/{practiceId}/team/invitations": {
      "post": {
        "tags": [
          "Team"
        ],
        "operationId": "invitePracticeTeamPerson",
        "parameters": [
          {
            "in": "path",
            "name": "practiceId",
            "required": true,
            "schema": {
              "type": "string",
              "pattern": "^prac_[0-7][0-9a-hjkmnp-tv-z]{25}$",
              "examples": [
                "prac_01j2y8m6jcc9tt24af5pw9x1bc"
              ]
            }
          },
          {
            "in": "header",
            "name": "Affinity-Version",
            "required": false,
            "schema": {
              "type": "string"
            },
            "description": "Selects the HTTP API contract for this request only. When omitted, API-key requests use their service account’s stored version. Does not change the stored default."
          },
          {
            "in": "header",
            "name": "Idempotency-Key",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "security": [
          {
            "bearerAuth": []
          },
          {
            "affinityApiKey": []
          }
        ],
        "responses": {
          "200": {
            "description": "HTTP 200",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/InvitePracticeTeamPersonResponse"
                }
              }
            }
          },
          "400": {
            "description": "HTTP 400",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "401": {
            "description": "HTTP 401",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "403": {
            "description": "HTTP 403",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "404": {
            "description": "HTTP 404",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "409": {
            "description": "HTTP 409",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "429": {
            "description": "HTTP 429",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "502": {
            "description": "HTTP 502",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          }
        },
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/InvitePracticeTeamPersonRequest"
              }
            }
          },
          "required": true
        },
        "description": "Requires team:write on the practice key or its platform key. Use roles to combine administrator, prescriber, clinical_staff, billing, or developer presets. Ownership uses the protected owner designation. The singular role field remains available for single-role assignments. Creates a real organization invitation and optional prescriber setup. The recipient must accept with their Affinity account. Repeating the same external identity retries pending invitation delivery. Accepted invitations do not change existing access. Team membership is shared between Test and Live; the external identity is mode-scoped. Keys cannot accept invitations. Headless registration and signing use separate endpoints.",
        "summary": "Invite team member",
        "x-visibility": "public"
      },
      "get": {
        "tags": [
          "Team"
        ],
        "operationId": "listPracticeTeamInvitations",
        "parameters": [
          {
            "in": "path",
            "name": "practiceId",
            "required": true,
            "schema": {
              "type": "string",
              "pattern": "^prac_[0-7][0-9a-hjkmnp-tv-z]{25}$",
              "examples": [
                "prac_01j2y8m6jcc9tt24af5pw9x1bc"
              ]
            }
          },
          {
            "in": "query",
            "name": "limit",
            "required": false,
            "schema": {
              "default": 25,
              "maximum": 100,
              "minimum": 1,
              "type": "integer"
            }
          },
          {
            "in": "query",
            "name": "startingAfter",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string",
                  "pattern": "^invite_[0-7][0-9a-hjkmnp-tv-z]{25}$",
                  "examples": [
                    "invite_01j2y8m6jcc9tt24af5pw9x1bc"
                  ]
                },
                {
                  "type": "null"
                }
              ]
            }
          },
          {
            "in": "query",
            "name": "endingBefore",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string",
                  "pattern": "^invite_[0-7][0-9a-hjkmnp-tv-z]{25}$",
                  "examples": [
                    "invite_01j2y8m6jcc9tt24af5pw9x1bc"
                  ]
                },
                {
                  "type": "null"
                }
              ]
            }
          },
          {
            "in": "query",
            "name": "status",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string",
                  "enum": [
                    "accepted",
                    "declined",
                    "pending",
                    "expired",
                    "revoked"
                  ]
                },
                {
                  "type": "null"
                }
              ]
            }
          },
          {
            "in": "query",
            "name": "email",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string",
                  "pattern": "^[^\\s@]+@[^\\s@]+\\.[^\\s@]+$"
                },
                {
                  "type": "null"
                }
              ]
            }
          },
          {
            "in": "query",
            "name": "externalId",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "description": "Match this integration's external identity in the API key's mode."
            }
          },
          {
            "in": "header",
            "name": "Affinity-Version",
            "required": false,
            "schema": {
              "type": "string"
            },
            "description": "Selects the HTTP API contract for this request only. When omitted, API-key requests use their service account’s stored version. Does not change the stored default."
          }
        ],
        "security": [
          {
            "bearerAuth": []
          },
          {
            "affinityApiKey": []
          }
        ],
        "responses": {
          "200": {
            "description": "HTTP 200",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ListPracticeTeamInvitationsResponse"
                }
              }
            }
          },
          "400": {
            "description": "HTTP 400",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "401": {
            "description": "HTTP 401",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "403": {
            "description": "HTTP 403",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "404": {
            "description": "HTTP 404",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "409": {
            "description": "HTTP 409",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "429": {
            "description": "HTTP 429",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          }
        },
        "description": "Requires team:read. Lists practice invitations, including invitations sent in Clinic. Filter by pending, expired, accepted, declined, or revoked status, exact email, or your integration externalId. Only your integration and API key mode can see its external identity and onboarding state. Follow person.nextActions after invitation acceptance.",
        "summary": "List invitations",
        "x-pier-pagination": {
          "cursorField": "id",
          "kind": "cursor"
        },
        "x-visibility": "public"
      }
    },
    "/v1/practices/{practiceId}/team": {
      "get": {
        "tags": [
          "Team"
        ],
        "operationId": "getPracticeTeam",
        "parameters": [
          {
            "in": "path",
            "name": "practiceId",
            "required": true,
            "schema": {
              "type": "string",
              "pattern": "^prac_[0-7][0-9a-hjkmnp-tv-z]{25}$",
              "examples": [
                "prac_01j2y8m6jcc9tt24af5pw9x1bc"
              ]
            }
          },
          {
            "in": "header",
            "name": "Affinity-Version",
            "required": false,
            "schema": {
              "type": "string"
            },
            "description": "Selects the HTTP API contract for this request only. When omitted, API-key requests use their service account’s stored version. Does not change the stored default."
          }
        ],
        "security": [
          {
            "bearerAuth": []
          },
          {
            "affinityApiKey": []
          }
        ],
        "responses": {
          "200": {
            "description": "HTTP 200",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/GetPracticeTeamResponse"
                }
              }
            }
          },
          "400": {
            "description": "HTTP 400",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "401": {
            "description": "HTTP 401",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "403": {
            "description": "HTTP 403",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "404": {
            "description": "HTTP 404",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "409": {
            "description": "HTTP 409",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "429": {
            "description": "HTTP 429",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          }
        },
        "description": "Requires team:read. Returns counts of members, invitations, and prescribers. Use the paginated members, prescribers, and invitations collections for individual records. Team access and clinician credentials are shared between Test and Live.",
        "summary": "Get team",
        "x-visibility": "public"
      }
    },
    "/v1/practices/{practiceId}/team/members": {
      "get": {
        "tags": [
          "Team"
        ],
        "operationId": "listPracticeTeamMembers",
        "parameters": [
          {
            "in": "path",
            "name": "practiceId",
            "required": true,
            "schema": {
              "type": "string",
              "pattern": "^prac_[0-7][0-9a-hjkmnp-tv-z]{25}$",
              "examples": [
                "prac_01j2y8m6jcc9tt24af5pw9x1bc"
              ]
            }
          },
          {
            "in": "query",
            "name": "limit",
            "required": false,
            "schema": {
              "default": 25,
              "maximum": 100,
              "minimum": 1,
              "type": "integer"
            }
          },
          {
            "in": "query",
            "name": "startingAfter",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string",
                  "pattern": "^mbr_[0-7][0-9a-hjkmnp-tv-z]{25}$",
                  "examples": [
                    "mbr_01j2y8m6jcc9tt24af5pw9x1bc"
                  ]
                },
                {
                  "type": "null"
                }
              ]
            }
          },
          {
            "in": "query",
            "name": "endingBefore",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string",
                  "pattern": "^mbr_[0-7][0-9a-hjkmnp-tv-z]{25}$",
                  "examples": [
                    "mbr_01j2y8m6jcc9tt24af5pw9x1bc"
                  ]
                },
                {
                  "type": "null"
                }
              ]
            }
          },
          {
            "in": "query",
            "name": "search",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ]
            }
          },
          {
            "in": "query",
            "name": "role",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string",
                  "enum": [
                    "owner",
                    "administrator",
                    "prescriber",
                    "clinical_staff",
                    "billing",
                    "developer"
                  ]
                },
                {
                  "type": "null"
                }
              ]
            }
          },
          {
            "in": "query",
            "name": "status",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string",
                  "enum": [
                    "active",
                    "disabled"
                  ]
                },
                {
                  "type": "null"
                }
              ]
            }
          },
          {
            "in": "header",
            "name": "Affinity-Version",
            "required": false,
            "schema": {
              "type": "string"
            },
            "description": "Selects the HTTP API contract for this request only. When omitted, API-key requests use their service account’s stored version. Does not change the stored default."
          }
        ],
        "security": [
          {
            "bearerAuth": []
          },
          {
            "affinityApiKey": []
          }
        ],
        "responses": {
          "200": {
            "description": "HTTP 200",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ListPracticeTeamMembersResponse"
                }
              }
            }
          },
          "400": {
            "description": "HTTP 400",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "401": {
            "description": "HTTP 401",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "403": {
            "description": "HTTP 403",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "404": {
            "description": "HTTP 404",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "409": {
            "description": "HTTP 409",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "429": {
            "description": "HTTP 429",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          }
        },
        "description": "Requires team:read. Search the roster by name or email, and filter by role or membership status. Includes members invited in Clinic, location access, and account-specific prescriber connections. Memberships are shared between Test and Live.",
        "summary": "List team members",
        "x-pier-pagination": {
          "cursorField": "id",
          "kind": "cursor"
        },
        "x-visibility": "public"
      }
    },
    "/v1/practices/{practiceId}/team/prescribers": {
      "get": {
        "tags": [
          "Team"
        ],
        "operationId": "listPracticeTeamPrescribers",
        "parameters": [
          {
            "in": "path",
            "name": "practiceId",
            "required": true,
            "schema": {
              "type": "string",
              "pattern": "^prac_[0-7][0-9a-hjkmnp-tv-z]{25}$",
              "examples": [
                "prac_01j2y8m6jcc9tt24af5pw9x1bc"
              ]
            }
          },
          {
            "in": "query",
            "name": "limit",
            "required": false,
            "schema": {
              "default": 25,
              "maximum": 100,
              "minimum": 1,
              "type": "integer"
            }
          },
          {
            "in": "query",
            "name": "startingAfter",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string",
                  "pattern": "^prov_[0-7][0-9a-hjkmnp-tv-z]{25}$",
                  "examples": [
                    "prov_01j2y8m6jcc9tt24af5pw9x1bc"
                  ]
                },
                {
                  "type": "null"
                }
              ]
            }
          },
          {
            "in": "query",
            "name": "endingBefore",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string",
                  "pattern": "^prov_[0-7][0-9a-hjkmnp-tv-z]{25}$",
                  "examples": [
                    "prov_01j2y8m6jcc9tt24af5pw9x1bc"
                  ]
                },
                {
                  "type": "null"
                }
              ]
            }
          },
          {
            "in": "query",
            "name": "search",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ]
            }
          },
          {
            "in": "query",
            "name": "npi",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string",
                  "pattern": "^\\d{10}$"
                },
                {
                  "type": "null"
                }
              ]
            }
          },
          {
            "in": "query",
            "name": "state",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "description": "Match a submitted license jurisdiction. This does not establish signing eligibility."
            }
          },
          {
            "in": "query",
            "name": "status",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string",
                  "enum": [
                    "active",
                    "inactive"
                  ]
                },
                {
                  "type": "null"
                }
              ]
            }
          },
          {
            "in": "header",
            "name": "Affinity-Version",
            "required": false,
            "schema": {
              "type": "string"
            },
            "description": "Selects the HTTP API contract for this request only. When omitted, API-key requests use their service account’s stored version. Does not change the stored default."
          }
        ],
        "security": [
          {
            "bearerAuth": []
          },
          {
            "affinityApiKey": []
          }
        ],
        "responses": {
          "200": {
            "description": "HTTP 200",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ListPracticeTeamPrescribersResponse"
                }
              }
            }
          },
          "400": {
            "description": "HTTP 400",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "401": {
            "description": "HTTP 401",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "403": {
            "description": "HTTP 403",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "404": {
            "description": "HTTP 404",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "409": {
            "description": "HTTP 409",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "429": {
            "description": "HTTP 429",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          }
        },
        "description": "Requires team:read. Filter practice prescribers by name, NPI, state, and practice status. Records include submitted licenses and their IDs. Signing authority also requires an active account connection, Live practice access, and prescription eligibility.",
        "summary": "List prescribers",
        "x-pier-pagination": {
          "cursorField": "id",
          "kind": "cursor"
        },
        "x-visibility": "public"
      }
    },
    "/v1/practices/{practiceId}/team/members/{memberId}": {
      "get": {
        "tags": [
          "Team"
        ],
        "operationId": "getPracticeTeamMember",
        "parameters": [
          {
            "in": "path",
            "name": "practiceId",
            "required": true,
            "schema": {
              "type": "string",
              "pattern": "^prac_[0-7][0-9a-hjkmnp-tv-z]{25}$",
              "examples": [
                "prac_01j2y8m6jcc9tt24af5pw9x1bc"
              ]
            }
          },
          {
            "in": "path",
            "name": "memberId",
            "required": true,
            "schema": {
              "type": "string",
              "pattern": "^mbr_[0-7][0-9a-hjkmnp-tv-z]{25}$",
              "examples": [
                "mbr_01j2y8m6jcc9tt24af5pw9x1bc"
              ]
            }
          },
          {
            "in": "header",
            "name": "Affinity-Version",
            "required": false,
            "schema": {
              "type": "string"
            },
            "description": "Selects the HTTP API contract for this request only. When omitted, API-key requests use their service account’s stored version. Does not change the stored default."
          }
        ],
        "security": [
          {
            "bearerAuth": []
          },
          {
            "affinityApiKey": []
          }
        ],
        "responses": {
          "200": {
            "description": "HTTP 200",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/GetPracticeTeamMemberResponse"
                }
              }
            }
          },
          "400": {
            "description": "HTTP 400",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "401": {
            "description": "HTTP 401",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "403": {
            "description": "HTTP 403",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "404": {
            "description": "HTTP 404",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "409": {
            "description": "HTTP 409",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "429": {
            "description": "HTTP 429",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          }
        },
        "description": "Requires team:read. Returns current account membership, roles, location access, and prescriber connection. The member ID identifies practice access; it is not the integration user ID used by orders.",
        "summary": "Get member",
        "x-visibility": "public"
      },
      "patch": {
        "tags": [
          "Team"
        ],
        "operationId": "updatePracticeTeamMember",
        "parameters": [
          {
            "in": "path",
            "name": "practiceId",
            "required": true,
            "schema": {
              "type": "string",
              "pattern": "^prac_[0-7][0-9a-hjkmnp-tv-z]{25}$",
              "examples": [
                "prac_01j2y8m6jcc9tt24af5pw9x1bc"
              ]
            }
          },
          {
            "in": "path",
            "name": "memberId",
            "required": true,
            "schema": {
              "type": "string",
              "pattern": "^mbr_[0-7][0-9a-hjkmnp-tv-z]{25}$",
              "examples": [
                "mbr_01j2y8m6jcc9tt24af5pw9x1bc"
              ]
            }
          },
          {
            "in": "header",
            "name": "Affinity-Version",
            "required": false,
            "schema": {
              "type": "string"
            },
            "description": "Selects the HTTP API contract for this request only. When omitted, API-key requests use their service account’s stored version. Does not change the stored default."
          },
          {
            "in": "header",
            "name": "Idempotency-Key",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "security": [
          {
            "bearerAuth": []
          },
          {
            "affinityApiKey": []
          }
        ],
        "responses": {
          "200": {
            "description": "HTTP 200",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/UpdatePracticeTeamMemberResponse"
                }
              }
            }
          },
          "400": {
            "description": "HTTP 400",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "401": {
            "description": "HTTP 401",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "403": {
            "description": "HTTP 403",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "404": {
            "description": "HTTP 404",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "409": {
            "description": "HTTP 409",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "429": {
            "description": "HTTP 429",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          }
        },
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/UpdatePracticeTeamMemberRequest"
              }
            }
          },
          "required": true
        },
        "description": "Requires team:write. Supply role, status, or locationIds; omitted values stay unchanged. A role replaces existing roles. Disable access with status disabled. An empty locationIds array grants all practice locations. Ownership changes require an active practice owner using a personal API key; service keys manage non-owner memberships. The final active owner cannot be removed. Changes apply to both Test and Live. Sign-in email and account security remain account settings.",
        "summary": "Update member access",
        "x-visibility": "public"
      }
    },
    "/v1/practices/{practiceId}/team/prescribers/{prescriberId}": {
      "get": {
        "tags": [
          "Team"
        ],
        "operationId": "getPracticeTeamPrescriber",
        "parameters": [
          {
            "in": "path",
            "name": "practiceId",
            "required": true,
            "schema": {
              "type": "string",
              "pattern": "^prac_[0-7][0-9a-hjkmnp-tv-z]{25}$",
              "examples": [
                "prac_01j2y8m6jcc9tt24af5pw9x1bc"
              ]
            }
          },
          {
            "in": "path",
            "name": "prescriberId",
            "required": true,
            "schema": {
              "type": "string",
              "pattern": "^prov_[0-7][0-9a-hjkmnp-tv-z]{25}$",
              "examples": [
                "prov_01j2y8m6jcc9tt24af5pw9x1bc"
              ]
            }
          },
          {
            "in": "header",
            "name": "Affinity-Version",
            "required": false,
            "schema": {
              "type": "string"
            },
            "description": "Selects the HTTP API contract for this request only. When omitted, API-key requests use their service account’s stored version. Does not change the stored default."
          }
        ],
        "security": [
          {
            "bearerAuth": []
          },
          {
            "affinityApiKey": []
          }
        ],
        "responses": {
          "200": {
            "description": "HTTP 200",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/GetPracticeTeamPrescriberResponse"
                }
              }
            }
          },
          "400": {
            "description": "HTTP 400",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "401": {
            "description": "HTTP 401",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "403": {
            "description": "HTTP 403",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "404": {
            "description": "HTTP 404",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "409": {
            "description": "HTTP 409",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "429": {
            "description": "HTTP 429",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          }
        },
        "description": "Requires team:read. Returns the clinical profile and submitted licenses, including license IDs. This is setup information, not a signing authorization.",
        "summary": "Get prescriber",
        "x-visibility": "public"
      },
      "patch": {
        "tags": [
          "Team"
        ],
        "operationId": "updatePracticeTeamPrescriber",
        "parameters": [
          {
            "in": "path",
            "name": "practiceId",
            "required": true,
            "schema": {
              "type": "string",
              "pattern": "^prac_[0-7][0-9a-hjkmnp-tv-z]{25}$",
              "examples": [
                "prac_01j2y8m6jcc9tt24af5pw9x1bc"
              ]
            }
          },
          {
            "in": "path",
            "name": "prescriberId",
            "required": true,
            "schema": {
              "type": "string",
              "pattern": "^prov_[0-7][0-9a-hjkmnp-tv-z]{25}$",
              "examples": [
                "prov_01j2y8m6jcc9tt24af5pw9x1bc"
              ]
            }
          },
          {
            "in": "header",
            "name": "Affinity-Version",
            "required": false,
            "schema": {
              "type": "string"
            },
            "description": "Selects the HTTP API contract for this request only. When omitted, API-key requests use their service account’s stored version. Does not change the stored default."
          },
          {
            "in": "header",
            "name": "Idempotency-Key",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "security": [
          {
            "bearerAuth": []
          },
          {
            "affinityApiKey": []
          }
        ],
        "responses": {
          "200": {
            "description": "HTTP 200",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/UpdatePracticeTeamPrescriberResponse"
                }
              }
            }
          },
          "400": {
            "description": "HTTP 400",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "401": {
            "description": "HTTP 401",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "403": {
            "description": "HTTP 403",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "404": {
            "description": "HTTP 404",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "409": {
            "description": "HTTP 409",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "429": {
            "description": "HTTP 429",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          }
        },
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/UpdatePracticeTeamPrescriberRequest"
              }
            }
          },
          "required": true
        },
        "description": "Requires team:write. Set practiceStatus to inactive to remove prescribing access in this practice, or active to restore an existing association. This does not create membership or signing authority. Practice status applies to Test and Live. Shared identity and license edits require Affinity support.",
        "summary": "Update prescriber",
        "x-visibility": "public"
      }
    },
    "/v1/practices/{practiceId}/team/prescribers/{prescriberId}/licenses": {
      "post": {
        "tags": [
          "Team"
        ],
        "operationId": "createPracticeTeamLicense",
        "parameters": [
          {
            "in": "path",
            "name": "practiceId",
            "required": true,
            "schema": {
              "type": "string",
              "pattern": "^prac_[0-7][0-9a-hjkmnp-tv-z]{25}$",
              "examples": [
                "prac_01j2y8m6jcc9tt24af5pw9x1bc"
              ]
            }
          },
          {
            "in": "path",
            "name": "prescriberId",
            "required": true,
            "schema": {
              "type": "string",
              "pattern": "^prov_[0-7][0-9a-hjkmnp-tv-z]{25}$",
              "examples": [
                "prov_01j2y8m6jcc9tt24af5pw9x1bc"
              ]
            }
          },
          {
            "in": "header",
            "name": "Affinity-Version",
            "required": false,
            "schema": {
              "type": "string"
            },
            "description": "Selects the HTTP API contract for this request only. When omitted, API-key requests use their service account’s stored version. Does not change the stored default."
          },
          {
            "in": "header",
            "name": "Idempotency-Key",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "security": [
          {
            "bearerAuth": []
          },
          {
            "affinityApiKey": []
          }
        ],
        "responses": {
          "200": {
            "description": "HTTP 200",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CreatePracticeTeamLicenseResponse"
                }
              }
            }
          },
          "400": {
            "description": "HTTP 400",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "401": {
            "description": "HTTP 401",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "403": {
            "description": "HTTP 403",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "404": {
            "description": "HTTP 404",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "409": {
            "description": "HTTP 409",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "429": {
            "description": "HTTP 429",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          }
        },
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CreatePracticeTeamLicenseRequest"
              }
            }
          },
          "required": true
        },
        "description": "Requires team:write and an active accepted prescriber account connection in this practice. Adds a license. Expiration is optional, but must be in the future when supplied. An exact repeat returns the existing license; update an existing license with PATCH and its license ID. Licenses are shared across practices and Test/Live. Other licenses stay unchanged.",
        "summary": "Add license",
        "x-visibility": "public"
      }
    },
    "/v1/practices/{practiceId}/team/prescribers/{prescriberId}/licenses/{licenseId}": {
      "patch": {
        "tags": [
          "Team"
        ],
        "operationId": "updatePracticeTeamLicense",
        "parameters": [
          {
            "in": "path",
            "name": "practiceId",
            "required": true,
            "schema": {
              "type": "string",
              "pattern": "^prac_[0-7][0-9a-hjkmnp-tv-z]{25}$",
              "examples": [
                "prac_01j2y8m6jcc9tt24af5pw9x1bc"
              ]
            }
          },
          {
            "in": "path",
            "name": "prescriberId",
            "required": true,
            "schema": {
              "type": "string",
              "pattern": "^prov_[0-7][0-9a-hjkmnp-tv-z]{25}$",
              "examples": [
                "prov_01j2y8m6jcc9tt24af5pw9x1bc"
              ]
            }
          },
          {
            "in": "path",
            "name": "licenseId",
            "required": true,
            "schema": {
              "type": "string",
              "pattern": "^lic_[0-7][0-9a-hjkmnp-tv-z]{25}$",
              "examples": [
                "lic_01j2y8m6jcc9tt24af5pw9x1bc"
              ]
            }
          },
          {
            "in": "header",
            "name": "Affinity-Version",
            "required": false,
            "schema": {
              "type": "string"
            },
            "description": "Selects the HTTP API contract for this request only. When omitted, API-key requests use their service account’s stored version. Does not change the stored default."
          },
          {
            "in": "header",
            "name": "Idempotency-Key",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "security": [
          {
            "bearerAuth": []
          },
          {
            "affinityApiKey": []
          }
        ],
        "responses": {
          "200": {
            "description": "HTTP 200",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/UpdatePracticeTeamLicenseResponse"
                }
              }
            }
          },
          "400": {
            "description": "HTTP 400",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "401": {
            "description": "HTTP 401",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "403": {
            "description": "HTTP 403",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "404": {
            "description": "HTTP 404",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "409": {
            "description": "HTTP 409",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "429": {
            "description": "HTTP 429",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          }
        },
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/UpdatePracticeTeamLicenseRequest"
              }
            }
          },
          "required": true
        },
        "description": "Requires team:write and an active accepted prescriber account connection in this practice. Correct the state or license number, or set or clear the optional expiresAt value. A supplied expiration must be in the future. Other licenses stay unchanged. Changes apply across practices and Test/Live.",
        "summary": "Update license",
        "x-visibility": "public"
      }
    },
    "/v1/practices/{practiceId}/team/invitations/{invitationId}": {
      "get": {
        "tags": [
          "Team"
        ],
        "operationId": "getPracticeTeamInvitation",
        "parameters": [
          {
            "in": "path",
            "name": "practiceId",
            "required": true,
            "schema": {
              "type": "string",
              "pattern": "^prac_[0-7][0-9a-hjkmnp-tv-z]{25}$",
              "examples": [
                "prac_01j2y8m6jcc9tt24af5pw9x1bc"
              ]
            }
          },
          {
            "in": "path",
            "name": "invitationId",
            "required": true,
            "schema": {
              "type": "string",
              "pattern": "^invite_[0-7][0-9a-hjkmnp-tv-z]{25}$",
              "examples": [
                "invite_01j2y8m6jcc9tt24af5pw9x1bc"
              ]
            }
          },
          {
            "in": "header",
            "name": "Affinity-Version",
            "required": false,
            "schema": {
              "type": "string"
            },
            "description": "Selects the HTTP API contract for this request only. When omitted, API-key requests use their service account’s stored version. Does not change the stored default."
          }
        ],
        "security": [
          {
            "bearerAuth": []
          },
          {
            "affinityApiKey": []
          }
        ],
        "responses": {
          "200": {
            "description": "HTTP 200",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/GetPracticeTeamInvitationResponse"
                }
              }
            }
          },
          "400": {
            "description": "HTTP 400",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "401": {
            "description": "HTTP 401",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "403": {
            "description": "HTTP 403",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "404": {
            "description": "HTTP 404",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "409": {
            "description": "HTTP 409",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "429": {
            "description": "HTTP 429",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          }
        },
        "description": "Requires team:read. Returns invitation status and current onboarding state for your integration. An accepted invitation can still have disabled membership or pending clinical review. Invitation tokens are never returned.",
        "summary": "Get invitation",
        "x-visibility": "public"
      },
      "delete": {
        "tags": [
          "Team"
        ],
        "operationId": "revokePracticeTeamInvitation",
        "parameters": [
          {
            "in": "path",
            "name": "practiceId",
            "required": true,
            "schema": {
              "type": "string",
              "pattern": "^prac_[0-7][0-9a-hjkmnp-tv-z]{25}$",
              "examples": [
                "prac_01j2y8m6jcc9tt24af5pw9x1bc"
              ]
            }
          },
          {
            "in": "path",
            "name": "invitationId",
            "required": true,
            "schema": {
              "type": "string",
              "pattern": "^invite_[0-7][0-9a-hjkmnp-tv-z]{25}$",
              "examples": [
                "invite_01j2y8m6jcc9tt24af5pw9x1bc"
              ]
            }
          },
          {
            "in": "header",
            "name": "Affinity-Version",
            "required": false,
            "schema": {
              "type": "string"
            },
            "description": "Selects the HTTP API contract for this request only. When omitted, API-key requests use their service account’s stored version. Does not change the stored default."
          },
          {
            "in": "header",
            "name": "Idempotency-Key",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "security": [
          {
            "bearerAuth": []
          },
          {
            "affinityApiKey": []
          }
        ],
        "responses": {
          "200": {
            "description": "HTTP 200",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RevokePracticeTeamInvitationResponse"
                }
              }
            }
          },
          "400": {
            "description": "HTTP 400",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "401": {
            "description": "HTTP 401",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "403": {
            "description": "HTTP 403",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "404": {
            "description": "HTTP 404",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "409": {
            "description": "HTTP 409",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "429": {
            "description": "HTTP 429",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          }
        },
        "description": "Requires team:write. Revokes a pending or expired invitation and its pending prescriber account connection. Repeating the revoke returns the revoked invitation. Accepted invitations return 409; disable the member instead. Retains invitation history.",
        "summary": "Revoke invitation",
        "x-visibility": "public"
      }
    },
    "/v1/practices/{practiceId}/team/invitations/{invitationId}/resend": {
      "post": {
        "tags": [
          "Team"
        ],
        "operationId": "resendPracticeTeamInvitation",
        "parameters": [
          {
            "in": "path",
            "name": "practiceId",
            "required": true,
            "schema": {
              "type": "string",
              "pattern": "^prac_[0-7][0-9a-hjkmnp-tv-z]{25}$",
              "examples": [
                "prac_01j2y8m6jcc9tt24af5pw9x1bc"
              ]
            }
          },
          {
            "in": "path",
            "name": "invitationId",
            "required": true,
            "schema": {
              "type": "string",
              "pattern": "^invite_[0-7][0-9a-hjkmnp-tv-z]{25}$",
              "examples": [
                "invite_01j2y8m6jcc9tt24af5pw9x1bc"
              ]
            }
          },
          {
            "in": "header",
            "name": "Affinity-Version",
            "required": false,
            "schema": {
              "type": "string"
            },
            "description": "Selects the HTTP API contract for this request only. When omitted, API-key requests use their service account’s stored version. Does not change the stored default."
          },
          {
            "in": "header",
            "name": "Idempotency-Key",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "security": [
          {
            "bearerAuth": []
          },
          {
            "affinityApiKey": []
          }
        ],
        "responses": {
          "200": {
            "description": "HTTP 200",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ResendPracticeTeamInvitationResponse"
                }
              }
            }
          },
          "400": {
            "description": "HTTP 400",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "401": {
            "description": "HTTP 401",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "403": {
            "description": "HTTP 403",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "404": {
            "description": "HTTP 404",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "409": {
            "description": "HTTP 409",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "429": {
            "description": "HTTP 429",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "502": {
            "description": "HTTP 502",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          }
        },
        "description": "Requires team:write. Resends a pending or expired invitation with the same ID, recipient, roles, and locations. The previous link stops working and the new link expires in seven days. Accepted and revoked invitations return 409. A 502 means the invitation was saved but email delivery could not be confirmed; retry this operation.",
        "summary": "Resend invitation",
        "x-visibility": "public"
      }
    },
    "/v1/auth/access": {
      "get": {
        "tags": [
          "API Keys"
        ],
        "operationId": "getApiAccess",
        "parameters": [
          {
            "in": "header",
            "name": "Affinity-Version",
            "required": false,
            "schema": {
              "type": "string"
            },
            "description": "Selects the HTTP API contract for this request only. When omitted, API-key requests use their service account’s stored version. Does not change the stored default."
          }
        ],
        "security": [
          {
            "bearerAuth": []
          },
          {
            "affinityApiKey": []
          }
        ],
        "responses": {
          "200": {
            "description": "HTTP 200",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/GetApiAccessResponse"
                }
              }
            }
          },
          "400": {
            "description": "HTTP 400",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "401": {
            "description": "HTTP 401",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "403": {
            "description": "HTTP 403",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "429": {
            "description": "HTTP 429",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          }
        },
        "description": "Returns the subject, mode, and scopes for the API key.",
        "summary": "Read API key access",
        "x-visibility": "public"
      }
    },
    "/v1/practices": {
      "get": {
        "tags": [
          "Practices"
        ],
        "operationId": "listPractices",
        "parameters": [
          {
            "in": "query",
            "name": "search",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string",
                  "maxLength": 200
                },
                {
                  "type": "null"
                }
              ],
              "description": "Case-insensitive search by practice name or external ID."
            }
          },
          {
            "in": "query",
            "name": "endingBefore",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string",
                  "pattern": "^prac_[0-7][0-9a-hjkmnp-tv-z]{25}$",
                  "examples": [
                    "prac_01j2y8m6jcc9tt24af5pw9x1bc"
                  ]
                },
                {
                  "type": "null"
                }
              ]
            }
          },
          {
            "in": "query",
            "name": "limit",
            "required": false,
            "schema": {
              "default": 25,
              "maximum": 100,
              "minimum": 1,
              "type": "integer"
            }
          },
          {
            "in": "query",
            "name": "startingAfter",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string",
                  "pattern": "^prac_[0-7][0-9a-hjkmnp-tv-z]{25}$",
                  "examples": [
                    "prac_01j2y8m6jcc9tt24af5pw9x1bc"
                  ]
                },
                {
                  "type": "null"
                }
              ]
            }
          },
          {
            "in": "header",
            "name": "Affinity-Version",
            "required": false,
            "schema": {
              "type": "string"
            },
            "description": "Selects the HTTP API contract for this request only. When omitted, API-key requests use their service account’s stored version. Does not change the stored default."
          }
        ],
        "security": [
          {
            "bearerAuth": []
          },
          {
            "affinityApiKey": []
          }
        ],
        "responses": {
          "200": {
            "description": "HTTP 200",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ListPracticesResponse"
                }
              }
            }
          },
          "400": {
            "description": "HTTP 400",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "401": {
            "description": "HTTP 401",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "403": {
            "description": "HTTP 403",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "404": {
            "description": "HTTP 404",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "409": {
            "description": "HTTP 409",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "422": {
            "description": "HTTP 422",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "429": {
            "description": "HTTP 429",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          }
        },
        "description": "Returns the practices that belong to the platform. The default Affinity-Version is 2026-09-28.",
        "summary": "List practices",
        "x-pier-pagination": {
          "cursorField": "id",
          "kind": "cursor"
        },
        "x-visibility": "public"
      },
      "post": {
        "tags": [
          "Practices"
        ],
        "operationId": "createPractice",
        "parameters": [
          {
            "in": "header",
            "name": "Affinity-Version",
            "required": false,
            "schema": {
              "type": "string"
            },
            "description": "Selects the HTTP API contract for this request only. When omitted, API-key requests use their service account’s stored version. Does not change the stored default."
          },
          {
            "in": "header",
            "name": "Idempotency-Key",
            "required": false,
            "schema": {
              "type": "string"
            }
          }
        ],
        "security": [
          {
            "bearerAuth": []
          },
          {
            "affinityApiKey": []
          }
        ],
        "responses": {
          "200": {
            "description": "HTTP 200",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CreatePracticeResponse"
                }
              }
            }
          },
          "400": {
            "description": "HTTP 400",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "401": {
            "description": "HTTP 401",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "403": {
            "description": "HTTP 403",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "404": {
            "description": "HTTP 404",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "409": {
            "description": "HTTP 409",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "422": {
            "description": "HTTP 422",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "429": {
            "description": "HTTP 429",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          }
        },
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CreatePracticeRequest"
              }
            }
          },
          "required": true
        },
        "description": "Creates a practice owned by the platform. Set liveEnabled to true to enable Live access at creation with an approved platform and a Live request. Defaults to false. Requires practices:write. Send Idempotency-Key when you retry the same request.",
        "summary": "Create practice",
        "x-visibility": "public"
      }
    },
    "/v1/practices/{practiceId}": {
      "get": {
        "tags": [
          "Practices"
        ],
        "operationId": "getPractice",
        "parameters": [
          {
            "in": "path",
            "name": "practiceId",
            "required": true,
            "schema": {
              "type": "string",
              "pattern": "^prac_[0-7][0-9a-hjkmnp-tv-z]{25}$",
              "examples": [
                "prac_01j2y8m6jcc9tt24af5pw9x1bc"
              ]
            }
          },
          {
            "in": "header",
            "name": "Affinity-Version",
            "required": false,
            "schema": {
              "type": "string"
            },
            "description": "Selects the HTTP API contract for this request only. When omitted, API-key requests use their service account’s stored version. Does not change the stored default."
          }
        ],
        "security": [
          {
            "bearerAuth": []
          },
          {
            "affinityApiKey": []
          }
        ],
        "responses": {
          "200": {
            "description": "HTTP 200",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/GetPracticeResponse"
                }
              }
            }
          },
          "400": {
            "description": "HTTP 400",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "401": {
            "description": "HTTP 401",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "403": {
            "description": "HTTP 403",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "404": {
            "description": "HTTP 404",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "409": {
            "description": "HTTP 409",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "422": {
            "description": "HTTP 422",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "429": {
            "description": "HTTP 429",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          }
        },
        "description": "Returns one practice that belongs to the platform.",
        "summary": "Read practice",
        "x-visibility": "public"
      },
      "patch": {
        "tags": [
          "Practices"
        ],
        "operationId": "updatePractice",
        "parameters": [
          {
            "in": "path",
            "name": "practiceId",
            "required": true,
            "schema": {
              "type": "string",
              "pattern": "^prac_[0-7][0-9a-hjkmnp-tv-z]{25}$",
              "examples": [
                "prac_01j2y8m6jcc9tt24af5pw9x1bc"
              ]
            }
          },
          {
            "in": "header",
            "name": "Affinity-Version",
            "required": false,
            "schema": {
              "type": "string"
            },
            "description": "Selects the HTTP API contract for this request only. When omitted, API-key requests use their service account’s stored version. Does not change the stored default."
          },
          {
            "in": "header",
            "name": "Idempotency-Key",
            "required": false,
            "schema": {
              "type": "string"
            }
          }
        ],
        "security": [
          {
            "bearerAuth": []
          },
          {
            "affinityApiKey": []
          }
        ],
        "responses": {
          "200": {
            "description": "HTTP 200",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/UpdatePracticeResponse"
                }
              }
            }
          },
          "400": {
            "description": "HTTP 400",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "401": {
            "description": "HTTP 401",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "403": {
            "description": "HTTP 403",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "404": {
            "description": "HTTP 404",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "409": {
            "description": "HTTP 409",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "422": {
            "description": "HTTP 422",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "429": {
            "description": "HTTP 429",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          }
        },
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/UpdatePracticeRequest"
              }
            }
          },
          "required": true
        },
        "description": "Updates one practice owned by the platform. Set liveEnabled to true or false to control Live access with an approved platform and a Live request. Affinity Admin decisions take precedence. Requires practices:write. Send Idempotency-Key when you retry the same request.",
        "summary": "Update practice",
        "x-visibility": "public"
      }
    },
    "/v1/practices/{practiceId}/patients": {
      "get": {
        "tags": [
          "Patients"
        ],
        "operationId": "listPatients",
        "parameters": [
          {
            "in": "query",
            "name": "endingBefore",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string",
                  "pattern": "^pat_[0-7][0-9a-hjkmnp-tv-z]{25}$",
                  "examples": [
                    "pat_01j2y8m6jcc9tt24af5pw9x1bc"
                  ]
                },
                {
                  "type": "null"
                }
              ]
            }
          },
          {
            "in": "query",
            "name": "externalId",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string",
                  "pattern": "^[^\\u0000\\p{Cs}]*$"
                },
                {
                  "type": "null"
                }
              ]
            }
          },
          {
            "in": "query",
            "name": "externalIdentitySource",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string",
                  "pattern": "^[^\\u0000\\p{Cs}]*$"
                },
                {
                  "type": "null"
                }
              ]
            }
          },
          {
            "in": "query",
            "name": "externalIdentityValue",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string",
                  "pattern": "^[^\\u0000\\p{Cs}]*$"
                },
                {
                  "type": "null"
                }
              ]
            }
          },
          {
            "in": "query",
            "name": "gender",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string",
                  "enum": [
                    "f",
                    "m",
                    "o",
                    "u"
                  ]
                },
                {
                  "type": "null"
                }
              ]
            }
          },
          {
            "in": "query",
            "name": "lastOrderAfter",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ]
            }
          },
          {
            "in": "query",
            "name": "lastOrderBefore",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ]
            }
          },
          {
            "in": "query",
            "name": "limit",
            "required": false,
            "schema": {
              "default": 25,
              "maximum": 100,
              "minimum": 1,
              "type": "integer"
            }
          },
          {
            "in": "path",
            "name": "practiceId",
            "required": true,
            "schema": {
              "type": "string",
              "pattern": "^prac_[0-7][0-9a-hjkmnp-tv-z]{25}$",
              "examples": [
                "prac_01j2y8m6jcc9tt24af5pw9x1bc"
              ]
            }
          },
          {
            "in": "query",
            "name": "program",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string",
                  "pattern": "^[^\\u0000\\p{Cs}]*$"
                },
                {
                  "type": "null"
                }
              ]
            }
          },
          {
            "in": "query",
            "name": "query",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string",
                  "pattern": "^[^\\u0000\\p{Cs}]*$"
                },
                {
                  "type": "null"
                }
              ]
            }
          },
          {
            "in": "query",
            "name": "sort",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string",
                  "enum": [
                    "created",
                    "name"
                  ]
                },
                {
                  "type": "null"
                }
              ]
            }
          },
          {
            "in": "query",
            "name": "startingAfter",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string",
                  "pattern": "^pat_[0-7][0-9a-hjkmnp-tv-z]{25}$",
                  "examples": [
                    "pat_01j2y8m6jcc9tt24af5pw9x1bc"
                  ]
                },
                {
                  "type": "null"
                }
              ]
            }
          },
          {
            "in": "query",
            "name": "states",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string",
                  "pattern": "^[^\\u0000\\p{Cs}]*$"
                },
                {
                  "type": "null"
                }
              ]
            }
          },
          {
            "in": "query",
            "name": "status",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string",
                  "enum": [
                    "active",
                    "inactive"
                  ]
                },
                {
                  "type": "null"
                }
              ]
            }
          },
          {
            "in": "header",
            "name": "Affinity-Version",
            "required": false,
            "schema": {
              "type": "string"
            },
            "description": "Selects the HTTP API contract for this request only. When omitted, API-key requests use their service account’s stored version. Does not change the stored default."
          },
          {
            "in": "header",
            "name": "Affinity-Actor-Id",
            "required": false,
            "schema": {
              "type": "string"
            },
            "description": "Required for user actors and optional for system actors. Omit both actor headers to use the authenticated service account as a system actor."
          },
          {
            "in": "header",
            "name": "Affinity-Actor-Type",
            "required": false,
            "schema": {
              "type": "string"
            },
            "description": "Use user when a person initiated the action and system for autonomous work. Omit both actor headers to default to system."
          }
        ],
        "security": [
          {
            "bearerAuth": []
          },
          {
            "affinityApiKey": []
          }
        ],
        "responses": {
          "200": {
            "description": "HTTP 200",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ListPatientsResponse"
                }
              }
            }
          },
          "400": {
            "description": "HTTP 400",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "401": {
            "description": "HTTP 401",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "403": {
            "description": "HTTP 403",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "404": {
            "description": "HTTP 404",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "409": {
            "description": "HTTP 409",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "422": {
            "description": "HTTP 422",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "429": {
            "description": "HTTP 429",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          }
        },
        "description": "Lists patients in one practice and mode. Use externalId for an exact match in the calling integration's namespace. Use externalIdentitySource with externalIdentityValue to search an explicit alias. Identity matching is case-sensitive after trimming whitespace. Other filters also apply.",
        "summary": "List patients",
        "x-pier-pagination": {
          "cursorField": "id",
          "kind": "cursor"
        },
        "x-visibility": "public"
      },
      "post": {
        "tags": [
          "Patients"
        ],
        "operationId": "createPatient",
        "parameters": [
          {
            "in": "path",
            "name": "practiceId",
            "required": true,
            "schema": {
              "type": "string",
              "pattern": "^prac_[0-7][0-9a-hjkmnp-tv-z]{25}$",
              "examples": [
                "prac_01j2y8m6jcc9tt24af5pw9x1bc"
              ]
            }
          },
          {
            "in": "header",
            "name": "Affinity-Version",
            "required": false,
            "schema": {
              "type": "string"
            },
            "description": "Selects the HTTP API contract for this request only. When omitted, API-key requests use their service account’s stored version. Does not change the stored default."
          },
          {
            "in": "header",
            "name": "Idempotency-Key",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "header",
            "name": "Affinity-Actor-Id",
            "required": false,
            "schema": {
              "type": "string"
            },
            "description": "Required for user actors and optional for system actors. Omit both actor headers to use the authenticated service account as a system actor."
          },
          {
            "in": "header",
            "name": "Affinity-Actor-Type",
            "required": false,
            "schema": {
              "type": "string"
            },
            "description": "Use user when a person initiated the action and system for autonomous work. Omit both actor headers to default to system."
          }
        ],
        "security": [
          {
            "bearerAuth": []
          },
          {
            "affinityApiKey": []
          }
        ],
        "responses": {
          "200": {
            "description": "HTTP 200",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CreatePatientResponse"
                }
              }
            }
          },
          "400": {
            "description": "HTTP 400",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "401": {
            "description": "HTTP 401",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "403": {
            "description": "HTTP 403",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "404": {
            "description": "HTTP 404",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "409": {
            "description": "HTTP 409",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "422": {
            "description": "HTTP 422",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "429": {
            "description": "HTTP 429",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          }
        },
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CreatePatientRequest"
              }
            }
          },
          "required": true
        },
        "description": "Creates a patient or resolves a matching externalId or external identity within this practice and mode. externalId belongs to the calling integration; externalIdentities holds aliases from other systems. Resolution preserves existing demographics; use PATCH to update them. Conflicting identifiers return 409. Email never merges patients. API keys require Idempotency-Key.",
        "summary": "Create patient",
        "x-visibility": "public"
      }
    },
    "/v1/practices/{practiceId}/patients/{patientId}": {
      "get": {
        "tags": [
          "Patients"
        ],
        "operationId": "getPatient",
        "parameters": [
          {
            "in": "path",
            "name": "patientId",
            "required": true,
            "schema": {
              "type": "string",
              "pattern": "^pat_[0-7][0-9a-hjkmnp-tv-z]{25}$",
              "examples": [
                "pat_01j2y8m6jcc9tt24af5pw9x1bc"
              ]
            }
          },
          {
            "in": "path",
            "name": "practiceId",
            "required": true,
            "schema": {
              "type": "string",
              "pattern": "^prac_[0-7][0-9a-hjkmnp-tv-z]{25}$",
              "examples": [
                "prac_01j2y8m6jcc9tt24af5pw9x1bc"
              ]
            }
          },
          {
            "in": "header",
            "name": "Affinity-Version",
            "required": false,
            "schema": {
              "type": "string"
            },
            "description": "Selects the HTTP API contract for this request only. When omitted, API-key requests use their service account’s stored version. Does not change the stored default."
          },
          {
            "in": "header",
            "name": "Affinity-Actor-Id",
            "required": false,
            "schema": {
              "type": "string"
            },
            "description": "Required for user actors and optional for system actors. Omit both actor headers to use the authenticated service account as a system actor."
          },
          {
            "in": "header",
            "name": "Affinity-Actor-Type",
            "required": false,
            "schema": {
              "type": "string"
            },
            "description": "Use user when a person initiated the action and system for autonomous work. Omit both actor headers to default to system."
          }
        ],
        "security": [
          {
            "bearerAuth": []
          },
          {
            "affinityApiKey": []
          }
        ],
        "responses": {
          "200": {
            "description": "HTTP 200",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/GetPatientResponse"
                }
              }
            }
          },
          "400": {
            "description": "HTTP 400",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "401": {
            "description": "HTTP 401",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "403": {
            "description": "HTTP 403",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "404": {
            "description": "HTTP 404",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "409": {
            "description": "HTTP 409",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "422": {
            "description": "HTTP 422",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "429": {
            "description": "HTTP 429",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          }
        },
        "description": "Returns one patient in the authorized practice and mode.",
        "summary": "Read patient",
        "x-visibility": "public"
      },
      "delete": {
        "tags": [
          "Patients"
        ],
        "operationId": "deletePatient",
        "parameters": [
          {
            "in": "path",
            "name": "patientId",
            "required": true,
            "schema": {
              "type": "string",
              "pattern": "^pat_[0-7][0-9a-hjkmnp-tv-z]{25}$",
              "examples": [
                "pat_01j2y8m6jcc9tt24af5pw9x1bc"
              ]
            }
          },
          {
            "in": "path",
            "name": "practiceId",
            "required": true,
            "schema": {
              "type": "string",
              "pattern": "^prac_[0-7][0-9a-hjkmnp-tv-z]{25}$",
              "examples": [
                "prac_01j2y8m6jcc9tt24af5pw9x1bc"
              ]
            }
          },
          {
            "in": "header",
            "name": "Affinity-Version",
            "required": false,
            "schema": {
              "type": "string"
            },
            "description": "Selects the HTTP API contract for this request only. When omitted, API-key requests use their service account’s stored version. Does not change the stored default."
          },
          {
            "in": "header",
            "name": "Idempotency-Key",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "header",
            "name": "Affinity-Actor-Id",
            "required": false,
            "schema": {
              "type": "string"
            },
            "description": "Required for user actors and optional for system actors. Omit both actor headers to use the authenticated service account as a system actor."
          },
          {
            "in": "header",
            "name": "Affinity-Actor-Type",
            "required": false,
            "schema": {
              "type": "string"
            },
            "description": "Use user when a person initiated the action and system for autonomous work. Omit both actor headers to default to system."
          }
        ],
        "security": [
          {
            "bearerAuth": []
          },
          {
            "affinityApiKey": []
          }
        ],
        "responses": {
          "200": {
            "description": "HTTP 200",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/DeletePatientResponse"
                }
              }
            }
          },
          "400": {
            "description": "HTTP 400",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "401": {
            "description": "HTTP 401",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "403": {
            "description": "HTTP 403",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "404": {
            "description": "HTTP 404",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "409": {
            "description": "HTTP 409",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "422": {
            "description": "HTTP 422",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "429": {
            "description": "HTTP 429",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          }
        },
        "description": "Requires patients:write and Idempotency-Key for API keys. Permanently deletes a patient with no order history. Any order history returns 409; use Update patient with status archived instead. Available to practice keys and authorized platform keys. Reusing the same idempotency key returns the original deletion result.",
        "summary": "Delete patient",
        "x-visibility": "public"
      },
      "patch": {
        "tags": [
          "Patients"
        ],
        "operationId": "updatePatient",
        "parameters": [
          {
            "in": "path",
            "name": "patientId",
            "required": true,
            "schema": {
              "type": "string",
              "pattern": "^pat_[0-7][0-9a-hjkmnp-tv-z]{25}$",
              "examples": [
                "pat_01j2y8m6jcc9tt24af5pw9x1bc"
              ]
            }
          },
          {
            "in": "path",
            "name": "practiceId",
            "required": true,
            "schema": {
              "type": "string",
              "pattern": "^prac_[0-7][0-9a-hjkmnp-tv-z]{25}$",
              "examples": [
                "prac_01j2y8m6jcc9tt24af5pw9x1bc"
              ]
            }
          },
          {
            "in": "header",
            "name": "Affinity-Version",
            "required": false,
            "schema": {
              "type": "string"
            },
            "description": "Selects the HTTP API contract for this request only. When omitted, API-key requests use their service account’s stored version. Does not change the stored default."
          },
          {
            "in": "header",
            "name": "Idempotency-Key",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "header",
            "name": "Affinity-Actor-Id",
            "required": false,
            "schema": {
              "type": "string"
            },
            "description": "Required for user actors and optional for system actors. Omit both actor headers to use the authenticated service account as a system actor."
          },
          {
            "in": "header",
            "name": "Affinity-Actor-Type",
            "required": false,
            "schema": {
              "type": "string"
            },
            "description": "Use user when a person initiated the action and system for autonomous work. Omit both actor headers to default to system."
          }
        ],
        "security": [
          {
            "bearerAuth": []
          },
          {
            "affinityApiKey": []
          }
        ],
        "responses": {
          "200": {
            "description": "HTTP 200",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/UpdatePatientResponse"
                }
              }
            }
          },
          "400": {
            "description": "HTTP 400",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "401": {
            "description": "HTTP 401",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "403": {
            "description": "HTTP 403",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "404": {
            "description": "HTTP 404",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "409": {
            "description": "HTTP 409",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "422": {
            "description": "HTTP 422",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "429": {
            "description": "HTTP 429",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          }
        },
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/UpdatePatientRequest"
              }
            }
          },
          "required": true
        },
        "description": "Updates a patient in the current practice and mode. Omitted fields remain unchanged; null clears an optional field. externalId updates the calling integration's identifier. externalIdentities replaces its explicit aliases. Identifiers cannot be reassigned from another patient. API keys require Idempotency-Key.",
        "summary": "Update patient",
        "x-visibility": "public"
      }
    },
    "/v1/practices/{practiceId}/patients/{patientId}/allergies": {
      "get": {
        "tags": [
          "Patients"
        ],
        "operationId": "getPatientAllergies",
        "parameters": [
          {
            "in": "path",
            "name": "patientId",
            "required": true,
            "schema": {
              "type": "string",
              "pattern": "^pat_[0-7][0-9a-hjkmnp-tv-z]{25}$",
              "examples": [
                "pat_01j2y8m6jcc9tt24af5pw9x1bc"
              ]
            }
          },
          {
            "in": "path",
            "name": "practiceId",
            "required": true,
            "schema": {
              "type": "string",
              "pattern": "^prac_[0-7][0-9a-hjkmnp-tv-z]{25}$",
              "examples": [
                "prac_01j2y8m6jcc9tt24af5pw9x1bc"
              ]
            }
          },
          {
            "in": "header",
            "name": "Affinity-Version",
            "required": false,
            "schema": {
              "type": "string"
            },
            "description": "Selects the HTTP API contract for this request only. When omitted, API-key requests use their service account’s stored version. Does not change the stored default."
          },
          {
            "in": "header",
            "name": "Affinity-Actor-Id",
            "required": false,
            "schema": {
              "type": "string"
            },
            "description": "Required for user actors and optional for system actors. Omit both actor headers to use the authenticated service account as a system actor."
          },
          {
            "in": "header",
            "name": "Affinity-Actor-Type",
            "required": false,
            "schema": {
              "type": "string"
            },
            "description": "Use user when a person initiated the action and system for autonomous work. Omit both actor headers to default to system."
          }
        ],
        "security": [
          {
            "bearerAuth": []
          },
          {
            "affinityApiKey": []
          }
        ],
        "responses": {
          "200": {
            "description": "HTTP 200",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/GetPatientAllergiesResponse"
                }
              }
            }
          },
          "400": {
            "description": "HTTP 400",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "401": {
            "description": "HTTP 401",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "403": {
            "description": "HTTP 403",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "404": {
            "description": "HTTP 404",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "409": {
            "description": "HTTP 409",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "422": {
            "description": "HTTP 422",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "429": {
            "description": "HTTP 429",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          }
        },
        "description": "Returns the patient's structured allergy entries and review status. A not_reviewed status is not a no-known-allergies assertion and blocks clinical review and signing.",
        "summary": "Read allergies",
        "x-visibility": "public"
      },
      "put": {
        "tags": [
          "Patients"
        ],
        "operationId": "replacePatientAllergies",
        "parameters": [
          {
            "in": "path",
            "name": "patientId",
            "required": true,
            "schema": {
              "type": "string",
              "pattern": "^pat_[0-7][0-9a-hjkmnp-tv-z]{25}$",
              "examples": [
                "pat_01j2y8m6jcc9tt24af5pw9x1bc"
              ]
            }
          },
          {
            "in": "path",
            "name": "practiceId",
            "required": true,
            "schema": {
              "type": "string",
              "pattern": "^prac_[0-7][0-9a-hjkmnp-tv-z]{25}$",
              "examples": [
                "prac_01j2y8m6jcc9tt24af5pw9x1bc"
              ]
            }
          },
          {
            "in": "header",
            "name": "Affinity-Version",
            "required": false,
            "schema": {
              "type": "string"
            },
            "description": "Selects the HTTP API contract for this request only. When omitted, API-key requests use their service account’s stored version. Does not change the stored default."
          },
          {
            "in": "header",
            "name": "Idempotency-Key",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "header",
            "name": "Affinity-Actor-Id",
            "required": false,
            "schema": {
              "type": "string"
            },
            "description": "Required for user actors and optional for system actors. Omit both actor headers to use the authenticated service account as a system actor."
          },
          {
            "in": "header",
            "name": "Affinity-Actor-Type",
            "required": false,
            "schema": {
              "type": "string"
            },
            "description": "Use user when a person initiated the action and system for autonomous work. Omit both actor headers to default to system."
          }
        ],
        "security": [
          {
            "bearerAuth": []
          },
          {
            "affinityApiKey": []
          }
        ],
        "responses": {
          "200": {
            "description": "HTTP 200",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ReplacePatientAllergiesResponse"
                }
              }
            }
          },
          "400": {
            "description": "HTTP 400",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "401": {
            "description": "HTTP 401",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "403": {
            "description": "HTTP 403",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "404": {
            "description": "HTTP 404",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "409": {
            "description": "HTTP 409",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "422": {
            "description": "HTTP 422",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "429": {
            "description": "HTTP 429",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          }
        },
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ReplacePatientAllergiesRequest"
              }
            }
          },
          "required": true
        },
        "description": "Replaces the patient's structured allergy record. Sending no_known is the explicit no-known-allergies acknowledgement; recorded requires at least one entry. Idempotency-Key is required.",
        "summary": "Replace allergies",
        "x-visibility": "public"
      }
    },
    "/v1/orders/{orderId}/prescriptions": {
      "post": {
        "tags": [
          "Orders"
        ],
        "operationId": "addOrderPrescription",
        "parameters": [
          {
            "in": "path",
            "name": "orderId",
            "required": true,
            "schema": {
              "type": "string",
              "pattern": "^ord_[0-7][0-9a-hjkmnp-tv-z]{25}$",
              "examples": [
                "ord_01j2y8m6jcc9tt24af5pw9x1bc"
              ]
            }
          },
          {
            "in": "header",
            "name": "Affinity-Version",
            "required": false,
            "schema": {
              "type": "string"
            },
            "description": "Selects the HTTP API contract for this request only. When omitted, API-key requests use their service account’s stored version. Does not change the stored default."
          },
          {
            "in": "header",
            "name": "Idempotency-Key",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "header",
            "name": "Affinity-Actor-Id",
            "required": false,
            "schema": {
              "type": "string"
            },
            "description": "Required for user actors and optional for system actors. Omit both actor headers to use the authenticated service account as a system actor."
          },
          {
            "in": "header",
            "name": "Affinity-Actor-Type",
            "required": false,
            "schema": {
              "type": "string"
            },
            "description": "Use user when a person initiated the action and system for autonomous work. Omit both actor headers to default to system."
          }
        ],
        "security": [
          {
            "bearerAuth": []
          },
          {
            "affinityApiKey": []
          }
        ],
        "responses": {
          "200": {
            "description": "HTTP 200",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AddOrderPrescriptionResponse"
                }
              }
            }
          },
          "400": {
            "description": "HTTP 400",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "401": {
            "description": "HTTP 401",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "403": {
            "description": "HTTP 403",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "404": {
            "description": "HTTP 404",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "409": {
            "description": "HTTP 409",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "422": {
            "description": "HTTP 422",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "429": {
            "description": "HTTP 429",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "503": {
            "description": "HTTP 503",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          }
        },
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/AddOrderPrescriptionRequest"
              }
            }
          },
          "required": true
        },
        "description": "Requires orders:write, Idempotency-Key and expectedRevision from the order being edited. Existing integrations may send expectedVersions instead; supply exactly one. Adds a complete prescription to an unsigned Order and returns all new versions. Omitted actor context defaults to the authenticated service account as a system actor. Patient and prescriber attribution stay fixed. Signed orders cannot be amended through this endpoint. Signing and submission require orders:sign through their separate endpoints.",
        "summary": "Add prescription to order",
        "x-visibility": "public"
      }
    },
    "/v1/orders/{orderId}/prescriptions/{prescriptionId}": {
      "patch": {
        "tags": [
          "Orders"
        ],
        "operationId": "updateOrderPrescription",
        "parameters": [
          {
            "in": "path",
            "name": "orderId",
            "required": true,
            "schema": {
              "type": "string",
              "pattern": "^ord_[0-7][0-9a-hjkmnp-tv-z]{25}$",
              "examples": [
                "ord_01j2y8m6jcc9tt24af5pw9x1bc"
              ]
            }
          },
          {
            "in": "path",
            "name": "prescriptionId",
            "required": true,
            "schema": {
              "type": "string",
              "pattern": "^rx_[0-7][0-9a-hjkmnp-tv-z]{25}$",
              "examples": [
                "rx_01j2y8m6jcc9tt24af5pw9x1bc"
              ]
            }
          },
          {
            "in": "header",
            "name": "Affinity-Version",
            "required": false,
            "schema": {
              "type": "string"
            },
            "description": "Selects the HTTP API contract for this request only. When omitted, API-key requests use their service account’s stored version. Does not change the stored default."
          },
          {
            "in": "header",
            "name": "Idempotency-Key",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "header",
            "name": "Affinity-Actor-Id",
            "required": false,
            "schema": {
              "type": "string"
            },
            "description": "Required for user actors and optional for system actors. Omit both actor headers to use the authenticated service account as a system actor."
          },
          {
            "in": "header",
            "name": "Affinity-Actor-Type",
            "required": false,
            "schema": {
              "type": "string"
            },
            "description": "Use user when a person initiated the action and system for autonomous work. Omit both actor headers to default to system."
          }
        ],
        "security": [
          {
            "bearerAuth": []
          },
          {
            "affinityApiKey": []
          }
        ],
        "responses": {
          "200": {
            "description": "HTTP 200",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/UpdateOrderPrescriptionResponse"
                }
              }
            }
          },
          "400": {
            "description": "HTTP 400",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "401": {
            "description": "HTTP 401",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "403": {
            "description": "HTTP 403",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "404": {
            "description": "HTTP 404",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "409": {
            "description": "HTTP 409",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "422": {
            "description": "HTTP 422",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "429": {
            "description": "HTTP 429",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "503": {
            "description": "HTTP 503",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          }
        },
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/UpdateOrderPrescriptionRequest"
              }
            }
          },
          "required": true
        },
        "description": "Requires orders:write, Idempotency-Key and expectedRevision from the order being edited. Existing integrations may send expectedVersions instead; supply exactly one. Replaces one prescription with complete medication instructions and returns all new versions. Omitted actor context defaults to the authenticated service account as a system actor. Patient and prescriber attribution stay fixed. Signed orders cannot be amended through this endpoint. Signing and submission require orders:sign through their separate endpoints.",
        "summary": "Update prescription in order",
        "x-visibility": "public"
      }
    },
    "/v1/order-batches": {
      "post": {
        "tags": [
          "Orders"
        ],
        "operationId": "createOrderBatch",
        "parameters": [
          {
            "in": "header",
            "name": "Affinity-Version",
            "required": false,
            "schema": {
              "type": "string"
            },
            "description": "Selects the HTTP API contract for this request only. When omitted, API-key requests use their service account’s stored version. Does not change the stored default."
          },
          {
            "in": "header",
            "name": "Idempotency-Key",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "header",
            "name": "Affinity-Actor-Id",
            "required": false,
            "schema": {
              "type": "string"
            },
            "description": "Required for user actors and optional for system actors. Omit both actor headers to use the authenticated service account as a system actor."
          },
          {
            "in": "header",
            "name": "Affinity-Actor-Type",
            "required": false,
            "schema": {
              "type": "string"
            },
            "description": "Use user when a person initiated the action and system for autonomous work. Omit both actor headers to default to system."
          }
        ],
        "security": [
          {
            "bearerAuth": []
          },
          {
            "affinityApiKey": []
          }
        ],
        "responses": {
          "200": {
            "description": "HTTP 200",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CreateOrderBatchResponse"
                }
              }
            }
          },
          "400": {
            "description": "HTTP 400",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "401": {
            "description": "HTTP 401",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "403": {
            "description": "HTTP 403",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "404": {
            "description": "HTTP 404",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "409": {
            "description": "HTTP 409",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "422": {
            "description": "HTTP 422",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "429": {
            "description": "HTTP 429",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "503": {
            "description": "HTTP 503",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          }
        },
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CreateOrderBatchRequest"
              }
            }
          },
          "required": true
        },
        "description": "Creates 1–20 orders for distinct patients in one practice, each with 1–20 prescriptions. Each accepts patientId or inline patient details. Orders and newly created patients commit atomically; any failure saves none. Requires orders:write and Idempotency-Key; inline patients also require patients:write. Omitted actor context defaults to the authenticated service account as a system actor. Sign and submit each resulting order separately using orders:sign.",
        "summary": "Create order batch",
        "x-visibility": "public"
      }
    },
    "/v1/catalog/items/{catalogItemId}/selling-price": {
      "get": {
        "tags": [
          "Platform Pricing"
        ],
        "operationId": "platform.public-api.selling-prices.readSellingPrice",
        "parameters": [
          {
            "in": "path",
            "name": "catalogItemId",
            "required": true,
            "schema": {
              "type": "string",
              "pattern": "^cat_[0-7][0-9a-hjkmnp-tv-z]{25}$",
              "examples": [
                "cat_01j2y8m6jcc9tt24af5pw9x1bc"
              ]
            }
          },
          {
            "in": "query",
            "name": "practiceId",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string",
                  "pattern": "^prac_[0-7][0-9a-hjkmnp-tv-z]{25}$",
                  "examples": [
                    "prac_01j2y8m6jcc9tt24af5pw9x1bc"
                  ]
                },
                {
                  "type": "null"
                }
              ]
            }
          },
          {
            "in": "header",
            "name": "Affinity-Version",
            "required": false,
            "schema": {
              "type": "string"
            },
            "description": "Selects the HTTP API contract for this request only. When omitted, API-key requests use their service account’s stored version. Does not change the stored default."
          }
        ],
        "security": [
          {
            "bearerAuth": []
          },
          {
            "affinityApiKey": []
          }
        ],
        "responses": {
          "200": {
            "description": "HTTP 200",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PlatformPublicApiSellingPricesReadSellingPriceResponse"
                }
              }
            }
          },
          "400": {
            "description": "HTTP 400",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "401": {
            "description": "HTTP 401",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "403": {
            "description": "HTTP 403",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "404": {
            "description": "HTTP 404",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "409": {
            "description": "HTTP 409",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "429": {
            "description": "HTTP 429",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          }
        },
        "description": "Requires selling_prices:read. Reads the platform override for this medication presentation. The same price applies to all pharmacies and passes to the platform’s practices. affinityPriceCents is the explicit Affinity default, or null when none is set.",
        "summary": "Read selling price",
        "x-visibility": "public"
      },
      "put": {
        "tags": [
          "Platform Pricing"
        ],
        "operationId": "platform.public-api.selling-prices.updateSellingPrice",
        "parameters": [
          {
            "in": "path",
            "name": "catalogItemId",
            "required": true,
            "schema": {
              "type": "string",
              "pattern": "^cat_[0-7][0-9a-hjkmnp-tv-z]{25}$",
              "examples": [
                "cat_01j2y8m6jcc9tt24af5pw9x1bc"
              ]
            }
          },
          {
            "in": "header",
            "name": "Affinity-Version",
            "required": false,
            "schema": {
              "type": "string"
            },
            "description": "Selects the HTTP API contract for this request only. When omitted, API-key requests use their service account’s stored version. Does not change the stored default."
          },
          {
            "in": "header",
            "name": "Idempotency-Key",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "security": [
          {
            "bearerAuth": []
          },
          {
            "affinityApiKey": []
          }
        ],
        "responses": {
          "200": {
            "description": "HTTP 200",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PlatformPublicApiSellingPricesUpdateSellingPriceResponse"
                }
              }
            }
          },
          "400": {
            "description": "HTTP 400",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "401": {
            "description": "HTTP 401",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "403": {
            "description": "HTTP 403",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "404": {
            "description": "HTTP 404",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "409": {
            "description": "HTTP 409",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "429": {
            "description": "HTTP 429",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          }
        },
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/PlatformPublicApiSellingPricesUpdateSellingPriceRequest"
              }
            }
          },
          "required": true
        },
        "description": "Requires selling_prices:write. Saves one presentation price for the platform and all its practices, regardless of pharmacy. Omit practiceId. Null removes the override and restores the Affinity default. Use baseVersion from the latest read; any intervening pricing edit requires a refresh.",
        "summary": "Set selling price",
        "x-visibility": "public"
      }
    },
    "/v1/catalog/items/{catalogItemId}/presentation-price": {
      "get": {
        "tags": [
          "Platform Pricing"
        ],
        "operationId": "platform.public-api.selling-prices.readPresentationPrice",
        "parameters": [
          {
            "in": "path",
            "name": "catalogItemId",
            "required": true,
            "schema": {
              "type": "string",
              "pattern": "^cat_[0-7][0-9a-hjkmnp-tv-z]{25}$",
              "examples": [
                "cat_01j2y8m6jcc9tt24af5pw9x1bc"
              ]
            }
          },
          {
            "in": "query",
            "name": "practiceId",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string",
                  "pattern": "^prac_[0-7][0-9a-hjkmnp-tv-z]{25}$",
                  "examples": [
                    "prac_01j2y8m6jcc9tt24af5pw9x1bc"
                  ]
                },
                {
                  "type": "null"
                }
              ]
            }
          },
          {
            "in": "header",
            "name": "Affinity-Version",
            "required": false,
            "schema": {
              "type": "string"
            },
            "description": "Selects the HTTP API contract for this request only. When omitted, API-key requests use their service account’s stored version. Does not change the stored default."
          }
        ],
        "security": [
          {
            "bearerAuth": []
          },
          {
            "affinityApiKey": []
          }
        ],
        "responses": {
          "200": {
            "description": "HTTP 200",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PlatformPublicApiSellingPricesReadPresentationPriceResponse"
                }
              }
            }
          },
          "400": {
            "description": "HTTP 400",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "401": {
            "description": "HTTP 401",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "403": {
            "description": "HTTP 403",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "404": {
            "description": "HTTP 404",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "409": {
            "description": "HTTP 409",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "429": {
            "description": "HTTP 429",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          }
        },
        "description": "Requires selling_prices:read. Reads the Affinity default and this platform's override, shared by every pharmacy and inherited by all its practices. Missing defaults are null.",
        "summary": "Read presentation price",
        "x-visibility": "public"
      },
      "put": {
        "tags": [
          "Platform Pricing"
        ],
        "operationId": "platform.public-api.selling-prices.updatePresentationPrice",
        "parameters": [
          {
            "in": "path",
            "name": "catalogItemId",
            "required": true,
            "schema": {
              "type": "string",
              "pattern": "^cat_[0-7][0-9a-hjkmnp-tv-z]{25}$",
              "examples": [
                "cat_01j2y8m6jcc9tt24af5pw9x1bc"
              ]
            }
          },
          {
            "in": "header",
            "name": "Affinity-Version",
            "required": false,
            "schema": {
              "type": "string"
            },
            "description": "Selects the HTTP API contract for this request only. When omitted, API-key requests use their service account’s stored version. Does not change the stored default."
          },
          {
            "in": "header",
            "name": "Idempotency-Key",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "security": [
          {
            "bearerAuth": []
          },
          {
            "affinityApiKey": []
          }
        ],
        "responses": {
          "200": {
            "description": "HTTP 200",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PlatformPublicApiSellingPricesUpdatePresentationPriceResponse"
                }
              }
            }
          },
          "400": {
            "description": "HTTP 400",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "401": {
            "description": "HTTP 401",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "403": {
            "description": "HTTP 403",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "404": {
            "description": "HTTP 404",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "409": {
            "description": "HTTP 409",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "429": {
            "description": "HTTP 429",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          }
        },
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/PlatformPublicApiSellingPricesUpdatePresentationPriceRequest"
              }
            }
          },
          "required": true
        },
        "description": "Requires selling_prices:write. Sets one override for this platform and all its practices, including when the Affinity default is absent. Omit practiceId. Null restores inheritance. Use baseVersion from the latest read.",
        "summary": "Set presentation price",
        "x-visibility": "public"
      }
    },
    "/v1/webhook-grants": {
      "get": {
        "tags": [
          "Webhooks"
        ],
        "operationId": "listWebhookGrants",
        "parameters": [
          {
            "in": "query",
            "name": "limit",
            "required": false,
            "schema": {
              "default": 25,
              "maximum": 100,
              "minimum": 1,
              "type": "integer"
            }
          },
          {
            "in": "query",
            "name": "startingAfter",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string",
                  "pattern": "^acct_[0-7][0-9a-hjkmnp-tv-z]{25}$",
                  "examples": [
                    "acct_01j2y8m6jcc9tt24af5pw9x1bc"
                  ]
                },
                {
                  "type": "null"
                }
              ]
            }
          },
          {
            "in": "query",
            "name": "endingBefore",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string",
                  "pattern": "^acct_[0-7][0-9a-hjkmnp-tv-z]{25}$",
                  "examples": [
                    "acct_01j2y8m6jcc9tt24af5pw9x1bc"
                  ]
                },
                {
                  "type": "null"
                }
              ]
            }
          },
          {
            "in": "header",
            "name": "Affinity-Version",
            "required": false,
            "schema": {
              "type": "string"
            },
            "description": "Selects the HTTP API contract for this request only. When omitted, API-key requests use their service account’s stored version. Does not change the stored default."
          }
        ],
        "security": [
          {
            "bearerAuth": []
          },
          {
            "affinityApiKey": []
          }
        ],
        "responses": {
          "200": {
            "description": "HTTP 200",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ListWebhookGrantsResponse"
                }
              }
            }
          },
          "400": {
            "description": "HTTP 400",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "401": {
            "description": "HTTP 401",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "403": {
            "description": "HTTP 403",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "404": {
            "description": "HTTP 404",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "409": {
            "description": "HTTP 409",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "429": {
            "description": "HTTP 429",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          }
        },
        "description": "Requires webhooks:read on the owning practice or pharmacy key. Lists platform webhook grants in the key's mode. Platforms cannot list or grant themselves delegated access.",
        "summary": "List access grants",
        "x-pier-pagination": {
          "cursorField": "id",
          "kind": "cursor"
        },
        "x-visibility": "public"
      }
    },
    "/v1/webhook-grants/{platformId}": {
      "put": {
        "tags": [
          "Webhooks"
        ],
        "operationId": "saveWebhookGrant",
        "parameters": [
          {
            "in": "path",
            "name": "platformId",
            "required": true,
            "schema": {
              "type": "string",
              "pattern": "^acct_[0-7][0-9a-hjkmnp-tv-z]{25}$",
              "examples": [
                "acct_01j2y8m6jcc9tt24af5pw9x1bc"
              ]
            }
          },
          {
            "in": "header",
            "name": "Affinity-Version",
            "required": false,
            "schema": {
              "type": "string"
            },
            "description": "Selects the HTTP API contract for this request only. When omitted, API-key requests use their service account’s stored version. Does not change the stored default."
          },
          {
            "in": "header",
            "name": "Idempotency-Key",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "security": [
          {
            "bearerAuth": []
          },
          {
            "affinityApiKey": []
          }
        ],
        "responses": {
          "200": {
            "description": "HTTP 200",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SaveWebhookGrantResponse"
                }
              }
            }
          },
          "400": {
            "description": "HTTP 400",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "401": {
            "description": "HTTP 401",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "403": {
            "description": "HTTP 403",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "404": {
            "description": "HTTP 404",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "409": {
            "description": "HTTP 409",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "429": {
            "description": "HTTP 429",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          }
        },
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/SaveWebhookGrantRequest"
              }
            }
          },
          "required": true
        },
        "description": "Requires webhooks:write on the owning practice or pharmacy key and Idempotency-Key. Grants or replaces a platform's webhook permissions in this mode. A practice must already be connected to that platform. The grant does not give the platform access to other API resources.",
        "summary": "Grant webhook access",
        "x-visibility": "public"
      },
      "delete": {
        "tags": [
          "Webhooks"
        ],
        "operationId": "revokeWebhookGrant",
        "parameters": [
          {
            "in": "path",
            "name": "platformId",
            "required": true,
            "schema": {
              "type": "string",
              "pattern": "^acct_[0-7][0-9a-hjkmnp-tv-z]{25}$",
              "examples": [
                "acct_01j2y8m6jcc9tt24af5pw9x1bc"
              ]
            }
          },
          {
            "in": "header",
            "name": "Affinity-Version",
            "required": false,
            "schema": {
              "type": "string"
            },
            "description": "Selects the HTTP API contract for this request only. When omitted, API-key requests use their service account’s stored version. Does not change the stored default."
          },
          {
            "in": "header",
            "name": "Idempotency-Key",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "security": [
          {
            "bearerAuth": []
          },
          {
            "affinityApiKey": []
          }
        ],
        "responses": {
          "200": {
            "description": "HTTP 200",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RevokeWebhookGrantResponse"
                }
              }
            }
          },
          "400": {
            "description": "HTTP 400",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "401": {
            "description": "HTTP 401",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "403": {
            "description": "HTTP 403",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "404": {
            "description": "HTTP 404",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "409": {
            "description": "HTTP 409",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "429": {
            "description": "HTTP 429",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          }
        },
        "description": "Requires webhooks:write on the owning practice or pharmacy key and Idempotency-Key. Removes platform webhook access in this mode. Existing endpoints remain owned by the practice or pharmacy and continue operating.",
        "summary": "Revoke webhook access",
        "x-visibility": "public"
      }
    }
  },
  "components": {
    "schemas": {
      "Problem": {
        "additionalProperties": false,
        "properties": {
          "code": {
            "type": "string"
          },
          "data": {
            "additionalProperties": true,
            "type": "object"
          },
          "detail": {
            "type": "string"
          },
          "instance": {
            "type": "string"
          },
          "requestId": {
            "type": "string"
          },
          "status": {
            "maximum": 599,
            "minimum": 400,
            "type": "integer"
          },
          "title": {
            "type": "string"
          },
          "traceId": {
            "type": "string"
          },
          "type": {
            "format": "uri",
            "type": "string"
          }
        },
        "required": [
          "type",
          "title",
          "status",
          "detail",
          "instance",
          "code",
          "requestId"
        ],
        "type": "object"
      },
      "ListPracticeLocationsResponse": {
        "title": "ListPracticeLocationsResponse",
        "type": "object",
        "properties": {
          "data": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "id": {
                  "type": "string",
                  "pattern": "^loc_[0-7][0-9a-hjkmnp-tv-z]{25}$",
                  "examples": [
                    "loc_01j2y8m6jcc9tt24af5pw9x1bc"
                  ]
                },
                "object": {
                  "type": "string",
                  "enum": [
                    "location"
                  ]
                },
                "practiceId": {
                  "type": "string",
                  "pattern": "^prac_[0-7][0-9a-hjkmnp-tv-z]{25}$",
                  "examples": [
                    "prac_01j2y8m6jcc9tt24af5pw9x1bc"
                  ]
                },
                "name": {
                  "type": "string"
                },
                "timezone": {
                  "anyOf": [
                    {
                      "type": "string"
                    },
                    {
                      "type": "null"
                    }
                  ]
                },
                "city": {
                  "anyOf": [
                    {
                      "type": "string"
                    },
                    {
                      "type": "null"
                    }
                  ]
                },
                "country": {
                  "type": "string"
                },
                "line1": {
                  "anyOf": [
                    {
                      "type": "string"
                    },
                    {
                      "type": "null"
                    }
                  ]
                },
                "line2": {
                  "anyOf": [
                    {
                      "type": "string"
                    },
                    {
                      "type": "null"
                    }
                  ]
                },
                "phone": {
                  "anyOf": [
                    {
                      "type": "string"
                    },
                    {
                      "type": "null"
                    }
                  ]
                },
                "postalCode": {
                  "anyOf": [
                    {
                      "type": "string"
                    },
                    {
                      "type": "null"
                    }
                  ]
                },
                "state": {
                  "anyOf": [
                    {
                      "type": "string"
                    },
                    {
                      "type": "null"
                    }
                  ]
                },
                "status": {
                  "type": "string",
                  "enum": [
                    "active",
                    "archived"
                  ]
                },
                "createdAt": {
                  "type": "string"
                },
                "updatedAt": {
                  "type": "string"
                }
              },
              "required": [
                "id",
                "object",
                "practiceId",
                "name",
                "timezone",
                "city",
                "country",
                "line1",
                "line2",
                "phone",
                "postalCode",
                "state",
                "status",
                "createdAt",
                "updatedAt"
              ],
              "additionalProperties": false
            }
          },
          "object": {
            "type": "string",
            "enum": [
              "list"
            ]
          },
          "hasMore": {
            "type": "boolean"
          },
          "url": {
            "type": "string"
          }
        },
        "required": [
          "data",
          "object",
          "hasMore",
          "url"
        ],
        "additionalProperties": false
      },
      "CreatePracticeLocationRequest": {
        "type": "object",
        "properties": {
          "city": {
            "anyOf": [
              {
                "anyOf": [
                  {
                    "type": "string"
                  },
                  {
                    "type": "null"
                  }
                ]
              },
              {
                "type": "null"
              }
            ]
          },
          "country": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ]
          },
          "line1": {
            "anyOf": [
              {
                "anyOf": [
                  {
                    "type": "string"
                  },
                  {
                    "type": "null"
                  }
                ]
              },
              {
                "type": "null"
              }
            ]
          },
          "line2": {
            "anyOf": [
              {
                "anyOf": [
                  {
                    "type": "string"
                  },
                  {
                    "type": "null"
                  }
                ]
              },
              {
                "type": "null"
              }
            ]
          },
          "name": {
            "type": "string"
          },
          "phone": {
            "anyOf": [
              {
                "anyOf": [
                  {
                    "type": "string"
                  },
                  {
                    "type": "null"
                  }
                ]
              },
              {
                "type": "null"
              }
            ]
          },
          "postalCode": {
            "anyOf": [
              {
                "anyOf": [
                  {
                    "type": "string"
                  },
                  {
                    "type": "null"
                  }
                ]
              },
              {
                "type": "null"
              }
            ]
          },
          "state": {
            "anyOf": [
              {
                "anyOf": [
                  {
                    "type": "string"
                  },
                  {
                    "type": "null"
                  }
                ]
              },
              {
                "type": "null"
              }
            ]
          },
          "timezone": {
            "anyOf": [
              {
                "anyOf": [
                  {
                    "type": "string"
                  },
                  {
                    "type": "null"
                  }
                ]
              },
              {
                "type": "null"
              }
            ],
            "description": "Optional IANA timezone override. Omit to leave unchanged; null clears it. No timezone is inferred when creating a record."
          }
        },
        "required": [
          "name"
        ],
        "additionalProperties": false,
        "title": "CreatePracticeLocationRequest"
      },
      "CreatePracticeLocationResponse": {
        "title": "CreatePracticeLocationResponse",
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "pattern": "^loc_[0-7][0-9a-hjkmnp-tv-z]{25}$",
            "examples": [
              "loc_01j2y8m6jcc9tt24af5pw9x1bc"
            ]
          },
          "object": {
            "type": "string",
            "enum": [
              "location"
            ]
          },
          "practiceId": {
            "type": "string",
            "pattern": "^prac_[0-7][0-9a-hjkmnp-tv-z]{25}$",
            "examples": [
              "prac_01j2y8m6jcc9tt24af5pw9x1bc"
            ]
          },
          "name": {
            "type": "string"
          },
          "timezone": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ]
          },
          "city": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ]
          },
          "country": {
            "type": "string"
          },
          "line1": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ]
          },
          "line2": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ]
          },
          "phone": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ]
          },
          "postalCode": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ]
          },
          "state": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ]
          },
          "status": {
            "type": "string",
            "enum": [
              "active",
              "archived"
            ]
          },
          "createdAt": {
            "type": "string"
          },
          "updatedAt": {
            "type": "string"
          }
        },
        "required": [
          "id",
          "object",
          "practiceId",
          "name",
          "timezone",
          "city",
          "country",
          "line1",
          "line2",
          "phone",
          "postalCode",
          "state",
          "status",
          "createdAt",
          "updatedAt"
        ],
        "additionalProperties": false
      },
      "GetPracticeLocationResponse": {
        "title": "GetPracticeLocationResponse",
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "pattern": "^loc_[0-7][0-9a-hjkmnp-tv-z]{25}$",
            "examples": [
              "loc_01j2y8m6jcc9tt24af5pw9x1bc"
            ]
          },
          "object": {
            "type": "string",
            "enum": [
              "location"
            ]
          },
          "practiceId": {
            "type": "string",
            "pattern": "^prac_[0-7][0-9a-hjkmnp-tv-z]{25}$",
            "examples": [
              "prac_01j2y8m6jcc9tt24af5pw9x1bc"
            ]
          },
          "name": {
            "type": "string"
          },
          "timezone": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ]
          },
          "city": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ]
          },
          "country": {
            "type": "string"
          },
          "line1": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ]
          },
          "line2": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ]
          },
          "phone": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ]
          },
          "postalCode": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ]
          },
          "state": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ]
          },
          "status": {
            "type": "string",
            "enum": [
              "active",
              "archived"
            ]
          },
          "createdAt": {
            "type": "string"
          },
          "updatedAt": {
            "type": "string"
          }
        },
        "required": [
          "id",
          "object",
          "practiceId",
          "name",
          "timezone",
          "city",
          "country",
          "line1",
          "line2",
          "phone",
          "postalCode",
          "state",
          "status",
          "createdAt",
          "updatedAt"
        ],
        "additionalProperties": false
      },
      "UpdatePracticeLocationRequest": {
        "type": "object",
        "properties": {
          "city": {
            "anyOf": [
              {
                "anyOf": [
                  {
                    "type": "string"
                  },
                  {
                    "type": "null"
                  }
                ]
              },
              {
                "type": "null"
              }
            ]
          },
          "country": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ]
          },
          "line1": {
            "anyOf": [
              {
                "anyOf": [
                  {
                    "type": "string"
                  },
                  {
                    "type": "null"
                  }
                ]
              },
              {
                "type": "null"
              }
            ]
          },
          "line2": {
            "anyOf": [
              {
                "anyOf": [
                  {
                    "type": "string"
                  },
                  {
                    "type": "null"
                  }
                ]
              },
              {
                "type": "null"
              }
            ]
          },
          "name": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ]
          },
          "phone": {
            "anyOf": [
              {
                "anyOf": [
                  {
                    "type": "string"
                  },
                  {
                    "type": "null"
                  }
                ]
              },
              {
                "type": "null"
              }
            ]
          },
          "postalCode": {
            "anyOf": [
              {
                "anyOf": [
                  {
                    "type": "string"
                  },
                  {
                    "type": "null"
                  }
                ]
              },
              {
                "type": "null"
              }
            ]
          },
          "state": {
            "anyOf": [
              {
                "anyOf": [
                  {
                    "type": "string"
                  },
                  {
                    "type": "null"
                  }
                ]
              },
              {
                "type": "null"
              }
            ]
          },
          "timezone": {
            "anyOf": [
              {
                "anyOf": [
                  {
                    "type": "string"
                  },
                  {
                    "type": "null"
                  }
                ]
              },
              {
                "type": "null"
              }
            ],
            "description": "Optional IANA timezone override. Omit to leave unchanged; null clears it. No timezone is inferred when creating a record."
          }
        },
        "additionalProperties": false,
        "title": "UpdatePracticeLocationRequest"
      },
      "UpdatePracticeLocationResponse": {
        "title": "UpdatePracticeLocationResponse",
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "pattern": "^loc_[0-7][0-9a-hjkmnp-tv-z]{25}$",
            "examples": [
              "loc_01j2y8m6jcc9tt24af5pw9x1bc"
            ]
          },
          "object": {
            "type": "string",
            "enum": [
              "location"
            ]
          },
          "practiceId": {
            "type": "string",
            "pattern": "^prac_[0-7][0-9a-hjkmnp-tv-z]{25}$",
            "examples": [
              "prac_01j2y8m6jcc9tt24af5pw9x1bc"
            ]
          },
          "name": {
            "type": "string"
          },
          "timezone": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ]
          },
          "city": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ]
          },
          "country": {
            "type": "string"
          },
          "line1": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ]
          },
          "line2": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ]
          },
          "phone": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ]
          },
          "postalCode": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ]
          },
          "state": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ]
          },
          "status": {
            "type": "string",
            "enum": [
              "active",
              "archived"
            ]
          },
          "createdAt": {
            "type": "string"
          },
          "updatedAt": {
            "type": "string"
          }
        },
        "required": [
          "id",
          "object",
          "practiceId",
          "name",
          "timezone",
          "city",
          "country",
          "line1",
          "line2",
          "phone",
          "postalCode",
          "state",
          "status",
          "createdAt",
          "updatedAt"
        ],
        "additionalProperties": false
      },
      "ArchivePracticeLocationResponse": {
        "title": "ArchivePracticeLocationResponse",
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "pattern": "^loc_[0-7][0-9a-hjkmnp-tv-z]{25}$",
            "examples": [
              "loc_01j2y8m6jcc9tt24af5pw9x1bc"
            ]
          },
          "object": {
            "type": "string",
            "enum": [
              "location"
            ]
          },
          "practiceId": {
            "type": "string",
            "pattern": "^prac_[0-7][0-9a-hjkmnp-tv-z]{25}$",
            "examples": [
              "prac_01j2y8m6jcc9tt24af5pw9x1bc"
            ]
          },
          "name": {
            "type": "string"
          },
          "timezone": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ]
          },
          "city": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ]
          },
          "country": {
            "type": "string"
          },
          "line1": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ]
          },
          "line2": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ]
          },
          "phone": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ]
          },
          "postalCode": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ]
          },
          "state": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ]
          },
          "status": {
            "type": "string",
            "enum": [
              "active",
              "archived"
            ]
          },
          "createdAt": {
            "type": "string"
          },
          "updatedAt": {
            "type": "string"
          }
        },
        "required": [
          "id",
          "object",
          "practiceId",
          "name",
          "timezone",
          "city",
          "country",
          "line1",
          "line2",
          "phone",
          "postalCode",
          "state",
          "status",
          "createdAt",
          "updatedAt"
        ],
        "additionalProperties": false
      },
      "CreatePlatformPracticeApiKeyRequest": {
        "type": "object",
        "properties": {
          "allowedIps": {
            "anyOf": [
              {
                "type": "array",
                "items": {
                  "anyOf": [
                    {
                      "type": "string",
                      "pattern": "^(?:(?:\\d{1,3}\\.){3}\\d{1,3}|(?:[a-f\\d]{0,4}:){2,7}[a-f\\d]{0,4})$"
                    },
                    {
                      "type": "string",
                      "pattern": "^(?:(?:\\d{1,3}\\.){3}\\d{1,3}|(?:[a-f\\d]{0,4}:){2,7}[a-f\\d]{0,4})$"
                    }
                  ]
                },
                "maxItems": 50
              },
              {
                "type": "null"
              }
            ]
          },
          "expiresAt": {
            "anyOf": [
              {
                "anyOf": [
                  {
                    "type": "string"
                  },
                  {
                    "type": "null"
                  }
                ]
              },
              {
                "type": "null"
              }
            ]
          },
          "name": {
            "type": "string"
          },
          "scopes": {
            "anyOf": [
              {
                "type": "array",
                "items": {
                  "type": "string",
                  "enum": [
                    "catalog:read",
                    "selling_prices:read",
                    "selling_prices:write",
                    "catalog_pricing:read",
                    "catalog_pricing:write",
                    "formulation_defaults:read",
                    "formulation_defaults:write",
                    "practices:read",
                    "practices:write",
                    "service_keys:write",
                    "locations:read",
                    "locations:write",
                    "orders:read",
                    "orders:write",
                    "orders:sign",
                    "patients:read",
                    "patients:write",
                    "team:read",
                    "team:write",
                    "hosted_sessions:write",
                    "webhooks:read",
                    "webhooks:write"
                  ]
                },
                "minItems": 1
              },
              {
                "type": "null"
              }
            ]
          }
        },
        "required": [
          "name"
        ],
        "additionalProperties": false,
        "title": "CreatePlatformPracticeApiKeyRequest"
      },
      "CreatePlatformPracticeApiKeyResponse": {
        "title": "CreatePlatformPracticeApiKeyResponse",
        "type": "object",
        "properties": {
          "apiKey": {
            "type": "object",
            "properties": {
              "allowedIps": {
                "type": "array",
                "items": {
                  "type": "string"
                }
              },
              "createdAt": {
                "type": "string"
              },
              "expiresAt": {
                "anyOf": [
                  {
                    "type": "string"
                  },
                  {
                    "type": "null"
                  }
                ]
              },
              "id": {
                "type": "string"
              },
              "keyPrefix": {
                "type": "string"
              },
              "lastUsedAt": {
                "anyOf": [
                  {
                    "type": "string"
                  },
                  {
                    "type": "null"
                  }
                ]
              },
              "mode": {
                "type": "string",
                "enum": [
                  "live",
                  "test"
                ]
              },
              "name": {
                "type": "string"
              },
              "revokedAt": {
                "anyOf": [
                  {
                    "type": "string"
                  },
                  {
                    "type": "null"
                  }
                ]
              },
              "scopes": {
                "type": "array",
                "items": {
                  "type": "string",
                  "enum": [
                    "catalog:read",
                    "selling_prices:read",
                    "selling_prices:write",
                    "catalog_pricing:read",
                    "catalog_pricing:write",
                    "formulation_defaults:read",
                    "formulation_defaults:write",
                    "practices:read",
                    "practices:write",
                    "service_keys:write",
                    "locations:read",
                    "locations:write",
                    "orders:read",
                    "orders:write",
                    "orders:sign",
                    "patients:read",
                    "patients:write",
                    "team:read",
                    "team:write",
                    "hosted_sessions:write",
                    "webhooks:read",
                    "webhooks:write"
                  ]
                }
              },
              "status": {
                "type": "string",
                "enum": [
                  "active",
                  "expired",
                  "revoked"
                ]
              }
            },
            "required": [
              "allowedIps",
              "createdAt",
              "expiresAt",
              "id",
              "keyPrefix",
              "lastUsedAt",
              "mode",
              "name",
              "revokedAt",
              "scopes",
              "status"
            ],
            "additionalProperties": false
          },
          "secret": {
            "type": "string"
          },
          "serviceAccount": {
            "type": "object",
            "properties": {
              "apiVersion": {
                "anyOf": [
                  {
                    "type": "string",
                    "enum": [
                      "2026-09-28"
                    ]
                  }
                ]
              },
              "displayName": {
                "type": "string"
              },
              "id": {
                "type": "string"
              },
              "maxScopes": {
                "type": "array",
                "items": {
                  "type": "string",
                  "enum": [
                    "catalog:read",
                    "selling_prices:read",
                    "selling_prices:write",
                    "catalog_pricing:read",
                    "catalog_pricing:write",
                    "formulation_defaults:read",
                    "formulation_defaults:write",
                    "practices:read",
                    "practices:write",
                    "service_keys:write",
                    "locations:read",
                    "locations:write",
                    "orders:read",
                    "orders:write",
                    "orders:sign",
                    "patients:read",
                    "patients:write",
                    "team:read",
                    "team:write",
                    "hosted_sessions:write",
                    "webhooks:read",
                    "webhooks:write"
                  ]
                }
              },
              "organizationId": {
                "type": "string"
              },
              "status": {
                "type": "string",
                "enum": [
                  "active",
                  "disabled"
                ]
              },
              "subjectId": {
                "type": "string"
              },
              "subjectType": {
                "type": "string",
                "enum": [
                  "practice",
                  "internal_service",
                  "pharmacy",
                  "platform",
                  "user"
                ]
              }
            },
            "required": [
              "apiVersion",
              "displayName",
              "id",
              "maxScopes",
              "organizationId",
              "status",
              "subjectId",
              "subjectType"
            ],
            "additionalProperties": false
          }
        },
        "required": [
          "apiKey",
          "secret",
          "serviceAccount"
        ],
        "additionalProperties": false
      },
      "GetAccountResponse": {
        "title": "GetAccountResponse",
        "type": "object",
        "properties": {
          "account": {
            "type": "object",
            "properties": {
              "allowedReturnUrls": {
                "type": "array",
                "items": {
                  "type": "string"
                }
              },
              "displayName": {
                "type": "string"
              },
              "id": {
                "type": "string",
                "pattern": "^acct_[0-7][0-9a-hjkmnp-tv-z]{25}$",
                "examples": [
                  "acct_01j2y8m6jcc9tt24af5pw9x1bc"
                ]
              },
              "object": {
                "type": "string",
                "enum": [
                  "account"
                ]
              },
              "slug": {
                "type": "string"
              },
              "status": {
                "type": "string",
                "enum": [
                  "active",
                  "pending",
                  "suspended"
                ]
              },
              "supportEmail": {
                "anyOf": [
                  {
                    "type": "string"
                  },
                  {
                    "type": "null"
                  }
                ]
              },
              "websiteUrl": {
                "anyOf": [
                  {
                    "type": "string"
                  },
                  {
                    "type": "null"
                  }
                ]
              }
            },
            "required": [
              "allowedReturnUrls",
              "displayName",
              "id",
              "object",
              "slug",
              "status",
              "supportEmail",
              "websiteUrl"
            ],
            "additionalProperties": false
          },
          "livemode": {
            "type": "boolean",
            "description": "True for a Live request; false for a Test request."
          },
          "scopes": {
            "anyOf": [
              {
                "type": "array",
                "items": {
                  "type": "string"
                }
              },
              {
                "type": "null"
              }
            ],
            "description": "Effective scopes of the authenticated API key. Null for a dashboard session; use membership.permissions for that session."
          },
          "membership": {
            "type": "object",
            "properties": {
              "permissions": {
                "type": "array",
                "items": {
                  "type": "string"
                },
                "description": "Effective API scopes for a service key; dashboard permissions for a signed-in member."
              },
              "role": {
                "type": "string",
                "enum": [
                  "administrator",
                  "clinical_reviewer",
                  "developer",
                  "operations",
                  "owner",
                  "viewer",
                  "service_key"
                ]
              },
              "roleName": {
                "type": "string"
              },
              "status": {
                "type": "string",
                "enum": [
                  "active",
                  "disabled",
                  "invited"
                ]
              }
            },
            "required": [
              "permissions",
              "role",
              "roleName",
              "status"
            ],
            "additionalProperties": false
          },
          "operatingMode": {
            "type": "string",
            "enum": [
              "production",
              "production_pending",
              "sandbox",
              "suspended"
            ],
            "description": "The organization's Live-access status, independent of this request's livemode."
          },
          "user": {
            "type": "object",
            "properties": {
              "email": {
                "type": "string"
              },
              "emailVerified": {
                "anyOf": [
                  {
                    "type": "boolean"
                  },
                  {
                    "type": "null"
                  }
                ]
              },
              "image": {
                "anyOf": [
                  {
                    "type": "string"
                  },
                  {
                    "type": "null"
                  }
                ]
              },
              "name": {
                "type": "string"
              },
              "twoFactorEnabled": {
                "anyOf": [
                  {
                    "type": "boolean"
                  },
                  {
                    "type": "null"
                  }
                ]
              },
              "userId": {
                "type": "string"
              }
            },
            "required": [
              "email",
              "image",
              "name",
              "userId"
            ],
            "additionalProperties": false
          }
        },
        "required": [
          "account",
          "livemode",
          "scopes",
          "membership",
          "operatingMode",
          "user"
        ],
        "additionalProperties": false
      },
      "ListCatalogItemsResponse": {
        "title": "ListCatalogItemsResponse",
        "type": "object",
        "properties": {
          "data": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "catalogDetails": {
                  "type": "object",
                  "properties": {
                    "packageComponents": {
                      "anyOf": [
                        {
                          "type": "array",
                          "items": {
                            "type": "object",
                            "properties": {
                              "container": {
                                "type": "string",
                                "allOf": [
                                  {
                                    "minLength": 1
                                  }
                                ]
                              },
                              "containerCount": {
                                "type": "integer",
                                "allOf": [
                                  {
                                    "exclusiveMinimum": 0
                                  }
                                ]
                              },
                              "contentsPerContainer": {
                                "type": "object",
                                "properties": {
                                  "value": {
                                    "type": "string",
                                    "allOf": [
                                      {
                                        "maxLength": 100
                                      },
                                      {
                                        "pattern": "^(?:0|[1-9]\\d*)(?:\\.\\d*[1-9])?$"
                                      }
                                    ]
                                  },
                                  "unit": {
                                    "type": "string",
                                    "enum": [
                                      "mg",
                                      "g",
                                      "ug",
                                      "mL",
                                      "L",
                                      "[IU]",
                                      "tablet",
                                      "capsule",
                                      "troche",
                                      "actuation",
                                      "patch",
                                      "package",
                                      "container"
                                    ]
                                  }
                                },
                                "required": [
                                  "value",
                                  "unit"
                                ],
                                "additionalProperties": false
                              }
                            },
                            "required": [
                              "container",
                              "containerCount",
                              "contentsPerContainer"
                            ],
                            "additionalProperties": false
                          }
                        },
                        {
                          "type": "null"
                        }
                      ],
                      "description": "Confirmed physical containers and contents. Empty or absent means container count cannot be inferred from dispense quantity."
                    },
                    "attributes": {
                      "type": "object",
                      "additionalProperties": {
                        "anyOf": [
                          {
                            "type": "string"
                          },
                          {
                            "type": "array",
                            "items": {
                              "type": "string"
                            }
                          }
                        ]
                      }
                    },
                    "directions": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "kind": {
                            "type": "string",
                            "enum": [
                              "suggested",
                              "template"
                            ]
                          },
                          "text": {
                            "type": "string"
                          }
                        },
                        "required": [
                          "kind",
                          "text"
                        ],
                        "additionalProperties": false
                      }
                    }
                  },
                  "required": [
                    "attributes",
                    "directions"
                  ],
                  "additionalProperties": false
                },
                "composition": {
                  "type": "object",
                  "properties": {
                    "status": {
                      "type": "string",
                      "enum": [
                        "complete",
                        "partial",
                        "unresolved"
                      ]
                    },
                    "ingredients": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "name": {
                            "type": "string"
                          },
                          "role": {
                            "type": "string",
                            "enum": [
                              "active",
                              "inactive"
                            ]
                          },
                          "basisOfStrengthSubstance": {
                            "anyOf": [
                              {
                                "type": "object",
                                "properties": {
                                  "name": {
                                    "type": "string"
                                  }
                                },
                                "required": [
                                  "name"
                                ],
                                "additionalProperties": false
                              },
                              {
                                "type": "null"
                              }
                            ]
                          },
                          "strength": {
                            "anyOf": [
                              {
                                "type": "object",
                                "properties": {
                                  "kind": {
                                    "type": "string",
                                    "enum": [
                                      "amount"
                                    ]
                                  },
                                  "amount": {
                                    "type": "object",
                                    "properties": {
                                      "value": {
                                        "type": "string",
                                        "allOf": [
                                          {
                                            "pattern": "^(?:0|[1-9][0-9]*)(?:\\.[0-9]+)?$"
                                          }
                                        ]
                                      },
                                      "unit": {
                                        "type": "string"
                                      }
                                    },
                                    "required": [
                                      "value",
                                      "unit"
                                    ],
                                    "additionalProperties": false
                                  }
                                },
                                "required": [
                                  "kind",
                                  "amount"
                                ],
                                "additionalProperties": false
                              },
                              {
                                "type": "object",
                                "properties": {
                                  "kind": {
                                    "type": "string",
                                    "enum": [
                                      "ratio"
                                    ]
                                  },
                                  "numerator": {
                                    "type": "object",
                                    "properties": {
                                      "value": {
                                        "type": "string",
                                        "allOf": [
                                          {
                                            "pattern": "^(?:0|[1-9][0-9]*)(?:\\.[0-9]+)?$"
                                          }
                                        ]
                                      },
                                      "unit": {
                                        "type": "string"
                                      }
                                    },
                                    "required": [
                                      "value",
                                      "unit"
                                    ],
                                    "additionalProperties": false
                                  },
                                  "denominator": {
                                    "type": "object",
                                    "properties": {
                                      "value": {
                                        "type": "string",
                                        "allOf": [
                                          {
                                            "pattern": "^(?:0|[1-9][0-9]*)(?:\\.[0-9]+)?$"
                                          }
                                        ]
                                      },
                                      "unit": {
                                        "type": "string"
                                      }
                                    },
                                    "required": [
                                      "value",
                                      "unit"
                                    ],
                                    "additionalProperties": false
                                  }
                                },
                                "required": [
                                  "kind",
                                  "numerator",
                                  "denominator"
                                ],
                                "additionalProperties": false
                              },
                              {
                                "type": "object",
                                "properties": {
                                  "kind": {
                                    "type": "string",
                                    "enum": [
                                      "unresolved"
                                    ]
                                  },
                                  "reason": {
                                    "type": "string"
                                  }
                                },
                                "required": [
                                  "kind",
                                  "reason"
                                ],
                                "additionalProperties": false
                              }
                            ]
                          }
                        },
                        "required": [
                          "name",
                          "role",
                          "basisOfStrengthSubstance",
                          "strength"
                        ],
                        "additionalProperties": false
                      }
                    }
                  },
                  "required": [
                    "status",
                    "ingredients"
                  ],
                  "additionalProperties": false
                },
                "allowedStates": {
                  "type": "array",
                  "items": {
                    "type": "string"
                  }
                },
                "availability": {
                  "type": "string",
                  "enum": [
                    "available",
                    "backordered",
                    "unavailable",
                    "unknown"
                  ]
                },
                "catalogKind": {
                  "type": "string"
                },
                "fulfillmentInclusions": {
                  "type": "array",
                  "items": {
                    "type": "object",
                    "properties": {
                      "amountCents": {
                        "type": "integer"
                      },
                      "kind": {
                        "type": "string",
                        "enum": [
                          "cold_chain",
                          "injection_supplies"
                        ]
                      },
                      "label": {
                        "type": "string"
                      },
                      "priceComponent": {
                        "type": "string",
                        "enum": [
                          "shipping"
                        ]
                      }
                    },
                    "required": [
                      "amountCents",
                      "kind",
                      "label",
                      "priceComponent"
                    ],
                    "additionalProperties": false
                  }
                },
                "ordering": {
                  "type": "object",
                  "properties": {
                    "requiresPrescription": {
                      "type": "boolean"
                    },
                    "requiresAccompanyingPrescription": {
                      "type": "boolean"
                    },
                    "shipping": {
                      "type": "string",
                      "enum": [
                        "prescription",
                        "accompanying_prescription"
                      ]
                    }
                  },
                  "required": [
                    "requiresPrescription",
                    "requiresAccompanyingPrescription",
                    "shipping"
                  ],
                  "additionalProperties": false
                },
                "category": {
                  "anyOf": [
                    {
                      "type": "string"
                    },
                    {
                      "type": "null"
                    }
                  ]
                },
                "coldShip": {
                  "type": "boolean"
                },
                "pharmacyId": {
                  "type": "string",
                  "allOf": [
                    {
                      "pattern": "^pharm_[0-7][0-9a-hjkmnp-tv-z]{25}$",
                      "examples": [
                        "pharm_01j2y8m6jcc9tt24af5pw9x1bc"
                      ]
                    }
                  ]
                },
                "pharmacyName": {
                  "type": "string"
                },
                "description": {
                  "type": "string"
                },
                "dosageForm": {
                  "type": "string"
                },
                "facilityType": {
                  "type": "string"
                },
                "id": {
                  "type": "string",
                  "allOf": [
                    {
                      "pattern": "^cat_[0-7][0-9a-hjkmnp-tv-z]{25}$",
                      "examples": [
                        "cat_01j2y8m6jcc9tt24af5pw9x1bc"
                      ]
                    }
                  ]
                },
                "imageUrl": {
                  "anyOf": [
                    {
                      "type": "string"
                    },
                    {
                      "type": "null"
                    }
                  ],
                  "description": "Primary product photo, falling back to dosage-form artwork. Null when neither is available."
                },
                "imageUrls": {
                  "type": "array",
                  "items": {
                    "type": "string"
                  },
                  "allOf": [
                    {
                      "maxItems": 40
                    }
                  ]
                },
                "medicationGroup": {
                  "anyOf": [
                    {
                      "type": "object",
                      "properties": {
                        "offerCount": {
                          "anyOf": [
                            {
                              "type": "number"
                            },
                            {
                              "type": "string",
                              "enum": [
                                "Infinity",
                                "-Infinity",
                                "NaN"
                              ]
                            }
                          ]
                        },
                        "pharmacyCount": {
                          "anyOf": [
                            {
                              "type": "number"
                            },
                            {
                              "type": "string",
                              "enum": [
                                "Infinity",
                                "-Infinity",
                                "NaN"
                              ]
                            }
                          ]
                        },
                        "strengths": {
                          "type": "array",
                          "items": {
                            "type": "string"
                          }
                        }
                      },
                      "required": [
                        "offerCount",
                        "pharmacyCount",
                        "strengths"
                      ],
                      "additionalProperties": false
                    },
                    {
                      "type": "null"
                    }
                  ]
                },
                "isOrderable": {
                  "type": "boolean"
                },
                "livemode": {
                  "type": "boolean"
                },
                "name": {
                  "type": "string"
                },
                "object": {
                  "type": "string",
                  "enum": [
                    "catalog_item"
                  ]
                },
                "patientSpecificRequired": {
                  "type": "boolean"
                },
                "quantityConstraint": {
                  "anyOf": [
                    {
                      "anyOf": [
                        {
                          "type": "object",
                          "properties": {
                            "kind": {
                              "type": "string",
                              "enum": [
                                "fixed"
                              ]
                            },
                            "quantity": {
                              "type": "object",
                              "properties": {
                                "value": {
                                  "type": "string",
                                  "allOf": [
                                    {
                                      "maxLength": 100
                                    },
                                    {
                                      "pattern": "^(?:0|[1-9]\\d*)(?:\\.\\d*[1-9])?$"
                                    }
                                  ]
                                },
                                "unit": {
                                  "type": "string",
                                  "allOf": [
                                    {
                                      "minLength": 1
                                    }
                                  ]
                                }
                              },
                              "required": [
                                "value",
                                "unit"
                              ],
                              "additionalProperties": false
                            }
                          },
                          "required": [
                            "kind",
                            "quantity"
                          ],
                          "additionalProperties": false
                        },
                        {
                          "type": "object",
                          "properties": {
                            "kind": {
                              "type": "string",
                              "enum": [
                                "choices"
                              ]
                            },
                            "quantities": {
                              "type": "array",
                              "prefixItems": [
                                {
                                  "type": "object",
                                  "properties": {
                                    "value": {
                                      "type": "string",
                                      "allOf": [
                                        {
                                          "maxLength": 100
                                        },
                                        {
                                          "pattern": "^(?:0|[1-9]\\d*)(?:\\.\\d*[1-9])?$"
                                        }
                                      ]
                                    },
                                    "unit": {
                                      "type": "string",
                                      "allOf": [
                                        {
                                          "minLength": 1
                                        }
                                      ]
                                    }
                                  },
                                  "required": [
                                    "value",
                                    "unit"
                                  ],
                                  "additionalProperties": false
                                }
                              ],
                              "minItems": 1,
                              "items": {
                                "type": "object",
                                "properties": {
                                  "value": {
                                    "type": "string",
                                    "allOf": [
                                      {
                                        "maxLength": 100
                                      },
                                      {
                                        "pattern": "^(?:0|[1-9]\\d*)(?:\\.\\d*[1-9])?$"
                                      }
                                    ]
                                  },
                                  "unit": {
                                    "type": "string",
                                    "allOf": [
                                      {
                                        "minLength": 1
                                      }
                                    ]
                                  }
                                },
                                "required": [
                                  "value",
                                  "unit"
                                ],
                                "additionalProperties": false
                              }
                            }
                          },
                          "required": [
                            "kind",
                            "quantities"
                          ],
                          "additionalProperties": false
                        },
                        {
                          "type": "object",
                          "properties": {
                            "kind": {
                              "type": "string",
                              "enum": [
                                "range"
                              ]
                            },
                            "unit": {
                              "type": "string",
                              "allOf": [
                                {
                                  "minLength": 1
                                }
                              ]
                            },
                            "minimum": {
                              "anyOf": [
                                {
                                  "type": "string",
                                  "allOf": [
                                    {
                                      "maxLength": 100
                                    },
                                    {
                                      "pattern": "^(?:0|[1-9]\\d*)(?:\\.\\d*[1-9])?$"
                                    }
                                  ]
                                },
                                {
                                  "type": "null"
                                }
                              ]
                            },
                            "maximum": {
                              "anyOf": [
                                {
                                  "type": "string",
                                  "allOf": [
                                    {
                                      "maxLength": 100
                                    },
                                    {
                                      "pattern": "^(?:0|[1-9]\\d*)(?:\\.\\d*[1-9])?$"
                                    }
                                  ]
                                },
                                {
                                  "type": "null"
                                }
                              ]
                            },
                            "increment": {
                              "anyOf": [
                                {
                                  "type": "string",
                                  "allOf": [
                                    {
                                      "maxLength": 100
                                    },
                                    {
                                      "pattern": "^(?:0|[1-9]\\d*)(?:\\.\\d*[1-9])?$"
                                    }
                                  ]
                                },
                                {
                                  "type": "null"
                                }
                              ]
                            }
                          },
                          "required": [
                            "kind",
                            "unit",
                            "minimum",
                            "maximum",
                            "increment"
                          ],
                          "additionalProperties": false
                        },
                        {
                          "type": "object",
                          "properties": {
                            "kind": {
                              "type": "string",
                              "enum": [
                                "unresolved"
                              ]
                            },
                            "sourceText": {
                              "type": "string"
                            }
                          },
                          "required": [
                            "kind",
                            "sourceText"
                          ],
                          "additionalProperties": false
                        }
                      ]
                    },
                    {
                      "type": "null"
                    }
                  ]
                },
                "prescriptionRequirements": {
                  "type": "object",
                  "properties": {
                    "allowedDaysSupply": {
                      "anyOf": [
                        {
                          "type": "array",
                          "items": {
                            "type": "integer"
                          }
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "allowedQuantities": {
                      "anyOf": [
                        {
                          "type": "array",
                          "items": {
                            "type": "object",
                            "properties": {
                              "daysSupply": {
                                "anyOf": [
                                  {
                                    "type": "integer"
                                  },
                                  {
                                    "type": "null"
                                  }
                                ]
                              },
                              "label": {
                                "type": "string"
                              },
                              "unit": {
                                "type": "string"
                              },
                              "value": {
                                "anyOf": [
                                  {
                                    "type": "number"
                                  },
                                  {
                                    "type": "string",
                                    "enum": [
                                      "Infinity",
                                      "-Infinity",
                                      "NaN"
                                    ]
                                  }
                                ]
                              }
                            },
                            "required": [
                              "label",
                              "unit",
                              "value"
                            ],
                            "additionalProperties": false
                          }
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "allowedReasonCategories": {
                      "anyOf": [
                        {
                          "type": "array",
                          "items": {
                            "type": "string",
                            "enum": [
                              "alcohol_free",
                              "drug_shortage",
                              "commercial_product_discontinued",
                              "modified_release",
                              "inactive_ingredient_sensitivity",
                              "inactive_ingredient_toxicity",
                              "concentration_adjustment",
                              "alternate_route",
                              "dosage_form_unavailable",
                              "flavor_adjustment",
                              "tablet_burden",
                              "patient_cannot_use_commercial_product",
                              "no_approved_product_available",
                              "no_rationale_required",
                              "other_patient_specific_need"
                            ]
                          }
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "reasonCategoryLabels": {
                      "anyOf": [
                        {
                          "type": "object",
                          "additionalProperties": {
                            "type": "string"
                          }
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "compoundingReason": {
                      "type": "string",
                      "enum": [
                        "not_required",
                        "optional",
                        "required"
                      ]
                    },
                    "compoundingReasonContext": {
                      "anyOf": [
                        {
                          "type": "string",
                          "enum": [
                            "not_supported",
                            "optional",
                            "required"
                          ]
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "controlledSchedule": {
                      "anyOf": [
                        {
                          "type": "string",
                          "enum": [
                            "II",
                            "III",
                            "IV",
                            "V"
                          ]
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "defaultDaysSupply": {
                      "anyOf": [
                        {
                          "type": "integer"
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "defaultQuantity": {
                      "anyOf": [
                        {
                          "type": "object",
                          "properties": {
                            "unit": {
                              "type": "string"
                            },
                            "value": {
                              "anyOf": [
                                {
                                  "type": "number"
                                },
                                {
                                  "type": "string",
                                  "enum": [
                                    "Infinity",
                                    "-Infinity",
                                    "NaN"
                                  ]
                                }
                              ]
                            }
                          },
                          "required": [
                            "unit",
                            "value"
                          ],
                          "additionalProperties": false
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "quantityIncrement": {
                      "anyOf": [
                        {
                          "type": "object",
                          "properties": {
                            "max": {
                              "anyOf": [
                                {
                                  "anyOf": [
                                    {
                                      "type": "number"
                                    },
                                    {
                                      "type": "string",
                                      "enum": [
                                        "Infinity",
                                        "-Infinity",
                                        "NaN"
                                      ]
                                    }
                                  ]
                                },
                                {
                                  "type": "null"
                                }
                              ]
                            },
                            "min": {
                              "anyOf": [
                                {
                                  "anyOf": [
                                    {
                                      "type": "number"
                                    },
                                    {
                                      "type": "string",
                                      "enum": [
                                        "Infinity",
                                        "-Infinity",
                                        "NaN"
                                      ]
                                    }
                                  ]
                                },
                                {
                                  "type": "null"
                                }
                              ]
                            },
                            "unit": {
                              "type": "string"
                            },
                            "value": {
                              "anyOf": [
                                {
                                  "type": "number"
                                },
                                {
                                  "type": "string",
                                  "enum": [
                                    "Infinity",
                                    "-Infinity",
                                    "NaN"
                                  ]
                                }
                              ]
                            }
                          },
                          "required": [
                            "unit",
                            "value"
                          ],
                          "additionalProperties": false
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "defaultSigs": {
                      "anyOf": [
                        {
                          "type": "array",
                          "items": {
                            "type": "string"
                          }
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "diagnosis": {
                      "type": "string",
                      "enum": [
                        "not_required",
                        "optional",
                        "required"
                      ]
                    },
                    "medicationReview": {
                      "anyOf": [
                        {
                          "type": "string",
                          "enum": [
                            "optional",
                            "required"
                          ]
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "diagnosisReview": {
                      "anyOf": [
                        {
                          "type": "string",
                          "enum": [
                            "optional",
                            "required"
                          ]
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "maxRefills": {
                      "anyOf": [
                        {
                          "type": "integer"
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "notes": {
                      "anyOf": [
                        {
                          "type": "array",
                          "items": {
                            "type": "string"
                          }
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "pharmacyNotes": {
                      "type": "string",
                      "enum": [
                        "not_supported",
                        "optional"
                      ]
                    },
                    "refills": {
                      "type": "string",
                      "enum": [
                        "not_supported",
                        "optional"
                      ]
                    },
                    "substitution": {
                      "type": "string",
                      "enum": [
                        "not_supported",
                        "optional"
                      ]
                    }
                  },
                  "required": [
                    "compoundingReason",
                    "diagnosis",
                    "pharmacyNotes",
                    "refills",
                    "substitution"
                  ],
                  "additionalProperties": false
                },
                "pricing": {
                  "anyOf": [
                    {
                      "type": "object",
                      "properties": {
                        "amountCents": {
                          "type": "integer",
                          "allOf": [
                            {
                              "minimum": 0
                            }
                          ]
                        },
                        "basis": {
                          "anyOf": [
                            {
                              "type": "object",
                              "properties": {
                                "kind": {
                                  "type": "string",
                                  "enum": [
                                    "item"
                                  ]
                                },
                                "quantity": {
                                  "type": "string",
                                  "enum": [
                                    "1"
                                  ]
                                },
                                "unit": {
                                  "type": "string",
                                  "allOf": [
                                    {
                                      "minLength": 1
                                    }
                                  ]
                                },
                                "quantityPrices": {
                                  "anyOf": [
                                    {
                                      "type": "array",
                                      "items": {
                                        "type": "object",
                                        "properties": {
                                          "quantity": {
                                            "type": "string",
                                            "allOf": [
                                              {
                                                "maxLength": 100
                                              },
                                              {
                                                "pattern": "^(?:0|[1-9]\\d*)(?:\\.\\d*[1-9])?$"
                                              }
                                            ]
                                          },
                                          "amountCents": {
                                            "type": "integer",
                                            "allOf": [
                                              {
                                                "exclusiveMinimum": 0
                                              }
                                            ]
                                          }
                                        },
                                        "required": [
                                          "quantity",
                                          "amountCents"
                                        ],
                                        "additionalProperties": false
                                      },
                                      "allOf": [
                                        {
                                          "minItems": 1
                                        }
                                      ]
                                    },
                                    {
                                      "type": "null"
                                    }
                                  ]
                                }
                              },
                              "required": [
                                "kind",
                                "quantity",
                                "unit"
                              ],
                              "additionalProperties": false
                            },
                            {
                              "type": "object",
                              "properties": {
                                "kind": {
                                  "type": "string",
                                  "enum": [
                                    "package"
                                  ]
                                },
                                "quantity": {
                                  "type": "string",
                                  "allOf": [
                                    {
                                      "maxLength": 100
                                    },
                                    {
                                      "pattern": "^(?:0|[1-9]\\d*)(?:\\.\\d*[1-9])?$"
                                    }
                                  ]
                                },
                                "unit": {
                                  "type": "string",
                                  "allOf": [
                                    {
                                      "minLength": 1
                                    }
                                  ]
                                }
                              },
                              "required": [
                                "kind",
                                "quantity",
                                "unit"
                              ],
                              "additionalProperties": false
                            },
                            {
                              "type": "object",
                              "properties": {
                                "kind": {
                                  "type": "string",
                                  "enum": [
                                    "unit"
                                  ]
                                },
                                "quantity": {
                                  "type": "string",
                                  "enum": [
                                    "1"
                                  ]
                                },
                                "unit": {
                                  "type": "string",
                                  "allOf": [
                                    {
                                      "minLength": 1
                                    }
                                  ]
                                }
                              },
                              "required": [
                                "kind",
                                "quantity",
                                "unit"
                              ],
                              "additionalProperties": false
                            }
                          ]
                        },
                        "currency": {
                          "type": "string",
                          "enum": [
                            "USD"
                          ]
                        },
                        "medicationSubtotalCents": {
                          "type": "integer",
                          "allOf": [
                            {
                              "minimum": 0
                            }
                          ]
                        }
                      },
                      "required": [
                        "amountCents",
                        "basis",
                        "currency",
                        "medicationSubtotalCents"
                      ],
                      "additionalProperties": false
                    },
                    {
                      "type": "null"
                    }
                  ]
                },
                "restrictedStates": {
                  "type": "array",
                  "items": {
                    "type": "string"
                  }
                },
                "route": {
                  "type": "string"
                },
                "shippingOptions": {
                  "type": "array",
                  "items": {
                    "type": "object",
                    "properties": {
                      "amountCents": {
                        "type": "integer",
                        "allOf": [
                          {
                            "minimum": 0
                          }
                        ]
                      },
                      "carrier": {
                        "anyOf": [
                          {
                            "type": "string"
                          },
                          {
                            "type": "null"
                          }
                        ]
                      },
                      "currency": {
                        "type": "string",
                        "enum": [
                          "USD"
                        ]
                      },
                      "destinationTypes": {
                        "type": "array",
                        "items": {
                          "type": "string",
                          "enum": [
                            "patient",
                            "practice"
                          ]
                        }
                      },
                      "estimatedDaysMax": {
                        "anyOf": [
                          {
                            "type": "integer",
                            "allOf": [
                              {
                                "minimum": 0
                              }
                            ]
                          },
                          {
                            "type": "null"
                          }
                        ]
                      },
                      "estimatedDaysMin": {
                        "anyOf": [
                          {
                            "type": "integer",
                            "allOf": [
                              {
                                "minimum": 0
                              }
                            ]
                          },
                          {
                            "type": "null"
                          }
                        ]
                      },
                      "id": {
                        "type": "string",
                        "allOf": [
                          {
                            "pattern": "^shp_[0-7][0-9a-hjkmnp-tv-z]{25}$",
                            "examples": [
                              "shp_01j2y8m6jcc9tt24af5pw9x1bc"
                            ]
                          }
                        ]
                      },
                      "label": {
                        "type": "string"
                      },
                      "serviceLevel": {
                        "type": "string"
                      },
                      "temperatures": {
                        "type": "array",
                        "items": {
                          "type": "string",
                          "enum": [
                            "ambient",
                            "refrigerated"
                          ]
                        }
                      }
                    },
                    "required": [
                      "amountCents",
                      "carrier",
                      "currency",
                      "destinationTypes",
                      "estimatedDaysMax",
                      "estimatedDaysMin",
                      "id",
                      "label",
                      "serviceLevel",
                      "temperatures"
                    ],
                    "additionalProperties": false
                  }
                },
                "strength": {
                  "anyOf": [
                    {
                      "type": "string"
                    },
                    {
                      "type": "null"
                    }
                  ]
                },
                "unit": {
                  "anyOf": [
                    {
                      "type": "string"
                    },
                    {
                      "type": "null"
                    }
                  ]
                }
              },
              "required": [
                "catalogDetails",
                "composition",
                "allowedStates",
                "availability",
                "catalogKind",
                "fulfillmentInclusions",
                "ordering",
                "category",
                "coldShip",
                "pharmacyId",
                "pharmacyName",
                "description",
                "dosageForm",
                "facilityType",
                "id",
                "imageUrl",
                "imageUrls",
                "isOrderable",
                "livemode",
                "name",
                "object",
                "patientSpecificRequired",
                "quantityConstraint",
                "prescriptionRequirements",
                "pricing",
                "restrictedStates",
                "route",
                "shippingOptions",
                "strength",
                "unit"
              ],
              "additionalProperties": false
            }
          },
          "hasMore": {
            "type": "boolean"
          },
          "object": {
            "type": "string",
            "enum": [
              "list"
            ]
          },
          "updatedAt": {
            "type": "string"
          },
          "url": {
            "type": "string",
            "enum": [
              "/v1/catalog/items"
            ]
          }
        },
        "required": [
          "data",
          "hasMore",
          "object",
          "updatedAt",
          "url"
        ],
        "additionalProperties": false
      },
      "ListPharmaciesResponse": {
        "title": "ListPharmaciesResponse",
        "type": "object",
        "properties": {
          "data": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "access": {
                  "type": "string",
                  "enum": [
                    "invited",
                    "network"
                  ]
                },
                "catalogItemCount": {
                  "type": "integer",
                  "minimum": 0
                },
                "facilityType": {
                  "type": "string"
                },
                "facilityLocations": {
                  "type": "array",
                  "items": {
                    "type": "object",
                    "properties": {
                      "city": {
                        "anyOf": [
                          {
                            "type": "string"
                          },
                          {
                            "type": "null"
                          }
                        ]
                      },
                      "country": {
                        "anyOf": [
                          {
                            "type": "string"
                          },
                          {
                            "type": "null"
                          }
                        ]
                      },
                      "name": {
                        "type": "string"
                      },
                      "state": {
                        "anyOf": [
                          {
                            "type": "string"
                          },
                          {
                            "type": "null"
                          }
                        ]
                      }
                    },
                    "required": [
                      "city",
                      "country",
                      "name",
                      "state"
                    ],
                    "additionalProperties": false
                  }
                },
                "id": {
                  "type": "string",
                  "pattern": "^pharm_[0-7][0-9a-hjkmnp-tv-z]{25}$",
                  "examples": [
                    "pharm_01j2y8m6jcc9tt24af5pw9x1bc"
                  ]
                },
                "livemode": {
                  "type": "boolean"
                },
                "logoUrl": {
                  "anyOf": [
                    {
                      "type": "string"
                    },
                    {
                      "type": "null"
                    }
                  ]
                },
                "name": {
                  "type": "string"
                },
                "object": {
                  "type": "string",
                  "enum": [
                    "pharmacy"
                  ]
                },
                "prescriptionsLast30Days": {
                  "type": "integer",
                  "minimum": 0
                },
                "profile": {
                  "anyOf": [
                    {
                      "type": "object",
                      "properties": {
                        "description": {
                          "type": "string"
                        },
                        "effectiveAt": {
                          "type": "string"
                        },
                        "monthlyPrescriptionVolume": {
                          "anyOf": [
                            {
                              "type": "integer",
                              "minimum": 0
                            },
                            {
                              "type": "null"
                            }
                          ]
                        },
                        "rating": {
                          "anyOf": [
                            {
                              "anyOf": [
                                {
                                  "type": "number",
                                  "minimum": 0,
                                  "maximum": 5
                                },
                                {
                                  "type": "string",
                                  "enum": [
                                    "Infinity",
                                    "-Infinity",
                                    "NaN"
                                  ]
                                }
                              ]
                            },
                            {
                              "type": "null"
                            }
                          ]
                        },
                        "ratingBasis": {
                          "anyOf": [
                            {
                              "type": "string"
                            },
                            {
                              "type": "null"
                            }
                          ]
                        },
                        "ratingReviewCount": {
                          "anyOf": [
                            {
                              "type": "integer",
                              "minimum": 0
                            },
                            {
                              "type": "null"
                            }
                          ]
                        },
                        "recommendedRank": {
                          "anyOf": [
                            {
                              "type": "integer",
                              "exclusiveMinimum": 0
                            },
                            {
                              "type": "null"
                            }
                          ]
                        }
                      },
                      "required": [
                        "description",
                        "effectiveAt",
                        "monthlyPrescriptionVolume",
                        "rating",
                        "ratingBasis",
                        "ratingReviewCount",
                        "recommendedRank"
                      ],
                      "additionalProperties": false
                    },
                    {
                      "type": "null"
                    }
                  ]
                },
                "restrictedStates": {
                  "type": "array",
                  "items": {
                    "type": "string"
                  }
                },
                "shippingOptions": {
                  "type": "array",
                  "items": {
                    "type": "object",
                    "properties": {
                      "amountCents": {
                        "type": "integer",
                        "minimum": 0
                      },
                      "carrier": {
                        "anyOf": [
                          {
                            "type": "string"
                          },
                          {
                            "type": "null"
                          }
                        ]
                      },
                      "currency": {
                        "type": "string",
                        "enum": [
                          "USD"
                        ]
                      },
                      "destinationTypes": {
                        "type": "array",
                        "items": {
                          "type": "string",
                          "enum": [
                            "patient",
                            "practice"
                          ]
                        }
                      },
                      "estimatedDaysMax": {
                        "anyOf": [
                          {
                            "type": "integer",
                            "minimum": 0
                          },
                          {
                            "type": "null"
                          }
                        ]
                      },
                      "estimatedDaysMin": {
                        "anyOf": [
                          {
                            "type": "integer",
                            "minimum": 0
                          },
                          {
                            "type": "null"
                          }
                        ]
                      },
                      "id": {
                        "type": "string",
                        "pattern": "^shp_[0-7][0-9a-hjkmnp-tv-z]{25}$",
                        "examples": [
                          "shp_01j2y8m6jcc9tt24af5pw9x1bc"
                        ]
                      },
                      "label": {
                        "type": "string"
                      },
                      "serviceLevel": {
                        "type": "string"
                      },
                      "temperatures": {
                        "type": "array",
                        "items": {
                          "type": "string",
                          "enum": [
                            "ambient",
                            "refrigerated"
                          ]
                        }
                      }
                    },
                    "required": [
                      "amountCents",
                      "carrier",
                      "currency",
                      "destinationTypes",
                      "estimatedDaysMax",
                      "estimatedDaysMin",
                      "id",
                      "label",
                      "serviceLevel",
                      "temperatures"
                    ],
                    "additionalProperties": false
                  }
                },
                "supportedStates": {
                  "type": "array",
                  "items": {
                    "type": "string"
                  }
                }
              },
              "required": [
                "access",
                "catalogItemCount",
                "facilityType",
                "facilityLocations",
                "id",
                "livemode",
                "logoUrl",
                "name",
                "object",
                "prescriptionsLast30Days",
                "profile",
                "restrictedStates",
                "shippingOptions",
                "supportedStates"
              ],
              "additionalProperties": false
            }
          },
          "hasMore": {
            "type": "boolean"
          },
          "object": {
            "type": "string",
            "enum": [
              "list"
            ]
          },
          "url": {
            "type": "string",
            "enum": [
              "/v1/pharmacies"
            ]
          }
        },
        "required": [
          "data",
          "hasMore",
          "object",
          "url"
        ],
        "additionalProperties": false
      },
      "ListShippingOptionsResponse": {
        "title": "ListShippingOptionsResponse",
        "type": "array",
        "items": {
          "type": "object",
          "properties": {
            "amountCents": {
              "type": "integer",
              "allOf": [
                {
                  "minimum": 0
                }
              ]
            },
            "carrier": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ]
            },
            "currency": {
              "type": "string",
              "enum": [
                "USD"
              ]
            },
            "estimatedDaysMax": {
              "anyOf": [
                {
                  "type": "integer",
                  "allOf": [
                    {
                      "minimum": 0
                    }
                  ]
                },
                {
                  "type": "null"
                }
              ]
            },
            "estimatedDaysMin": {
              "anyOf": [
                {
                  "type": "integer",
                  "allOf": [
                    {
                      "minimum": 0
                    }
                  ]
                },
                {
                  "type": "null"
                }
              ]
            },
            "id": {
              "type": "string",
              "allOf": [
                {
                  "pattern": "^shp_[0-7][0-9a-hjkmnp-tv-z]{25}$",
                  "examples": [
                    "shp_01j2y8m6jcc9tt24af5pw9x1bc"
                  ]
                }
              ]
            },
            "label": {
              "type": "string"
            },
            "serviceLevel": {
              "type": "string"
            },
            "temperature": {
              "type": "string",
              "enum": [
                "ambient",
                "refrigerated"
              ]
            }
          },
          "required": [
            "amountCents",
            "carrier",
            "currency",
            "estimatedDaysMax",
            "estimatedDaysMin",
            "id",
            "label",
            "serviceLevel",
            "temperature"
          ],
          "additionalProperties": false
        },
        "maxItems": 50
      },
      "ListOrdersResponse": {
        "title": "ListOrdersResponse",
        "type": "object",
        "properties": {
          "data": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "revision": {
                  "type": "string",
                  "pattern": "^rev_[a-f0-9]{64}$",
                  "description": "Opaque revision of the complete order prescription set. Send the revision you reviewed as expectedRevision; never replace it automatically after a conflict."
                },
                "otcItems": {
                  "type": "array",
                  "items": {
                    "type": "object",
                    "properties": {
                      "catalogItemId": {
                        "type": "string",
                        "allOf": [
                          {
                            "pattern": "^cat_[0-7][0-9a-hjkmnp-tv-z]{25}$",
                            "examples": [
                              "cat_01j2y8m6jcc9tt24af5pw9x1bc"
                            ]
                          }
                        ]
                      },
                      "prescriptionId": {
                        "type": "string",
                        "allOf": [
                          {
                            "pattern": "^rx_[0-7][0-9a-hjkmnp-tv-z]{25}$",
                            "examples": [
                              "rx_01j2y8m6jcc9tt24af5pw9x1bc"
                            ]
                          }
                        ]
                      },
                      "name": {
                        "type": "string"
                      },
                      "quantity": {
                        "type": "integer"
                      },
                      "unitPriceCents": {
                        "type": "integer"
                      },
                      "subtotalCents": {
                        "type": "integer"
                      }
                    },
                    "required": [
                      "catalogItemId",
                      "prescriptionId",
                      "name",
                      "quantity",
                      "unitPriceCents",
                      "subtotalCents"
                    ],
                    "additionalProperties": false
                  }
                },
                "practiceMedicationTotalCents": {
                  "anyOf": [
                    {
                      "type": "integer"
                    },
                    {
                      "type": "null"
                    }
                  ],
                  "description": "Snapshot of the practice-facing medication total. Null until every prescription has recorded submission pricing. Excludes shipping and supplies."
                },
                "externalOrderId": {
                  "anyOf": [
                    {
                      "type": "string",
                      "allOf": [
                        {
                          "minLength": 1
                        },
                        {
                          "maxLength": 200
                        },
                        {
                          "pattern": "\\S"
                        },
                        {
                          "pattern": "^[^\\p{Cc}\\p{Cs}]*$"
                        }
                      ]
                    },
                    {
                      "type": "null"
                    }
                  ]
                },
                "metadata": {
                  "type": "object",
                  "additionalProperties": {
                    "anyOf": [
                      {
                        "type": "string",
                        "allOf": [
                          {
                            "pattern": "^[^\\p{Cs}]*$"
                          },
                          {
                            "maxLength": 500
                          }
                        ]
                      },
                      {
                        "type": "number"
                      },
                      {
                        "type": "boolean"
                      },
                      {
                        "type": "null"
                      }
                    ]
                  },
                  "allOf": [
                    {
                      "propertyNames": {
                        "type": "string",
                        "allOf": [
                          {
                            "pattern": "^[^\\p{Cs}]*$"
                          },
                          {
                            "minLength": 1
                          },
                          {
                            "maxLength": 40
                          }
                        ]
                      }
                    },
                    {
                      "maxProperties": 20
                    }
                  ]
                },
                "createdAt": {
                  "type": "string"
                },
                "fulfillments": {
                  "type": "array",
                  "items": {
                    "type": "object",
                    "properties": {
                      "carrier": {
                        "anyOf": [
                          {
                            "type": "string"
                          },
                          {
                            "type": "null"
                          }
                        ]
                      },
                      "cancellations": {
                        "type": "array",
                        "items": {
                          "type": "object",
                          "properties": {
                            "attempts": {
                              "type": "integer"
                            },
                            "confirmedAt": {
                              "anyOf": [
                                {
                                  "type": "string"
                                },
                                {
                                  "type": "null"
                                }
                              ]
                            },
                            "createdAt": {
                              "type": "string"
                            },
                            "errorCode": {
                              "anyOf": [
                                {
                                  "type": "string"
                                },
                                {
                                  "type": "null"
                                }
                              ]
                            },
                            "errorMessage": {
                              "anyOf": [
                                {
                                  "type": "string"
                                },
                                {
                                  "type": "null"
                                }
                              ]
                            },
                            "id": {
                              "type": "string",
                              "allOf": [
                                {
                                  "pattern": "^cancl_[0-7][0-9a-hjkmnp-tv-z]{25}$",
                                  "examples": [
                                    "cancl_01j2y8m6jcc9tt24af5pw9x1bc"
                                  ]
                                }
                              ]
                            },
                            "providerStatus": {
                              "anyOf": [
                                {
                                  "type": "string"
                                },
                                {
                                  "type": "null"
                                }
                              ]
                            },
                            "reason": {
                              "type": "string"
                            },
                            "requestedAt": {
                              "type": "string"
                            },
                            "requestedBy": {
                              "type": "object",
                              "properties": {
                                "id": {
                                  "type": "string"
                                },
                                "type": {
                                  "type": "string"
                                }
                              },
                              "required": [
                                "id",
                                "type"
                              ],
                              "additionalProperties": false
                            },
                            "resolvedAt": {
                              "anyOf": [
                                {
                                  "type": "string"
                                },
                                {
                                  "type": "null"
                                }
                              ]
                            },
                            "sentAt": {
                              "anyOf": [
                                {
                                  "type": "string"
                                },
                                {
                                  "type": "null"
                                }
                              ]
                            },
                            "source": {
                              "type": "string",
                              "enum": [
                                "provider",
                                "platform",
                                "public_api",
                                "pharmacy",
                                "system"
                              ]
                            },
                            "status": {
                              "type": "string",
                              "enum": [
                                "requested",
                                "sent",
                                "confirmed",
                                "rejected",
                                "failed",
                                "too_late"
                              ]
                            },
                            "updatedAt": {
                              "type": "string"
                            }
                          },
                          "required": [
                            "attempts",
                            "confirmedAt",
                            "createdAt",
                            "errorCode",
                            "errorMessage",
                            "id",
                            "providerStatus",
                            "reason",
                            "requestedAt",
                            "requestedBy",
                            "resolvedAt",
                            "sentAt",
                            "source",
                            "status",
                            "updatedAt"
                          ],
                          "additionalProperties": false
                        }
                      },
                      "pharmacyId": {
                        "anyOf": [
                          {
                            "type": "string",
                            "allOf": [
                              {
                                "pattern": "^pharm_[0-7][0-9a-hjkmnp-tv-z]{25}$",
                                "examples": [
                                  "pharm_01j2y8m6jcc9tt24af5pw9x1bc"
                                ]
                              }
                            ]
                          },
                          {
                            "type": "null"
                          }
                        ]
                      },
                      "createdAt": {
                        "type": "string"
                      },
                      "id": {
                        "type": "string",
                        "allOf": [
                          {
                            "pattern": "^ord_[0-7][0-9a-hjkmnp-tv-z]{25}$",
                            "examples": [
                              "ord_01j2y8m6jcc9tt24af5pw9x1bc"
                            ]
                          }
                        ]
                      },
                      "prescriptionId": {
                        "type": "string",
                        "allOf": [
                          {
                            "pattern": "^rx_[0-7][0-9a-hjkmnp-tv-z]{25}$",
                            "examples": [
                              "rx_01j2y8m6jcc9tt24af5pw9x1bc"
                            ]
                          }
                        ]
                      },
                      "status": {
                        "type": "string"
                      },
                      "trackingNumber": {
                        "anyOf": [
                          {
                            "type": "string"
                          },
                          {
                            "type": "null"
                          }
                        ]
                      },
                      "trackingStatus": {
                        "anyOf": [
                          {
                            "type": "string"
                          },
                          {
                            "type": "null"
                          }
                        ]
                      },
                      "shippedAt": {
                        "anyOf": [
                          {
                            "type": "string"
                          },
                          {
                            "type": "null"
                          }
                        ]
                      },
                      "deliveredAt": {
                        "anyOf": [
                          {
                            "type": "string"
                          },
                          {
                            "type": "null"
                          }
                        ]
                      },
                      "estimatedDeliveryAt": {
                        "anyOf": [
                          {
                            "type": "string"
                          },
                          {
                            "type": "null"
                          }
                        ]
                      },
                      "exceptions": {
                        "type": "array",
                        "items": {
                          "type": "object",
                          "properties": {
                            "actionable": {
                              "type": "boolean"
                            },
                            "assignedTo": {
                              "anyOf": [
                                {
                                  "type": "object",
                                  "properties": {
                                    "id": {
                                      "type": "string"
                                    },
                                    "name": {
                                      "type": "string"
                                    }
                                  },
                                  "required": [
                                    "id",
                                    "name"
                                  ],
                                  "additionalProperties": false
                                },
                                {
                                  "type": "null"
                                }
                              ]
                            },
                            "createdAt": {
                              "type": "string"
                            },
                            "dueAt": {
                              "anyOf": [
                                {
                                  "type": "string"
                                },
                                {
                                  "type": "null"
                                }
                              ]
                            },
                            "id": {
                              "type": "string",
                              "allOf": [
                                {
                                  "pattern": "^fex_[0-7][0-9a-hjkmnp-tv-z]{25}$",
                                  "examples": [
                                    "fex_01j2y8m6jcc9tt24af5pw9x1bc"
                                  ]
                                }
                              ]
                            },
                            "kind": {
                              "type": "string"
                            },
                            "resolution": {
                              "anyOf": [
                                {
                                  "type": "string"
                                },
                                {
                                  "type": "null"
                                }
                              ]
                            },
                            "resolvedAt": {
                              "anyOf": [
                                {
                                  "type": "string"
                                },
                                {
                                  "type": "null"
                                }
                              ]
                            },
                            "retryable": {
                              "type": "boolean"
                            },
                            "severity": {
                              "type": "string",
                              "enum": [
                                "warning",
                                "critical"
                              ]
                            },
                            "status": {
                              "type": "string",
                              "enum": [
                                "open",
                                "acknowledged",
                                "resolved"
                              ]
                            },
                            "summary": {
                              "type": "string"
                            },
                            "updatedAt": {
                              "type": "string"
                            }
                          },
                          "required": [
                            "actionable",
                            "assignedTo",
                            "createdAt",
                            "dueAt",
                            "id",
                            "kind",
                            "resolution",
                            "resolvedAt",
                            "retryable",
                            "severity",
                            "status",
                            "summary",
                            "updatedAt"
                          ],
                          "additionalProperties": false
                        }
                      },
                      "shipping": {
                        "type": "object",
                        "properties": {
                          "destinationType": {
                            "type": "string",
                            "enum": [
                              "patient",
                              "practice"
                            ]
                          },
                          "method": {
                            "type": "string",
                            "enum": [
                              "standard",
                              "expedited",
                              "overnight",
                              "pickup",
                              "local_delivery"
                            ]
                          },
                          "option": {
                            "anyOf": [
                              {
                                "type": "object",
                                "properties": {
                                  "amountCents": {
                                    "type": "integer",
                                    "allOf": [
                                      {
                                        "minimum": 0
                                      }
                                    ]
                                  },
                                  "currency": {
                                    "type": "string",
                                    "enum": [
                                      "USD"
                                    ]
                                  },
                                  "label": {
                                    "type": "string"
                                  },
                                  "serviceLevel": {
                                    "type": "string"
                                  },
                                  "temperature": {
                                    "type": "string",
                                    "enum": [
                                      "ambient",
                                      "refrigerated"
                                    ]
                                  }
                                },
                                "required": [
                                  "amountCents",
                                  "currency",
                                  "label",
                                  "serviceLevel",
                                  "temperature"
                                ],
                                "additionalProperties": false
                              },
                              {
                                "type": "null"
                              }
                            ]
                          }
                        },
                        "required": [
                          "destinationType",
                          "method",
                          "option"
                        ],
                        "additionalProperties": false
                      },
                      "shipments": {
                        "type": "array",
                        "items": {
                          "type": "object",
                          "properties": {
                            "carrier": {
                              "anyOf": [
                                {
                                  "type": "string"
                                },
                                {
                                  "type": "null"
                                }
                              ]
                            },
                            "createdAt": {
                              "type": "string"
                            },
                            "deliveredAt": {
                              "anyOf": [
                                {
                                  "type": "string"
                                },
                                {
                                  "type": "null"
                                }
                              ]
                            },
                            "estimatedDeliveryAt": {
                              "anyOf": [
                                {
                                  "type": "string"
                                },
                                {
                                  "type": "null"
                                }
                              ]
                            },
                            "id": {
                              "type": "string",
                              "allOf": [
                                {
                                  "pattern": "^ship_[0-7][0-9a-hjkmnp-tv-z]{25}$",
                                  "examples": [
                                    "ship_01j2y8m6jcc9tt24af5pw9x1bc"
                                  ]
                                }
                              ]
                            },
                            "isActive": {
                              "type": "boolean"
                            },
                            "providerStatus": {
                              "anyOf": [
                                {
                                  "type": "string"
                                },
                                {
                                  "type": "null"
                                }
                              ]
                            },
                            "replacedAt": {
                              "anyOf": [
                                {
                                  "type": "string"
                                },
                                {
                                  "type": "null"
                                }
                              ]
                            },
                            "replacesShipmentId": {
                              "anyOf": [
                                {
                                  "type": "string",
                                  "allOf": [
                                    {
                                      "pattern": "^ship_[0-7][0-9a-hjkmnp-tv-z]{25}$",
                                      "examples": [
                                        "ship_01j2y8m6jcc9tt24af5pw9x1bc"
                                      ]
                                    }
                                  ]
                                },
                                {
                                  "type": "null"
                                }
                              ]
                            },
                            "shippedAt": {
                              "anyOf": [
                                {
                                  "type": "string"
                                },
                                {
                                  "type": "null"
                                }
                              ]
                            },
                            "source": {
                              "type": "string",
                              "enum": [
                                "pharmacy_webhook",
                                "pharmacy",
                                "system"
                              ]
                            },
                            "status": {
                              "type": "string",
                              "enum": [
                                "label_created",
                                "carrier_possession",
                                "in_transit",
                                "out_for_delivery",
                                "delivered",
                                "delayed",
                                "delivery_failed",
                                "returned",
                                "voided",
                                "unknown"
                              ]
                            },
                            "trackingNumber": {
                              "anyOf": [
                                {
                                  "type": "string"
                                },
                                {
                                  "type": "null"
                                }
                              ]
                            },
                            "trackingUrl": {
                              "anyOf": [
                                {
                                  "type": "string"
                                },
                                {
                                  "type": "null"
                                }
                              ]
                            },
                            "updatedAt": {
                              "type": "string"
                            },
                            "voidedAt": {
                              "anyOf": [
                                {
                                  "type": "string"
                                },
                                {
                                  "type": "null"
                                }
                              ]
                            }
                          },
                          "required": [
                            "carrier",
                            "createdAt",
                            "deliveredAt",
                            "estimatedDeliveryAt",
                            "id",
                            "isActive",
                            "providerStatus",
                            "replacedAt",
                            "replacesShipmentId",
                            "shippedAt",
                            "source",
                            "status",
                            "trackingNumber",
                            "trackingUrl",
                            "updatedAt",
                            "voidedAt"
                          ],
                          "additionalProperties": false
                        }
                      },
                      "trackingUrl": {
                        "anyOf": [
                          {
                            "type": "string"
                          },
                          {
                            "type": "null"
                          }
                        ]
                      },
                      "updatedAt": {
                        "type": "string"
                      }
                    },
                    "required": [
                      "carrier",
                      "cancellations",
                      "pharmacyId",
                      "createdAt",
                      "id",
                      "prescriptionId",
                      "status",
                      "trackingNumber",
                      "trackingStatus",
                      "shippedAt",
                      "deliveredAt",
                      "estimatedDeliveryAt",
                      "exceptions",
                      "shipping",
                      "shipments",
                      "trackingUrl",
                      "updatedAt"
                    ],
                    "additionalProperties": false
                  }
                },
                "id": {
                  "type": "string",
                  "pattern": "^ord_[0-7][0-9a-hjkmnp-tv-z]{25}$",
                  "examples": [
                    "ord_01j2y8m6jcc9tt24af5pw9x1bc"
                  ]
                },
                "lifecycleEvents": {
                  "type": "array",
                  "items": {
                    "type": "object",
                    "properties": {
                      "createdAt": {
                        "type": "string"
                      },
                      "eventType": {
                        "type": "string"
                      },
                      "id": {
                        "type": "string"
                      },
                      "message": {
                        "type": "string"
                      },
                      "source": {
                        "type": "string",
                        "enum": [
                          "cancellation",
                          "exception",
                          "fulfillment",
                          "integration",
                          "shipment",
                          "webhook"
                        ]
                      }
                    },
                    "required": [
                      "createdAt",
                      "eventType",
                      "id",
                      "message",
                      "source"
                    ],
                    "additionalProperties": false
                  }
                },
                "livemode": {
                  "type": "boolean"
                },
                "object": {
                  "type": "string",
                  "enum": [
                    "order"
                  ]
                },
                "patientExternalId": {
                  "anyOf": [
                    {
                      "type": "string"
                    },
                    {
                      "type": "null"
                    }
                  ]
                },
                "patientId": {
                  "type": "string",
                  "pattern": "^pat_[0-7][0-9a-hjkmnp-tv-z]{25}$",
                  "examples": [
                    "pat_01j2y8m6jcc9tt24af5pw9x1bc"
                  ]
                },
                "patientName": {
                  "type": "string"
                },
                "patientState": {
                  "type": "string",
                  "description": "The patient's current clinical state. This is not the saved delivery state; use each prescription's deliveryAddress for shipping."
                },
                "practiceId": {
                  "type": "string",
                  "pattern": "^prac_[0-7][0-9a-hjkmnp-tv-z]{25}$",
                  "examples": [
                    "prac_01j2y8m6jcc9tt24af5pw9x1bc"
                  ]
                },
                "prescriberName": {
                  "anyOf": [
                    {
                      "type": "string"
                    },
                    {
                      "type": "null"
                    }
                  ]
                },
                "prescriberNpi": {
                  "anyOf": [
                    {
                      "type": "string"
                    },
                    {
                      "type": "null"
                    }
                  ]
                },
                "review": {
                  "anyOf": [
                    {
                      "type": "object",
                      "properties": {
                        "status": {
                          "type": "string",
                          "enum": [
                            "completed",
                            "rejected"
                          ]
                        },
                        "reason": {
                          "anyOf": [
                            {
                              "type": "string"
                            },
                            {
                              "type": "null"
                            }
                          ]
                        },
                        "requestedAt": {
                          "type": "string"
                        },
                        "completedAt": {
                          "anyOf": [
                            {
                              "type": "string"
                            },
                            {
                              "type": "null"
                            }
                          ]
                        },
                        "canceledAt": {
                          "anyOf": [
                            {
                              "type": "string"
                            },
                            {
                              "type": "null"
                            }
                          ]
                        },
                        "resolvedAt": {
                          "anyOf": [
                            {
                              "type": "string"
                            },
                            {
                              "type": "null"
                            }
                          ]
                        },
                        "resolvedBy": {
                          "anyOf": [
                            {
                              "type": "object",
                              "properties": {
                                "id": {
                                  "type": "string"
                                },
                                "type": {
                                  "type": "string"
                                }
                              },
                              "required": [
                                "id",
                                "type"
                              ],
                              "additionalProperties": false
                            },
                            {
                              "type": "null"
                            }
                          ]
                        },
                        "providerId": {
                          "anyOf": [
                            {
                              "type": "string",
                              "allOf": [
                                {
                                  "pattern": "^prov_[0-7][0-9a-hjkmnp-tv-z]{25}$",
                                  "examples": [
                                    "prov_01j2y8m6jcc9tt24af5pw9x1bc"
                                  ]
                                }
                              ]
                            },
                            {
                              "type": "null"
                            }
                          ]
                        }
                      },
                      "required": [
                        "status",
                        "reason",
                        "requestedAt",
                        "completedAt",
                        "canceledAt",
                        "resolvedAt",
                        "resolvedBy",
                        "providerId"
                      ],
                      "additionalProperties": false
                    },
                    {
                      "type": "null"
                    }
                  ]
                },
                "prescriptions": {
                  "type": "array",
                  "items": {
                    "type": "object",
                    "properties": {
                      "version": {
                        "type": "integer"
                      },
                      "daysSupply": {
                        "anyOf": [
                          {
                            "anyOf": [
                              {
                                "type": "number"
                              },
                              {
                                "type": "string",
                                "enum": [
                                  "Infinity",
                                  "-Infinity",
                                  "NaN"
                                ]
                              }
                            ]
                          },
                          {
                            "type": "null"
                          }
                        ]
                      },
                      "patientSnapshot": {
                        "type": "object",
                        "properties": {
                          "address": {
                            "anyOf": [
                              {
                                "type": "object"
                              },
                              {
                                "type": "null"
                              }
                            ]
                          },
                          "allergyReviewStatus": {
                            "anyOf": [
                              {
                                "type": "string",
                                "enum": [
                                  "no_known",
                                  "not_reviewed",
                                  "recorded"
                                ]
                              },
                              {
                                "type": "null"
                              }
                            ]
                          },
                          "dateOfBirth": {
                            "type": "string"
                          },
                          "email": {
                            "anyOf": [
                              {
                                "type": "string"
                              },
                              {
                                "type": "null"
                              }
                            ]
                          },
                          "gender": {
                            "anyOf": [
                              {
                                "type": "string",
                                "enum": [
                                  "f",
                                  "m",
                                  "o",
                                  "u"
                                ]
                              },
                              {
                                "type": "null"
                              }
                            ]
                          },
                          "legalName": {
                            "type": "string"
                          },
                          "phone": {
                            "anyOf": [
                              {
                                "type": "string"
                              },
                              {
                                "type": "null"
                              }
                            ]
                          },
                          "state": {
                            "type": "string"
                          }
                        },
                        "required": [
                          "dateOfBirth",
                          "legalName",
                          "state"
                        ],
                        "additionalProperties": false
                      },
                      "deliveryAddress": {
                        "anyOf": [
                          {
                            "type": "object"
                          },
                          {
                            "type": "null"
                          }
                        ],
                        "description": "The saved delivery address for this prescription version. Patient profile updates do not replace it. Review this address before signing."
                      },
                      "deliveryAddressDiffersFromPatient": {
                        "type": "boolean",
                        "description": "Whether the saved delivery address differs from the current primary patient address. This can be intentional; confirm the delivery address before signing."
                      },
                      "providerSnapshot": {
                        "anyOf": [
                          {
                            "type": "object",
                            "properties": {
                              "address": {
                                "anyOf": [
                                  {
                                    "type": "object"
                                  },
                                  {
                                    "type": "null"
                                  }
                                ]
                              },
                              "credentials": {
                                "anyOf": [
                                  {
                                    "type": "string"
                                  },
                                  {
                                    "type": "null"
                                  }
                                ]
                              },
                              "legalName": {
                                "type": "string"
                              },
                              "licenseNumber": {
                                "anyOf": [
                                  {
                                    "type": "string"
                                  },
                                  {
                                    "type": "null"
                                  }
                                ]
                              },
                              "licenseState": {
                                "anyOf": [
                                  {
                                    "type": "string"
                                  },
                                  {
                                    "type": "null"
                                  }
                                ]
                              },
                              "licenseExpiresAt": {
                                "anyOf": [
                                  {
                                    "type": "string"
                                  },
                                  {
                                    "type": "null"
                                  }
                                ]
                              },
                              "npi": {
                                "type": "string"
                              },
                              "phone": {
                                "anyOf": [
                                  {
                                    "type": "string"
                                  },
                                  {
                                    "type": "null"
                                  }
                                ]
                              }
                            },
                            "required": [
                              "legalName",
                              "npi"
                            ],
                            "additionalProperties": false
                          },
                          {
                            "type": "null"
                          }
                        ]
                      },
                      "clinical": {
                        "anyOf": [
                          {
                            "type": "object",
                            "properties": {
                              "allergies": {
                                "anyOf": [
                                  {
                                    "type": "array",
                                    "items": {
                                      "type": "object",
                                      "properties": {
                                        "code": {
                                          "anyOf": [
                                            {
                                              "type": "string"
                                            },
                                            {
                                              "type": "null"
                                            }
                                          ]
                                        },
                                        "codeSystem": {
                                          "anyOf": [
                                            {
                                              "type": "string"
                                            },
                                            {
                                              "type": "null"
                                            }
                                          ]
                                        },
                                        "display": {
                                          "type": "string"
                                        },
                                        "source": {
                                          "anyOf": [
                                            {
                                              "type": "string"
                                            },
                                            {
                                              "type": "null"
                                            }
                                          ]
                                        },
                                        "category": {
                                          "anyOf": [
                                            {
                                              "type": "string"
                                            },
                                            {
                                              "type": "null"
                                            }
                                          ]
                                        },
                                        "severity": {
                                          "anyOf": [
                                            {
                                              "anyOf": [
                                                {
                                                  "type": "string"
                                                },
                                                {
                                                  "type": "null"
                                                }
                                              ]
                                            },
                                            {
                                              "type": "null"
                                            }
                                          ]
                                        },
                                        "type": {
                                          "anyOf": [
                                            {
                                              "anyOf": [
                                                {
                                                  "type": "string"
                                                },
                                                {
                                                  "type": "null"
                                                }
                                              ]
                                            },
                                            {
                                              "type": "null"
                                            }
                                          ]
                                        },
                                        "verificationStatus": {
                                          "anyOf": [
                                            {
                                              "anyOf": [
                                                {
                                                  "type": "string"
                                                },
                                                {
                                                  "type": "null"
                                                }
                                              ]
                                            },
                                            {
                                              "type": "null"
                                            }
                                          ]
                                        },
                                        "reactions": {
                                          "anyOf": [
                                            {
                                              "type": "array",
                                              "items": {
                                                "type": "object",
                                                "properties": {
                                                  "code": {
                                                    "anyOf": [
                                                      {
                                                        "type": "string"
                                                      },
                                                      {
                                                        "type": "null"
                                                      }
                                                    ]
                                                  },
                                                  "codeSystem": {
                                                    "anyOf": [
                                                      {
                                                        "type": "string"
                                                      },
                                                      {
                                                        "type": "null"
                                                      }
                                                    ]
                                                  },
                                                  "display": {
                                                    "type": "string"
                                                  },
                                                  "source": {
                                                    "anyOf": [
                                                      {
                                                        "type": "string"
                                                      },
                                                      {
                                                        "type": "null"
                                                      }
                                                    ]
                                                  }
                                                },
                                                "required": [
                                                  "display"
                                                ],
                                                "additionalProperties": false
                                              }
                                            },
                                            {
                                              "type": "null"
                                            }
                                          ]
                                        }
                                      },
                                      "required": [
                                        "display"
                                      ],
                                      "additionalProperties": false
                                    }
                                  },
                                  {
                                    "type": "null"
                                  }
                                ]
                              },
                              "medicationReviewStatus": {
                                "anyOf": [
                                  {
                                    "type": "string",
                                    "enum": [
                                      "not_reviewed",
                                      "none",
                                      "recorded"
                                    ]
                                  },
                                  {
                                    "type": "null"
                                  }
                                ]
                              },
                              "diagnosisReviewStatus": {
                                "anyOf": [
                                  {
                                    "type": "string",
                                    "enum": [
                                      "not_reviewed",
                                      "none",
                                      "recorded"
                                    ]
                                  },
                                  {
                                    "type": "null"
                                  }
                                ]
                              },
                              "conditions": {
                                "anyOf": [
                                  {
                                    "type": "array",
                                    "items": {
                                      "type": "object",
                                      "properties": {
                                        "code": {
                                          "anyOf": [
                                            {
                                              "type": "string"
                                            },
                                            {
                                              "type": "null"
                                            }
                                          ]
                                        },
                                        "codeSystem": {
                                          "anyOf": [
                                            {
                                              "type": "string"
                                            },
                                            {
                                              "type": "null"
                                            }
                                          ]
                                        },
                                        "display": {
                                          "type": "string"
                                        },
                                        "source": {
                                          "anyOf": [
                                            {
                                              "type": "string"
                                            },
                                            {
                                              "type": "null"
                                            }
                                          ]
                                        }
                                      },
                                      "required": [
                                        "display"
                                      ],
                                      "additionalProperties": false
                                    }
                                  },
                                  {
                                    "type": "null"
                                  }
                                ]
                              },
                              "compoundingReason": {
                                "anyOf": [
                                  {
                                    "type": "object",
                                    "properties": {
                                      "category": {
                                        "anyOf": [
                                          {
                                            "type": "string"
                                          },
                                          {
                                            "type": "null"
                                          }
                                        ]
                                      },
                                      "context": {
                                        "type": "string"
                                      }
                                    },
                                    "required": [
                                      "context"
                                    ],
                                    "additionalProperties": false
                                  },
                                  {
                                    "type": "null"
                                  }
                                ]
                              },
                              "medications": {
                                "anyOf": [
                                  {
                                    "type": "array",
                                    "items": {
                                      "type": "object",
                                      "properties": {
                                        "display": {
                                          "type": "string"
                                        },
                                        "ndc": {
                                          "anyOf": [
                                            {
                                              "type": "string"
                                            },
                                            {
                                              "type": "null"
                                            }
                                          ]
                                        },
                                        "rxNormCui": {
                                          "anyOf": [
                                            {
                                              "type": "string"
                                            },
                                            {
                                              "type": "null"
                                            }
                                          ]
                                        },
                                        "source": {
                                          "anyOf": [
                                            {
                                              "type": "string"
                                            },
                                            {
                                              "type": "null"
                                            }
                                          ]
                                        }
                                      },
                                      "required": [
                                        "display"
                                      ],
                                      "additionalProperties": false
                                    }
                                  },
                                  {
                                    "type": "null"
                                  }
                                ]
                              },
                              "observations": {
                                "anyOf": [
                                  {
                                    "type": "array",
                                    "items": {
                                      "type": "object",
                                      "properties": {
                                        "code": {
                                          "anyOf": [
                                            {
                                              "type": "string"
                                            },
                                            {
                                              "type": "null"
                                            }
                                          ]
                                        },
                                        "display": {
                                          "type": "string"
                                        },
                                        "value": {
                                          "anyOf": [
                                            {
                                              "type": "number"
                                            },
                                            {
                                              "type": "string",
                                              "enum": [
                                                "Infinity",
                                                "-Infinity",
                                                "NaN"
                                              ]
                                            }
                                          ]
                                        },
                                        "unit": {
                                          "type": "string"
                                        }
                                      },
                                      "required": [
                                        "display",
                                        "value",
                                        "unit"
                                      ],
                                      "additionalProperties": false
                                    }
                                  },
                                  {
                                    "type": "null"
                                  }
                                ]
                              }
                            },
                            "additionalProperties": false
                          },
                          {
                            "type": "null"
                          }
                        ]
                      },
                      "dispensing": {
                        "anyOf": [
                          {
                            "type": "object",
                            "properties": {
                              "dispenseUponAcceptance": {
                                "type": "boolean"
                              },
                              "substitutionPermitted": {
                                "type": "boolean"
                              },
                              "pharmacyNotes": {
                                "anyOf": [
                                  {
                                    "type": "string"
                                  },
                                  {
                                    "type": "null"
                                  }
                                ]
                              },
                              "requestedFillDate": {
                                "anyOf": [
                                  {
                                    "type": "string"
                                  },
                                  {
                                    "type": "null"
                                  }
                                ]
                              },
                              "shippingOptionId": {
                                "anyOf": [
                                  {
                                    "type": "string"
                                  },
                                  {
                                    "type": "null"
                                  }
                                ]
                              },
                              "shippingAmountCents": {
                                "anyOf": [
                                  {
                                    "type": "integer"
                                  },
                                  {
                                    "type": "null"
                                  }
                                ]
                              },
                              "shippingDestinationType": {
                                "anyOf": [
                                  {
                                    "type": "string",
                                    "enum": [
                                      "patient",
                                      "practice"
                                    ]
                                  },
                                  {
                                    "type": "null"
                                  }
                                ]
                              }
                            },
                            "required": [
                              "dispenseUponAcceptance",
                              "substitutionPermitted"
                            ],
                            "additionalProperties": false
                          },
                          {
                            "type": "null"
                          }
                        ]
                      },
                      "structuredSig": {
                        "anyOf": [
                          {
                            "type": "object",
                            "properties": {
                              "dose": {
                                "type": "string"
                              },
                              "doseUnit": {
                                "type": "string"
                              },
                              "frequency": {
                                "type": "string"
                              },
                              "route": {
                                "type": "string"
                              },
                              "prn": {
                                "type": "boolean"
                              },
                              "duration": {
                                "anyOf": [
                                  {
                                    "type": "string"
                                  },
                                  {
                                    "type": "null"
                                  }
                                ]
                              },
                              "indication": {
                                "anyOf": [
                                  {
                                    "type": "string"
                                  },
                                  {
                                    "type": "null"
                                  }
                                ]
                              },
                              "maxDailyUse": {
                                "anyOf": [
                                  {
                                    "type": "string"
                                  },
                                  {
                                    "type": "null"
                                  }
                                ]
                              },
                              "titrationSchedule": {
                                "anyOf": [
                                  {
                                    "type": "string"
                                  },
                                  {
                                    "type": "null"
                                  }
                                ]
                              }
                            },
                            "required": [
                              "dose",
                              "doseUnit",
                              "frequency",
                              "route",
                              "prn"
                            ],
                            "additionalProperties": false
                          },
                          {
                            "type": "null"
                          }
                        ]
                      },
                      "externalPrescriptionId": {
                        "anyOf": [
                          {
                            "type": "string",
                            "allOf": [
                              {
                                "minLength": 1
                              },
                              {
                                "maxLength": 200
                              },
                              {
                                "pattern": "\\S"
                              },
                              {
                                "pattern": "^[^\\p{Cc}\\p{Cs}]*$"
                              }
                            ]
                          },
                          {
                            "type": "null"
                          }
                        ]
                      },
                      "catalogItemId": {
                        "anyOf": [
                          {
                            "type": "string",
                            "allOf": [
                              {
                                "pattern": "^cat_[0-7][0-9a-hjkmnp-tv-z]{25}$",
                                "examples": [
                                  "cat_01j2y8m6jcc9tt24af5pw9x1bc"
                                ]
                              }
                            ]
                          },
                          {
                            "type": "null"
                          }
                        ]
                      },
                      "pharmacyId": {
                        "anyOf": [
                          {
                            "type": "string",
                            "allOf": [
                              {
                                "pattern": "^pharm_[0-7][0-9a-hjkmnp-tv-z]{25}$",
                                "examples": [
                                  "pharm_01j2y8m6jcc9tt24af5pw9x1bc"
                                ]
                              }
                            ]
                          },
                          {
                            "type": "null"
                          }
                        ]
                      },
                      "pharmacyName": {
                        "anyOf": [
                          {
                            "type": "string"
                          },
                          {
                            "type": "null"
                          }
                        ]
                      },
                      "directions": {
                        "type": "string"
                      },
                      "dosageForm": {
                        "anyOf": [
                          {
                            "type": "string"
                          },
                          {
                            "type": "null"
                          }
                        ]
                      },
                      "id": {
                        "type": "string",
                        "allOf": [
                          {
                            "pattern": "^rx_[0-7][0-9a-hjkmnp-tv-z]{25}$",
                            "examples": [
                              "rx_01j2y8m6jcc9tt24af5pw9x1bc"
                            ]
                          }
                        ]
                      },
                      "medicationName": {
                        "type": "string"
                      },
                      "quantity": {
                        "anyOf": [
                          {
                            "type": "number"
                          },
                          {
                            "type": "string",
                            "enum": [
                              "Infinity",
                              "-Infinity",
                              "NaN"
                            ]
                          }
                        ]
                      },
                      "quantityUnit": {
                        "type": "string"
                      },
                      "refills": {
                        "type": "integer"
                      },
                      "status": {
                        "type": "string"
                      },
                      "strength": {
                        "anyOf": [
                          {
                            "type": "string"
                          },
                          {
                            "type": "null"
                          }
                        ]
                      }
                    },
                    "required": [
                      "version",
                      "daysSupply",
                      "patientSnapshot",
                      "deliveryAddress",
                      "deliveryAddressDiffersFromPatient",
                      "providerSnapshot",
                      "clinical",
                      "dispensing",
                      "structuredSig",
                      "externalPrescriptionId",
                      "catalogItemId",
                      "pharmacyId",
                      "pharmacyName",
                      "directions",
                      "dosageForm",
                      "id",
                      "medicationName",
                      "quantity",
                      "quantityUnit",
                      "refills",
                      "status",
                      "strength"
                    ],
                    "additionalProperties": false
                  },
                  "allOf": [
                    {
                      "minItems": 1
                    }
                  ]
                },
                "status": {
                  "type": "string",
                  "enum": [
                    "blocked",
                    "cancelled",
                    "delivered",
                    "draft",
                    "partially_submitted",
                    "requires_provider_signature",
                    "processing",
                    "ready",
                    "rejected",
                    "shipped",
                    "submitted"
                  ]
                },
                "updatedAt": {
                  "type": "string"
                }
              },
              "required": [
                "revision",
                "otcItems",
                "practiceMedicationTotalCents",
                "externalOrderId",
                "metadata",
                "createdAt",
                "fulfillments",
                "id",
                "lifecycleEvents",
                "livemode",
                "object",
                "patientExternalId",
                "patientId",
                "patientName",
                "patientState",
                "practiceId",
                "prescriberName",
                "prescriberNpi",
                "review",
                "prescriptions",
                "status",
                "updatedAt"
              ],
              "additionalProperties": false
            }
          },
          "hasMore": {
            "type": "boolean"
          },
          "object": {
            "type": "string",
            "enum": [
              "list"
            ]
          },
          "url": {
            "type": "string",
            "enum": [
              "/v1/orders"
            ]
          }
        },
        "required": [
          "data",
          "hasMore",
          "object",
          "url"
        ],
        "additionalProperties": false
      },
      "CreateOrderRequest": {
        "type": "object",
        "properties": {
          "practiceId": {
            "type": "string",
            "pattern": "^prac_[0-7][0-9a-hjkmnp-tv-z]{25}$",
            "examples": [
              "prac_01j2y8m6jcc9tt24af5pw9x1bc"
            ]
          },
          "userId": {
            "anyOf": [
              {
                "type": "string",
                "pattern": "^user_[0-7][0-9a-hjkmnp-tv-z]{25}$",
                "examples": [
                  "user_01j2y8m6jcc9tt24af5pw9x1bc"
                ]
              },
              {
                "type": "null"
              }
            ]
          },
          "prescriber": {
            "anyOf": [
              {
                "type": "object",
                "properties": {
                  "id": {
                    "anyOf": [
                      {
                        "type": "string",
                        "pattern": "^prov_[0-7][0-9a-hjkmnp-tv-z]{25}$",
                        "examples": [
                          "prov_01j2y8m6jcc9tt24af5pw9x1bc"
                        ]
                      },
                      {
                        "type": "null"
                      }
                    ]
                  },
                  "npi": {
                    "anyOf": [
                      {
                        "type": "string"
                      },
                      {
                        "type": "null"
                      }
                    ]
                  },
                  "externalId": {
                    "anyOf": [
                      {
                        "type": "string"
                      },
                      {
                        "type": "null"
                      }
                    ]
                  },
                  "profile": {
                    "anyOf": [
                      {
                        "type": "object",
                        "properties": {
                          "email": {
                            "anyOf": [
                              {
                                "type": "string",
                                "pattern": "^[^\\s@]+@[^\\s@]+\\.[^\\s@]+$"
                              },
                              {
                                "type": "null"
                              }
                            ]
                          },
                          "phone": {
                            "anyOf": [
                              {
                                "type": "string"
                              },
                              {
                                "type": "null"
                              }
                            ]
                          }
                        },
                        "additionalProperties": false
                      },
                      {
                        "type": "null"
                      }
                    ]
                  }
                },
                "additionalProperties": false
              },
              {
                "type": "null"
              }
            ]
          },
          "otcItems": {
            "anyOf": [
              {
                "type": "array",
                "items": {
                  "type": "object",
                  "properties": {
                    "catalogItemId": {
                      "type": "string",
                      "pattern": "^cat_[0-7][0-9a-hjkmnp-tv-z]{25}$",
                      "examples": [
                        "cat_01j2y8m6jcc9tt24af5pw9x1bc"
                      ]
                    },
                    "quantity": {
                      "type": "integer",
                      "minimum": 1,
                      "maximum": 100
                    }
                  },
                  "required": [
                    "catalogItemId",
                    "quantity"
                  ],
                  "additionalProperties": false
                },
                "maxItems": 20
              },
              {
                "type": "null"
              }
            ]
          },
          "externalOrderId": {
            "anyOf": [
              {
                "type": "string",
                "minLength": 1,
                "maxLength": 200,
                "pattern": "\\S",
                "allOf": [
                  {
                    "pattern": "^[^\\p{Cc}\\p{Cs}]*$"
                  }
                ]
              },
              {
                "type": "null"
              }
            ]
          },
          "metadata": {
            "anyOf": [
              {
                "type": "object",
                "additionalProperties": {
                  "anyOf": [
                    {
                      "type": "string",
                      "pattern": "^[^\\p{Cs}]*$",
                      "maxLength": 500
                    },
                    {
                      "type": "number"
                    },
                    {
                      "type": "boolean"
                    },
                    {
                      "type": "null"
                    }
                  ]
                },
                "propertyNames": {
                  "type": "string",
                  "pattern": "^[^\\p{Cs}]*$",
                  "minLength": 1,
                  "maxLength": 40
                },
                "maxProperties": 20
              },
              {
                "type": "null"
              }
            ]
          },
          "patientId": {
            "anyOf": [
              {
                "type": "string",
                "pattern": "^pat_[0-7][0-9a-hjkmnp-tv-z]{25}$",
                "examples": [
                  "pat_01j2y8m6jcc9tt24af5pw9x1bc"
                ]
              },
              {
                "type": "null"
              }
            ]
          },
          "patient": {
            "anyOf": [
              {
                "type": "object",
                "properties": {
                  "address": {
                    "anyOf": [
                      {
                        "anyOf": [
                          {
                            "type": "object",
                            "properties": {
                              "city": {
                                "type": "string",
                                "pattern": "^[^\\u0000\\p{Cs}]*$",
                                "allOf": [
                                  {
                                    "pattern": "^[^\\p{Cc}\\u200B\\u2028-\\u202E\\u2066-\\u2069]*$"
                                  }
                                ]
                              },
                              "line1": {
                                "type": "string",
                                "pattern": "^[^\\u0000\\p{Cs}]*$",
                                "allOf": [
                                  {
                                    "pattern": "^[^\\p{Cc}\\u200B\\u2028-\\u202E\\u2066-\\u2069]*$"
                                  }
                                ]
                              },
                              "line2": {
                                "anyOf": [
                                  {
                                    "anyOf": [
                                      {
                                        "type": "string",
                                        "pattern": "^[^\\u0000\\p{Cs}]*$",
                                        "allOf": [
                                          {
                                            "pattern": "^[^\\p{Cc}\\u200B\\u2028-\\u202E\\u2066-\\u2069]*$"
                                          }
                                        ]
                                      },
                                      {
                                        "type": "null"
                                      }
                                    ]
                                  },
                                  {
                                    "type": "null"
                                  }
                                ]
                              },
                              "postalCode": {
                                "type": "string"
                              },
                              "state": {
                                "type": "string"
                              },
                              "country": {
                                "anyOf": [
                                  {
                                    "type": "string",
                                    "enum": [
                                      "US"
                                    ]
                                  },
                                  {
                                    "type": "null"
                                  }
                                ]
                              }
                            },
                            "required": [
                              "city",
                              "line1",
                              "postalCode",
                              "state"
                            ],
                            "additionalProperties": false
                          },
                          {
                            "type": "null"
                          }
                        ]
                      },
                      {
                        "type": "null"
                      }
                    ]
                  },
                  "clinicalProfile": {
                    "anyOf": [
                      {
                        "type": "object",
                        "properties": {
                          "currentMedications": {
                            "type": "array",
                            "items": {
                              "type": "string",
                              "pattern": "^[^\\u0000\\p{Cs}]*$"
                            },
                            "maxItems": 100
                          },
                          "heightInches": {
                            "anyOf": [
                              {
                                "anyOf": [
                                  {
                                    "anyOf": [
                                      {
                                        "type": "number",
                                        "exclusiveMinimum": 0
                                      },
                                      {
                                        "type": "string",
                                        "enum": [
                                          "Infinity",
                                          "-Infinity",
                                          "NaN"
                                        ]
                                      }
                                    ]
                                  },
                                  {
                                    "type": "null"
                                  }
                                ]
                              },
                              {
                                "type": "null"
                              }
                            ]
                          },
                          "reviewedAt": {
                            "anyOf": [
                              {
                                "anyOf": [
                                  {
                                    "type": "string"
                                  },
                                  {
                                    "type": "null"
                                  }
                                ]
                              },
                              {
                                "type": "null"
                              }
                            ]
                          },
                          "weightPounds": {
                            "anyOf": [
                              {
                                "anyOf": [
                                  {
                                    "anyOf": [
                                      {
                                        "type": "number",
                                        "exclusiveMinimum": 0
                                      },
                                      {
                                        "type": "string",
                                        "enum": [
                                          "Infinity",
                                          "-Infinity",
                                          "NaN"
                                        ]
                                      }
                                    ]
                                  },
                                  {
                                    "type": "null"
                                  }
                                ]
                              },
                              {
                                "type": "null"
                              }
                            ]
                          }
                        },
                        "required": [
                          "currentMedications"
                        ],
                        "additionalProperties": false
                      },
                      {
                        "type": "null"
                      }
                    ]
                  },
                  "dateOfBirth": {
                    "type": "string",
                    "pattern": "^\\d{4}-\\d{2}-\\d{2}$"
                  },
                  "email": {
                    "anyOf": [
                      {
                        "anyOf": [
                          {
                            "type": "string"
                          },
                          {
                            "type": "null"
                          }
                        ]
                      },
                      {
                        "type": "null"
                      }
                    ]
                  },
                  "externalId": {
                    "anyOf": [
                      {
                        "type": "string",
                        "pattern": "^[^\\u0000\\p{Cs}]*$"
                      },
                      {
                        "type": "null"
                      }
                    ]
                  },
                  "externalIdentities": {
                    "anyOf": [
                      {
                        "type": "array",
                        "items": {
                          "type": "object",
                          "properties": {
                            "source": {
                              "type": "string",
                              "pattern": "^[^\\u0000\\p{Cs}]*$"
                            },
                            "value": {
                              "type": "string",
                              "pattern": "^[^\\u0000\\p{Cs}]*$"
                            }
                          },
                          "required": [
                            "source",
                            "value"
                          ],
                          "additionalProperties": false
                        },
                        "maxItems": 50
                      },
                      {
                        "type": "null"
                      }
                    ]
                  },
                  "addresses": {
                    "anyOf": [
                      {
                        "type": "array",
                        "items": {
                          "type": "object",
                          "properties": {
                            "id": {
                              "anyOf": [
                                {
                                  "type": "string",
                                  "pattern": "^addr_[0-7][0-9a-hjkmnp-tv-z]{25}$",
                                  "examples": [
                                    "addr_01j2y8m6jcc9tt24af5pw9x1bc"
                                  ]
                                },
                                {
                                  "type": "null"
                                }
                              ]
                            },
                            "address": {
                              "type": "object",
                              "properties": {
                                "city": {
                                  "type": "string",
                                  "pattern": "^[^\\u0000\\p{Cs}]*$",
                                  "allOf": [
                                    {
                                      "pattern": "^[^\\p{Cc}\\u200B\\u2028-\\u202E\\u2066-\\u2069]*$"
                                    }
                                  ]
                                },
                                "country": {
                                  "anyOf": [
                                    {
                                      "type": "string",
                                      "enum": [
                                        "US"
                                      ]
                                    },
                                    {
                                      "type": "null"
                                    }
                                  ]
                                },
                                "line1": {
                                  "type": "string",
                                  "pattern": "^[^\\u0000\\p{Cs}]*$",
                                  "allOf": [
                                    {
                                      "pattern": "^[^\\p{Cc}\\u200B\\u2028-\\u202E\\u2066-\\u2069]*$"
                                    }
                                  ]
                                },
                                "line2": {
                                  "anyOf": [
                                    {
                                      "anyOf": [
                                        {
                                          "type": "string",
                                          "pattern": "^[^\\u0000\\p{Cs}]*$",
                                          "allOf": [
                                            {
                                              "pattern": "^[^\\p{Cc}\\u200B\\u2028-\\u202E\\u2066-\\u2069]*$"
                                            }
                                          ]
                                        },
                                        {
                                          "type": "null"
                                        }
                                      ]
                                    },
                                    {
                                      "type": "null"
                                    }
                                  ]
                                },
                                "postalCode": {
                                  "type": "string"
                                },
                                "state": {
                                  "type": "string"
                                }
                              },
                              "required": [
                                "city",
                                "line1",
                                "postalCode",
                                "state"
                              ],
                              "additionalProperties": false
                            },
                            "label": {
                              "type": "string",
                              "pattern": "^[^\\u0000\\p{Cs}]*$"
                            },
                            "preferredShipping": {
                              "type": "boolean"
                            },
                            "recipientName": {
                              "anyOf": [
                                {
                                  "type": "string",
                                  "pattern": "^[^\\u0000\\p{Cs}]*$",
                                  "allOf": [
                                    {
                                      "pattern": "^[^\\p{Cc}\\u200B\\u2028-\\u202E\\u2066-\\u2069]*$"
                                    }
                                  ]
                                },
                                {
                                  "type": "null"
                                }
                              ]
                            }
                          },
                          "required": [
                            "address",
                            "label",
                            "preferredShipping",
                            "recipientName"
                          ],
                          "additionalProperties": false
                        },
                        "maxItems": 50
                      },
                      {
                        "type": "null"
                      }
                    ]
                  },
                  "encounters": {
                    "anyOf": [
                      {
                        "type": "array",
                        "items": {
                          "type": "object",
                          "properties": {
                            "notes": {
                              "anyOf": [
                                {
                                  "type": "string",
                                  "pattern": "^[^\\u0000\\p{Cs}]*$",
                                  "maxLength": 5000
                                },
                                {
                                  "type": "null"
                                }
                              ]
                            },
                            "occurredAt": {
                              "type": "string"
                            },
                            "providerName": {
                              "anyOf": [
                                {
                                  "type": "string",
                                  "pattern": "^[^\\u0000\\p{Cs}]*$"
                                },
                                {
                                  "type": "null"
                                }
                              ]
                            },
                            "type": {
                              "type": "string",
                              "pattern": "^[^\\u0000\\p{Cs}]*$"
                            }
                          },
                          "required": [
                            "notes",
                            "occurredAt",
                            "providerName",
                            "type"
                          ],
                          "additionalProperties": false
                        }
                      },
                      {
                        "type": "null"
                      }
                    ]
                  },
                  "gender": {
                    "anyOf": [
                      {
                        "type": "string",
                        "enum": [
                          "f",
                          "m",
                          "o",
                          "u"
                        ]
                      },
                      {
                        "type": "null"
                      }
                    ]
                  },
                  "locationId": {
                    "anyOf": [
                      {
                        "type": "string",
                        "pattern": "^loc_[0-7][0-9a-hjkmnp-tv-z]{25}$",
                        "examples": [
                          "loc_01j2y8m6jcc9tt24af5pw9x1bc"
                        ]
                      },
                      {
                        "type": "null"
                      }
                    ]
                  },
                  "metadata": {
                    "anyOf": [
                      {
                        "type": "object"
                      },
                      {
                        "type": "null"
                      }
                    ]
                  },
                  "medicalRecordNumber": {
                    "anyOf": [
                      {
                        "anyOf": [
                          {
                            "type": "string",
                            "pattern": "^[^\\u0000\\p{Cs}]*$"
                          },
                          {
                            "type": "null"
                          }
                        ]
                      },
                      {
                        "type": "null"
                      }
                    ]
                  },
                  "measurements": {
                    "anyOf": [
                      {
                        "type": "array",
                        "items": {
                          "type": "object",
                          "properties": {
                            "heightCentimeters": {
                              "anyOf": [
                                {
                                  "anyOf": [
                                    {
                                      "type": "number",
                                      "exclusiveMinimum": 0
                                    },
                                    {
                                      "type": "string",
                                      "enum": [
                                        "Infinity",
                                        "-Infinity",
                                        "NaN"
                                      ]
                                    }
                                  ]
                                },
                                {
                                  "type": "null"
                                }
                              ]
                            },
                            "recordedAt": {
                              "type": "string"
                            },
                            "source": {
                              "type": "string",
                              "pattern": "^[^\\u0000\\p{Cs}]*$"
                            },
                            "weightKilograms": {
                              "anyOf": [
                                {
                                  "anyOf": [
                                    {
                                      "type": "number",
                                      "exclusiveMinimum": 0
                                    },
                                    {
                                      "type": "string",
                                      "enum": [
                                        "Infinity",
                                        "-Infinity",
                                        "NaN"
                                      ]
                                    }
                                  ]
                                },
                                {
                                  "type": "null"
                                }
                              ]
                            }
                          },
                          "required": [
                            "heightCentimeters",
                            "recordedAt",
                            "source",
                            "weightKilograms"
                          ],
                          "additionalProperties": false
                        }
                      },
                      {
                        "type": "null"
                      }
                    ]
                  },
                  "name": {
                    "type": "object",
                    "properties": {
                      "first": {
                        "type": "string",
                        "pattern": "^[^\\u0000\\p{Cs}]*$",
                        "allOf": [
                          {
                            "pattern": "^[^\\p{Cc}\\u200B\\u2028-\\u202E\\u2066-\\u2069]*$"
                          }
                        ]
                      },
                      "last": {
                        "type": "string",
                        "pattern": "^[^\\u0000\\p{Cs}]*$",
                        "allOf": [
                          {
                            "pattern": "^[^\\p{Cc}\\u200B\\u2028-\\u202E\\u2066-\\u2069]*$"
                          }
                        ]
                      },
                      "middle": {
                        "anyOf": [
                          {
                            "anyOf": [
                              {
                                "type": "string",
                                "pattern": "^[^\\u0000\\p{Cs}]*$",
                                "allOf": [
                                  {
                                    "pattern": "^[^\\p{Cc}\\u200B\\u2028-\\u202E\\u2066-\\u2069]*$"
                                  }
                                ]
                              },
                              {
                                "type": "null"
                              }
                            ]
                          },
                          {
                            "type": "null"
                          }
                        ]
                      },
                      "preferred": {
                        "anyOf": [
                          {
                            "anyOf": [
                              {
                                "type": "string",
                                "pattern": "^[^\\u0000\\p{Cs}]*$",
                                "allOf": [
                                  {
                                    "pattern": "^[^\\p{Cc}\\u200B\\u2028-\\u202E\\u2066-\\u2069]*$"
                                  }
                                ]
                              },
                              {
                                "type": "null"
                              }
                            ]
                          },
                          {
                            "type": "null"
                          }
                        ]
                      }
                    },
                    "required": [
                      "first",
                      "last"
                    ],
                    "additionalProperties": false
                  },
                  "phone": {
                    "anyOf": [
                      {
                        "anyOf": [
                          {
                            "type": "string"
                          },
                          {
                            "type": "null"
                          }
                        ]
                      },
                      {
                        "type": "null"
                      }
                    ]
                  },
                  "programs": {
                    "anyOf": [
                      {
                        "type": "array",
                        "items": {
                          "type": "object",
                          "properties": {
                            "endedAt": {
                              "anyOf": [
                                {
                                  "type": "string"
                                },
                                {
                                  "type": "null"
                                }
                              ]
                            },
                            "name": {
                              "type": "string",
                              "pattern": "^[^\\u0000\\p{Cs}]*$"
                            },
                            "startedAt": {
                              "type": "string"
                            },
                            "status": {
                              "type": "string",
                              "enum": [
                                "active",
                                "completed",
                                "paused"
                              ]
                            }
                          },
                          "required": [
                            "endedAt",
                            "name",
                            "startedAt",
                            "status"
                          ],
                          "additionalProperties": false
                        }
                      },
                      {
                        "type": "null"
                      }
                    ]
                  }
                },
                "required": [
                  "dateOfBirth",
                  "name"
                ],
                "additionalProperties": false
              },
              {
                "type": "null"
              }
            ]
          },
          "shippingAddressId": {
            "anyOf": [
              {
                "type": "string",
                "pattern": "^addr_[0-7][0-9a-hjkmnp-tv-z]{25}$",
                "examples": [
                  "addr_01j2y8m6jcc9tt24af5pw9x1bc"
                ]
              },
              {
                "type": "null"
              }
            ]
          },
          "prescriptions": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "externalPrescriptionId": {
                  "anyOf": [
                    {
                      "type": "string",
                      "minLength": 1,
                      "maxLength": 200,
                      "pattern": "\\S",
                      "allOf": [
                        {
                          "pattern": "^[^\\p{Cc}\\p{Cs}]*$"
                        }
                      ]
                    },
                    {
                      "type": "null"
                    }
                  ]
                },
                "clinical": {
                  "anyOf": [
                    {
                      "type": "object",
                      "properties": {
                        "compoundingReason": {
                          "anyOf": [
                            {
                              "type": "object",
                              "properties": {
                                "category": {
                                  "anyOf": [
                                    {
                                      "type": "string",
                                      "enum": [
                                        "alcohol_free",
                                        "drug_shortage",
                                        "commercial_product_discontinued",
                                        "modified_release",
                                        "inactive_ingredient_sensitivity",
                                        "inactive_ingredient_toxicity",
                                        "concentration_adjustment",
                                        "alternate_route",
                                        "dosage_form_unavailable",
                                        "flavor_adjustment",
                                        "tablet_burden",
                                        "patient_cannot_use_commercial_product",
                                        "no_approved_product_available",
                                        "no_rationale_required",
                                        "other_patient_specific_need"
                                      ]
                                    },
                                    {
                                      "type": "null"
                                    }
                                  ]
                                },
                                "context": {
                                  "anyOf": [
                                    {
                                      "type": "string"
                                    },
                                    {
                                      "type": "null"
                                    }
                                  ]
                                }
                              },
                              "additionalProperties": false
                            },
                            {
                              "type": "null"
                            }
                          ]
                        },
                        "medicationReviewStatus": {
                          "anyOf": [
                            {
                              "type": "string",
                              "enum": [
                                "not_reviewed",
                                "none",
                                "recorded"
                              ]
                            },
                            {
                              "type": "null"
                            }
                          ]
                        },
                        "diagnosisReviewStatus": {
                          "anyOf": [
                            {
                              "type": "string",
                              "enum": [
                                "not_reviewed",
                                "none",
                                "recorded"
                              ]
                            },
                            {
                              "type": "null"
                            }
                          ]
                        },
                        "currentMedications": {
                          "anyOf": [
                            {
                              "type": "array",
                              "items": {
                                "type": "string"
                              },
                              "maxItems": 100
                            },
                            {
                              "type": "null"
                            }
                          ]
                        },
                        "diagnoses": {
                          "anyOf": [
                            {
                              "type": "array",
                              "items": {
                                "type": "object",
                                "properties": {
                                  "code": {
                                    "type": "string"
                                  },
                                  "display": {
                                    "type": "string"
                                  }
                                },
                                "required": [
                                  "code",
                                  "display"
                                ],
                                "additionalProperties": false
                              },
                              "maxItems": 20
                            },
                            {
                              "type": "null"
                            }
                          ]
                        },
                        "observations": {
                          "anyOf": [
                            {
                              "type": "array",
                              "items": {
                                "type": "object",
                                "properties": {
                                  "display": {
                                    "type": "string"
                                  },
                                  "unit": {
                                    "type": "string"
                                  },
                                  "value": {
                                    "anyOf": [
                                      {
                                        "type": "number",
                                        "exclusiveMinimum": 0
                                      },
                                      {
                                        "type": "string",
                                        "enum": [
                                          "Infinity",
                                          "-Infinity",
                                          "NaN"
                                        ]
                                      }
                                    ]
                                  }
                                },
                                "required": [
                                  "display",
                                  "unit",
                                  "value"
                                ],
                                "additionalProperties": false
                              },
                              "maxItems": 20
                            },
                            {
                              "type": "null"
                            }
                          ]
                        }
                      },
                      "additionalProperties": false
                    },
                    {
                      "type": "null"
                    }
                  ]
                },
                "pharmacyId": {
                  "anyOf": [
                    {
                      "type": "string",
                      "pattern": "^pharm_[0-7][0-9a-hjkmnp-tv-z]{25}$",
                      "examples": [
                        "pharm_01j2y8m6jcc9tt24af5pw9x1bc"
                      ]
                    },
                    {
                      "type": "null"
                    }
                  ]
                },
                "daysSupply": {
                  "type": "integer",
                  "minimum": 1,
                  "maximum": 365
                },
                "dispensing": {
                  "type": "object",
                  "properties": {
                    "dispenseUponAcceptance": {
                      "anyOf": [
                        {
                          "type": "boolean"
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "shippingOptionId": {
                      "anyOf": [
                        {
                          "type": "string",
                          "pattern": "^shp_[0-7][0-9a-hjkmnp-tv-z]{25}$",
                          "examples": [
                            "shp_01j2y8m6jcc9tt24af5pw9x1bc"
                          ]
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "shippingAmountCents": {
                      "anyOf": [
                        {
                          "type": "integer",
                          "minimum": 0
                        },
                        {
                          "type": "null"
                        }
                      ],
                      "description": "Reviewed customer shipping rate for the selected service. Preview supplies this value. Shared group rates must not be summed per prescription."
                    },
                    "shippingDestinationType": {
                      "anyOf": [
                        {
                          "type": "string",
                          "enum": [
                            "patient"
                          ]
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "pharmacyNotes": {
                      "anyOf": [
                        {
                          "type": "string"
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "requestedFillDate": {
                      "anyOf": [
                        {
                          "type": "string",
                          "pattern": "^\\d{4}-\\d{2}-\\d{2}$"
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "substitutionPermitted": {
                      "anyOf": [
                        {
                          "type": "boolean"
                        },
                        {
                          "type": "null"
                        }
                      ]
                    }
                  },
                  "additionalProperties": false
                },
                "directions": {
                  "type": "string"
                },
                "medicationId": {
                  "type": "string",
                  "pattern": "^cat_[0-7][0-9a-hjkmnp-tv-z]{25}$",
                  "examples": [
                    "cat_01j2y8m6jcc9tt24af5pw9x1bc"
                  ]
                },
                "quantity": {
                  "anyOf": [
                    {
                      "type": "number",
                      "exclusiveMinimum": 0,
                      "maximum": 100000
                    },
                    {
                      "type": "string",
                      "enum": [
                        "Infinity",
                        "-Infinity",
                        "NaN"
                      ]
                    }
                  ]
                },
                "quantityUnit": {
                  "type": "string"
                },
                "refills": {
                  "type": "integer",
                  "minimum": 0,
                  "maximum": 99
                },
                "structuredSig": {
                  "anyOf": [
                    {
                      "type": "object",
                      "properties": {
                        "dose": {
                          "type": "string"
                        },
                        "doseUnit": {
                          "type": "string"
                        },
                        "duration": {
                          "anyOf": [
                            {
                              "type": "string"
                            },
                            {
                              "type": "null"
                            }
                          ]
                        },
                        "frequency": {
                          "type": "string"
                        },
                        "indication": {
                          "anyOf": [
                            {
                              "type": "string"
                            },
                            {
                              "type": "null"
                            }
                          ]
                        },
                        "maxDailyUse": {
                          "anyOf": [
                            {
                              "type": "string"
                            },
                            {
                              "type": "null"
                            }
                          ]
                        },
                        "prn": {
                          "anyOf": [
                            {
                              "type": "boolean"
                            },
                            {
                              "type": "null"
                            }
                          ]
                        },
                        "route": {
                          "type": "string"
                        },
                        "titrationSchedule": {
                          "anyOf": [
                            {
                              "type": "string"
                            },
                            {
                              "type": "null"
                            }
                          ]
                        }
                      },
                      "required": [
                        "dose",
                        "doseUnit",
                        "frequency",
                        "route"
                      ],
                      "additionalProperties": false
                    },
                    {
                      "type": "null"
                    }
                  ]
                }
              },
              "required": [
                "daysSupply",
                "dispensing",
                "directions",
                "medicationId",
                "quantity",
                "quantityUnit",
                "refills"
              ],
              "additionalProperties": false
            },
            "minItems": 1,
            "maxItems": 20
          }
        },
        "required": [
          "practiceId",
          "prescriptions"
        ],
        "additionalProperties": false,
        "title": "CreateOrderRequest"
      },
      "CreateOrderResponse": {
        "title": "CreateOrderResponse",
        "type": "object",
        "properties": {
          "revision": {
            "type": "string",
            "pattern": "^rev_[a-f0-9]{64}$",
            "description": "Opaque revision of the complete order prescription set. Send the revision you reviewed as expectedRevision; never replace it automatically after a conflict."
          },
          "otcItems": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "catalogItemId": {
                  "type": "string",
                  "allOf": [
                    {
                      "pattern": "^cat_[0-7][0-9a-hjkmnp-tv-z]{25}$",
                      "examples": [
                        "cat_01j2y8m6jcc9tt24af5pw9x1bc"
                      ]
                    }
                  ]
                },
                "name": {
                  "type": "string"
                },
                "quantity": {
                  "type": "integer"
                },
                "unitPriceCents": {
                  "type": "integer"
                },
                "subtotalCents": {
                  "type": "integer"
                }
              },
              "required": [
                "catalogItemId",
                "name",
                "quantity",
                "unitPriceCents",
                "subtotalCents"
              ],
              "additionalProperties": false
            }
          },
          "externalOrderId": {
            "anyOf": [
              {
                "type": "string",
                "minLength": 1,
                "maxLength": 200,
                "pattern": "\\S",
                "allOf": [
                  {
                    "pattern": "^[^\\p{Cc}\\p{Cs}]*$"
                  }
                ]
              },
              {
                "type": "null"
              }
            ]
          },
          "metadata": {
            "type": "object",
            "additionalProperties": {
              "anyOf": [
                {
                  "type": "string",
                  "allOf": [
                    {
                      "pattern": "^[^\\p{Cs}]*$"
                    },
                    {
                      "maxLength": 500
                    }
                  ]
                },
                {
                  "type": "number"
                },
                {
                  "type": "boolean"
                },
                {
                  "type": "null"
                }
              ]
            },
            "allOf": [
              {
                "propertyNames": {
                  "type": "string",
                  "allOf": [
                    {
                      "pattern": "^[^\\p{Cs}]*$"
                    },
                    {
                      "minLength": 1
                    },
                    {
                      "maxLength": 40
                    }
                  ]
                }
              },
              {
                "maxProperties": 20
              }
            ]
          },
          "createdAt": {
            "type": "string"
          },
          "id": {
            "type": "string",
            "pattern": "^ord_[0-7][0-9a-hjkmnp-tv-z]{25}$",
            "examples": [
              "ord_01j2y8m6jcc9tt24af5pw9x1bc"
            ]
          },
          "livemode": {
            "type": "boolean"
          },
          "object": {
            "type": "string",
            "enum": [
              "order"
            ]
          },
          "patientId": {
            "type": "string",
            "pattern": "^pat_[0-7][0-9a-hjkmnp-tv-z]{25}$",
            "examples": [
              "pat_01j2y8m6jcc9tt24af5pw9x1bc"
            ]
          },
          "practiceId": {
            "type": "string",
            "pattern": "^prac_[0-7][0-9a-hjkmnp-tv-z]{25}$",
            "examples": [
              "prac_01j2y8m6jcc9tt24af5pw9x1bc"
            ]
          },
          "prescriptions": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "pharmacyId": {
                  "type": "string",
                  "allOf": [
                    {
                      "pattern": "^pharm_[0-7][0-9a-hjkmnp-tv-z]{25}$",
                      "examples": [
                        "pharm_01j2y8m6jcc9tt24af5pw9x1bc"
                      ]
                    }
                  ]
                },
                "externalPrescriptionId": {
                  "anyOf": [
                    {
                      "type": "string",
                      "allOf": [
                        {
                          "minLength": 1
                        },
                        {
                          "maxLength": 200
                        },
                        {
                          "pattern": "\\S"
                        },
                        {
                          "pattern": "^[^\\p{Cc}\\p{Cs}]*$"
                        }
                      ]
                    },
                    {
                      "type": "null"
                    }
                  ]
                },
                "createdAt": {
                  "type": "string"
                },
                "directions": {
                  "type": "string"
                },
                "version": {
                  "type": "integer",
                  "allOf": [
                    {
                      "minimum": 1
                    }
                  ]
                },
                "id": {
                  "type": "string",
                  "allOf": [
                    {
                      "pattern": "^rx_[0-7][0-9a-hjkmnp-tv-z]{25}$",
                      "examples": [
                        "rx_01j2y8m6jcc9tt24af5pw9x1bc"
                      ]
                    }
                  ]
                },
                "medicationId": {
                  "anyOf": [
                    {
                      "type": "string",
                      "allOf": [
                        {
                          "pattern": "^cat_[0-7][0-9a-hjkmnp-tv-z]{25}$",
                          "examples": [
                            "cat_01j2y8m6jcc9tt24af5pw9x1bc"
                          ]
                        }
                      ]
                    },
                    {
                      "type": "null"
                    }
                  ]
                },
                "medicationName": {
                  "type": "string"
                },
                "object": {
                  "type": "string",
                  "enum": [
                    "prescription"
                  ]
                },
                "quantity": {
                  "anyOf": [
                    {
                      "type": "number"
                    },
                    {
                      "type": "string",
                      "enum": [
                        "Infinity",
                        "-Infinity",
                        "NaN"
                      ]
                    }
                  ]
                },
                "quantityUnit": {
                  "type": "string"
                },
                "refills": {
                  "type": "integer"
                },
                "status": {
                  "type": "string",
                  "enum": [
                    "requires_provider_signature"
                  ]
                }
              },
              "required": [
                "pharmacyId",
                "externalPrescriptionId",
                "createdAt",
                "directions",
                "version",
                "id",
                "medicationId",
                "medicationName",
                "object",
                "quantity",
                "quantityUnit",
                "refills",
                "status"
              ],
              "additionalProperties": false
            }
          },
          "userId": {
            "anyOf": [
              {
                "type": "string",
                "pattern": "^user_[0-7][0-9a-hjkmnp-tv-z]{25}$",
                "examples": [
                  "user_01j2y8m6jcc9tt24af5pw9x1bc"
                ]
              },
              {
                "type": "null"
              }
            ]
          },
          "status": {
            "type": "string",
            "enum": [
              "requires_provider_signature"
            ]
          }
        },
        "required": [
          "revision",
          "otcItems",
          "externalOrderId",
          "metadata",
          "createdAt",
          "id",
          "livemode",
          "object",
          "patientId",
          "practiceId",
          "prescriptions",
          "userId",
          "status"
        ],
        "additionalProperties": false
      },
      "GetOrderResponse": {
        "title": "GetOrderResponse",
        "type": "object",
        "properties": {
          "revision": {
            "type": "string",
            "pattern": "^rev_[a-f0-9]{64}$",
            "description": "Opaque revision of the complete order prescription set. Send the revision you reviewed as expectedRevision; never replace it automatically after a conflict."
          },
          "otcItems": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "catalogItemId": {
                  "type": "string",
                  "allOf": [
                    {
                      "pattern": "^cat_[0-7][0-9a-hjkmnp-tv-z]{25}$",
                      "examples": [
                        "cat_01j2y8m6jcc9tt24af5pw9x1bc"
                      ]
                    }
                  ]
                },
                "prescriptionId": {
                  "type": "string",
                  "allOf": [
                    {
                      "pattern": "^rx_[0-7][0-9a-hjkmnp-tv-z]{25}$",
                      "examples": [
                        "rx_01j2y8m6jcc9tt24af5pw9x1bc"
                      ]
                    }
                  ]
                },
                "name": {
                  "type": "string"
                },
                "quantity": {
                  "type": "integer"
                },
                "unitPriceCents": {
                  "type": "integer"
                },
                "subtotalCents": {
                  "type": "integer"
                }
              },
              "required": [
                "catalogItemId",
                "prescriptionId",
                "name",
                "quantity",
                "unitPriceCents",
                "subtotalCents"
              ],
              "additionalProperties": false
            }
          },
          "practiceMedicationTotalCents": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "description": "Snapshot of the practice-facing medication total. Null until every prescription has recorded submission pricing. Excludes shipping and supplies."
          },
          "externalOrderId": {
            "anyOf": [
              {
                "type": "string",
                "allOf": [
                  {
                    "minLength": 1
                  },
                  {
                    "maxLength": 200
                  },
                  {
                    "pattern": "\\S"
                  },
                  {
                    "pattern": "^[^\\p{Cc}\\p{Cs}]*$"
                  }
                ]
              },
              {
                "type": "null"
              }
            ]
          },
          "metadata": {
            "type": "object",
            "additionalProperties": {
              "anyOf": [
                {
                  "type": "string",
                  "allOf": [
                    {
                      "pattern": "^[^\\p{Cs}]*$"
                    },
                    {
                      "maxLength": 500
                    }
                  ]
                },
                {
                  "type": "number"
                },
                {
                  "type": "boolean"
                },
                {
                  "type": "null"
                }
              ]
            },
            "allOf": [
              {
                "propertyNames": {
                  "type": "string",
                  "allOf": [
                    {
                      "pattern": "^[^\\p{Cs}]*$"
                    },
                    {
                      "minLength": 1
                    },
                    {
                      "maxLength": 40
                    }
                  ]
                }
              },
              {
                "maxProperties": 20
              }
            ]
          },
          "createdAt": {
            "type": "string"
          },
          "fulfillments": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "carrier": {
                  "anyOf": [
                    {
                      "type": "string"
                    },
                    {
                      "type": "null"
                    }
                  ]
                },
                "cancellations": {
                  "type": "array",
                  "items": {
                    "type": "object",
                    "properties": {
                      "attempts": {
                        "type": "integer"
                      },
                      "confirmedAt": {
                        "anyOf": [
                          {
                            "type": "string"
                          },
                          {
                            "type": "null"
                          }
                        ]
                      },
                      "createdAt": {
                        "type": "string"
                      },
                      "errorCode": {
                        "anyOf": [
                          {
                            "type": "string"
                          },
                          {
                            "type": "null"
                          }
                        ]
                      },
                      "errorMessage": {
                        "anyOf": [
                          {
                            "type": "string"
                          },
                          {
                            "type": "null"
                          }
                        ]
                      },
                      "id": {
                        "type": "string",
                        "allOf": [
                          {
                            "pattern": "^cancl_[0-7][0-9a-hjkmnp-tv-z]{25}$",
                            "examples": [
                              "cancl_01j2y8m6jcc9tt24af5pw9x1bc"
                            ]
                          }
                        ]
                      },
                      "providerStatus": {
                        "anyOf": [
                          {
                            "type": "string"
                          },
                          {
                            "type": "null"
                          }
                        ]
                      },
                      "reason": {
                        "type": "string"
                      },
                      "requestedAt": {
                        "type": "string"
                      },
                      "requestedBy": {
                        "type": "object",
                        "properties": {
                          "id": {
                            "type": "string"
                          },
                          "type": {
                            "type": "string"
                          }
                        },
                        "required": [
                          "id",
                          "type"
                        ],
                        "additionalProperties": false
                      },
                      "resolvedAt": {
                        "anyOf": [
                          {
                            "type": "string"
                          },
                          {
                            "type": "null"
                          }
                        ]
                      },
                      "sentAt": {
                        "anyOf": [
                          {
                            "type": "string"
                          },
                          {
                            "type": "null"
                          }
                        ]
                      },
                      "source": {
                        "type": "string",
                        "enum": [
                          "provider",
                          "platform",
                          "public_api",
                          "pharmacy",
                          "system"
                        ]
                      },
                      "status": {
                        "type": "string",
                        "enum": [
                          "requested",
                          "sent",
                          "confirmed",
                          "rejected",
                          "failed",
                          "too_late"
                        ]
                      },
                      "updatedAt": {
                        "type": "string"
                      }
                    },
                    "required": [
                      "attempts",
                      "confirmedAt",
                      "createdAt",
                      "errorCode",
                      "errorMessage",
                      "id",
                      "providerStatus",
                      "reason",
                      "requestedAt",
                      "requestedBy",
                      "resolvedAt",
                      "sentAt",
                      "source",
                      "status",
                      "updatedAt"
                    ],
                    "additionalProperties": false
                  }
                },
                "pharmacyId": {
                  "anyOf": [
                    {
                      "type": "string",
                      "allOf": [
                        {
                          "pattern": "^pharm_[0-7][0-9a-hjkmnp-tv-z]{25}$",
                          "examples": [
                            "pharm_01j2y8m6jcc9tt24af5pw9x1bc"
                          ]
                        }
                      ]
                    },
                    {
                      "type": "null"
                    }
                  ]
                },
                "createdAt": {
                  "type": "string"
                },
                "id": {
                  "type": "string",
                  "allOf": [
                    {
                      "pattern": "^ord_[0-7][0-9a-hjkmnp-tv-z]{25}$",
                      "examples": [
                        "ord_01j2y8m6jcc9tt24af5pw9x1bc"
                      ]
                    }
                  ]
                },
                "prescriptionId": {
                  "type": "string",
                  "allOf": [
                    {
                      "pattern": "^rx_[0-7][0-9a-hjkmnp-tv-z]{25}$",
                      "examples": [
                        "rx_01j2y8m6jcc9tt24af5pw9x1bc"
                      ]
                    }
                  ]
                },
                "status": {
                  "type": "string"
                },
                "trackingNumber": {
                  "anyOf": [
                    {
                      "type": "string"
                    },
                    {
                      "type": "null"
                    }
                  ]
                },
                "trackingStatus": {
                  "anyOf": [
                    {
                      "type": "string"
                    },
                    {
                      "type": "null"
                    }
                  ]
                },
                "shippedAt": {
                  "anyOf": [
                    {
                      "type": "string"
                    },
                    {
                      "type": "null"
                    }
                  ]
                },
                "deliveredAt": {
                  "anyOf": [
                    {
                      "type": "string"
                    },
                    {
                      "type": "null"
                    }
                  ]
                },
                "estimatedDeliveryAt": {
                  "anyOf": [
                    {
                      "type": "string"
                    },
                    {
                      "type": "null"
                    }
                  ]
                },
                "exceptions": {
                  "type": "array",
                  "items": {
                    "type": "object",
                    "properties": {
                      "actionable": {
                        "type": "boolean"
                      },
                      "assignedTo": {
                        "anyOf": [
                          {
                            "type": "object",
                            "properties": {
                              "id": {
                                "type": "string"
                              },
                              "name": {
                                "type": "string"
                              }
                            },
                            "required": [
                              "id",
                              "name"
                            ],
                            "additionalProperties": false
                          },
                          {
                            "type": "null"
                          }
                        ]
                      },
                      "createdAt": {
                        "type": "string"
                      },
                      "dueAt": {
                        "anyOf": [
                          {
                            "type": "string"
                          },
                          {
                            "type": "null"
                          }
                        ]
                      },
                      "id": {
                        "type": "string",
                        "allOf": [
                          {
                            "pattern": "^fex_[0-7][0-9a-hjkmnp-tv-z]{25}$",
                            "examples": [
                              "fex_01j2y8m6jcc9tt24af5pw9x1bc"
                            ]
                          }
                        ]
                      },
                      "kind": {
                        "type": "string"
                      },
                      "resolution": {
                        "anyOf": [
                          {
                            "type": "string"
                          },
                          {
                            "type": "null"
                          }
                        ]
                      },
                      "resolvedAt": {
                        "anyOf": [
                          {
                            "type": "string"
                          },
                          {
                            "type": "null"
                          }
                        ]
                      },
                      "retryable": {
                        "type": "boolean"
                      },
                      "severity": {
                        "type": "string",
                        "enum": [
                          "warning",
                          "critical"
                        ]
                      },
                      "status": {
                        "type": "string",
                        "enum": [
                          "open",
                          "acknowledged",
                          "resolved"
                        ]
                      },
                      "summary": {
                        "type": "string"
                      },
                      "updatedAt": {
                        "type": "string"
                      }
                    },
                    "required": [
                      "actionable",
                      "assignedTo",
                      "createdAt",
                      "dueAt",
                      "id",
                      "kind",
                      "resolution",
                      "resolvedAt",
                      "retryable",
                      "severity",
                      "status",
                      "summary",
                      "updatedAt"
                    ],
                    "additionalProperties": false
                  }
                },
                "shipping": {
                  "type": "object",
                  "properties": {
                    "destinationType": {
                      "type": "string",
                      "enum": [
                        "patient",
                        "practice"
                      ]
                    },
                    "method": {
                      "type": "string",
                      "enum": [
                        "standard",
                        "expedited",
                        "overnight",
                        "pickup",
                        "local_delivery"
                      ]
                    },
                    "option": {
                      "anyOf": [
                        {
                          "type": "object",
                          "properties": {
                            "amountCents": {
                              "type": "integer",
                              "allOf": [
                                {
                                  "minimum": 0
                                }
                              ]
                            },
                            "currency": {
                              "type": "string",
                              "enum": [
                                "USD"
                              ]
                            },
                            "label": {
                              "type": "string"
                            },
                            "serviceLevel": {
                              "type": "string"
                            },
                            "temperature": {
                              "type": "string",
                              "enum": [
                                "ambient",
                                "refrigerated"
                              ]
                            }
                          },
                          "required": [
                            "amountCents",
                            "currency",
                            "label",
                            "serviceLevel",
                            "temperature"
                          ],
                          "additionalProperties": false
                        },
                        {
                          "type": "null"
                        }
                      ]
                    }
                  },
                  "required": [
                    "destinationType",
                    "method",
                    "option"
                  ],
                  "additionalProperties": false
                },
                "shipments": {
                  "type": "array",
                  "items": {
                    "type": "object",
                    "properties": {
                      "carrier": {
                        "anyOf": [
                          {
                            "type": "string"
                          },
                          {
                            "type": "null"
                          }
                        ]
                      },
                      "createdAt": {
                        "type": "string"
                      },
                      "deliveredAt": {
                        "anyOf": [
                          {
                            "type": "string"
                          },
                          {
                            "type": "null"
                          }
                        ]
                      },
                      "estimatedDeliveryAt": {
                        "anyOf": [
                          {
                            "type": "string"
                          },
                          {
                            "type": "null"
                          }
                        ]
                      },
                      "id": {
                        "type": "string",
                        "allOf": [
                          {
                            "pattern": "^ship_[0-7][0-9a-hjkmnp-tv-z]{25}$",
                            "examples": [
                              "ship_01j2y8m6jcc9tt24af5pw9x1bc"
                            ]
                          }
                        ]
                      },
                      "isActive": {
                        "type": "boolean"
                      },
                      "providerStatus": {
                        "anyOf": [
                          {
                            "type": "string"
                          },
                          {
                            "type": "null"
                          }
                        ]
                      },
                      "replacedAt": {
                        "anyOf": [
                          {
                            "type": "string"
                          },
                          {
                            "type": "null"
                          }
                        ]
                      },
                      "replacesShipmentId": {
                        "anyOf": [
                          {
                            "type": "string",
                            "allOf": [
                              {
                                "pattern": "^ship_[0-7][0-9a-hjkmnp-tv-z]{25}$",
                                "examples": [
                                  "ship_01j2y8m6jcc9tt24af5pw9x1bc"
                                ]
                              }
                            ]
                          },
                          {
                            "type": "null"
                          }
                        ]
                      },
                      "shippedAt": {
                        "anyOf": [
                          {
                            "type": "string"
                          },
                          {
                            "type": "null"
                          }
                        ]
                      },
                      "source": {
                        "type": "string",
                        "enum": [
                          "pharmacy_webhook",
                          "pharmacy",
                          "system"
                        ]
                      },
                      "status": {
                        "type": "string",
                        "enum": [
                          "label_created",
                          "carrier_possession",
                          "in_transit",
                          "out_for_delivery",
                          "delivered",
                          "delayed",
                          "delivery_failed",
                          "returned",
                          "voided",
                          "unknown"
                        ]
                      },
                      "trackingNumber": {
                        "anyOf": [
                          {
                            "type": "string"
                          },
                          {
                            "type": "null"
                          }
                        ]
                      },
                      "trackingUrl": {
                        "anyOf": [
                          {
                            "type": "string"
                          },
                          {
                            "type": "null"
                          }
                        ]
                      },
                      "updatedAt": {
                        "type": "string"
                      },
                      "voidedAt": {
                        "anyOf": [
                          {
                            "type": "string"
                          },
                          {
                            "type": "null"
                          }
                        ]
                      }
                    },
                    "required": [
                      "carrier",
                      "createdAt",
                      "deliveredAt",
                      "estimatedDeliveryAt",
                      "id",
                      "isActive",
                      "providerStatus",
                      "replacedAt",
                      "replacesShipmentId",
                      "shippedAt",
                      "source",
                      "status",
                      "trackingNumber",
                      "trackingUrl",
                      "updatedAt",
                      "voidedAt"
                    ],
                    "additionalProperties": false
                  }
                },
                "trackingUrl": {
                  "anyOf": [
                    {
                      "type": "string"
                    },
                    {
                      "type": "null"
                    }
                  ]
                },
                "updatedAt": {
                  "type": "string"
                }
              },
              "required": [
                "carrier",
                "cancellations",
                "pharmacyId",
                "createdAt",
                "id",
                "prescriptionId",
                "status",
                "trackingNumber",
                "trackingStatus",
                "shippedAt",
                "deliveredAt",
                "estimatedDeliveryAt",
                "exceptions",
                "shipping",
                "shipments",
                "trackingUrl",
                "updatedAt"
              ],
              "additionalProperties": false
            }
          },
          "id": {
            "type": "string",
            "pattern": "^ord_[0-7][0-9a-hjkmnp-tv-z]{25}$",
            "examples": [
              "ord_01j2y8m6jcc9tt24af5pw9x1bc"
            ]
          },
          "lifecycleEvents": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "createdAt": {
                  "type": "string"
                },
                "eventType": {
                  "type": "string"
                },
                "id": {
                  "type": "string"
                },
                "message": {
                  "type": "string"
                },
                "source": {
                  "type": "string",
                  "enum": [
                    "cancellation",
                    "exception",
                    "fulfillment",
                    "integration",
                    "shipment",
                    "webhook"
                  ]
                }
              },
              "required": [
                "createdAt",
                "eventType",
                "id",
                "message",
                "source"
              ],
              "additionalProperties": false
            }
          },
          "livemode": {
            "type": "boolean"
          },
          "object": {
            "type": "string",
            "enum": [
              "order"
            ]
          },
          "patientExternalId": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ]
          },
          "patientId": {
            "type": "string",
            "pattern": "^pat_[0-7][0-9a-hjkmnp-tv-z]{25}$",
            "examples": [
              "pat_01j2y8m6jcc9tt24af5pw9x1bc"
            ]
          },
          "patientName": {
            "type": "string"
          },
          "patientState": {
            "type": "string",
            "description": "The patient's current clinical state. This is not the saved delivery state; use each prescription's deliveryAddress for shipping."
          },
          "practiceId": {
            "type": "string",
            "pattern": "^prac_[0-7][0-9a-hjkmnp-tv-z]{25}$",
            "examples": [
              "prac_01j2y8m6jcc9tt24af5pw9x1bc"
            ]
          },
          "prescriberName": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ]
          },
          "prescriberNpi": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ]
          },
          "review": {
            "anyOf": [
              {
                "type": "object",
                "properties": {
                  "status": {
                    "type": "string",
                    "enum": [
                      "completed",
                      "rejected"
                    ]
                  },
                  "reason": {
                    "anyOf": [
                      {
                        "type": "string"
                      },
                      {
                        "type": "null"
                      }
                    ]
                  },
                  "requestedAt": {
                    "type": "string"
                  },
                  "completedAt": {
                    "anyOf": [
                      {
                        "type": "string"
                      },
                      {
                        "type": "null"
                      }
                    ]
                  },
                  "canceledAt": {
                    "anyOf": [
                      {
                        "type": "string"
                      },
                      {
                        "type": "null"
                      }
                    ]
                  },
                  "resolvedAt": {
                    "anyOf": [
                      {
                        "type": "string"
                      },
                      {
                        "type": "null"
                      }
                    ]
                  },
                  "resolvedBy": {
                    "anyOf": [
                      {
                        "type": "object",
                        "properties": {
                          "id": {
                            "type": "string"
                          },
                          "type": {
                            "type": "string"
                          }
                        },
                        "required": [
                          "id",
                          "type"
                        ],
                        "additionalProperties": false
                      },
                      {
                        "type": "null"
                      }
                    ]
                  },
                  "providerId": {
                    "anyOf": [
                      {
                        "type": "string",
                        "allOf": [
                          {
                            "pattern": "^prov_[0-7][0-9a-hjkmnp-tv-z]{25}$",
                            "examples": [
                              "prov_01j2y8m6jcc9tt24af5pw9x1bc"
                            ]
                          }
                        ]
                      },
                      {
                        "type": "null"
                      }
                    ]
                  }
                },
                "required": [
                  "status",
                  "reason",
                  "requestedAt",
                  "completedAt",
                  "canceledAt",
                  "resolvedAt",
                  "resolvedBy",
                  "providerId"
                ],
                "additionalProperties": false
              },
              {
                "type": "null"
              }
            ]
          },
          "prescriptions": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "version": {
                  "type": "integer"
                },
                "daysSupply": {
                  "anyOf": [
                    {
                      "anyOf": [
                        {
                          "type": "number"
                        },
                        {
                          "type": "string",
                          "enum": [
                            "Infinity",
                            "-Infinity",
                            "NaN"
                          ]
                        }
                      ]
                    },
                    {
                      "type": "null"
                    }
                  ]
                },
                "patientSnapshot": {
                  "type": "object",
                  "properties": {
                    "address": {
                      "anyOf": [
                        {
                          "type": "object"
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "allergyReviewStatus": {
                      "anyOf": [
                        {
                          "type": "string",
                          "enum": [
                            "no_known",
                            "not_reviewed",
                            "recorded"
                          ]
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "dateOfBirth": {
                      "type": "string"
                    },
                    "email": {
                      "anyOf": [
                        {
                          "type": "string"
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "gender": {
                      "anyOf": [
                        {
                          "type": "string",
                          "enum": [
                            "f",
                            "m",
                            "o",
                            "u"
                          ]
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "legalName": {
                      "type": "string"
                    },
                    "phone": {
                      "anyOf": [
                        {
                          "type": "string"
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "state": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "dateOfBirth",
                    "legalName",
                    "state"
                  ],
                  "additionalProperties": false
                },
                "deliveryAddress": {
                  "anyOf": [
                    {
                      "type": "object"
                    },
                    {
                      "type": "null"
                    }
                  ],
                  "description": "The saved delivery address for this prescription version. Patient profile updates do not replace it. Review this address before signing."
                },
                "deliveryAddressDiffersFromPatient": {
                  "type": "boolean",
                  "description": "Whether the saved delivery address differs from the current primary patient address. This can be intentional; confirm the delivery address before signing."
                },
                "providerSnapshot": {
                  "anyOf": [
                    {
                      "type": "object",
                      "properties": {
                        "address": {
                          "anyOf": [
                            {
                              "type": "object"
                            },
                            {
                              "type": "null"
                            }
                          ]
                        },
                        "credentials": {
                          "anyOf": [
                            {
                              "type": "string"
                            },
                            {
                              "type": "null"
                            }
                          ]
                        },
                        "legalName": {
                          "type": "string"
                        },
                        "licenseNumber": {
                          "anyOf": [
                            {
                              "type": "string"
                            },
                            {
                              "type": "null"
                            }
                          ]
                        },
                        "licenseState": {
                          "anyOf": [
                            {
                              "type": "string"
                            },
                            {
                              "type": "null"
                            }
                          ]
                        },
                        "licenseExpiresAt": {
                          "anyOf": [
                            {
                              "type": "string"
                            },
                            {
                              "type": "null"
                            }
                          ]
                        },
                        "npi": {
                          "type": "string"
                        },
                        "phone": {
                          "anyOf": [
                            {
                              "type": "string"
                            },
                            {
                              "type": "null"
                            }
                          ]
                        }
                      },
                      "required": [
                        "legalName",
                        "npi"
                      ],
                      "additionalProperties": false
                    },
                    {
                      "type": "null"
                    }
                  ]
                },
                "clinical": {
                  "anyOf": [
                    {
                      "type": "object",
                      "properties": {
                        "allergies": {
                          "anyOf": [
                            {
                              "type": "array",
                              "items": {
                                "type": "object",
                                "properties": {
                                  "code": {
                                    "anyOf": [
                                      {
                                        "type": "string"
                                      },
                                      {
                                        "type": "null"
                                      }
                                    ]
                                  },
                                  "codeSystem": {
                                    "anyOf": [
                                      {
                                        "type": "string"
                                      },
                                      {
                                        "type": "null"
                                      }
                                    ]
                                  },
                                  "display": {
                                    "type": "string"
                                  },
                                  "source": {
                                    "anyOf": [
                                      {
                                        "type": "string"
                                      },
                                      {
                                        "type": "null"
                                      }
                                    ]
                                  },
                                  "category": {
                                    "anyOf": [
                                      {
                                        "type": "string"
                                      },
                                      {
                                        "type": "null"
                                      }
                                    ]
                                  },
                                  "severity": {
                                    "anyOf": [
                                      {
                                        "anyOf": [
                                          {
                                            "type": "string"
                                          },
                                          {
                                            "type": "null"
                                          }
                                        ]
                                      },
                                      {
                                        "type": "null"
                                      }
                                    ]
                                  },
                                  "type": {
                                    "anyOf": [
                                      {
                                        "anyOf": [
                                          {
                                            "type": "string"
                                          },
                                          {
                                            "type": "null"
                                          }
                                        ]
                                      },
                                      {
                                        "type": "null"
                                      }
                                    ]
                                  },
                                  "verificationStatus": {
                                    "anyOf": [
                                      {
                                        "anyOf": [
                                          {
                                            "type": "string"
                                          },
                                          {
                                            "type": "null"
                                          }
                                        ]
                                      },
                                      {
                                        "type": "null"
                                      }
                                    ]
                                  },
                                  "reactions": {
                                    "anyOf": [
                                      {
                                        "type": "array",
                                        "items": {
                                          "type": "object",
                                          "properties": {
                                            "code": {
                                              "anyOf": [
                                                {
                                                  "type": "string"
                                                },
                                                {
                                                  "type": "null"
                                                }
                                              ]
                                            },
                                            "codeSystem": {
                                              "anyOf": [
                                                {
                                                  "type": "string"
                                                },
                                                {
                                                  "type": "null"
                                                }
                                              ]
                                            },
                                            "display": {
                                              "type": "string"
                                            },
                                            "source": {
                                              "anyOf": [
                                                {
                                                  "type": "string"
                                                },
                                                {
                                                  "type": "null"
                                                }
                                              ]
                                            }
                                          },
                                          "required": [
                                            "display"
                                          ],
                                          "additionalProperties": false
                                        }
                                      },
                                      {
                                        "type": "null"
                                      }
                                    ]
                                  }
                                },
                                "required": [
                                  "display"
                                ],
                                "additionalProperties": false
                              }
                            },
                            {
                              "type": "null"
                            }
                          ]
                        },
                        "medicationReviewStatus": {
                          "anyOf": [
                            {
                              "type": "string",
                              "enum": [
                                "not_reviewed",
                                "none",
                                "recorded"
                              ]
                            },
                            {
                              "type": "null"
                            }
                          ]
                        },
                        "diagnosisReviewStatus": {
                          "anyOf": [
                            {
                              "type": "string",
                              "enum": [
                                "not_reviewed",
                                "none",
                                "recorded"
                              ]
                            },
                            {
                              "type": "null"
                            }
                          ]
                        },
                        "conditions": {
                          "anyOf": [
                            {
                              "type": "array",
                              "items": {
                                "type": "object",
                                "properties": {
                                  "code": {
                                    "anyOf": [
                                      {
                                        "type": "string"
                                      },
                                      {
                                        "type": "null"
                                      }
                                    ]
                                  },
                                  "codeSystem": {
                                    "anyOf": [
                                      {
                                        "type": "string"
                                      },
                                      {
                                        "type": "null"
                                      }
                                    ]
                                  },
                                  "display": {
                                    "type": "string"
                                  },
                                  "source": {
                                    "anyOf": [
                                      {
                                        "type": "string"
                                      },
                                      {
                                        "type": "null"
                                      }
                                    ]
                                  }
                                },
                                "required": [
                                  "display"
                                ],
                                "additionalProperties": false
                              }
                            },
                            {
                              "type": "null"
                            }
                          ]
                        },
                        "compoundingReason": {
                          "anyOf": [
                            {
                              "type": "object",
                              "properties": {
                                "category": {
                                  "anyOf": [
                                    {
                                      "type": "string"
                                    },
                                    {
                                      "type": "null"
                                    }
                                  ]
                                },
                                "context": {
                                  "type": "string"
                                }
                              },
                              "required": [
                                "context"
                              ],
                              "additionalProperties": false
                            },
                            {
                              "type": "null"
                            }
                          ]
                        },
                        "medications": {
                          "anyOf": [
                            {
                              "type": "array",
                              "items": {
                                "type": "object",
                                "properties": {
                                  "display": {
                                    "type": "string"
                                  },
                                  "ndc": {
                                    "anyOf": [
                                      {
                                        "type": "string"
                                      },
                                      {
                                        "type": "null"
                                      }
                                    ]
                                  },
                                  "rxNormCui": {
                                    "anyOf": [
                                      {
                                        "type": "string"
                                      },
                                      {
                                        "type": "null"
                                      }
                                    ]
                                  },
                                  "source": {
                                    "anyOf": [
                                      {
                                        "type": "string"
                                      },
                                      {
                                        "type": "null"
                                      }
                                    ]
                                  }
                                },
                                "required": [
                                  "display"
                                ],
                                "additionalProperties": false
                              }
                            },
                            {
                              "type": "null"
                            }
                          ]
                        },
                        "observations": {
                          "anyOf": [
                            {
                              "type": "array",
                              "items": {
                                "type": "object",
                                "properties": {
                                  "code": {
                                    "anyOf": [
                                      {
                                        "type": "string"
                                      },
                                      {
                                        "type": "null"
                                      }
                                    ]
                                  },
                                  "display": {
                                    "type": "string"
                                  },
                                  "value": {
                                    "anyOf": [
                                      {
                                        "type": "number"
                                      },
                                      {
                                        "type": "string",
                                        "enum": [
                                          "Infinity",
                                          "-Infinity",
                                          "NaN"
                                        ]
                                      }
                                    ]
                                  },
                                  "unit": {
                                    "type": "string"
                                  }
                                },
                                "required": [
                                  "display",
                                  "value",
                                  "unit"
                                ],
                                "additionalProperties": false
                              }
                            },
                            {
                              "type": "null"
                            }
                          ]
                        }
                      },
                      "additionalProperties": false
                    },
                    {
                      "type": "null"
                    }
                  ]
                },
                "dispensing": {
                  "anyOf": [
                    {
                      "type": "object",
                      "properties": {
                        "dispenseUponAcceptance": {
                          "type": "boolean"
                        },
                        "substitutionPermitted": {
                          "type": "boolean"
                        },
                        "pharmacyNotes": {
                          "anyOf": [
                            {
                              "type": "string"
                            },
                            {
                              "type": "null"
                            }
                          ]
                        },
                        "requestedFillDate": {
                          "anyOf": [
                            {
                              "type": "string"
                            },
                            {
                              "type": "null"
                            }
                          ]
                        },
                        "shippingOptionId": {
                          "anyOf": [
                            {
                              "type": "string"
                            },
                            {
                              "type": "null"
                            }
                          ]
                        },
                        "shippingAmountCents": {
                          "anyOf": [
                            {
                              "type": "integer"
                            },
                            {
                              "type": "null"
                            }
                          ]
                        },
                        "shippingDestinationType": {
                          "anyOf": [
                            {
                              "type": "string",
                              "enum": [
                                "patient",
                                "practice"
                              ]
                            },
                            {
                              "type": "null"
                            }
                          ]
                        }
                      },
                      "required": [
                        "dispenseUponAcceptance",
                        "substitutionPermitted"
                      ],
                      "additionalProperties": false
                    },
                    {
                      "type": "null"
                    }
                  ]
                },
                "structuredSig": {
                  "anyOf": [
                    {
                      "type": "object",
                      "properties": {
                        "dose": {
                          "type": "string"
                        },
                        "doseUnit": {
                          "type": "string"
                        },
                        "frequency": {
                          "type": "string"
                        },
                        "route": {
                          "type": "string"
                        },
                        "prn": {
                          "type": "boolean"
                        },
                        "duration": {
                          "anyOf": [
                            {
                              "type": "string"
                            },
                            {
                              "type": "null"
                            }
                          ]
                        },
                        "indication": {
                          "anyOf": [
                            {
                              "type": "string"
                            },
                            {
                              "type": "null"
                            }
                          ]
                        },
                        "maxDailyUse": {
                          "anyOf": [
                            {
                              "type": "string"
                            },
                            {
                              "type": "null"
                            }
                          ]
                        },
                        "titrationSchedule": {
                          "anyOf": [
                            {
                              "type": "string"
                            },
                            {
                              "type": "null"
                            }
                          ]
                        }
                      },
                      "required": [
                        "dose",
                        "doseUnit",
                        "frequency",
                        "route",
                        "prn"
                      ],
                      "additionalProperties": false
                    },
                    {
                      "type": "null"
                    }
                  ]
                },
                "externalPrescriptionId": {
                  "anyOf": [
                    {
                      "type": "string",
                      "allOf": [
                        {
                          "minLength": 1
                        },
                        {
                          "maxLength": 200
                        },
                        {
                          "pattern": "\\S"
                        },
                        {
                          "pattern": "^[^\\p{Cc}\\p{Cs}]*$"
                        }
                      ]
                    },
                    {
                      "type": "null"
                    }
                  ]
                },
                "catalogItemId": {
                  "anyOf": [
                    {
                      "type": "string",
                      "allOf": [
                        {
                          "pattern": "^cat_[0-7][0-9a-hjkmnp-tv-z]{25}$",
                          "examples": [
                            "cat_01j2y8m6jcc9tt24af5pw9x1bc"
                          ]
                        }
                      ]
                    },
                    {
                      "type": "null"
                    }
                  ]
                },
                "pharmacyId": {
                  "anyOf": [
                    {
                      "type": "string",
                      "allOf": [
                        {
                          "pattern": "^pharm_[0-7][0-9a-hjkmnp-tv-z]{25}$",
                          "examples": [
                            "pharm_01j2y8m6jcc9tt24af5pw9x1bc"
                          ]
                        }
                      ]
                    },
                    {
                      "type": "null"
                    }
                  ]
                },
                "pharmacyName": {
                  "anyOf": [
                    {
                      "type": "string"
                    },
                    {
                      "type": "null"
                    }
                  ]
                },
                "directions": {
                  "type": "string"
                },
                "dosageForm": {
                  "anyOf": [
                    {
                      "type": "string"
                    },
                    {
                      "type": "null"
                    }
                  ]
                },
                "id": {
                  "type": "string",
                  "allOf": [
                    {
                      "pattern": "^rx_[0-7][0-9a-hjkmnp-tv-z]{25}$",
                      "examples": [
                        "rx_01j2y8m6jcc9tt24af5pw9x1bc"
                      ]
                    }
                  ]
                },
                "medicationName": {
                  "type": "string"
                },
                "quantity": {
                  "anyOf": [
                    {
                      "type": "number"
                    },
                    {
                      "type": "string",
                      "enum": [
                        "Infinity",
                        "-Infinity",
                        "NaN"
                      ]
                    }
                  ]
                },
                "quantityUnit": {
                  "type": "string"
                },
                "refills": {
                  "type": "integer"
                },
                "status": {
                  "type": "string"
                },
                "strength": {
                  "anyOf": [
                    {
                      "type": "string"
                    },
                    {
                      "type": "null"
                    }
                  ]
                }
              },
              "required": [
                "version",
                "daysSupply",
                "patientSnapshot",
                "deliveryAddress",
                "deliveryAddressDiffersFromPatient",
                "providerSnapshot",
                "clinical",
                "dispensing",
                "structuredSig",
                "externalPrescriptionId",
                "catalogItemId",
                "pharmacyId",
                "pharmacyName",
                "directions",
                "dosageForm",
                "id",
                "medicationName",
                "quantity",
                "quantityUnit",
                "refills",
                "status",
                "strength"
              ],
              "additionalProperties": false
            },
            "allOf": [
              {
                "minItems": 1
              }
            ]
          },
          "status": {
            "type": "string",
            "enum": [
              "blocked",
              "cancelled",
              "delivered",
              "draft",
              "partially_submitted",
              "requires_provider_signature",
              "processing",
              "ready",
              "rejected",
              "shipped",
              "submitted"
            ]
          },
          "updatedAt": {
            "type": "string"
          }
        },
        "required": [
          "revision",
          "otcItems",
          "practiceMedicationTotalCents",
          "externalOrderId",
          "metadata",
          "createdAt",
          "fulfillments",
          "id",
          "lifecycleEvents",
          "livemode",
          "object",
          "patientExternalId",
          "patientId",
          "patientName",
          "patientState",
          "practiceId",
          "prescriberName",
          "prescriberNpi",
          "review",
          "prescriptions",
          "status",
          "updatedAt"
        ],
        "additionalProperties": false
      },
      "CancelOrderRequest": {
        "type": "object",
        "properties": {
          "reason": {
            "type": "string"
          }
        },
        "required": [
          "reason"
        ],
        "additionalProperties": false,
        "title": "CancelOrderRequest"
      },
      "CancelOrderResponse": {
        "title": "CancelOrderResponse",
        "type": "object",
        "properties": {
          "revision": {
            "type": "string",
            "pattern": "^rev_[a-f0-9]{64}$",
            "description": "Opaque revision of the complete order prescription set. Send the revision you reviewed as expectedRevision; never replace it automatically after a conflict."
          },
          "otcItems": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "catalogItemId": {
                  "type": "string",
                  "allOf": [
                    {
                      "pattern": "^cat_[0-7][0-9a-hjkmnp-tv-z]{25}$",
                      "examples": [
                        "cat_01j2y8m6jcc9tt24af5pw9x1bc"
                      ]
                    }
                  ]
                },
                "prescriptionId": {
                  "type": "string",
                  "allOf": [
                    {
                      "pattern": "^rx_[0-7][0-9a-hjkmnp-tv-z]{25}$",
                      "examples": [
                        "rx_01j2y8m6jcc9tt24af5pw9x1bc"
                      ]
                    }
                  ]
                },
                "name": {
                  "type": "string"
                },
                "quantity": {
                  "type": "integer"
                },
                "unitPriceCents": {
                  "type": "integer"
                },
                "subtotalCents": {
                  "type": "integer"
                }
              },
              "required": [
                "catalogItemId",
                "prescriptionId",
                "name",
                "quantity",
                "unitPriceCents",
                "subtotalCents"
              ],
              "additionalProperties": false
            }
          },
          "practiceMedicationTotalCents": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "description": "Snapshot of the practice-facing medication total. Null until every prescription has recorded submission pricing. Excludes shipping and supplies."
          },
          "externalOrderId": {
            "anyOf": [
              {
                "type": "string",
                "allOf": [
                  {
                    "minLength": 1
                  },
                  {
                    "maxLength": 200
                  },
                  {
                    "pattern": "\\S"
                  },
                  {
                    "pattern": "^[^\\p{Cc}\\p{Cs}]*$"
                  }
                ]
              },
              {
                "type": "null"
              }
            ]
          },
          "metadata": {
            "type": "object",
            "additionalProperties": {
              "anyOf": [
                {
                  "type": "string",
                  "allOf": [
                    {
                      "pattern": "^[^\\p{Cs}]*$"
                    },
                    {
                      "maxLength": 500
                    }
                  ]
                },
                {
                  "type": "number"
                },
                {
                  "type": "boolean"
                },
                {
                  "type": "null"
                }
              ]
            },
            "allOf": [
              {
                "propertyNames": {
                  "type": "string",
                  "allOf": [
                    {
                      "pattern": "^[^\\p{Cs}]*$"
                    },
                    {
                      "minLength": 1
                    },
                    {
                      "maxLength": 40
                    }
                  ]
                }
              },
              {
                "maxProperties": 20
              }
            ]
          },
          "createdAt": {
            "type": "string"
          },
          "fulfillments": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "carrier": {
                  "anyOf": [
                    {
                      "type": "string"
                    },
                    {
                      "type": "null"
                    }
                  ]
                },
                "cancellations": {
                  "type": "array",
                  "items": {
                    "type": "object",
                    "properties": {
                      "attempts": {
                        "type": "integer"
                      },
                      "confirmedAt": {
                        "anyOf": [
                          {
                            "type": "string"
                          },
                          {
                            "type": "null"
                          }
                        ]
                      },
                      "createdAt": {
                        "type": "string"
                      },
                      "errorCode": {
                        "anyOf": [
                          {
                            "type": "string"
                          },
                          {
                            "type": "null"
                          }
                        ]
                      },
                      "errorMessage": {
                        "anyOf": [
                          {
                            "type": "string"
                          },
                          {
                            "type": "null"
                          }
                        ]
                      },
                      "id": {
                        "type": "string",
                        "allOf": [
                          {
                            "pattern": "^cancl_[0-7][0-9a-hjkmnp-tv-z]{25}$",
                            "examples": [
                              "cancl_01j2y8m6jcc9tt24af5pw9x1bc"
                            ]
                          }
                        ]
                      },
                      "providerStatus": {
                        "anyOf": [
                          {
                            "type": "string"
                          },
                          {
                            "type": "null"
                          }
                        ]
                      },
                      "reason": {
                        "type": "string"
                      },
                      "requestedAt": {
                        "type": "string"
                      },
                      "requestedBy": {
                        "type": "object",
                        "properties": {
                          "id": {
                            "type": "string"
                          },
                          "type": {
                            "type": "string"
                          }
                        },
                        "required": [
                          "id",
                          "type"
                        ],
                        "additionalProperties": false
                      },
                      "resolvedAt": {
                        "anyOf": [
                          {
                            "type": "string"
                          },
                          {
                            "type": "null"
                          }
                        ]
                      },
                      "sentAt": {
                        "anyOf": [
                          {
                            "type": "string"
                          },
                          {
                            "type": "null"
                          }
                        ]
                      },
                      "source": {
                        "type": "string",
                        "enum": [
                          "provider",
                          "platform",
                          "public_api",
                          "pharmacy",
                          "system"
                        ]
                      },
                      "status": {
                        "type": "string",
                        "enum": [
                          "requested",
                          "sent",
                          "confirmed",
                          "rejected",
                          "failed",
                          "too_late"
                        ]
                      },
                      "updatedAt": {
                        "type": "string"
                      }
                    },
                    "required": [
                      "attempts",
                      "confirmedAt",
                      "createdAt",
                      "errorCode",
                      "errorMessage",
                      "id",
                      "providerStatus",
                      "reason",
                      "requestedAt",
                      "requestedBy",
                      "resolvedAt",
                      "sentAt",
                      "source",
                      "status",
                      "updatedAt"
                    ],
                    "additionalProperties": false
                  }
                },
                "pharmacyId": {
                  "anyOf": [
                    {
                      "type": "string",
                      "allOf": [
                        {
                          "pattern": "^pharm_[0-7][0-9a-hjkmnp-tv-z]{25}$",
                          "examples": [
                            "pharm_01j2y8m6jcc9tt24af5pw9x1bc"
                          ]
                        }
                      ]
                    },
                    {
                      "type": "null"
                    }
                  ]
                },
                "createdAt": {
                  "type": "string"
                },
                "id": {
                  "type": "string",
                  "allOf": [
                    {
                      "pattern": "^ord_[0-7][0-9a-hjkmnp-tv-z]{25}$",
                      "examples": [
                        "ord_01j2y8m6jcc9tt24af5pw9x1bc"
                      ]
                    }
                  ]
                },
                "prescriptionId": {
                  "type": "string",
                  "allOf": [
                    {
                      "pattern": "^rx_[0-7][0-9a-hjkmnp-tv-z]{25}$",
                      "examples": [
                        "rx_01j2y8m6jcc9tt24af5pw9x1bc"
                      ]
                    }
                  ]
                },
                "status": {
                  "type": "string"
                },
                "trackingNumber": {
                  "anyOf": [
                    {
                      "type": "string"
                    },
                    {
                      "type": "null"
                    }
                  ]
                },
                "trackingStatus": {
                  "anyOf": [
                    {
                      "type": "string"
                    },
                    {
                      "type": "null"
                    }
                  ]
                },
                "shippedAt": {
                  "anyOf": [
                    {
                      "type": "string"
                    },
                    {
                      "type": "null"
                    }
                  ]
                },
                "deliveredAt": {
                  "anyOf": [
                    {
                      "type": "string"
                    },
                    {
                      "type": "null"
                    }
                  ]
                },
                "estimatedDeliveryAt": {
                  "anyOf": [
                    {
                      "type": "string"
                    },
                    {
                      "type": "null"
                    }
                  ]
                },
                "exceptions": {
                  "type": "array",
                  "items": {
                    "type": "object",
                    "properties": {
                      "actionable": {
                        "type": "boolean"
                      },
                      "assignedTo": {
                        "anyOf": [
                          {
                            "type": "object",
                            "properties": {
                              "id": {
                                "type": "string"
                              },
                              "name": {
                                "type": "string"
                              }
                            },
                            "required": [
                              "id",
                              "name"
                            ],
                            "additionalProperties": false
                          },
                          {
                            "type": "null"
                          }
                        ]
                      },
                      "createdAt": {
                        "type": "string"
                      },
                      "dueAt": {
                        "anyOf": [
                          {
                            "type": "string"
                          },
                          {
                            "type": "null"
                          }
                        ]
                      },
                      "id": {
                        "type": "string",
                        "allOf": [
                          {
                            "pattern": "^fex_[0-7][0-9a-hjkmnp-tv-z]{25}$",
                            "examples": [
                              "fex_01j2y8m6jcc9tt24af5pw9x1bc"
                            ]
                          }
                        ]
                      },
                      "kind": {
                        "type": "string"
                      },
                      "resolution": {
                        "anyOf": [
                          {
                            "type": "string"
                          },
                          {
                            "type": "null"
                          }
                        ]
                      },
                      "resolvedAt": {
                        "anyOf": [
                          {
                            "type": "string"
                          },
                          {
                            "type": "null"
                          }
                        ]
                      },
                      "retryable": {
                        "type": "boolean"
                      },
                      "severity": {
                        "type": "string",
                        "enum": [
                          "warning",
                          "critical"
                        ]
                      },
                      "status": {
                        "type": "string",
                        "enum": [
                          "open",
                          "acknowledged",
                          "resolved"
                        ]
                      },
                      "summary": {
                        "type": "string"
                      },
                      "updatedAt": {
                        "type": "string"
                      }
                    },
                    "required": [
                      "actionable",
                      "assignedTo",
                      "createdAt",
                      "dueAt",
                      "id",
                      "kind",
                      "resolution",
                      "resolvedAt",
                      "retryable",
                      "severity",
                      "status",
                      "summary",
                      "updatedAt"
                    ],
                    "additionalProperties": false
                  }
                },
                "shipping": {
                  "type": "object",
                  "properties": {
                    "destinationType": {
                      "type": "string",
                      "enum": [
                        "patient",
                        "practice"
                      ]
                    },
                    "method": {
                      "type": "string",
                      "enum": [
                        "standard",
                        "expedited",
                        "overnight",
                        "pickup",
                        "local_delivery"
                      ]
                    },
                    "option": {
                      "anyOf": [
                        {
                          "type": "object",
                          "properties": {
                            "amountCents": {
                              "type": "integer",
                              "allOf": [
                                {
                                  "minimum": 0
                                }
                              ]
                            },
                            "currency": {
                              "type": "string",
                              "enum": [
                                "USD"
                              ]
                            },
                            "label": {
                              "type": "string"
                            },
                            "serviceLevel": {
                              "type": "string"
                            },
                            "temperature": {
                              "type": "string",
                              "enum": [
                                "ambient",
                                "refrigerated"
                              ]
                            }
                          },
                          "required": [
                            "amountCents",
                            "currency",
                            "label",
                            "serviceLevel",
                            "temperature"
                          ],
                          "additionalProperties": false
                        },
                        {
                          "type": "null"
                        }
                      ]
                    }
                  },
                  "required": [
                    "destinationType",
                    "method",
                    "option"
                  ],
                  "additionalProperties": false
                },
                "shipments": {
                  "type": "array",
                  "items": {
                    "type": "object",
                    "properties": {
                      "carrier": {
                        "anyOf": [
                          {
                            "type": "string"
                          },
                          {
                            "type": "null"
                          }
                        ]
                      },
                      "createdAt": {
                        "type": "string"
                      },
                      "deliveredAt": {
                        "anyOf": [
                          {
                            "type": "string"
                          },
                          {
                            "type": "null"
                          }
                        ]
                      },
                      "estimatedDeliveryAt": {
                        "anyOf": [
                          {
                            "type": "string"
                          },
                          {
                            "type": "null"
                          }
                        ]
                      },
                      "id": {
                        "type": "string",
                        "allOf": [
                          {
                            "pattern": "^ship_[0-7][0-9a-hjkmnp-tv-z]{25}$",
                            "examples": [
                              "ship_01j2y8m6jcc9tt24af5pw9x1bc"
                            ]
                          }
                        ]
                      },
                      "isActive": {
                        "type": "boolean"
                      },
                      "providerStatus": {
                        "anyOf": [
                          {
                            "type": "string"
                          },
                          {
                            "type": "null"
                          }
                        ]
                      },
                      "replacedAt": {
                        "anyOf": [
                          {
                            "type": "string"
                          },
                          {
                            "type": "null"
                          }
                        ]
                      },
                      "replacesShipmentId": {
                        "anyOf": [
                          {
                            "type": "string",
                            "allOf": [
                              {
                                "pattern": "^ship_[0-7][0-9a-hjkmnp-tv-z]{25}$",
                                "examples": [
                                  "ship_01j2y8m6jcc9tt24af5pw9x1bc"
                                ]
                              }
                            ]
                          },
                          {
                            "type": "null"
                          }
                        ]
                      },
                      "shippedAt": {
                        "anyOf": [
                          {
                            "type": "string"
                          },
                          {
                            "type": "null"
                          }
                        ]
                      },
                      "source": {
                        "type": "string",
                        "enum": [
                          "pharmacy_webhook",
                          "pharmacy",
                          "system"
                        ]
                      },
                      "status": {
                        "type": "string",
                        "enum": [
                          "label_created",
                          "carrier_possession",
                          "in_transit",
                          "out_for_delivery",
                          "delivered",
                          "delayed",
                          "delivery_failed",
                          "returned",
                          "voided",
                          "unknown"
                        ]
                      },
                      "trackingNumber": {
                        "anyOf": [
                          {
                            "type": "string"
                          },
                          {
                            "type": "null"
                          }
                        ]
                      },
                      "trackingUrl": {
                        "anyOf": [
                          {
                            "type": "string"
                          },
                          {
                            "type": "null"
                          }
                        ]
                      },
                      "updatedAt": {
                        "type": "string"
                      },
                      "voidedAt": {
                        "anyOf": [
                          {
                            "type": "string"
                          },
                          {
                            "type": "null"
                          }
                        ]
                      }
                    },
                    "required": [
                      "carrier",
                      "createdAt",
                      "deliveredAt",
                      "estimatedDeliveryAt",
                      "id",
                      "isActive",
                      "providerStatus",
                      "replacedAt",
                      "replacesShipmentId",
                      "shippedAt",
                      "source",
                      "status",
                      "trackingNumber",
                      "trackingUrl",
                      "updatedAt",
                      "voidedAt"
                    ],
                    "additionalProperties": false
                  }
                },
                "trackingUrl": {
                  "anyOf": [
                    {
                      "type": "string"
                    },
                    {
                      "type": "null"
                    }
                  ]
                },
                "updatedAt": {
                  "type": "string"
                }
              },
              "required": [
                "carrier",
                "cancellations",
                "pharmacyId",
                "createdAt",
                "id",
                "prescriptionId",
                "status",
                "trackingNumber",
                "trackingStatus",
                "shippedAt",
                "deliveredAt",
                "estimatedDeliveryAt",
                "exceptions",
                "shipping",
                "shipments",
                "trackingUrl",
                "updatedAt"
              ],
              "additionalProperties": false
            }
          },
          "id": {
            "type": "string",
            "pattern": "^ord_[0-7][0-9a-hjkmnp-tv-z]{25}$",
            "examples": [
              "ord_01j2y8m6jcc9tt24af5pw9x1bc"
            ]
          },
          "lifecycleEvents": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "createdAt": {
                  "type": "string"
                },
                "eventType": {
                  "type": "string"
                },
                "id": {
                  "type": "string"
                },
                "message": {
                  "type": "string"
                },
                "source": {
                  "type": "string",
                  "enum": [
                    "cancellation",
                    "exception",
                    "fulfillment",
                    "integration",
                    "shipment",
                    "webhook"
                  ]
                }
              },
              "required": [
                "createdAt",
                "eventType",
                "id",
                "message",
                "source"
              ],
              "additionalProperties": false
            }
          },
          "livemode": {
            "type": "boolean"
          },
          "object": {
            "type": "string",
            "enum": [
              "order"
            ]
          },
          "patientExternalId": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ]
          },
          "patientId": {
            "type": "string",
            "pattern": "^pat_[0-7][0-9a-hjkmnp-tv-z]{25}$",
            "examples": [
              "pat_01j2y8m6jcc9tt24af5pw9x1bc"
            ]
          },
          "patientName": {
            "type": "string"
          },
          "patientState": {
            "type": "string",
            "description": "The patient's current clinical state. This is not the saved delivery state; use each prescription's deliveryAddress for shipping."
          },
          "practiceId": {
            "type": "string",
            "pattern": "^prac_[0-7][0-9a-hjkmnp-tv-z]{25}$",
            "examples": [
              "prac_01j2y8m6jcc9tt24af5pw9x1bc"
            ]
          },
          "prescriberName": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ]
          },
          "prescriberNpi": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ]
          },
          "review": {
            "anyOf": [
              {
                "type": "object",
                "properties": {
                  "status": {
                    "type": "string",
                    "enum": [
                      "completed",
                      "rejected"
                    ]
                  },
                  "reason": {
                    "anyOf": [
                      {
                        "type": "string"
                      },
                      {
                        "type": "null"
                      }
                    ]
                  },
                  "requestedAt": {
                    "type": "string"
                  },
                  "completedAt": {
                    "anyOf": [
                      {
                        "type": "string"
                      },
                      {
                        "type": "null"
                      }
                    ]
                  },
                  "canceledAt": {
                    "anyOf": [
                      {
                        "type": "string"
                      },
                      {
                        "type": "null"
                      }
                    ]
                  },
                  "resolvedAt": {
                    "anyOf": [
                      {
                        "type": "string"
                      },
                      {
                        "type": "null"
                      }
                    ]
                  },
                  "resolvedBy": {
                    "anyOf": [
                      {
                        "type": "object",
                        "properties": {
                          "id": {
                            "type": "string"
                          },
                          "type": {
                            "type": "string"
                          }
                        },
                        "required": [
                          "id",
                          "type"
                        ],
                        "additionalProperties": false
                      },
                      {
                        "type": "null"
                      }
                    ]
                  },
                  "providerId": {
                    "anyOf": [
                      {
                        "type": "string",
                        "allOf": [
                          {
                            "pattern": "^prov_[0-7][0-9a-hjkmnp-tv-z]{25}$",
                            "examples": [
                              "prov_01j2y8m6jcc9tt24af5pw9x1bc"
                            ]
                          }
                        ]
                      },
                      {
                        "type": "null"
                      }
                    ]
                  }
                },
                "required": [
                  "status",
                  "reason",
                  "requestedAt",
                  "completedAt",
                  "canceledAt",
                  "resolvedAt",
                  "resolvedBy",
                  "providerId"
                ],
                "additionalProperties": false
              },
              {
                "type": "null"
              }
            ]
          },
          "prescriptions": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "version": {
                  "type": "integer"
                },
                "daysSupply": {
                  "anyOf": [
                    {
                      "anyOf": [
                        {
                          "type": "number"
                        },
                        {
                          "type": "string",
                          "enum": [
                            "Infinity",
                            "-Infinity",
                            "NaN"
                          ]
                        }
                      ]
                    },
                    {
                      "type": "null"
                    }
                  ]
                },
                "patientSnapshot": {
                  "type": "object",
                  "properties": {
                    "address": {
                      "anyOf": [
                        {
                          "type": "object"
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "allergyReviewStatus": {
                      "anyOf": [
                        {
                          "type": "string",
                          "enum": [
                            "no_known",
                            "not_reviewed",
                            "recorded"
                          ]
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "dateOfBirth": {
                      "type": "string"
                    },
                    "email": {
                      "anyOf": [
                        {
                          "type": "string"
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "gender": {
                      "anyOf": [
                        {
                          "type": "string",
                          "enum": [
                            "f",
                            "m",
                            "o",
                            "u"
                          ]
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "legalName": {
                      "type": "string"
                    },
                    "phone": {
                      "anyOf": [
                        {
                          "type": "string"
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "state": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "dateOfBirth",
                    "legalName",
                    "state"
                  ],
                  "additionalProperties": false
                },
                "deliveryAddress": {
                  "anyOf": [
                    {
                      "type": "object"
                    },
                    {
                      "type": "null"
                    }
                  ],
                  "description": "The saved delivery address for this prescription version. Patient profile updates do not replace it. Review this address before signing."
                },
                "deliveryAddressDiffersFromPatient": {
                  "type": "boolean",
                  "description": "Whether the saved delivery address differs from the current primary patient address. This can be intentional; confirm the delivery address before signing."
                },
                "providerSnapshot": {
                  "anyOf": [
                    {
                      "type": "object",
                      "properties": {
                        "address": {
                          "anyOf": [
                            {
                              "type": "object"
                            },
                            {
                              "type": "null"
                            }
                          ]
                        },
                        "credentials": {
                          "anyOf": [
                            {
                              "type": "string"
                            },
                            {
                              "type": "null"
                            }
                          ]
                        },
                        "legalName": {
                          "type": "string"
                        },
                        "licenseNumber": {
                          "anyOf": [
                            {
                              "type": "string"
                            },
                            {
                              "type": "null"
                            }
                          ]
                        },
                        "licenseState": {
                          "anyOf": [
                            {
                              "type": "string"
                            },
                            {
                              "type": "null"
                            }
                          ]
                        },
                        "licenseExpiresAt": {
                          "anyOf": [
                            {
                              "type": "string"
                            },
                            {
                              "type": "null"
                            }
                          ]
                        },
                        "npi": {
                          "type": "string"
                        },
                        "phone": {
                          "anyOf": [
                            {
                              "type": "string"
                            },
                            {
                              "type": "null"
                            }
                          ]
                        }
                      },
                      "required": [
                        "legalName",
                        "npi"
                      ],
                      "additionalProperties": false
                    },
                    {
                      "type": "null"
                    }
                  ]
                },
                "clinical": {
                  "anyOf": [
                    {
                      "type": "object",
                      "properties": {
                        "allergies": {
                          "anyOf": [
                            {
                              "type": "array",
                              "items": {
                                "type": "object",
                                "properties": {
                                  "code": {
                                    "anyOf": [
                                      {
                                        "type": "string"
                                      },
                                      {
                                        "type": "null"
                                      }
                                    ]
                                  },
                                  "codeSystem": {
                                    "anyOf": [
                                      {
                                        "type": "string"
                                      },
                                      {
                                        "type": "null"
                                      }
                                    ]
                                  },
                                  "display": {
                                    "type": "string"
                                  },
                                  "source": {
                                    "anyOf": [
                                      {
                                        "type": "string"
                                      },
                                      {
                                        "type": "null"
                                      }
                                    ]
                                  },
                                  "category": {
                                    "anyOf": [
                                      {
                                        "type": "string"
                                      },
                                      {
                                        "type": "null"
                                      }
                                    ]
                                  },
                                  "severity": {
                                    "anyOf": [
                                      {
                                        "anyOf": [
                                          {
                                            "type": "string"
                                          },
                                          {
                                            "type": "null"
                                          }
                                        ]
                                      },
                                      {
                                        "type": "null"
                                      }
                                    ]
                                  },
                                  "type": {
                                    "anyOf": [
                                      {
                                        "anyOf": [
                                          {
                                            "type": "string"
                                          },
                                          {
                                            "type": "null"
                                          }
                                        ]
                                      },
                                      {
                                        "type": "null"
                                      }
                                    ]
                                  },
                                  "verificationStatus": {
                                    "anyOf": [
                                      {
                                        "anyOf": [
                                          {
                                            "type": "string"
                                          },
                                          {
                                            "type": "null"
                                          }
                                        ]
                                      },
                                      {
                                        "type": "null"
                                      }
                                    ]
                                  },
                                  "reactions": {
                                    "anyOf": [
                                      {
                                        "type": "array",
                                        "items": {
                                          "type": "object",
                                          "properties": {
                                            "code": {
                                              "anyOf": [
                                                {
                                                  "type": "string"
                                                },
                                                {
                                                  "type": "null"
                                                }
                                              ]
                                            },
                                            "codeSystem": {
                                              "anyOf": [
                                                {
                                                  "type": "string"
                                                },
                                                {
                                                  "type": "null"
                                                }
                                              ]
                                            },
                                            "display": {
                                              "type": "string"
                                            },
                                            "source": {
                                              "anyOf": [
                                                {
                                                  "type": "string"
                                                },
                                                {
                                                  "type": "null"
                                                }
                                              ]
                                            }
                                          },
                                          "required": [
                                            "display"
                                          ],
                                          "additionalProperties": false
                                        }
                                      },
                                      {
                                        "type": "null"
                                      }
                                    ]
                                  }
                                },
                                "required": [
                                  "display"
                                ],
                                "additionalProperties": false
                              }
                            },
                            {
                              "type": "null"
                            }
                          ]
                        },
                        "medicationReviewStatus": {
                          "anyOf": [
                            {
                              "type": "string",
                              "enum": [
                                "not_reviewed",
                                "none",
                                "recorded"
                              ]
                            },
                            {
                              "type": "null"
                            }
                          ]
                        },
                        "diagnosisReviewStatus": {
                          "anyOf": [
                            {
                              "type": "string",
                              "enum": [
                                "not_reviewed",
                                "none",
                                "recorded"
                              ]
                            },
                            {
                              "type": "null"
                            }
                          ]
                        },
                        "conditions": {
                          "anyOf": [
                            {
                              "type": "array",
                              "items": {
                                "type": "object",
                                "properties": {
                                  "code": {
                                    "anyOf": [
                                      {
                                        "type": "string"
                                      },
                                      {
                                        "type": "null"
                                      }
                                    ]
                                  },
                                  "codeSystem": {
                                    "anyOf": [
                                      {
                                        "type": "string"
                                      },
                                      {
                                        "type": "null"
                                      }
                                    ]
                                  },
                                  "display": {
                                    "type": "string"
                                  },
                                  "source": {
                                    "anyOf": [
                                      {
                                        "type": "string"
                                      },
                                      {
                                        "type": "null"
                                      }
                                    ]
                                  }
                                },
                                "required": [
                                  "display"
                                ],
                                "additionalProperties": false
                              }
                            },
                            {
                              "type": "null"
                            }
                          ]
                        },
                        "compoundingReason": {
                          "anyOf": [
                            {
                              "type": "object",
                              "properties": {
                                "category": {
                                  "anyOf": [
                                    {
                                      "type": "string"
                                    },
                                    {
                                      "type": "null"
                                    }
                                  ]
                                },
                                "context": {
                                  "type": "string"
                                }
                              },
                              "required": [
                                "context"
                              ],
                              "additionalProperties": false
                            },
                            {
                              "type": "null"
                            }
                          ]
                        },
                        "medications": {
                          "anyOf": [
                            {
                              "type": "array",
                              "items": {
                                "type": "object",
                                "properties": {
                                  "display": {
                                    "type": "string"
                                  },
                                  "ndc": {
                                    "anyOf": [
                                      {
                                        "type": "string"
                                      },
                                      {
                                        "type": "null"
                                      }
                                    ]
                                  },
                                  "rxNormCui": {
                                    "anyOf": [
                                      {
                                        "type": "string"
                                      },
                                      {
                                        "type": "null"
                                      }
                                    ]
                                  },
                                  "source": {
                                    "anyOf": [
                                      {
                                        "type": "string"
                                      },
                                      {
                                        "type": "null"
                                      }
                                    ]
                                  }
                                },
                                "required": [
                                  "display"
                                ],
                                "additionalProperties": false
                              }
                            },
                            {
                              "type": "null"
                            }
                          ]
                        },
                        "observations": {
                          "anyOf": [
                            {
                              "type": "array",
                              "items": {
                                "type": "object",
                                "properties": {
                                  "code": {
                                    "anyOf": [
                                      {
                                        "type": "string"
                                      },
                                      {
                                        "type": "null"
                                      }
                                    ]
                                  },
                                  "display": {
                                    "type": "string"
                                  },
                                  "value": {
                                    "anyOf": [
                                      {
                                        "type": "number"
                                      },
                                      {
                                        "type": "string",
                                        "enum": [
                                          "Infinity",
                                          "-Infinity",
                                          "NaN"
                                        ]
                                      }
                                    ]
                                  },
                                  "unit": {
                                    "type": "string"
                                  }
                                },
                                "required": [
                                  "display",
                                  "value",
                                  "unit"
                                ],
                                "additionalProperties": false
                              }
                            },
                            {
                              "type": "null"
                            }
                          ]
                        }
                      },
                      "additionalProperties": false
                    },
                    {
                      "type": "null"
                    }
                  ]
                },
                "dispensing": {
                  "anyOf": [
                    {
                      "type": "object",
                      "properties": {
                        "dispenseUponAcceptance": {
                          "type": "boolean"
                        },
                        "substitutionPermitted": {
                          "type": "boolean"
                        },
                        "pharmacyNotes": {
                          "anyOf": [
                            {
                              "type": "string"
                            },
                            {
                              "type": "null"
                            }
                          ]
                        },
                        "requestedFillDate": {
                          "anyOf": [
                            {
                              "type": "string"
                            },
                            {
                              "type": "null"
                            }
                          ]
                        },
                        "shippingOptionId": {
                          "anyOf": [
                            {
                              "type": "string"
                            },
                            {
                              "type": "null"
                            }
                          ]
                        },
                        "shippingAmountCents": {
                          "anyOf": [
                            {
                              "type": "integer"
                            },
                            {
                              "type": "null"
                            }
                          ]
                        },
                        "shippingDestinationType": {
                          "anyOf": [
                            {
                              "type": "string",
                              "enum": [
                                "patient",
                                "practice"
                              ]
                            },
                            {
                              "type": "null"
                            }
                          ]
                        }
                      },
                      "required": [
                        "dispenseUponAcceptance",
                        "substitutionPermitted"
                      ],
                      "additionalProperties": false
                    },
                    {
                      "type": "null"
                    }
                  ]
                },
                "structuredSig": {
                  "anyOf": [
                    {
                      "type": "object",
                      "properties": {
                        "dose": {
                          "type": "string"
                        },
                        "doseUnit": {
                          "type": "string"
                        },
                        "frequency": {
                          "type": "string"
                        },
                        "route": {
                          "type": "string"
                        },
                        "prn": {
                          "type": "boolean"
                        },
                        "duration": {
                          "anyOf": [
                            {
                              "type": "string"
                            },
                            {
                              "type": "null"
                            }
                          ]
                        },
                        "indication": {
                          "anyOf": [
                            {
                              "type": "string"
                            },
                            {
                              "type": "null"
                            }
                          ]
                        },
                        "maxDailyUse": {
                          "anyOf": [
                            {
                              "type": "string"
                            },
                            {
                              "type": "null"
                            }
                          ]
                        },
                        "titrationSchedule": {
                          "anyOf": [
                            {
                              "type": "string"
                            },
                            {
                              "type": "null"
                            }
                          ]
                        }
                      },
                      "required": [
                        "dose",
                        "doseUnit",
                        "frequency",
                        "route",
                        "prn"
                      ],
                      "additionalProperties": false
                    },
                    {
                      "type": "null"
                    }
                  ]
                },
                "externalPrescriptionId": {
                  "anyOf": [
                    {
                      "type": "string",
                      "allOf": [
                        {
                          "minLength": 1
                        },
                        {
                          "maxLength": 200
                        },
                        {
                          "pattern": "\\S"
                        },
                        {
                          "pattern": "^[^\\p{Cc}\\p{Cs}]*$"
                        }
                      ]
                    },
                    {
                      "type": "null"
                    }
                  ]
                },
                "catalogItemId": {
                  "anyOf": [
                    {
                      "type": "string",
                      "allOf": [
                        {
                          "pattern": "^cat_[0-7][0-9a-hjkmnp-tv-z]{25}$",
                          "examples": [
                            "cat_01j2y8m6jcc9tt24af5pw9x1bc"
                          ]
                        }
                      ]
                    },
                    {
                      "type": "null"
                    }
                  ]
                },
                "pharmacyId": {
                  "anyOf": [
                    {
                      "type": "string",
                      "allOf": [
                        {
                          "pattern": "^pharm_[0-7][0-9a-hjkmnp-tv-z]{25}$",
                          "examples": [
                            "pharm_01j2y8m6jcc9tt24af5pw9x1bc"
                          ]
                        }
                      ]
                    },
                    {
                      "type": "null"
                    }
                  ]
                },
                "pharmacyName": {
                  "anyOf": [
                    {
                      "type": "string"
                    },
                    {
                      "type": "null"
                    }
                  ]
                },
                "directions": {
                  "type": "string"
                },
                "dosageForm": {
                  "anyOf": [
                    {
                      "type": "string"
                    },
                    {
                      "type": "null"
                    }
                  ]
                },
                "id": {
                  "type": "string",
                  "allOf": [
                    {
                      "pattern": "^rx_[0-7][0-9a-hjkmnp-tv-z]{25}$",
                      "examples": [
                        "rx_01j2y8m6jcc9tt24af5pw9x1bc"
                      ]
                    }
                  ]
                },
                "medicationName": {
                  "type": "string"
                },
                "quantity": {
                  "anyOf": [
                    {
                      "type": "number"
                    },
                    {
                      "type": "string",
                      "enum": [
                        "Infinity",
                        "-Infinity",
                        "NaN"
                      ]
                    }
                  ]
                },
                "quantityUnit": {
                  "type": "string"
                },
                "refills": {
                  "type": "integer"
                },
                "status": {
                  "type": "string"
                },
                "strength": {
                  "anyOf": [
                    {
                      "type": "string"
                    },
                    {
                      "type": "null"
                    }
                  ]
                }
              },
              "required": [
                "version",
                "daysSupply",
                "patientSnapshot",
                "deliveryAddress",
                "deliveryAddressDiffersFromPatient",
                "providerSnapshot",
                "clinical",
                "dispensing",
                "structuredSig",
                "externalPrescriptionId",
                "catalogItemId",
                "pharmacyId",
                "pharmacyName",
                "directions",
                "dosageForm",
                "id",
                "medicationName",
                "quantity",
                "quantityUnit",
                "refills",
                "status",
                "strength"
              ],
              "additionalProperties": false
            },
            "allOf": [
              {
                "minItems": 1
              }
            ]
          },
          "status": {
            "type": "string",
            "enum": [
              "blocked",
              "cancelled",
              "delivered",
              "draft",
              "partially_submitted",
              "requires_provider_signature",
              "processing",
              "ready",
              "rejected",
              "shipped",
              "submitted"
            ]
          },
          "updatedAt": {
            "type": "string"
          },
          "cancellation": {
            "type": "object",
            "properties": {
              "status": {
                "type": "string",
                "enum": [
                  "confirmed",
                  "pending",
                  "partial",
                  "failed"
                ]
              },
              "outcomes": {
                "type": "array",
                "items": {
                  "type": "object",
                  "properties": {
                    "cancellationId": {
                      "type": "string",
                      "pattern": "^cancl_[0-7][0-9a-hjkmnp-tv-z]{25}$",
                      "examples": [
                        "cancl_01j2y8m6jcc9tt24af5pw9x1bc"
                      ]
                    },
                    "fulfillmentId": {
                      "type": "string",
                      "pattern": "^ord_[0-7][0-9a-hjkmnp-tv-z]{25}$",
                      "examples": [
                        "ord_01j2y8m6jcc9tt24af5pw9x1bc"
                      ]
                    },
                    "status": {
                      "type": "string",
                      "enum": [
                        "confirmed",
                        "failed",
                        "rejected",
                        "requested",
                        "sent",
                        "too_late"
                      ]
                    }
                  },
                  "required": [
                    "cancellationId",
                    "fulfillmentId",
                    "status"
                  ],
                  "additionalProperties": false
                }
              }
            },
            "required": [
              "status",
              "outcomes"
            ],
            "additionalProperties": false
          }
        },
        "required": [
          "revision",
          "otcItems",
          "practiceMedicationTotalCents",
          "externalOrderId",
          "metadata",
          "createdAt",
          "fulfillments",
          "id",
          "lifecycleEvents",
          "livemode",
          "object",
          "patientExternalId",
          "patientId",
          "patientName",
          "patientState",
          "practiceId",
          "prescriberName",
          "prescriberNpi",
          "review",
          "prescriptions",
          "status",
          "updatedAt",
          "cancellation"
        ],
        "additionalProperties": false
      },
      "ActOnOrderExceptionRequest": {
        "type": "object",
        "properties": {
          "action": {
            "type": "string",
            "enum": [
              "acknowledge",
              "assign_to_me",
              "contact_pharmacy",
              "record_outcome",
              "resolve",
              "retry"
            ]
          },
          "note": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ]
          }
        },
        "required": [
          "action"
        ],
        "additionalProperties": false,
        "title": "ActOnOrderExceptionRequest"
      },
      "ActOnOrderExceptionResponse": {
        "title": "ActOnOrderExceptionResponse",
        "type": "object",
        "properties": {
          "action": {
            "type": "string"
          },
          "exceptionId": {
            "type": "string",
            "pattern": "^fex_[0-7][0-9a-hjkmnp-tv-z]{25}$",
            "examples": [
              "fex_01j2y8m6jcc9tt24af5pw9x1bc"
            ]
          },
          "status": {
            "type": "string",
            "enum": [
              "open",
              "acknowledged",
              "resolved"
            ]
          }
        },
        "required": [
          "action",
          "exceptionId",
          "status"
        ],
        "additionalProperties": false
      },
      "ListOrderEventsResponse": {
        "title": "ListOrderEventsResponse",
        "type": "object",
        "properties": {
          "data": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "createdAt": {
                  "type": "string"
                },
                "eventType": {
                  "type": "string"
                },
                "id": {
                  "type": "string",
                  "pattern": "^evt_[0-7][0-9a-hjkmnp-tv-z]{25}$",
                  "examples": [
                    "evt_01j2y8m6jcc9tt24af5pw9x1bc"
                  ]
                },
                "message": {
                  "type": "string"
                },
                "metadata": {
                  "type": "object"
                },
                "object": {
                  "type": "string",
                  "enum": [
                    "event"
                  ]
                }
              },
              "required": [
                "createdAt",
                "eventType",
                "id",
                "message",
                "metadata",
                "object"
              ],
              "additionalProperties": false
            }
          },
          "hasMore": {
            "type": "boolean"
          },
          "object": {
            "type": "string",
            "enum": [
              "list"
            ]
          },
          "url": {
            "type": "string"
          }
        },
        "required": [
          "data",
          "hasMore",
          "object",
          "url"
        ],
        "additionalProperties": false
      },
      "ListWebhookEndpointsResponse": {
        "title": "ListWebhookEndpointsResponse",
        "type": "object",
        "properties": {
          "data": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "organizationId": {
                  "type": "string",
                  "pattern": "^acct_[0-7][0-9a-hjkmnp-tv-z]{25}$",
                  "examples": [
                    "acct_01j2y8m6jcc9tt24af5pw9x1bc"
                  ]
                },
                "practiceIds": {
                  "type": "array",
                  "items": {
                    "type": "string",
                    "allOf": [
                      {
                        "pattern": "^prac_[0-7][0-9a-hjkmnp-tv-z]{25}$",
                        "examples": [
                          "prac_01j2y8m6jcc9tt24af5pw9x1bc"
                        ]
                      }
                    ]
                  }
                },
                "apiVersion": {
                  "type": "string"
                },
                "consecutiveFailures": {
                  "type": "integer",
                  "minimum": 0
                },
                "createdAt": {
                  "type": "string"
                },
                "description": {
                  "type": "string"
                },
                "id": {
                  "type": "string",
                  "pattern": "^whe_[0-7][0-9a-hjkmnp-tv-z]{25}$",
                  "examples": [
                    "whe_01j2y8m6jcc9tt24af5pw9x1bc"
                  ]
                },
                "livemode": {
                  "type": "boolean"
                },
                "object": {
                  "type": "string",
                  "enum": [
                    "webhook_endpoint"
                  ]
                },
                "payloadStyle": {
                  "type": "string",
                  "enum": [
                    "thin",
                    "snapshot"
                  ]
                },
                "status": {
                  "type": "string",
                  "enum": [
                    "active",
                    "suspended",
                    "disabled"
                  ]
                },
                "subscribedEvents": {
                  "type": "array",
                  "items": {
                    "type": "string"
                  }
                },
                "updatedAt": {
                  "type": "string"
                },
                "url": {
                  "type": "string"
                }
              },
              "required": [
                "organizationId",
                "practiceIds",
                "apiVersion",
                "consecutiveFailures",
                "createdAt",
                "description",
                "id",
                "livemode",
                "object",
                "payloadStyle",
                "status",
                "subscribedEvents",
                "updatedAt",
                "url"
              ],
              "additionalProperties": false
            }
          },
          "hasMore": {
            "type": "boolean"
          },
          "object": {
            "type": "string",
            "enum": [
              "list"
            ]
          },
          "url": {
            "type": "string",
            "enum": [
              "/v1/webhook-endpoints"
            ]
          }
        },
        "required": [
          "data",
          "hasMore",
          "object",
          "url"
        ],
        "additionalProperties": false
      },
      "CreateWebhookEndpointRequest": {
        "type": "object",
        "properties": {
          "practiceIds": {
            "type": "array",
            "items": {
              "type": "string",
              "pattern": "^prac_[0-7][0-9a-hjkmnp-tv-z]{25}$",
              "examples": [
                "prac_01j2y8m6jcc9tt24af5pw9x1bc"
              ]
            },
            "maxItems": 100
          },
          "description": {
            "type": "string"
          },
          "payloadStyle": {
            "type": "string",
            "enum": [
              "thin",
              "snapshot"
            ]
          },
          "subscribedEvents": {
            "type": "array",
            "items": {
              "type": "string",
              "enum": [
                "webhook_endpoint.test",
                "cancellation.requested",
                "cancellation.sent",
                "cancellation.confirmed",
                "cancellation.rejected",
                "cancellation.failed",
                "cancellation.too_late",
                "order.created",
                "order.updated",
                "order.review_requested",
                "order.changes_requested",
                "order.signed",
                "order.rejected",
                "order.submitted",
                "order.accepted",
                "order.processing",
                "order.shipped",
                "order.delivered",
                "order.blocked",
                "order.cancelled"
              ]
            }
          },
          "url": {
            "type": "string",
            "maxLength": 2048
          }
        },
        "required": [
          "url"
        ],
        "additionalProperties": false,
        "title": "CreateWebhookEndpointRequest"
      },
      "CreateWebhookEndpointResponse": {
        "title": "CreateWebhookEndpointResponse",
        "type": "object",
        "properties": {
          "organizationId": {
            "type": "string",
            "pattern": "^acct_[0-7][0-9a-hjkmnp-tv-z]{25}$",
            "examples": [
              "acct_01j2y8m6jcc9tt24af5pw9x1bc"
            ]
          },
          "practiceIds": {
            "type": "array",
            "items": {
              "type": "string",
              "allOf": [
                {
                  "pattern": "^prac_[0-7][0-9a-hjkmnp-tv-z]{25}$",
                  "examples": [
                    "prac_01j2y8m6jcc9tt24af5pw9x1bc"
                  ]
                }
              ]
            }
          },
          "apiVersion": {
            "type": "string"
          },
          "consecutiveFailures": {
            "type": "integer",
            "minimum": 0
          },
          "createdAt": {
            "type": "string"
          },
          "description": {
            "type": "string"
          },
          "id": {
            "type": "string",
            "pattern": "^whe_[0-7][0-9a-hjkmnp-tv-z]{25}$",
            "examples": [
              "whe_01j2y8m6jcc9tt24af5pw9x1bc"
            ]
          },
          "livemode": {
            "type": "boolean"
          },
          "object": {
            "type": "string",
            "enum": [
              "webhook_endpoint"
            ]
          },
          "payloadStyle": {
            "type": "string",
            "enum": [
              "thin",
              "snapshot"
            ]
          },
          "status": {
            "type": "string",
            "enum": [
              "active",
              "suspended",
              "disabled"
            ]
          },
          "subscribedEvents": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "updatedAt": {
            "type": "string"
          },
          "url": {
            "type": "string"
          },
          "signingSecret": {
            "type": "string"
          }
        },
        "required": [
          "organizationId",
          "practiceIds",
          "apiVersion",
          "consecutiveFailures",
          "createdAt",
          "description",
          "id",
          "livemode",
          "object",
          "payloadStyle",
          "status",
          "subscribedEvents",
          "updatedAt",
          "url",
          "signingSecret"
        ],
        "additionalProperties": false
      },
      "UpdateWebhookEndpointRequest": {
        "type": "object",
        "properties": {
          "practiceIds": {
            "type": "array",
            "items": {
              "type": "string",
              "pattern": "^prac_[0-7][0-9a-hjkmnp-tv-z]{25}$",
              "examples": [
                "prac_01j2y8m6jcc9tt24af5pw9x1bc"
              ]
            },
            "maxItems": 100
          },
          "description": {
            "type": "string"
          },
          "payloadStyle": {
            "type": "string",
            "enum": [
              "thin",
              "snapshot"
            ]
          },
          "status": {
            "type": "string",
            "enum": [
              "active",
              "suspended",
              "disabled"
            ]
          },
          "subscribedEvents": {
            "type": "array",
            "items": {
              "type": "string",
              "enum": [
                "webhook_endpoint.test",
                "cancellation.requested",
                "cancellation.sent",
                "cancellation.confirmed",
                "cancellation.rejected",
                "cancellation.failed",
                "cancellation.too_late",
                "order.created",
                "order.updated",
                "order.review_requested",
                "order.changes_requested",
                "order.signed",
                "order.rejected",
                "order.submitted",
                "order.accepted",
                "order.processing",
                "order.shipped",
                "order.delivered",
                "order.blocked",
                "order.cancelled"
              ]
            }
          },
          "url": {
            "type": "string",
            "maxLength": 2048
          }
        },
        "additionalProperties": false,
        "title": "UpdateWebhookEndpointRequest"
      },
      "UpdateWebhookEndpointResponse": {
        "title": "UpdateWebhookEndpointResponse",
        "type": "object",
        "properties": {
          "organizationId": {
            "type": "string",
            "pattern": "^acct_[0-7][0-9a-hjkmnp-tv-z]{25}$",
            "examples": [
              "acct_01j2y8m6jcc9tt24af5pw9x1bc"
            ]
          },
          "practiceIds": {
            "type": "array",
            "items": {
              "type": "string",
              "allOf": [
                {
                  "pattern": "^prac_[0-7][0-9a-hjkmnp-tv-z]{25}$",
                  "examples": [
                    "prac_01j2y8m6jcc9tt24af5pw9x1bc"
                  ]
                }
              ]
            }
          },
          "apiVersion": {
            "type": "string"
          },
          "consecutiveFailures": {
            "type": "integer",
            "minimum": 0
          },
          "createdAt": {
            "type": "string"
          },
          "description": {
            "type": "string"
          },
          "id": {
            "type": "string",
            "pattern": "^whe_[0-7][0-9a-hjkmnp-tv-z]{25}$",
            "examples": [
              "whe_01j2y8m6jcc9tt24af5pw9x1bc"
            ]
          },
          "livemode": {
            "type": "boolean"
          },
          "object": {
            "type": "string",
            "enum": [
              "webhook_endpoint"
            ]
          },
          "payloadStyle": {
            "type": "string",
            "enum": [
              "thin",
              "snapshot"
            ]
          },
          "status": {
            "type": "string",
            "enum": [
              "active",
              "suspended",
              "disabled"
            ]
          },
          "subscribedEvents": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "updatedAt": {
            "type": "string"
          },
          "url": {
            "type": "string"
          }
        },
        "required": [
          "organizationId",
          "practiceIds",
          "apiVersion",
          "consecutiveFailures",
          "createdAt",
          "description",
          "id",
          "livemode",
          "object",
          "payloadStyle",
          "status",
          "subscribedEvents",
          "updatedAt",
          "url"
        ],
        "additionalProperties": false
      },
      "DeleteWebhookEndpointResponse": {
        "title": "DeleteWebhookEndpointResponse",
        "type": "object",
        "properties": {
          "organizationId": {
            "type": "string",
            "pattern": "^acct_[0-7][0-9a-hjkmnp-tv-z]{25}$",
            "examples": [
              "acct_01j2y8m6jcc9tt24af5pw9x1bc"
            ]
          },
          "practiceIds": {
            "type": "array",
            "items": {
              "type": "string",
              "allOf": [
                {
                  "pattern": "^prac_[0-7][0-9a-hjkmnp-tv-z]{25}$",
                  "examples": [
                    "prac_01j2y8m6jcc9tt24af5pw9x1bc"
                  ]
                }
              ]
            }
          },
          "apiVersion": {
            "type": "string"
          },
          "consecutiveFailures": {
            "type": "integer",
            "minimum": 0
          },
          "createdAt": {
            "type": "string"
          },
          "description": {
            "type": "string"
          },
          "id": {
            "type": "string",
            "pattern": "^whe_[0-7][0-9a-hjkmnp-tv-z]{25}$",
            "examples": [
              "whe_01j2y8m6jcc9tt24af5pw9x1bc"
            ]
          },
          "livemode": {
            "type": "boolean"
          },
          "object": {
            "type": "string",
            "enum": [
              "webhook_endpoint"
            ]
          },
          "payloadStyle": {
            "type": "string",
            "enum": [
              "thin",
              "snapshot"
            ]
          },
          "status": {
            "type": "string",
            "enum": [
              "active",
              "suspended",
              "disabled"
            ]
          },
          "subscribedEvents": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "updatedAt": {
            "type": "string"
          },
          "url": {
            "type": "string"
          }
        },
        "required": [
          "organizationId",
          "practiceIds",
          "apiVersion",
          "consecutiveFailures",
          "createdAt",
          "description",
          "id",
          "livemode",
          "object",
          "payloadStyle",
          "status",
          "subscribedEvents",
          "updatedAt",
          "url"
        ],
        "additionalProperties": false
      },
      "RotateWebhookEndpointSecretResponse": {
        "title": "RotateWebhookEndpointSecretResponse",
        "type": "object",
        "properties": {
          "organizationId": {
            "type": "string",
            "pattern": "^acct_[0-7][0-9a-hjkmnp-tv-z]{25}$",
            "examples": [
              "acct_01j2y8m6jcc9tt24af5pw9x1bc"
            ]
          },
          "practiceIds": {
            "type": "array",
            "items": {
              "type": "string",
              "allOf": [
                {
                  "pattern": "^prac_[0-7][0-9a-hjkmnp-tv-z]{25}$",
                  "examples": [
                    "prac_01j2y8m6jcc9tt24af5pw9x1bc"
                  ]
                }
              ]
            }
          },
          "apiVersion": {
            "type": "string"
          },
          "consecutiveFailures": {
            "type": "integer",
            "minimum": 0
          },
          "createdAt": {
            "type": "string"
          },
          "description": {
            "type": "string"
          },
          "id": {
            "type": "string",
            "pattern": "^whe_[0-7][0-9a-hjkmnp-tv-z]{25}$",
            "examples": [
              "whe_01j2y8m6jcc9tt24af5pw9x1bc"
            ]
          },
          "livemode": {
            "type": "boolean"
          },
          "object": {
            "type": "string",
            "enum": [
              "webhook_endpoint"
            ]
          },
          "payloadStyle": {
            "type": "string",
            "enum": [
              "thin",
              "snapshot"
            ]
          },
          "status": {
            "type": "string",
            "enum": [
              "active",
              "suspended",
              "disabled"
            ]
          },
          "subscribedEvents": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "updatedAt": {
            "type": "string"
          },
          "url": {
            "type": "string"
          },
          "signingSecret": {
            "type": "string"
          }
        },
        "required": [
          "organizationId",
          "practiceIds",
          "apiVersion",
          "consecutiveFailures",
          "createdAt",
          "description",
          "id",
          "livemode",
          "object",
          "payloadStyle",
          "status",
          "subscribedEvents",
          "updatedAt",
          "url",
          "signingSecret"
        ],
        "additionalProperties": false
      },
      "TestWebhookEndpointResponse": {
        "title": "TestWebhookEndpointResponse",
        "type": "object",
        "properties": {
          "eventId": {
            "type": "string"
          }
        },
        "required": [
          "eventId"
        ],
        "additionalProperties": false
      },
      "ListWebhookEventsResponse": {
        "title": "ListWebhookEventsResponse",
        "type": "object",
        "properties": {
          "data": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "apiVersion": {
                  "type": "string"
                },
                "createdAt": {
                  "type": "string"
                },
                "eventType": {
                  "type": "string"
                },
                "id": {
                  "type": "string",
                  "pattern": "^evt_[0-7][0-9a-hjkmnp-tv-z]{25}$",
                  "examples": [
                    "evt_01j2y8m6jcc9tt24af5pw9x1bc"
                  ]
                },
                "livemode": {
                  "type": "boolean"
                },
                "object": {
                  "type": "string",
                  "enum": [
                    "webhook_event"
                  ]
                },
                "resourceId": {
                  "type": "string"
                },
                "resourceType": {
                  "type": "string"
                },
                "status": {
                  "type": "string",
                  "enum": [
                    "delivered",
                    "failed",
                    "pending"
                  ]
                }
              },
              "required": [
                "apiVersion",
                "createdAt",
                "eventType",
                "id",
                "livemode",
                "object",
                "resourceId",
                "resourceType",
                "status"
              ],
              "additionalProperties": false
            }
          },
          "hasMore": {
            "type": "boolean"
          },
          "object": {
            "type": "string",
            "enum": [
              "list"
            ]
          },
          "url": {
            "type": "string",
            "enum": [
              "/v1/webhook-events"
            ]
          }
        },
        "required": [
          "data",
          "hasMore",
          "object",
          "url"
        ],
        "additionalProperties": false
      },
      "GetWebhookEventResponse": {
        "title": "GetWebhookEventResponse",
        "type": "object",
        "properties": {
          "apiVersion": {
            "type": "string"
          },
          "createdAt": {
            "type": "string"
          },
          "eventType": {
            "type": "string"
          },
          "id": {
            "type": "string",
            "pattern": "^evt_[0-7][0-9a-hjkmnp-tv-z]{25}$",
            "examples": [
              "evt_01j2y8m6jcc9tt24af5pw9x1bc"
            ]
          },
          "livemode": {
            "type": "boolean"
          },
          "object": {
            "type": "string",
            "enum": [
              "webhook_event"
            ]
          },
          "resourceId": {
            "type": "string"
          },
          "resourceType": {
            "type": "string"
          },
          "status": {
            "type": "string",
            "enum": [
              "delivered",
              "failed",
              "pending"
            ]
          },
          "attempts": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "deliveryId": {
                  "type": "string"
                },
                "endpointId": {
                  "type": "string"
                },
                "attemptNumber": {
                  "type": "integer",
                  "allOf": [
                    {
                      "exclusiveMinimum": 0
                    }
                  ]
                },
                "completedAt": {
                  "anyOf": [
                    {
                      "type": "string"
                    },
                    {
                      "type": "null"
                    }
                  ]
                },
                "durationMs": {
                  "anyOf": [
                    {
                      "anyOf": [
                        {
                          "type": "number"
                        },
                        {
                          "type": "string",
                          "enum": [
                            "Infinity",
                            "-Infinity",
                            "NaN"
                          ]
                        }
                      ]
                    },
                    {
                      "type": "null"
                    }
                  ]
                },
                "errorCode": {
                  "anyOf": [
                    {
                      "type": "string"
                    },
                    {
                      "type": "null"
                    }
                  ]
                },
                "errorMessage": {
                  "anyOf": [
                    {
                      "type": "string"
                    },
                    {
                      "type": "null"
                    }
                  ]
                },
                "id": {
                  "type": "string",
                  "allOf": [
                    {
                      "pattern": "^wha_[0-7][0-9a-hjkmnp-tv-z]{25}$",
                      "examples": [
                        "wha_01j2y8m6jcc9tt24af5pw9x1bc"
                      ]
                    }
                  ]
                },
                "requestedAt": {
                  "type": "string"
                },
                "responseStatus": {
                  "anyOf": [
                    {
                      "anyOf": [
                        {
                          "type": "number"
                        },
                        {
                          "type": "string",
                          "enum": [
                            "Infinity",
                            "-Infinity",
                            "NaN"
                          ]
                        }
                      ]
                    },
                    {
                      "type": "null"
                    }
                  ]
                },
                "trigger": {
                  "type": "string",
                  "enum": [
                    "automatic",
                    "manual",
                    "test"
                  ]
                }
              },
              "required": [
                "deliveryId",
                "endpointId",
                "attemptNumber",
                "completedAt",
                "durationMs",
                "errorCode",
                "errorMessage",
                "id",
                "requestedAt",
                "responseStatus",
                "trigger"
              ],
              "additionalProperties": false
            }
          },
          "deliveries": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "automaticAttemptCount": {
                  "anyOf": [
                    {
                      "type": "number"
                    },
                    {
                      "type": "string",
                      "enum": [
                        "Infinity",
                        "-Infinity",
                        "NaN"
                      ]
                    }
                  ]
                },
                "endpointId": {
                  "type": "string",
                  "allOf": [
                    {
                      "pattern": "^whe_[0-7][0-9a-hjkmnp-tv-z]{25}$",
                      "examples": [
                        "whe_01j2y8m6jcc9tt24af5pw9x1bc"
                      ]
                    }
                  ]
                },
                "id": {
                  "type": "string",
                  "allOf": [
                    {
                      "pattern": "^whd_[0-7][0-9a-hjkmnp-tv-z]{25}$",
                      "examples": [
                        "whd_01j2y8m6jcc9tt24af5pw9x1bc"
                      ]
                    }
                  ]
                },
                "lastErrorCode": {
                  "anyOf": [
                    {
                      "type": "string"
                    },
                    {
                      "type": "null"
                    }
                  ]
                },
                "lastErrorMessage": {
                  "anyOf": [
                    {
                      "type": "string"
                    },
                    {
                      "type": "null"
                    }
                  ]
                },
                "nextAttemptAt": {
                  "anyOf": [
                    {
                      "type": "string"
                    },
                    {
                      "type": "null"
                    }
                  ]
                },
                "status": {
                  "type": "string",
                  "enum": [
                    "delivered",
                    "failed",
                    "pending",
                    "retrying"
                  ]
                }
              },
              "required": [
                "automaticAttemptCount",
                "endpointId",
                "id",
                "lastErrorCode",
                "lastErrorMessage",
                "nextAttemptAt",
                "status"
              ],
              "additionalProperties": false
            }
          },
          "payload": {
            "type": "object"
          }
        },
        "required": [
          "apiVersion",
          "createdAt",
          "eventType",
          "id",
          "livemode",
          "object",
          "resourceId",
          "resourceType",
          "status",
          "attempts",
          "deliveries",
          "payload"
        ],
        "additionalProperties": false
      },
      "ReplayWebhookEventResponse": {
        "title": "ReplayWebhookEventResponse",
        "type": "object",
        "properties": {
          "apiVersion": {
            "type": "string"
          },
          "createdAt": {
            "type": "string"
          },
          "eventType": {
            "type": "string"
          },
          "id": {
            "type": "string",
            "pattern": "^evt_[0-7][0-9a-hjkmnp-tv-z]{25}$",
            "examples": [
              "evt_01j2y8m6jcc9tt24af5pw9x1bc"
            ]
          },
          "livemode": {
            "type": "boolean"
          },
          "object": {
            "type": "string",
            "enum": [
              "webhook_event"
            ]
          },
          "resourceId": {
            "type": "string"
          },
          "resourceType": {
            "type": "string"
          },
          "status": {
            "type": "string",
            "enum": [
              "delivered",
              "failed",
              "pending"
            ]
          },
          "attempts": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "deliveryId": {
                  "type": "string"
                },
                "endpointId": {
                  "type": "string"
                },
                "attemptNumber": {
                  "type": "integer",
                  "allOf": [
                    {
                      "exclusiveMinimum": 0
                    }
                  ]
                },
                "completedAt": {
                  "anyOf": [
                    {
                      "type": "string"
                    },
                    {
                      "type": "null"
                    }
                  ]
                },
                "durationMs": {
                  "anyOf": [
                    {
                      "anyOf": [
                        {
                          "type": "number"
                        },
                        {
                          "type": "string",
                          "enum": [
                            "Infinity",
                            "-Infinity",
                            "NaN"
                          ]
                        }
                      ]
                    },
                    {
                      "type": "null"
                    }
                  ]
                },
                "errorCode": {
                  "anyOf": [
                    {
                      "type": "string"
                    },
                    {
                      "type": "null"
                    }
                  ]
                },
                "errorMessage": {
                  "anyOf": [
                    {
                      "type": "string"
                    },
                    {
                      "type": "null"
                    }
                  ]
                },
                "id": {
                  "type": "string",
                  "allOf": [
                    {
                      "pattern": "^wha_[0-7][0-9a-hjkmnp-tv-z]{25}$",
                      "examples": [
                        "wha_01j2y8m6jcc9tt24af5pw9x1bc"
                      ]
                    }
                  ]
                },
                "requestedAt": {
                  "type": "string"
                },
                "responseStatus": {
                  "anyOf": [
                    {
                      "anyOf": [
                        {
                          "type": "number"
                        },
                        {
                          "type": "string",
                          "enum": [
                            "Infinity",
                            "-Infinity",
                            "NaN"
                          ]
                        }
                      ]
                    },
                    {
                      "type": "null"
                    }
                  ]
                },
                "trigger": {
                  "type": "string",
                  "enum": [
                    "automatic",
                    "manual",
                    "test"
                  ]
                }
              },
              "required": [
                "deliveryId",
                "endpointId",
                "attemptNumber",
                "completedAt",
                "durationMs",
                "errorCode",
                "errorMessage",
                "id",
                "requestedAt",
                "responseStatus",
                "trigger"
              ],
              "additionalProperties": false
            }
          },
          "deliveries": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "automaticAttemptCount": {
                  "anyOf": [
                    {
                      "type": "number"
                    },
                    {
                      "type": "string",
                      "enum": [
                        "Infinity",
                        "-Infinity",
                        "NaN"
                      ]
                    }
                  ]
                },
                "endpointId": {
                  "type": "string",
                  "allOf": [
                    {
                      "pattern": "^whe_[0-7][0-9a-hjkmnp-tv-z]{25}$",
                      "examples": [
                        "whe_01j2y8m6jcc9tt24af5pw9x1bc"
                      ]
                    }
                  ]
                },
                "id": {
                  "type": "string",
                  "allOf": [
                    {
                      "pattern": "^whd_[0-7][0-9a-hjkmnp-tv-z]{25}$",
                      "examples": [
                        "whd_01j2y8m6jcc9tt24af5pw9x1bc"
                      ]
                    }
                  ]
                },
                "lastErrorCode": {
                  "anyOf": [
                    {
                      "type": "string"
                    },
                    {
                      "type": "null"
                    }
                  ]
                },
                "lastErrorMessage": {
                  "anyOf": [
                    {
                      "type": "string"
                    },
                    {
                      "type": "null"
                    }
                  ]
                },
                "nextAttemptAt": {
                  "anyOf": [
                    {
                      "type": "string"
                    },
                    {
                      "type": "null"
                    }
                  ]
                },
                "status": {
                  "type": "string",
                  "enum": [
                    "delivered",
                    "failed",
                    "pending",
                    "retrying"
                  ]
                }
              },
              "required": [
                "automaticAttemptCount",
                "endpointId",
                "id",
                "lastErrorCode",
                "lastErrorMessage",
                "nextAttemptAt",
                "status"
              ],
              "additionalProperties": false
            }
          },
          "payload": {
            "type": "object"
          }
        },
        "required": [
          "apiVersion",
          "createdAt",
          "eventType",
          "id",
          "livemode",
          "object",
          "resourceId",
          "resourceType",
          "status",
          "attempts",
          "deliveries",
          "payload"
        ],
        "additionalProperties": false
      },
      "GetOrderTestSimulationResponse": {
        "title": "GetOrderTestSimulationResponse",
        "type": "object",
        "properties": {
          "mode": {
            "type": "string",
            "enum": [
              "automatic",
              "manual"
            ]
          },
          "scenario": {
            "type": "string",
            "enum": [
              "successful",
              "pharmacy_rejection",
              "cancellation_declined"
            ]
          },
          "pendingAction": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ]
          },
          "lastError": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ]
          },
          "availableActions": {
            "type": "array",
            "items": {
              "type": "string",
              "enum": [
                "accept",
                "process",
                "ship",
                "deliver",
                "reject",
                "confirm_cancellation",
                "decline_cancellation"
              ]
            }
          },
          "scenarioEditable": {
            "type": "boolean"
          }
        },
        "required": [
          "mode",
          "scenario",
          "pendingAction",
          "lastError",
          "availableActions",
          "scenarioEditable"
        ],
        "additionalProperties": false
      },
      "UpdateOrderTestSimulationRequest": {
        "type": "object",
        "properties": {
          "mode": {
            "type": "string",
            "enum": [
              "automatic",
              "manual"
            ]
          },
          "scenario": {
            "type": "string",
            "enum": [
              "successful",
              "pharmacy_rejection",
              "cancellation_declined"
            ]
          },
          "action": {
            "anyOf": [
              {
                "type": "string",
                "enum": [
                  "accept",
                  "process",
                  "ship",
                  "deliver",
                  "reject",
                  "confirm_cancellation",
                  "decline_cancellation"
                ]
              },
              {
                "type": "null"
              }
            ]
          }
        },
        "required": [
          "mode",
          "scenario"
        ],
        "additionalProperties": false,
        "title": "UpdateOrderTestSimulationRequest"
      },
      "UpdateOrderTestSimulationResponse": {
        "title": "UpdateOrderTestSimulationResponse",
        "type": "object",
        "properties": {
          "mode": {
            "type": "string",
            "enum": [
              "automatic",
              "manual"
            ]
          },
          "scenario": {
            "type": "string",
            "enum": [
              "successful",
              "pharmacy_rejection",
              "cancellation_declined"
            ]
          },
          "pendingAction": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ]
          },
          "lastError": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ]
          },
          "availableActions": {
            "type": "array",
            "items": {
              "type": "string",
              "enum": [
                "accept",
                "process",
                "ship",
                "deliver",
                "reject",
                "confirm_cancellation",
                "decline_cancellation"
              ]
            }
          },
          "scenarioEditable": {
            "type": "boolean"
          }
        },
        "required": [
          "mode",
          "scenario",
          "pendingAction",
          "lastError",
          "availableActions",
          "scenarioEditable"
        ],
        "additionalProperties": false
      },
      "RetrievePrescribingOptionsResponse": {
        "title": "RetrievePrescribingOptionsResponse",
        "type": "object",
        "properties": {
          "compoundingReason": {
            "type": "object",
            "properties": {
              "required": {
                "type": "boolean"
              },
              "categoryRequired": {
                "type": "boolean"
              },
              "context": {
                "type": "string",
                "enum": [
                  "not_supported",
                  "optional",
                  "required"
                ]
              },
              "contextPrompt": {
                "anyOf": [
                  {
                    "type": "string"
                  },
                  {
                    "type": "null"
                  }
                ]
              },
              "choices": {
                "type": "array",
                "items": {
                  "type": "object",
                  "properties": {
                    "category": {
                      "type": "string",
                      "enum": [
                        "alcohol_free",
                        "drug_shortage",
                        "commercial_product_discontinued",
                        "modified_release",
                        "inactive_ingredient_sensitivity",
                        "inactive_ingredient_toxicity",
                        "concentration_adjustment",
                        "alternate_route",
                        "dosage_form_unavailable",
                        "flavor_adjustment",
                        "tablet_burden",
                        "patient_cannot_use_commercial_product",
                        "no_approved_product_available",
                        "no_rationale_required",
                        "other_patient_specific_need"
                      ]
                    },
                    "label": {
                      "type": "string"
                    },
                    "contextRequired": {
                      "type": "boolean"
                    },
                    "contextPrompt": {
                      "anyOf": [
                        {
                          "type": "string"
                        },
                        {
                          "type": "null"
                        }
                      ]
                    }
                  },
                  "required": [
                    "category",
                    "label",
                    "contextRequired",
                    "contextPrompt"
                  ],
                  "additionalProperties": false
                }
              }
            },
            "required": [
              "required",
              "categoryRequired",
              "context",
              "contextPrompt",
              "choices"
            ],
            "additionalProperties": false
          },
          "compoundingReasonCategoryDefault": {
            "anyOf": [
              {
                "type": "string",
                "enum": [
                  "alcohol_free",
                  "drug_shortage",
                  "commercial_product_discontinued",
                  "modified_release",
                  "inactive_ingredient_sensitivity",
                  "inactive_ingredient_toxicity",
                  "concentration_adjustment",
                  "alternate_route",
                  "dosage_form_unavailable",
                  "flavor_adjustment",
                  "tablet_burden",
                  "patient_cannot_use_commercial_product",
                  "no_approved_product_available",
                  "no_rationale_required",
                  "other_patient_specific_need"
                ]
              },
              {
                "type": "null"
              }
            ]
          },
          "compoundingReasonDefault": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ]
          },
          "default": {
            "anyOf": [
              {
                "type": "object",
                "properties": {
                  "directions": {
                    "type": "string"
                  },
                  "format": {
                    "type": "string",
                    "enum": [
                      "free_text",
                      "structured"
                    ]
                  },
                  "source": {
                    "type": "string",
                    "enum": [
                      "affinity",
                      "catalog",
                      "pharmacy"
                    ]
                  },
                  "structuredSig": {
                    "anyOf": [
                      {
                        "type": "object",
                        "properties": {
                          "dose": {
                            "type": "string"
                          },
                          "doseUnit": {
                            "type": "string"
                          },
                          "duration": {
                            "anyOf": [
                              {
                                "type": "string"
                              },
                              {
                                "type": "null"
                              }
                            ]
                          },
                          "frequency": {
                            "type": "string"
                          },
                          "maxDailyUse": {
                            "anyOf": [
                              {
                                "type": "string"
                              },
                              {
                                "type": "null"
                              }
                            ]
                          },
                          "prn": {
                            "type": "boolean"
                          },
                          "route": {
                            "type": "string"
                          },
                          "titrationSchedule": {
                            "anyOf": [
                              {
                                "type": "string"
                              },
                              {
                                "type": "null"
                              }
                            ]
                          }
                        },
                        "required": [
                          "dose",
                          "doseUnit",
                          "frequency",
                          "prn",
                          "route"
                        ],
                        "additionalProperties": false
                      },
                      {
                        "type": "null"
                      }
                    ]
                  }
                },
                "required": [
                  "directions",
                  "format",
                  "source",
                  "structuredSig"
                ],
                "additionalProperties": false
              },
              {
                "type": "null"
              }
            ]
          },
          "formulationDefault": {
            "anyOf": [
              {
                "type": "object",
                "properties": {
                  "directions": {
                    "type": "string"
                  },
                  "format": {
                    "type": "string",
                    "enum": [
                      "free_text",
                      "structured"
                    ]
                  },
                  "structuredSig": {
                    "anyOf": [
                      {
                        "type": "object",
                        "properties": {
                          "dose": {
                            "type": "string"
                          },
                          "doseUnit": {
                            "type": "string"
                          },
                          "duration": {
                            "anyOf": [
                              {
                                "type": "string"
                              },
                              {
                                "type": "null"
                              }
                            ]
                          },
                          "frequency": {
                            "type": "string"
                          },
                          "maxDailyUse": {
                            "anyOf": [
                              {
                                "type": "string"
                              },
                              {
                                "type": "null"
                              }
                            ]
                          },
                          "prn": {
                            "type": "boolean"
                          },
                          "route": {
                            "type": "string"
                          },
                          "titrationSchedule": {
                            "anyOf": [
                              {
                                "type": "string"
                              },
                              {
                                "type": "null"
                              }
                            ]
                          }
                        },
                        "required": [
                          "dose",
                          "doseUnit",
                          "frequency",
                          "prn",
                          "route"
                        ],
                        "additionalProperties": false
                      },
                      {
                        "type": "null"
                      }
                    ]
                  }
                },
                "required": [
                  "directions",
                  "format",
                  "structuredSig"
                ],
                "additionalProperties": false
              },
              {
                "type": "null"
              }
            ]
          },
          "initial": {
            "type": "object",
            "properties": {
              "dose": {
                "anyOf": [
                  {
                    "type": "string"
                  },
                  {
                    "type": "null"
                  }
                ]
              },
              "doseUnit": {
                "anyOf": [
                  {
                    "type": "string"
                  },
                  {
                    "type": "null"
                  }
                ]
              },
              "duration": {
                "anyOf": [
                  {
                    "type": "string"
                  },
                  {
                    "type": "null"
                  }
                ]
              },
              "frequency": {
                "anyOf": [
                  {
                    "type": "string"
                  },
                  {
                    "type": "null"
                  }
                ]
              },
              "maxDailyUse": {
                "anyOf": [
                  {
                    "type": "string"
                  },
                  {
                    "type": "null"
                  }
                ]
              },
              "prn": {
                "anyOf": [
                  {
                    "type": "boolean"
                  },
                  {
                    "type": "null"
                  }
                ]
              },
              "route": {
                "anyOf": [
                  {
                    "type": "string"
                  },
                  {
                    "type": "null"
                  }
                ]
              },
              "titrationSchedule": {
                "anyOf": [
                  {
                    "type": "string"
                  },
                  {
                    "type": "null"
                  }
                ]
              }
            },
            "additionalProperties": false
          },
          "medication": {
            "type": "object",
            "properties": {
              "name": {
                "type": "string"
              },
              "rxnorm": {
                "anyOf": [
                  {
                    "type": "object",
                    "properties": {
                      "code": {
                        "type": "string"
                      },
                      "display": {
                        "type": "string"
                      },
                      "doseForm": {
                        "type": "string"
                      },
                      "route": {
                        "type": "string"
                      },
                      "system": {
                        "type": "string",
                        "enum": [
                          "rxnorm"
                        ]
                      }
                    },
                    "required": [
                      "code",
                      "display",
                      "doseForm",
                      "route",
                      "system"
                    ],
                    "additionalProperties": false
                  },
                  {
                    "type": "null"
                  }
                ]
              }
            },
            "required": [
              "name",
              "rxnorm"
            ],
            "additionalProperties": false
          },
          "options": {
            "type": "object",
            "properties": {
              "doseUnits": {
                "type": "array",
                "items": {
                  "type": "object",
                  "properties": {
                    "label": {
                      "type": "string"
                    },
                    "source": {
                      "type": "string",
                      "enum": [
                        "catalog",
                        "pharmacy",
                        "rxnorm"
                      ]
                    },
                    "value": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "label",
                    "source",
                    "value"
                  ],
                  "additionalProperties": false
                }
              },
              "doses": {
                "type": "array",
                "items": {
                  "type": "object",
                  "properties": {
                    "label": {
                      "type": "string"
                    },
                    "source": {
                      "type": "string",
                      "enum": [
                        "catalog",
                        "pharmacy",
                        "rxnorm"
                      ]
                    },
                    "value": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "label",
                    "source",
                    "value"
                  ],
                  "additionalProperties": false
                }
              },
              "frequencies": {
                "type": "array",
                "items": {
                  "type": "object",
                  "properties": {
                    "label": {
                      "type": "string"
                    },
                    "source": {
                      "type": "string",
                      "enum": [
                        "catalog",
                        "pharmacy",
                        "rxnorm"
                      ]
                    },
                    "value": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "label",
                    "source",
                    "value"
                  ],
                  "additionalProperties": false
                }
              },
              "routes": {
                "type": "array",
                "items": {
                  "type": "object",
                  "properties": {
                    "label": {
                      "type": "string"
                    },
                    "source": {
                      "type": "string",
                      "enum": [
                        "catalog",
                        "pharmacy",
                        "rxnorm"
                      ]
                    },
                    "value": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "label",
                    "source",
                    "value"
                  ],
                  "additionalProperties": false
                }
              }
            },
            "required": [
              "doseUnits",
              "doses",
              "frequencies",
              "routes"
            ],
            "additionalProperties": false
          },
          "pharmacyDirections": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "directions": {
                  "type": "string"
                },
                "format": {
                  "type": "string",
                  "enum": [
                    "free_text",
                    "structured"
                  ]
                },
                "structuredSig": {
                  "anyOf": [
                    {
                      "type": "object",
                      "properties": {
                        "dose": {
                          "type": "string"
                        },
                        "doseUnit": {
                          "type": "string"
                        },
                        "duration": {
                          "anyOf": [
                            {
                              "type": "string"
                            },
                            {
                              "type": "null"
                            }
                          ]
                        },
                        "frequency": {
                          "type": "string"
                        },
                        "maxDailyUse": {
                          "anyOf": [
                            {
                              "type": "string"
                            },
                            {
                              "type": "null"
                            }
                          ]
                        },
                        "prn": {
                          "type": "boolean"
                        },
                        "route": {
                          "type": "string"
                        },
                        "titrationSchedule": {
                          "anyOf": [
                            {
                              "type": "string"
                            },
                            {
                              "type": "null"
                            }
                          ]
                        }
                      },
                      "required": [
                        "dose",
                        "doseUnit",
                        "frequency",
                        "prn",
                        "route"
                      ],
                      "additionalProperties": false
                    },
                    {
                      "type": "null"
                    }
                  ]
                }
              },
              "required": [
                "directions",
                "format",
                "structuredSig"
              ],
              "additionalProperties": false
            }
          },
          "templates": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "id": {
                  "type": "string"
                },
                "initial": {
                  "type": "object",
                  "properties": {
                    "dose": {
                      "anyOf": [
                        {
                          "type": "string"
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "doseUnit": {
                      "anyOf": [
                        {
                          "type": "string"
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "duration": {
                      "anyOf": [
                        {
                          "type": "string"
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "frequency": {
                      "anyOf": [
                        {
                          "type": "string"
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "maxDailyUse": {
                      "anyOf": [
                        {
                          "type": "string"
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "prn": {
                      "anyOf": [
                        {
                          "type": "boolean"
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "route": {
                      "anyOf": [
                        {
                          "type": "string"
                        },
                        {
                          "type": "null"
                        }
                      ]
                    }
                  },
                  "additionalProperties": false
                },
                "label": {
                  "type": "string"
                },
                "preview": {
                  "type": "string"
                },
                "revision": {
                  "type": "string",
                  "maxLength": 100
                }
              },
              "required": [
                "id",
                "initial",
                "label",
                "preview",
                "revision"
              ],
              "additionalProperties": false
            }
          },
          "object": {
            "type": "string",
            "enum": [
              "prescribing_options"
            ]
          },
          "catalogItemId": {
            "type": "string",
            "pattern": "^cat_[0-7][0-9a-hjkmnp-tv-z]{25}$",
            "examples": [
              "cat_01j2y8m6jcc9tt24af5pw9x1bc"
            ]
          },
          "practiceId": {
            "type": "string",
            "pattern": "^prac_[0-7][0-9a-hjkmnp-tv-z]{25}$",
            "examples": [
              "prac_01j2y8m6jcc9tt24af5pw9x1bc"
            ]
          },
          "livemode": {
            "type": "boolean"
          },
          "revision": {
            "type": "string",
            "maxLength": 100
          },
          "catalog": {
            "type": "object",
            "properties": {
              "catalogDetails": {
                "type": "object",
                "properties": {
                  "packageComponents": {
                    "anyOf": [
                      {
                        "type": "array",
                        "items": {
                          "type": "object",
                          "properties": {
                            "container": {
                              "type": "string",
                              "allOf": [
                                {
                                  "minLength": 1
                                }
                              ]
                            },
                            "containerCount": {
                              "type": "integer",
                              "allOf": [
                                {
                                  "exclusiveMinimum": 0
                                }
                              ]
                            },
                            "contentsPerContainer": {
                              "type": "object",
                              "properties": {
                                "value": {
                                  "type": "string",
                                  "allOf": [
                                    {
                                      "maxLength": 100
                                    },
                                    {
                                      "pattern": "^(?:0|[1-9]\\d*)(?:\\.\\d*[1-9])?$"
                                    }
                                  ]
                                },
                                "unit": {
                                  "type": "string",
                                  "enum": [
                                    "mg",
                                    "g",
                                    "ug",
                                    "mL",
                                    "L",
                                    "[IU]",
                                    "tablet",
                                    "capsule",
                                    "troche",
                                    "actuation",
                                    "patch",
                                    "package",
                                    "container"
                                  ]
                                }
                              },
                              "required": [
                                "value",
                                "unit"
                              ],
                              "additionalProperties": false
                            }
                          },
                          "required": [
                            "container",
                            "containerCount",
                            "contentsPerContainer"
                          ],
                          "additionalProperties": false
                        }
                      },
                      {
                        "type": "null"
                      }
                    ],
                    "description": "Confirmed physical containers and contents. Empty or absent means container count cannot be inferred from dispense quantity."
                  },
                  "attributes": {
                    "type": "object",
                    "additionalProperties": {
                      "anyOf": [
                        {
                          "type": "string"
                        },
                        {
                          "type": "array",
                          "items": {
                            "type": "string"
                          }
                        }
                      ]
                    }
                  },
                  "directions": {
                    "type": "array",
                    "items": {
                      "type": "object",
                      "properties": {
                        "kind": {
                          "type": "string",
                          "enum": [
                            "suggested",
                            "template"
                          ]
                        },
                        "text": {
                          "type": "string"
                        }
                      },
                      "required": [
                        "kind",
                        "text"
                      ],
                      "additionalProperties": false
                    }
                  }
                },
                "required": [
                  "attributes",
                  "directions"
                ],
                "additionalProperties": false
              },
              "composition": {
                "type": "object",
                "properties": {
                  "status": {
                    "type": "string",
                    "enum": [
                      "complete",
                      "partial",
                      "unresolved"
                    ]
                  },
                  "ingredients": {
                    "type": "array",
                    "items": {
                      "type": "object",
                      "properties": {
                        "name": {
                          "type": "string"
                        },
                        "role": {
                          "type": "string",
                          "enum": [
                            "active",
                            "inactive"
                          ]
                        },
                        "basisOfStrengthSubstance": {
                          "anyOf": [
                            {
                              "type": "object",
                              "properties": {
                                "name": {
                                  "type": "string"
                                }
                              },
                              "required": [
                                "name"
                              ],
                              "additionalProperties": false
                            },
                            {
                              "type": "null"
                            }
                          ]
                        },
                        "strength": {
                          "anyOf": [
                            {
                              "type": "object",
                              "properties": {
                                "kind": {
                                  "type": "string",
                                  "enum": [
                                    "amount"
                                  ]
                                },
                                "amount": {
                                  "type": "object",
                                  "properties": {
                                    "value": {
                                      "type": "string",
                                      "allOf": [
                                        {
                                          "pattern": "^(?:0|[1-9][0-9]*)(?:\\.[0-9]+)?$"
                                        }
                                      ]
                                    },
                                    "unit": {
                                      "type": "string"
                                    }
                                  },
                                  "required": [
                                    "value",
                                    "unit"
                                  ],
                                  "additionalProperties": false
                                }
                              },
                              "required": [
                                "kind",
                                "amount"
                              ],
                              "additionalProperties": false
                            },
                            {
                              "type": "object",
                              "properties": {
                                "kind": {
                                  "type": "string",
                                  "enum": [
                                    "ratio"
                                  ]
                                },
                                "numerator": {
                                  "type": "object",
                                  "properties": {
                                    "value": {
                                      "type": "string",
                                      "allOf": [
                                        {
                                          "pattern": "^(?:0|[1-9][0-9]*)(?:\\.[0-9]+)?$"
                                        }
                                      ]
                                    },
                                    "unit": {
                                      "type": "string"
                                    }
                                  },
                                  "required": [
                                    "value",
                                    "unit"
                                  ],
                                  "additionalProperties": false
                                },
                                "denominator": {
                                  "type": "object",
                                  "properties": {
                                    "value": {
                                      "type": "string",
                                      "allOf": [
                                        {
                                          "pattern": "^(?:0|[1-9][0-9]*)(?:\\.[0-9]+)?$"
                                        }
                                      ]
                                    },
                                    "unit": {
                                      "type": "string"
                                    }
                                  },
                                  "required": [
                                    "value",
                                    "unit"
                                  ],
                                  "additionalProperties": false
                                }
                              },
                              "required": [
                                "kind",
                                "numerator",
                                "denominator"
                              ],
                              "additionalProperties": false
                            },
                            {
                              "type": "object",
                              "properties": {
                                "kind": {
                                  "type": "string",
                                  "enum": [
                                    "unresolved"
                                  ]
                                },
                                "reason": {
                                  "type": "string"
                                }
                              },
                              "required": [
                                "kind",
                                "reason"
                              ],
                              "additionalProperties": false
                            }
                          ]
                        }
                      },
                      "required": [
                        "name",
                        "role",
                        "basisOfStrengthSubstance",
                        "strength"
                      ],
                      "additionalProperties": false
                    }
                  }
                },
                "required": [
                  "status",
                  "ingredients"
                ],
                "additionalProperties": false
              },
              "allowedStates": {
                "type": "array",
                "items": {
                  "type": "string"
                }
              },
              "availability": {
                "type": "string",
                "enum": [
                  "available",
                  "backordered",
                  "unavailable",
                  "unknown"
                ]
              },
              "catalogKind": {
                "type": "string"
              },
              "fulfillmentInclusions": {
                "type": "array",
                "items": {
                  "type": "object",
                  "properties": {
                    "amountCents": {
                      "type": "integer"
                    },
                    "kind": {
                      "type": "string",
                      "enum": [
                        "cold_chain",
                        "injection_supplies"
                      ]
                    },
                    "label": {
                      "type": "string"
                    },
                    "priceComponent": {
                      "type": "string",
                      "enum": [
                        "shipping"
                      ]
                    }
                  },
                  "required": [
                    "amountCents",
                    "kind",
                    "label",
                    "priceComponent"
                  ],
                  "additionalProperties": false
                }
              },
              "ordering": {
                "type": "object",
                "properties": {
                  "requiresPrescription": {
                    "type": "boolean"
                  },
                  "requiresAccompanyingPrescription": {
                    "type": "boolean"
                  },
                  "shipping": {
                    "type": "string",
                    "enum": [
                      "prescription",
                      "accompanying_prescription"
                    ]
                  }
                },
                "required": [
                  "requiresPrescription",
                  "requiresAccompanyingPrescription",
                  "shipping"
                ],
                "additionalProperties": false
              },
              "category": {
                "anyOf": [
                  {
                    "type": "string"
                  },
                  {
                    "type": "null"
                  }
                ]
              },
              "coldShip": {
                "type": "boolean"
              },
              "pharmacyId": {
                "type": "string",
                "allOf": [
                  {
                    "pattern": "^pharm_[0-7][0-9a-hjkmnp-tv-z]{25}$",
                    "examples": [
                      "pharm_01j2y8m6jcc9tt24af5pw9x1bc"
                    ]
                  }
                ]
              },
              "pharmacyName": {
                "type": "string"
              },
              "description": {
                "type": "string"
              },
              "dosageForm": {
                "type": "string"
              },
              "facilityType": {
                "type": "string"
              },
              "id": {
                "type": "string",
                "allOf": [
                  {
                    "pattern": "^cat_[0-7][0-9a-hjkmnp-tv-z]{25}$",
                    "examples": [
                      "cat_01j2y8m6jcc9tt24af5pw9x1bc"
                    ]
                  }
                ]
              },
              "imageUrl": {
                "anyOf": [
                  {
                    "type": "string"
                  },
                  {
                    "type": "null"
                  }
                ],
                "description": "Primary product photo, falling back to dosage-form artwork. Null when neither is available."
              },
              "imageUrls": {
                "type": "array",
                "items": {
                  "type": "string"
                },
                "allOf": [
                  {
                    "maxItems": 40
                  }
                ]
              },
              "medicationGroup": {
                "anyOf": [
                  {
                    "type": "object",
                    "properties": {
                      "offerCount": {
                        "anyOf": [
                          {
                            "type": "number"
                          },
                          {
                            "type": "string",
                            "enum": [
                              "Infinity",
                              "-Infinity",
                              "NaN"
                            ]
                          }
                        ]
                      },
                      "pharmacyCount": {
                        "anyOf": [
                          {
                            "type": "number"
                          },
                          {
                            "type": "string",
                            "enum": [
                              "Infinity",
                              "-Infinity",
                              "NaN"
                            ]
                          }
                        ]
                      },
                      "strengths": {
                        "type": "array",
                        "items": {
                          "type": "string"
                        }
                      }
                    },
                    "required": [
                      "offerCount",
                      "pharmacyCount",
                      "strengths"
                    ],
                    "additionalProperties": false
                  },
                  {
                    "type": "null"
                  }
                ]
              },
              "isOrderable": {
                "type": "boolean"
              },
              "livemode": {
                "type": "boolean"
              },
              "name": {
                "type": "string"
              },
              "object": {
                "type": "string",
                "enum": [
                  "catalog_item"
                ]
              },
              "patientSpecificRequired": {
                "type": "boolean"
              },
              "quantityConstraint": {
                "anyOf": [
                  {
                    "anyOf": [
                      {
                        "type": "object",
                        "properties": {
                          "kind": {
                            "type": "string",
                            "enum": [
                              "fixed"
                            ]
                          },
                          "quantity": {
                            "type": "object",
                            "properties": {
                              "value": {
                                "type": "string",
                                "allOf": [
                                  {
                                    "maxLength": 100
                                  },
                                  {
                                    "pattern": "^(?:0|[1-9]\\d*)(?:\\.\\d*[1-9])?$"
                                  }
                                ]
                              },
                              "unit": {
                                "type": "string",
                                "allOf": [
                                  {
                                    "minLength": 1
                                  }
                                ]
                              }
                            },
                            "required": [
                              "value",
                              "unit"
                            ],
                            "additionalProperties": false
                          }
                        },
                        "required": [
                          "kind",
                          "quantity"
                        ],
                        "additionalProperties": false
                      },
                      {
                        "type": "object",
                        "properties": {
                          "kind": {
                            "type": "string",
                            "enum": [
                              "choices"
                            ]
                          },
                          "quantities": {
                            "type": "array",
                            "prefixItems": [
                              {
                                "type": "object",
                                "properties": {
                                  "value": {
                                    "type": "string",
                                    "allOf": [
                                      {
                                        "maxLength": 100
                                      },
                                      {
                                        "pattern": "^(?:0|[1-9]\\d*)(?:\\.\\d*[1-9])?$"
                                      }
                                    ]
                                  },
                                  "unit": {
                                    "type": "string",
                                    "allOf": [
                                      {
                                        "minLength": 1
                                      }
                                    ]
                                  }
                                },
                                "required": [
                                  "value",
                                  "unit"
                                ],
                                "additionalProperties": false
                              }
                            ],
                            "minItems": 1,
                            "items": {
                              "type": "object",
                              "properties": {
                                "value": {
                                  "type": "string",
                                  "allOf": [
                                    {
                                      "maxLength": 100
                                    },
                                    {
                                      "pattern": "^(?:0|[1-9]\\d*)(?:\\.\\d*[1-9])?$"
                                    }
                                  ]
                                },
                                "unit": {
                                  "type": "string",
                                  "allOf": [
                                    {
                                      "minLength": 1
                                    }
                                  ]
                                }
                              },
                              "required": [
                                "value",
                                "unit"
                              ],
                              "additionalProperties": false
                            }
                          }
                        },
                        "required": [
                          "kind",
                          "quantities"
                        ],
                        "additionalProperties": false
                      },
                      {
                        "type": "object",
                        "properties": {
                          "kind": {
                            "type": "string",
                            "enum": [
                              "range"
                            ]
                          },
                          "unit": {
                            "type": "string",
                            "allOf": [
                              {
                                "minLength": 1
                              }
                            ]
                          },
                          "minimum": {
                            "anyOf": [
                              {
                                "type": "string",
                                "allOf": [
                                  {
                                    "maxLength": 100
                                  },
                                  {
                                    "pattern": "^(?:0|[1-9]\\d*)(?:\\.\\d*[1-9])?$"
                                  }
                                ]
                              },
                              {
                                "type": "null"
                              }
                            ]
                          },
                          "maximum": {
                            "anyOf": [
                              {
                                "type": "string",
                                "allOf": [
                                  {
                                    "maxLength": 100
                                  },
                                  {
                                    "pattern": "^(?:0|[1-9]\\d*)(?:\\.\\d*[1-9])?$"
                                  }
                                ]
                              },
                              {
                                "type": "null"
                              }
                            ]
                          },
                          "increment": {
                            "anyOf": [
                              {
                                "type": "string",
                                "allOf": [
                                  {
                                    "maxLength": 100
                                  },
                                  {
                                    "pattern": "^(?:0|[1-9]\\d*)(?:\\.\\d*[1-9])?$"
                                  }
                                ]
                              },
                              {
                                "type": "null"
                              }
                            ]
                          }
                        },
                        "required": [
                          "kind",
                          "unit",
                          "minimum",
                          "maximum",
                          "increment"
                        ],
                        "additionalProperties": false
                      },
                      {
                        "type": "object",
                        "properties": {
                          "kind": {
                            "type": "string",
                            "enum": [
                              "unresolved"
                            ]
                          },
                          "sourceText": {
                            "type": "string"
                          }
                        },
                        "required": [
                          "kind",
                          "sourceText"
                        ],
                        "additionalProperties": false
                      }
                    ]
                  },
                  {
                    "type": "null"
                  }
                ]
              },
              "prescriptionRequirements": {
                "type": "object",
                "properties": {
                  "allowedDaysSupply": {
                    "anyOf": [
                      {
                        "type": "array",
                        "items": {
                          "type": "integer"
                        }
                      },
                      {
                        "type": "null"
                      }
                    ]
                  },
                  "allowedQuantities": {
                    "anyOf": [
                      {
                        "type": "array",
                        "items": {
                          "type": "object",
                          "properties": {
                            "daysSupply": {
                              "anyOf": [
                                {
                                  "type": "integer"
                                },
                                {
                                  "type": "null"
                                }
                              ]
                            },
                            "label": {
                              "type": "string"
                            },
                            "unit": {
                              "type": "string"
                            },
                            "value": {
                              "anyOf": [
                                {
                                  "type": "number"
                                },
                                {
                                  "type": "string",
                                  "enum": [
                                    "Infinity",
                                    "-Infinity",
                                    "NaN"
                                  ]
                                }
                              ]
                            }
                          },
                          "required": [
                            "label",
                            "unit",
                            "value"
                          ],
                          "additionalProperties": false
                        }
                      },
                      {
                        "type": "null"
                      }
                    ]
                  },
                  "allowedReasonCategories": {
                    "anyOf": [
                      {
                        "type": "array",
                        "items": {
                          "type": "string",
                          "enum": [
                            "alcohol_free",
                            "drug_shortage",
                            "commercial_product_discontinued",
                            "modified_release",
                            "inactive_ingredient_sensitivity",
                            "inactive_ingredient_toxicity",
                            "concentration_adjustment",
                            "alternate_route",
                            "dosage_form_unavailable",
                            "flavor_adjustment",
                            "tablet_burden",
                            "patient_cannot_use_commercial_product",
                            "no_approved_product_available",
                            "no_rationale_required",
                            "other_patient_specific_need"
                          ]
                        }
                      },
                      {
                        "type": "null"
                      }
                    ]
                  },
                  "reasonCategoryLabels": {
                    "anyOf": [
                      {
                        "type": "object",
                        "additionalProperties": {
                          "type": "string"
                        }
                      },
                      {
                        "type": "null"
                      }
                    ]
                  },
                  "compoundingReason": {
                    "type": "string",
                    "enum": [
                      "not_required",
                      "optional",
                      "required"
                    ]
                  },
                  "compoundingReasonContext": {
                    "anyOf": [
                      {
                        "type": "string",
                        "enum": [
                          "not_supported",
                          "optional",
                          "required"
                        ]
                      },
                      {
                        "type": "null"
                      }
                    ]
                  },
                  "controlledSchedule": {
                    "anyOf": [
                      {
                        "type": "string",
                        "enum": [
                          "II",
                          "III",
                          "IV",
                          "V"
                        ]
                      },
                      {
                        "type": "null"
                      }
                    ]
                  },
                  "defaultDaysSupply": {
                    "anyOf": [
                      {
                        "type": "integer"
                      },
                      {
                        "type": "null"
                      }
                    ]
                  },
                  "defaultQuantity": {
                    "anyOf": [
                      {
                        "type": "object",
                        "properties": {
                          "unit": {
                            "type": "string"
                          },
                          "value": {
                            "anyOf": [
                              {
                                "type": "number"
                              },
                              {
                                "type": "string",
                                "enum": [
                                  "Infinity",
                                  "-Infinity",
                                  "NaN"
                                ]
                              }
                            ]
                          }
                        },
                        "required": [
                          "unit",
                          "value"
                        ],
                        "additionalProperties": false
                      },
                      {
                        "type": "null"
                      }
                    ]
                  },
                  "quantityIncrement": {
                    "anyOf": [
                      {
                        "type": "object",
                        "properties": {
                          "max": {
                            "anyOf": [
                              {
                                "anyOf": [
                                  {
                                    "type": "number"
                                  },
                                  {
                                    "type": "string",
                                    "enum": [
                                      "Infinity",
                                      "-Infinity",
                                      "NaN"
                                    ]
                                  }
                                ]
                              },
                              {
                                "type": "null"
                              }
                            ]
                          },
                          "min": {
                            "anyOf": [
                              {
                                "anyOf": [
                                  {
                                    "type": "number"
                                  },
                                  {
                                    "type": "string",
                                    "enum": [
                                      "Infinity",
                                      "-Infinity",
                                      "NaN"
                                    ]
                                  }
                                ]
                              },
                              {
                                "type": "null"
                              }
                            ]
                          },
                          "unit": {
                            "type": "string"
                          },
                          "value": {
                            "anyOf": [
                              {
                                "type": "number"
                              },
                              {
                                "type": "string",
                                "enum": [
                                  "Infinity",
                                  "-Infinity",
                                  "NaN"
                                ]
                              }
                            ]
                          }
                        },
                        "required": [
                          "unit",
                          "value"
                        ],
                        "additionalProperties": false
                      },
                      {
                        "type": "null"
                      }
                    ]
                  },
                  "defaultSigs": {
                    "anyOf": [
                      {
                        "type": "array",
                        "items": {
                          "type": "string"
                        }
                      },
                      {
                        "type": "null"
                      }
                    ]
                  },
                  "diagnosis": {
                    "type": "string",
                    "enum": [
                      "not_required",
                      "optional",
                      "required"
                    ]
                  },
                  "medicationReview": {
                    "anyOf": [
                      {
                        "type": "string",
                        "enum": [
                          "optional",
                          "required"
                        ]
                      },
                      {
                        "type": "null"
                      }
                    ]
                  },
                  "diagnosisReview": {
                    "anyOf": [
                      {
                        "type": "string",
                        "enum": [
                          "optional",
                          "required"
                        ]
                      },
                      {
                        "type": "null"
                      }
                    ]
                  },
                  "maxRefills": {
                    "anyOf": [
                      {
                        "type": "integer"
                      },
                      {
                        "type": "null"
                      }
                    ]
                  },
                  "notes": {
                    "anyOf": [
                      {
                        "type": "array",
                        "items": {
                          "type": "string"
                        }
                      },
                      {
                        "type": "null"
                      }
                    ]
                  },
                  "pharmacyNotes": {
                    "type": "string",
                    "enum": [
                      "not_supported",
                      "optional"
                    ]
                  },
                  "refills": {
                    "type": "string",
                    "enum": [
                      "not_supported",
                      "optional"
                    ]
                  },
                  "substitution": {
                    "type": "string",
                    "enum": [
                      "not_supported",
                      "optional"
                    ]
                  }
                },
                "required": [
                  "compoundingReason",
                  "diagnosis",
                  "pharmacyNotes",
                  "refills",
                  "substitution"
                ],
                "additionalProperties": false
              },
              "pricing": {
                "anyOf": [
                  {
                    "type": "object",
                    "properties": {
                      "amountCents": {
                        "type": "integer",
                        "allOf": [
                          {
                            "minimum": 0
                          }
                        ]
                      },
                      "basis": {
                        "anyOf": [
                          {
                            "type": "object",
                            "properties": {
                              "kind": {
                                "type": "string",
                                "enum": [
                                  "item"
                                ]
                              },
                              "quantity": {
                                "type": "string",
                                "enum": [
                                  "1"
                                ]
                              },
                              "unit": {
                                "type": "string",
                                "allOf": [
                                  {
                                    "minLength": 1
                                  }
                                ]
                              },
                              "quantityPrices": {
                                "anyOf": [
                                  {
                                    "type": "array",
                                    "items": {
                                      "type": "object",
                                      "properties": {
                                        "quantity": {
                                          "type": "string",
                                          "allOf": [
                                            {
                                              "maxLength": 100
                                            },
                                            {
                                              "pattern": "^(?:0|[1-9]\\d*)(?:\\.\\d*[1-9])?$"
                                            }
                                          ]
                                        },
                                        "amountCents": {
                                          "type": "integer",
                                          "allOf": [
                                            {
                                              "exclusiveMinimum": 0
                                            }
                                          ]
                                        }
                                      },
                                      "required": [
                                        "quantity",
                                        "amountCents"
                                      ],
                                      "additionalProperties": false
                                    },
                                    "allOf": [
                                      {
                                        "minItems": 1
                                      }
                                    ]
                                  },
                                  {
                                    "type": "null"
                                  }
                                ]
                              }
                            },
                            "required": [
                              "kind",
                              "quantity",
                              "unit"
                            ],
                            "additionalProperties": false
                          },
                          {
                            "type": "object",
                            "properties": {
                              "kind": {
                                "type": "string",
                                "enum": [
                                  "package"
                                ]
                              },
                              "quantity": {
                                "type": "string",
                                "allOf": [
                                  {
                                    "maxLength": 100
                                  },
                                  {
                                    "pattern": "^(?:0|[1-9]\\d*)(?:\\.\\d*[1-9])?$"
                                  }
                                ]
                              },
                              "unit": {
                                "type": "string",
                                "allOf": [
                                  {
                                    "minLength": 1
                                  }
                                ]
                              }
                            },
                            "required": [
                              "kind",
                              "quantity",
                              "unit"
                            ],
                            "additionalProperties": false
                          },
                          {
                            "type": "object",
                            "properties": {
                              "kind": {
                                "type": "string",
                                "enum": [
                                  "unit"
                                ]
                              },
                              "quantity": {
                                "type": "string",
                                "enum": [
                                  "1"
                                ]
                              },
                              "unit": {
                                "type": "string",
                                "allOf": [
                                  {
                                    "minLength": 1
                                  }
                                ]
                              }
                            },
                            "required": [
                              "kind",
                              "quantity",
                              "unit"
                            ],
                            "additionalProperties": false
                          }
                        ]
                      },
                      "currency": {
                        "type": "string",
                        "enum": [
                          "USD"
                        ]
                      },
                      "medicationSubtotalCents": {
                        "type": "integer",
                        "allOf": [
                          {
                            "minimum": 0
                          }
                        ]
                      }
                    },
                    "required": [
                      "amountCents",
                      "basis",
                      "currency",
                      "medicationSubtotalCents"
                    ],
                    "additionalProperties": false
                  },
                  {
                    "type": "null"
                  }
                ]
              },
              "restrictedStates": {
                "type": "array",
                "items": {
                  "type": "string"
                }
              },
              "route": {
                "type": "string"
              },
              "shippingOptions": {
                "type": "array",
                "items": {
                  "type": "object",
                  "properties": {
                    "amountCents": {
                      "type": "integer",
                      "allOf": [
                        {
                          "minimum": 0
                        }
                      ]
                    },
                    "carrier": {
                      "anyOf": [
                        {
                          "type": "string"
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "currency": {
                      "type": "string",
                      "enum": [
                        "USD"
                      ]
                    },
                    "destinationTypes": {
                      "type": "array",
                      "items": {
                        "type": "string",
                        "enum": [
                          "patient",
                          "practice"
                        ]
                      }
                    },
                    "estimatedDaysMax": {
                      "anyOf": [
                        {
                          "type": "integer",
                          "allOf": [
                            {
                              "minimum": 0
                            }
                          ]
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "estimatedDaysMin": {
                      "anyOf": [
                        {
                          "type": "integer",
                          "allOf": [
                            {
                              "minimum": 0
                            }
                          ]
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "id": {
                      "type": "string",
                      "allOf": [
                        {
                          "pattern": "^shp_[0-7][0-9a-hjkmnp-tv-z]{25}$",
                          "examples": [
                            "shp_01j2y8m6jcc9tt24af5pw9x1bc"
                          ]
                        }
                      ]
                    },
                    "label": {
                      "type": "string"
                    },
                    "serviceLevel": {
                      "type": "string"
                    },
                    "temperatures": {
                      "type": "array",
                      "items": {
                        "type": "string",
                        "enum": [
                          "ambient",
                          "refrigerated"
                        ]
                      }
                    }
                  },
                  "required": [
                    "amountCents",
                    "carrier",
                    "currency",
                    "destinationTypes",
                    "estimatedDaysMax",
                    "estimatedDaysMin",
                    "id",
                    "label",
                    "serviceLevel",
                    "temperatures"
                  ],
                  "additionalProperties": false
                }
              },
              "strength": {
                "anyOf": [
                  {
                    "type": "string"
                  },
                  {
                    "type": "null"
                  }
                ]
              },
              "unit": {
                "anyOf": [
                  {
                    "type": "string"
                  },
                  {
                    "type": "null"
                  }
                ]
              }
            },
            "required": [
              "catalogDetails",
              "composition",
              "allowedStates",
              "availability",
              "catalogKind",
              "fulfillmentInclusions",
              "ordering",
              "category",
              "coldShip",
              "pharmacyId",
              "pharmacyName",
              "description",
              "dosageForm",
              "facilityType",
              "id",
              "imageUrl",
              "imageUrls",
              "isOrderable",
              "livemode",
              "name",
              "object",
              "patientSpecificRequired",
              "quantityConstraint",
              "prescriptionRequirements",
              "pricing",
              "restrictedStates",
              "route",
              "shippingOptions",
              "strength",
              "unit"
            ],
            "additionalProperties": false
          },
          "defaultPresetId": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ]
          },
          "presets": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "id": {
                  "type": "string"
                },
                "revision": {
                  "type": "string",
                  "maxLength": 100
                },
                "source": {
                  "type": "string",
                  "enum": [
                    "affinity",
                    "pharmacy",
                    "catalog"
                  ]
                },
                "directions": {
                  "type": "string"
                },
                "format": {
                  "type": "string",
                  "enum": [
                    "structured",
                    "free_text"
                  ]
                },
                "structuredSig": {
                  "anyOf": [
                    {
                      "type": "object",
                      "properties": {
                        "dose": {
                          "type": "string"
                        },
                        "doseUnit": {
                          "type": "string"
                        },
                        "frequency": {
                          "type": "string"
                        },
                        "route": {
                          "type": "string"
                        },
                        "prn": {
                          "type": "boolean"
                        },
                        "duration": {
                          "anyOf": [
                            {
                              "type": "string"
                            },
                            {
                              "type": "null"
                            }
                          ]
                        },
                        "indication": {
                          "anyOf": [
                            {
                              "type": "string"
                            },
                            {
                              "type": "null"
                            }
                          ]
                        },
                        "maxDailyUse": {
                          "anyOf": [
                            {
                              "type": "string"
                            },
                            {
                              "type": "null"
                            }
                          ]
                        },
                        "titrationSchedule": {
                          "anyOf": [
                            {
                              "type": "string"
                            },
                            {
                              "type": "null"
                            }
                          ]
                        }
                      },
                      "required": [
                        "dose",
                        "doseUnit",
                        "frequency",
                        "route",
                        "prn"
                      ],
                      "additionalProperties": false
                    },
                    {
                      "type": "null"
                    }
                  ]
                },
                "quantity": {
                  "anyOf": [
                    {
                      "type": "object",
                      "properties": {
                        "value": {
                          "type": "number"
                        },
                        "unit": {
                          "type": "string"
                        }
                      },
                      "required": [
                        "value",
                        "unit"
                      ],
                      "additionalProperties": false
                    },
                    {
                      "type": "null"
                    }
                  ]
                },
                "daysSupply": {
                  "anyOf": [
                    {
                      "type": "integer"
                    },
                    {
                      "type": "null"
                    }
                  ]
                },
                "refills": {
                  "type": "integer"
                }
              },
              "required": [
                "id",
                "revision",
                "source",
                "directions",
                "format",
                "structuredSig",
                "quantity",
                "daysSupply",
                "refills"
              ],
              "additionalProperties": false
            }
          }
        },
        "required": [
          "compoundingReason",
          "compoundingReasonCategoryDefault",
          "compoundingReasonDefault",
          "default",
          "formulationDefault",
          "initial",
          "medication",
          "options",
          "pharmacyDirections",
          "templates",
          "object",
          "catalogItemId",
          "practiceId",
          "livemode",
          "revision",
          "catalog",
          "defaultPresetId",
          "presets"
        ],
        "additionalProperties": false
      },
      "PreviewOrderRequest": {
        "type": "object",
        "properties": {
          "otcItems": {
            "anyOf": [
              {
                "type": "array",
                "items": {
                  "type": "object",
                  "properties": {
                    "catalogItemId": {
                      "type": "string",
                      "pattern": "^cat_[0-7][0-9a-hjkmnp-tv-z]{25}$",
                      "examples": [
                        "cat_01j2y8m6jcc9tt24af5pw9x1bc"
                      ]
                    },
                    "quantity": {
                      "type": "integer",
                      "minimum": 1,
                      "maximum": 100
                    }
                  },
                  "required": [
                    "catalogItemId",
                    "quantity"
                  ],
                  "additionalProperties": false
                },
                "maxItems": 20
              },
              {
                "type": "null"
              }
            ]
          },
          "practiceId": {
            "type": "string",
            "pattern": "^prac_[0-7][0-9a-hjkmnp-tv-z]{25}$",
            "examples": [
              "prac_01j2y8m6jcc9tt24af5pw9x1bc"
            ]
          },
          "patientId": {
            "anyOf": [
              {
                "type": "string",
                "pattern": "^pat_[0-7][0-9a-hjkmnp-tv-z]{25}$",
                "examples": [
                  "pat_01j2y8m6jcc9tt24af5pw9x1bc"
                ]
              },
              {
                "type": "null"
              }
            ]
          },
          "patientExternalId": {
            "anyOf": [
              {
                "type": "string",
                "pattern": "^[^\\u0000\\p{Cs}]*$"
              },
              {
                "type": "null"
              }
            ]
          },
          "patient": {
            "anyOf": [
              {
                "type": "object",
                "properties": {
                  "address": {
                    "anyOf": [
                      {
                        "anyOf": [
                          {
                            "type": "object",
                            "properties": {
                              "city": {
                                "type": "string",
                                "pattern": "^[^\\u0000\\p{Cs}]*$",
                                "allOf": [
                                  {
                                    "pattern": "^[^\\p{Cc}\\u200B\\u2028-\\u202E\\u2066-\\u2069]*$"
                                  }
                                ]
                              },
                              "line1": {
                                "type": "string",
                                "pattern": "^[^\\u0000\\p{Cs}]*$",
                                "allOf": [
                                  {
                                    "pattern": "^[^\\p{Cc}\\u200B\\u2028-\\u202E\\u2066-\\u2069]*$"
                                  }
                                ]
                              },
                              "line2": {
                                "anyOf": [
                                  {
                                    "anyOf": [
                                      {
                                        "type": "string",
                                        "pattern": "^[^\\u0000\\p{Cs}]*$",
                                        "allOf": [
                                          {
                                            "pattern": "^[^\\p{Cc}\\u200B\\u2028-\\u202E\\u2066-\\u2069]*$"
                                          }
                                        ]
                                      },
                                      {
                                        "type": "null"
                                      }
                                    ]
                                  },
                                  {
                                    "type": "null"
                                  }
                                ]
                              },
                              "postalCode": {
                                "type": "string"
                              },
                              "state": {
                                "type": "string"
                              },
                              "country": {
                                "anyOf": [
                                  {
                                    "type": "string",
                                    "enum": [
                                      "US"
                                    ]
                                  },
                                  {
                                    "type": "null"
                                  }
                                ]
                              }
                            },
                            "required": [
                              "city",
                              "line1",
                              "postalCode",
                              "state"
                            ],
                            "additionalProperties": false
                          },
                          {
                            "type": "null"
                          }
                        ]
                      },
                      {
                        "type": "null"
                      }
                    ]
                  },
                  "clinicalProfile": {
                    "anyOf": [
                      {
                        "type": "object",
                        "properties": {
                          "currentMedications": {
                            "type": "array",
                            "items": {
                              "type": "string",
                              "pattern": "^[^\\u0000\\p{Cs}]*$"
                            },
                            "maxItems": 100
                          },
                          "heightInches": {
                            "anyOf": [
                              {
                                "anyOf": [
                                  {
                                    "anyOf": [
                                      {
                                        "type": "number",
                                        "exclusiveMinimum": 0
                                      },
                                      {
                                        "type": "string",
                                        "enum": [
                                          "Infinity",
                                          "-Infinity",
                                          "NaN"
                                        ]
                                      }
                                    ]
                                  },
                                  {
                                    "type": "null"
                                  }
                                ]
                              },
                              {
                                "type": "null"
                              }
                            ]
                          },
                          "reviewedAt": {
                            "anyOf": [
                              {
                                "anyOf": [
                                  {
                                    "type": "string"
                                  },
                                  {
                                    "type": "null"
                                  }
                                ]
                              },
                              {
                                "type": "null"
                              }
                            ]
                          },
                          "weightPounds": {
                            "anyOf": [
                              {
                                "anyOf": [
                                  {
                                    "anyOf": [
                                      {
                                        "type": "number",
                                        "exclusiveMinimum": 0
                                      },
                                      {
                                        "type": "string",
                                        "enum": [
                                          "Infinity",
                                          "-Infinity",
                                          "NaN"
                                        ]
                                      }
                                    ]
                                  },
                                  {
                                    "type": "null"
                                  }
                                ]
                              },
                              {
                                "type": "null"
                              }
                            ]
                          }
                        },
                        "required": [
                          "currentMedications"
                        ],
                        "additionalProperties": false
                      },
                      {
                        "type": "null"
                      }
                    ]
                  },
                  "dateOfBirth": {
                    "type": "string",
                    "pattern": "^\\d{4}-\\d{2}-\\d{2}$"
                  },
                  "email": {
                    "anyOf": [
                      {
                        "anyOf": [
                          {
                            "type": "string"
                          },
                          {
                            "type": "null"
                          }
                        ]
                      },
                      {
                        "type": "null"
                      }
                    ]
                  },
                  "externalId": {
                    "anyOf": [
                      {
                        "type": "string",
                        "pattern": "^[^\\u0000\\p{Cs}]*$"
                      },
                      {
                        "type": "null"
                      }
                    ]
                  },
                  "externalIdentities": {
                    "anyOf": [
                      {
                        "type": "array",
                        "items": {
                          "type": "object",
                          "properties": {
                            "source": {
                              "type": "string",
                              "pattern": "^[^\\u0000\\p{Cs}]*$"
                            },
                            "value": {
                              "type": "string",
                              "pattern": "^[^\\u0000\\p{Cs}]*$"
                            }
                          },
                          "required": [
                            "source",
                            "value"
                          ],
                          "additionalProperties": false
                        },
                        "maxItems": 50
                      },
                      {
                        "type": "null"
                      }
                    ]
                  },
                  "addresses": {
                    "anyOf": [
                      {
                        "type": "array",
                        "items": {
                          "type": "object",
                          "properties": {
                            "id": {
                              "anyOf": [
                                {
                                  "type": "string",
                                  "pattern": "^addr_[0-7][0-9a-hjkmnp-tv-z]{25}$",
                                  "examples": [
                                    "addr_01j2y8m6jcc9tt24af5pw9x1bc"
                                  ]
                                },
                                {
                                  "type": "null"
                                }
                              ]
                            },
                            "address": {
                              "type": "object",
                              "properties": {
                                "city": {
                                  "type": "string",
                                  "pattern": "^[^\\u0000\\p{Cs}]*$",
                                  "allOf": [
                                    {
                                      "pattern": "^[^\\p{Cc}\\u200B\\u2028-\\u202E\\u2066-\\u2069]*$"
                                    }
                                  ]
                                },
                                "country": {
                                  "anyOf": [
                                    {
                                      "type": "string",
                                      "enum": [
                                        "US"
                                      ]
                                    },
                                    {
                                      "type": "null"
                                    }
                                  ]
                                },
                                "line1": {
                                  "type": "string",
                                  "pattern": "^[^\\u0000\\p{Cs}]*$",
                                  "allOf": [
                                    {
                                      "pattern": "^[^\\p{Cc}\\u200B\\u2028-\\u202E\\u2066-\\u2069]*$"
                                    }
                                  ]
                                },
                                "line2": {
                                  "anyOf": [
                                    {
                                      "anyOf": [
                                        {
                                          "type": "string",
                                          "pattern": "^[^\\u0000\\p{Cs}]*$",
                                          "allOf": [
                                            {
                                              "pattern": "^[^\\p{Cc}\\u200B\\u2028-\\u202E\\u2066-\\u2069]*$"
                                            }
                                          ]
                                        },
                                        {
                                          "type": "null"
                                        }
                                      ]
                                    },
                                    {
                                      "type": "null"
                                    }
                                  ]
                                },
                                "postalCode": {
                                  "type": "string"
                                },
                                "state": {
                                  "type": "string"
                                }
                              },
                              "required": [
                                "city",
                                "line1",
                                "postalCode",
                                "state"
                              ],
                              "additionalProperties": false
                            },
                            "label": {
                              "type": "string",
                              "pattern": "^[^\\u0000\\p{Cs}]*$"
                            },
                            "preferredShipping": {
                              "type": "boolean"
                            },
                            "recipientName": {
                              "anyOf": [
                                {
                                  "type": "string",
                                  "pattern": "^[^\\u0000\\p{Cs}]*$",
                                  "allOf": [
                                    {
                                      "pattern": "^[^\\p{Cc}\\u200B\\u2028-\\u202E\\u2066-\\u2069]*$"
                                    }
                                  ]
                                },
                                {
                                  "type": "null"
                                }
                              ]
                            }
                          },
                          "required": [
                            "address",
                            "label",
                            "preferredShipping",
                            "recipientName"
                          ],
                          "additionalProperties": false
                        },
                        "maxItems": 50
                      },
                      {
                        "type": "null"
                      }
                    ]
                  },
                  "encounters": {
                    "anyOf": [
                      {
                        "type": "array",
                        "items": {
                          "type": "object",
                          "properties": {
                            "notes": {
                              "anyOf": [
                                {
                                  "type": "string",
                                  "pattern": "^[^\\u0000\\p{Cs}]*$",
                                  "maxLength": 5000
                                },
                                {
                                  "type": "null"
                                }
                              ]
                            },
                            "occurredAt": {
                              "type": "string"
                            },
                            "providerName": {
                              "anyOf": [
                                {
                                  "type": "string",
                                  "pattern": "^[^\\u0000\\p{Cs}]*$"
                                },
                                {
                                  "type": "null"
                                }
                              ]
                            },
                            "type": {
                              "type": "string",
                              "pattern": "^[^\\u0000\\p{Cs}]*$"
                            }
                          },
                          "required": [
                            "notes",
                            "occurredAt",
                            "providerName",
                            "type"
                          ],
                          "additionalProperties": false
                        }
                      },
                      {
                        "type": "null"
                      }
                    ]
                  },
                  "gender": {
                    "anyOf": [
                      {
                        "type": "string",
                        "enum": [
                          "f",
                          "m",
                          "o",
                          "u"
                        ]
                      },
                      {
                        "type": "null"
                      }
                    ]
                  },
                  "locationId": {
                    "anyOf": [
                      {
                        "type": "string",
                        "pattern": "^loc_[0-7][0-9a-hjkmnp-tv-z]{25}$",
                        "examples": [
                          "loc_01j2y8m6jcc9tt24af5pw9x1bc"
                        ]
                      },
                      {
                        "type": "null"
                      }
                    ]
                  },
                  "metadata": {
                    "anyOf": [
                      {
                        "type": "object"
                      },
                      {
                        "type": "null"
                      }
                    ]
                  },
                  "medicalRecordNumber": {
                    "anyOf": [
                      {
                        "anyOf": [
                          {
                            "type": "string",
                            "pattern": "^[^\\u0000\\p{Cs}]*$"
                          },
                          {
                            "type": "null"
                          }
                        ]
                      },
                      {
                        "type": "null"
                      }
                    ]
                  },
                  "measurements": {
                    "anyOf": [
                      {
                        "type": "array",
                        "items": {
                          "type": "object",
                          "properties": {
                            "heightCentimeters": {
                              "anyOf": [
                                {
                                  "anyOf": [
                                    {
                                      "type": "number",
                                      "exclusiveMinimum": 0
                                    },
                                    {
                                      "type": "string",
                                      "enum": [
                                        "Infinity",
                                        "-Infinity",
                                        "NaN"
                                      ]
                                    }
                                  ]
                                },
                                {
                                  "type": "null"
                                }
                              ]
                            },
                            "recordedAt": {
                              "type": "string"
                            },
                            "source": {
                              "type": "string",
                              "pattern": "^[^\\u0000\\p{Cs}]*$"
                            },
                            "weightKilograms": {
                              "anyOf": [
                                {
                                  "anyOf": [
                                    {
                                      "type": "number",
                                      "exclusiveMinimum": 0
                                    },
                                    {
                                      "type": "string",
                                      "enum": [
                                        "Infinity",
                                        "-Infinity",
                                        "NaN"
                                      ]
                                    }
                                  ]
                                },
                                {
                                  "type": "null"
                                }
                              ]
                            }
                          },
                          "required": [
                            "heightCentimeters",
                            "recordedAt",
                            "source",
                            "weightKilograms"
                          ],
                          "additionalProperties": false
                        }
                      },
                      {
                        "type": "null"
                      }
                    ]
                  },
                  "name": {
                    "type": "object",
                    "properties": {
                      "first": {
                        "type": "string",
                        "pattern": "^[^\\u0000\\p{Cs}]*$",
                        "allOf": [
                          {
                            "pattern": "^[^\\p{Cc}\\u200B\\u2028-\\u202E\\u2066-\\u2069]*$"
                          }
                        ]
                      },
                      "last": {
                        "type": "string",
                        "pattern": "^[^\\u0000\\p{Cs}]*$",
                        "allOf": [
                          {
                            "pattern": "^[^\\p{Cc}\\u200B\\u2028-\\u202E\\u2066-\\u2069]*$"
                          }
                        ]
                      },
                      "middle": {
                        "anyOf": [
                          {
                            "anyOf": [
                              {
                                "type": "string",
                                "pattern": "^[^\\u0000\\p{Cs}]*$",
                                "allOf": [
                                  {
                                    "pattern": "^[^\\p{Cc}\\u200B\\u2028-\\u202E\\u2066-\\u2069]*$"
                                  }
                                ]
                              },
                              {
                                "type": "null"
                              }
                            ]
                          },
                          {
                            "type": "null"
                          }
                        ]
                      },
                      "preferred": {
                        "anyOf": [
                          {
                            "anyOf": [
                              {
                                "type": "string",
                                "pattern": "^[^\\u0000\\p{Cs}]*$",
                                "allOf": [
                                  {
                                    "pattern": "^[^\\p{Cc}\\u200B\\u2028-\\u202E\\u2066-\\u2069]*$"
                                  }
                                ]
                              },
                              {
                                "type": "null"
                              }
                            ]
                          },
                          {
                            "type": "null"
                          }
                        ]
                      }
                    },
                    "required": [
                      "first",
                      "last"
                    ],
                    "additionalProperties": false
                  },
                  "phone": {
                    "anyOf": [
                      {
                        "anyOf": [
                          {
                            "type": "string"
                          },
                          {
                            "type": "null"
                          }
                        ]
                      },
                      {
                        "type": "null"
                      }
                    ]
                  },
                  "programs": {
                    "anyOf": [
                      {
                        "type": "array",
                        "items": {
                          "type": "object",
                          "properties": {
                            "endedAt": {
                              "anyOf": [
                                {
                                  "type": "string"
                                },
                                {
                                  "type": "null"
                                }
                              ]
                            },
                            "name": {
                              "type": "string",
                              "pattern": "^[^\\u0000\\p{Cs}]*$"
                            },
                            "startedAt": {
                              "type": "string"
                            },
                            "status": {
                              "type": "string",
                              "enum": [
                                "active",
                                "completed",
                                "paused"
                              ]
                            }
                          },
                          "required": [
                            "endedAt",
                            "name",
                            "startedAt",
                            "status"
                          ],
                          "additionalProperties": false
                        }
                      },
                      {
                        "type": "null"
                      }
                    ]
                  }
                },
                "required": [
                  "dateOfBirth",
                  "name"
                ],
                "additionalProperties": false
              },
              {
                "type": "null"
              }
            ]
          },
          "userId": {
            "anyOf": [
              {
                "type": "string",
                "pattern": "^user_[0-7][0-9a-hjkmnp-tv-z]{25}$",
                "examples": [
                  "user_01j2y8m6jcc9tt24af5pw9x1bc"
                ]
              },
              {
                "type": "null"
              }
            ]
          },
          "prescriber": {
            "anyOf": [
              {
                "type": "object",
                "properties": {
                  "id": {
                    "anyOf": [
                      {
                        "type": "string",
                        "pattern": "^prov_[0-7][0-9a-hjkmnp-tv-z]{25}$",
                        "examples": [
                          "prov_01j2y8m6jcc9tt24af5pw9x1bc"
                        ]
                      },
                      {
                        "type": "null"
                      }
                    ]
                  },
                  "npi": {
                    "anyOf": [
                      {
                        "type": "string"
                      },
                      {
                        "type": "null"
                      }
                    ]
                  },
                  "externalId": {
                    "anyOf": [
                      {
                        "type": "string"
                      },
                      {
                        "type": "null"
                      }
                    ]
                  },
                  "profile": {
                    "anyOf": [
                      {
                        "type": "object",
                        "properties": {
                          "email": {
                            "anyOf": [
                              {
                                "type": "string",
                                "pattern": "^[^\\s@]+@[^\\s@]+\\.[^\\s@]+$"
                              },
                              {
                                "type": "null"
                              }
                            ]
                          },
                          "phone": {
                            "anyOf": [
                              {
                                "type": "string"
                              },
                              {
                                "type": "null"
                              }
                            ]
                          }
                        },
                        "additionalProperties": false
                      },
                      {
                        "type": "null"
                      }
                    ]
                  }
                },
                "additionalProperties": false
              },
              {
                "type": "null"
              }
            ]
          },
          "shippingAddressId": {
            "anyOf": [
              {
                "type": "string",
                "pattern": "^addr_[0-7][0-9a-hjkmnp-tv-z]{25}$",
                "examples": [
                  "addr_01j2y8m6jcc9tt24af5pw9x1bc"
                ]
              },
              {
                "type": "null"
              }
            ]
          },
          "externalOrderId": {
            "anyOf": [
              {
                "type": "string",
                "maxLength": 200
              },
              {
                "type": "null"
              }
            ]
          },
          "prescriptions": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "medicationId": {
                  "type": "string",
                  "pattern": "^cat_[0-7][0-9a-hjkmnp-tv-z]{25}$",
                  "examples": [
                    "cat_01j2y8m6jcc9tt24af5pw9x1bc"
                  ]
                },
                "externalPrescriptionId": {
                  "anyOf": [
                    {
                      "type": "string",
                      "minLength": 1,
                      "maxLength": 200,
                      "pattern": "\\S",
                      "allOf": [
                        {
                          "pattern": "^[^\\p{Cc}\\p{Cs}]*$"
                        }
                      ]
                    },
                    {
                      "type": "null"
                    }
                  ]
                },
                "preset": {
                  "anyOf": [
                    {
                      "type": "string",
                      "maxLength": 100
                    },
                    {
                      "type": "null"
                    }
                  ]
                },
                "expectedRevision": {
                  "anyOf": [
                    {
                      "type": "string",
                      "maxLength": 100
                    },
                    {
                      "type": "null"
                    }
                  ]
                },
                "overrides": {
                  "anyOf": [
                    {
                      "type": "object",
                      "properties": {
                        "sig": {
                          "anyOf": [
                            {
                              "anyOf": [
                                {
                                  "type": "object",
                                  "properties": {
                                    "format": {
                                      "type": "string",
                                      "enum": [
                                        "structured"
                                      ]
                                    },
                                    "fields": {
                                      "type": "object",
                                      "properties": {
                                        "dose": {
                                          "type": "string"
                                        },
                                        "doseUnit": {
                                          "type": "string"
                                        },
                                        "frequency": {
                                          "type": "string"
                                        },
                                        "route": {
                                          "type": "string"
                                        },
                                        "prn": {
                                          "anyOf": [
                                            {
                                              "type": "boolean"
                                            },
                                            {
                                              "type": "null"
                                            }
                                          ]
                                        },
                                        "duration": {
                                          "anyOf": [
                                            {
                                              "type": "string"
                                            },
                                            {
                                              "type": "null"
                                            }
                                          ]
                                        },
                                        "indication": {
                                          "anyOf": [
                                            {
                                              "type": "string"
                                            },
                                            {
                                              "type": "null"
                                            }
                                          ]
                                        },
                                        "maxDailyUse": {
                                          "anyOf": [
                                            {
                                              "type": "string"
                                            },
                                            {
                                              "type": "null"
                                            }
                                          ]
                                        },
                                        "titrationSchedule": {
                                          "anyOf": [
                                            {
                                              "type": "string"
                                            },
                                            {
                                              "type": "null"
                                            }
                                          ]
                                        }
                                      },
                                      "required": [
                                        "dose",
                                        "doseUnit",
                                        "frequency",
                                        "route"
                                      ],
                                      "additionalProperties": false
                                    }
                                  },
                                  "required": [
                                    "format",
                                    "fields"
                                  ],
                                  "additionalProperties": false
                                },
                                {
                                  "type": "object",
                                  "properties": {
                                    "format": {
                                      "type": "string",
                                      "enum": [
                                        "free_text"
                                      ]
                                    },
                                    "text": {
                                      "type": "string"
                                    }
                                  },
                                  "required": [
                                    "format",
                                    "text"
                                  ],
                                  "additionalProperties": false
                                },
                                {
                                  "type": "object",
                                  "properties": {
                                    "format": {
                                      "type": "string",
                                      "enum": [
                                        "template"
                                      ]
                                    },
                                    "templateId": {
                                      "type": "string",
                                      "maxLength": 100
                                    },
                                    "templateRevision": {
                                      "type": "string",
                                      "maxLength": 100
                                    },
                                    "values": {
                                      "type": "object",
                                      "additionalProperties": {
                                        "type": "string"
                                      }
                                    }
                                  },
                                  "required": [
                                    "format",
                                    "templateId",
                                    "templateRevision",
                                    "values"
                                  ],
                                  "additionalProperties": false
                                }
                              ]
                            },
                            {
                              "type": "null"
                            }
                          ]
                        },
                        "quantity": {
                          "anyOf": [
                            {
                              "anyOf": [
                                {
                                  "type": "object",
                                  "properties": {
                                    "value": {
                                      "type": "number"
                                    },
                                    "unit": {
                                      "type": "string"
                                    }
                                  },
                                  "required": [
                                    "value",
                                    "unit"
                                  ],
                                  "additionalProperties": false
                                },
                                {
                                  "type": "null"
                                }
                              ]
                            },
                            {
                              "type": "null"
                            }
                          ]
                        },
                        "daysSupply": {
                          "anyOf": [
                            {
                              "anyOf": [
                                {
                                  "type": "integer"
                                },
                                {
                                  "type": "null"
                                }
                              ]
                            },
                            {
                              "type": "null"
                            }
                          ]
                        },
                        "refills": {
                          "anyOf": [
                            {
                              "type": "integer",
                              "minimum": 0,
                              "maximum": 99
                            },
                            {
                              "type": "null"
                            }
                          ]
                        },
                        "clinical": {
                          "anyOf": [
                            {
                              "anyOf": [
                                {
                                  "type": "object",
                                  "properties": {
                                    "compoundingReason": {
                                      "anyOf": [
                                        {
                                          "type": "object",
                                          "properties": {
                                            "category": {
                                              "anyOf": [
                                                {
                                                  "type": "string",
                                                  "enum": [
                                                    "alcohol_free",
                                                    "drug_shortage",
                                                    "commercial_product_discontinued",
                                                    "modified_release",
                                                    "inactive_ingredient_sensitivity",
                                                    "inactive_ingredient_toxicity",
                                                    "concentration_adjustment",
                                                    "alternate_route",
                                                    "dosage_form_unavailable",
                                                    "flavor_adjustment",
                                                    "tablet_burden",
                                                    "patient_cannot_use_commercial_product",
                                                    "no_approved_product_available",
                                                    "no_rationale_required",
                                                    "other_patient_specific_need"
                                                  ]
                                                },
                                                {
                                                  "type": "null"
                                                }
                                              ]
                                            },
                                            "context": {
                                              "anyOf": [
                                                {
                                                  "type": "string"
                                                },
                                                {
                                                  "type": "null"
                                                }
                                              ]
                                            }
                                          },
                                          "additionalProperties": false
                                        },
                                        {
                                          "type": "null"
                                        }
                                      ]
                                    },
                                    "medicationReviewStatus": {
                                      "anyOf": [
                                        {
                                          "type": "string",
                                          "enum": [
                                            "not_reviewed",
                                            "none",
                                            "recorded"
                                          ]
                                        },
                                        {
                                          "type": "null"
                                        }
                                      ]
                                    },
                                    "diagnosisReviewStatus": {
                                      "anyOf": [
                                        {
                                          "type": "string",
                                          "enum": [
                                            "not_reviewed",
                                            "none",
                                            "recorded"
                                          ]
                                        },
                                        {
                                          "type": "null"
                                        }
                                      ]
                                    },
                                    "currentMedications": {
                                      "anyOf": [
                                        {
                                          "type": "array",
                                          "items": {
                                            "type": "string"
                                          },
                                          "maxItems": 100
                                        },
                                        {
                                          "type": "null"
                                        }
                                      ]
                                    },
                                    "diagnoses": {
                                      "anyOf": [
                                        {
                                          "type": "array",
                                          "items": {
                                            "type": "object",
                                            "properties": {
                                              "code": {
                                                "type": "string"
                                              },
                                              "display": {
                                                "type": "string"
                                              }
                                            },
                                            "required": [
                                              "code",
                                              "display"
                                            ],
                                            "additionalProperties": false
                                          },
                                          "maxItems": 20
                                        },
                                        {
                                          "type": "null"
                                        }
                                      ]
                                    },
                                    "observations": {
                                      "anyOf": [
                                        {
                                          "type": "array",
                                          "items": {
                                            "type": "object",
                                            "properties": {
                                              "display": {
                                                "type": "string"
                                              },
                                              "unit": {
                                                "type": "string"
                                              },
                                              "value": {
                                                "anyOf": [
                                                  {
                                                    "type": "number",
                                                    "exclusiveMinimum": 0
                                                  },
                                                  {
                                                    "type": "string",
                                                    "enum": [
                                                      "Infinity",
                                                      "-Infinity",
                                                      "NaN"
                                                    ]
                                                  }
                                                ]
                                              }
                                            },
                                            "required": [
                                              "display",
                                              "unit",
                                              "value"
                                            ],
                                            "additionalProperties": false
                                          },
                                          "maxItems": 20
                                        },
                                        {
                                          "type": "null"
                                        }
                                      ]
                                    }
                                  },
                                  "additionalProperties": false
                                },
                                {
                                  "type": "null"
                                }
                              ]
                            },
                            {
                              "type": "null"
                            }
                          ]
                        },
                        "dispensing": {
                          "anyOf": [
                            {
                              "type": "object",
                              "properties": {
                                "dispenseUponAcceptance": {
                                  "anyOf": [
                                    {
                                      "type": "boolean"
                                    },
                                    {
                                      "type": "null"
                                    }
                                  ]
                                },
                                "shippingOptionId": {
                                  "anyOf": [
                                    {
                                      "type": "string",
                                      "pattern": "^shp_[0-7][0-9a-hjkmnp-tv-z]{25}$",
                                      "examples": [
                                        "shp_01j2y8m6jcc9tt24af5pw9x1bc"
                                      ]
                                    },
                                    {
                                      "type": "null"
                                    }
                                  ]
                                },
                                "shippingAmountCents": {
                                  "anyOf": [
                                    {
                                      "type": "integer",
                                      "minimum": 0
                                    },
                                    {
                                      "type": "null"
                                    }
                                  ],
                                  "description": "Reviewed customer shipping rate for the selected service. Preview supplies this value. Shared group rates must not be summed per prescription."
                                },
                                "shippingDestinationType": {
                                  "anyOf": [
                                    {
                                      "type": "string",
                                      "enum": [
                                        "patient"
                                      ]
                                    },
                                    {
                                      "type": "null"
                                    }
                                  ]
                                },
                                "pharmacyNotes": {
                                  "anyOf": [
                                    {
                                      "type": "string"
                                    },
                                    {
                                      "type": "null"
                                    }
                                  ]
                                },
                                "requestedFillDate": {
                                  "anyOf": [
                                    {
                                      "type": "string",
                                      "pattern": "^\\d{4}-\\d{2}-\\d{2}$"
                                    },
                                    {
                                      "type": "null"
                                    }
                                  ]
                                },
                                "substitutionPermitted": {
                                  "anyOf": [
                                    {
                                      "type": "boolean"
                                    },
                                    {
                                      "type": "null"
                                    }
                                  ]
                                }
                              },
                              "additionalProperties": false
                            },
                            {
                              "type": "null"
                            }
                          ]
                        }
                      },
                      "additionalProperties": false
                    },
                    {
                      "type": "null"
                    }
                  ]
                }
              },
              "required": [
                "medicationId"
              ],
              "additionalProperties": false
            },
            "minItems": 1,
            "maxItems": 20
          },
          "shipping": {
            "anyOf": [
              {
                "type": "object",
                "properties": {
                  "selection": {
                    "anyOf": [
                      {
                        "type": "string",
                        "enum": [
                          "manual",
                          "lowest_cost",
                          "fastest"
                        ]
                      },
                      {
                        "type": "null"
                      }
                    ]
                  }
                },
                "additionalProperties": false
              },
              {
                "type": "null"
              }
            ]
          }
        },
        "required": [
          "practiceId",
          "prescriptions"
        ],
        "additionalProperties": false,
        "title": "PreviewOrderRequest"
      },
      "PreviewOrderResponse": {
        "title": "PreviewOrderResponse",
        "type": "object",
        "properties": {
          "clinicalRequirementsSatisfied": {
            "type": "boolean"
          },
          "clinicalIssues": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "code": {
                  "type": "string"
                },
                "path": {
                  "type": "string"
                },
                "message": {
                  "type": "string"
                }
              },
              "required": [
                "code",
                "path",
                "message"
              ],
              "additionalProperties": false
            }
          },
          "clinicalRequirements": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "field": {
                  "type": "string"
                },
                "label": {
                  "type": "string"
                },
                "type": {
                  "type": "string",
                  "enum": [
                    "allergy_review",
                    "medication_review",
                    "diagnosis_review",
                    "diagnosis"
                  ]
                },
                "required": {
                  "type": "boolean"
                },
                "status": {
                  "type": "string",
                  "enum": [
                    "missing",
                    "satisfied"
                  ]
                }
              },
              "required": [
                "field",
                "label",
                "type",
                "required",
                "status"
              ],
              "additionalProperties": false
            }
          },
          "otcItems": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "catalogItemId": {
                  "type": "string",
                  "pattern": "^cat_[0-7][0-9a-hjkmnp-tv-z]{25}$",
                  "examples": [
                    "cat_01j2y8m6jcc9tt24af5pw9x1bc"
                  ]
                },
                "name": {
                  "type": "string"
                },
                "quantity": {
                  "type": "integer"
                },
                "unitPriceCents": {
                  "type": "integer"
                },
                "subtotalCents": {
                  "type": "integer"
                }
              },
              "required": [
                "catalogItemId",
                "name",
                "quantity",
                "unitPriceCents",
                "subtotalCents"
              ],
              "additionalProperties": false
            },
            "maxItems": 20
          },
          "shippingGroups": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "key": {
                  "type": "string"
                },
                "pharmacy": {
                  "type": "string"
                },
                "label": {
                  "type": "string"
                },
                "temperature": {
                  "type": "string",
                  "enum": [
                    "ambient",
                    "refrigerated"
                  ]
                },
                "amountCents": {
                  "type": "integer"
                },
                "itemCount": {
                  "type": "integer"
                },
                "prescriptionIndexes": {
                  "type": "array",
                  "items": {
                    "type": "integer"
                  },
                  "description": "Zero-based indexes into the preview prescriptions array. This is an estimated shipping charge group, not a guarantee of one physical package."
                }
              },
              "required": [
                "key",
                "pharmacy",
                "label",
                "temperature",
                "amountCents",
                "itemCount",
                "prescriptionIndexes"
              ],
              "additionalProperties": false
            },
            "maxItems": 20
          },
          "totals": {
            "type": "object",
            "properties": {
              "currency": {
                "type": "string",
                "enum": [
                  "USD"
                ]
              },
              "medicationSubtotalCents": {
                "anyOf": [
                  {
                    "type": "integer"
                  },
                  {
                    "type": "null"
                  }
                ]
              },
              "supplySubtotalCents": {
                "anyOf": [
                  {
                    "type": "integer"
                  },
                  {
                    "type": "null"
                  }
                ]
              },
              "shippingTotalCents": {
                "anyOf": [
                  {
                    "type": "integer"
                  },
                  {
                    "type": "null"
                  }
                ]
              },
              "estimatedTotalCents": {
                "anyOf": [
                  {
                    "type": "integer"
                  },
                  {
                    "type": "null"
                  }
                ]
              }
            },
            "required": [
              "currency",
              "medicationSubtotalCents",
              "supplySubtotalCents",
              "shippingTotalCents",
              "estimatedTotalCents"
            ],
            "additionalProperties": false
          },
          "object": {
            "type": "string",
            "enum": [
              "order_preview"
            ]
          },
          "livemode": {
            "type": "boolean"
          },
          "prescriptions": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "medicationId": {
                  "type": "string",
                  "pattern": "^cat_[0-7][0-9a-hjkmnp-tv-z]{25}$",
                  "examples": [
                    "cat_01j2y8m6jcc9tt24af5pw9x1bc"
                  ]
                },
                "revision": {
                  "type": "string",
                  "maxLength": 100
                },
                "directions": {
                  "type": "string"
                },
                "structuredSig": {
                  "anyOf": [
                    {
                      "type": "object",
                      "properties": {
                        "dose": {
                          "type": "string"
                        },
                        "doseUnit": {
                          "type": "string"
                        },
                        "frequency": {
                          "type": "string"
                        },
                        "route": {
                          "type": "string"
                        },
                        "prn": {
                          "type": "boolean"
                        },
                        "duration": {
                          "anyOf": [
                            {
                              "type": "string"
                            },
                            {
                              "type": "null"
                            }
                          ]
                        },
                        "indication": {
                          "anyOf": [
                            {
                              "type": "string"
                            },
                            {
                              "type": "null"
                            }
                          ]
                        },
                        "maxDailyUse": {
                          "anyOf": [
                            {
                              "type": "string"
                            },
                            {
                              "type": "null"
                            }
                          ]
                        },
                        "titrationSchedule": {
                          "anyOf": [
                            {
                              "type": "string"
                            },
                            {
                              "type": "null"
                            }
                          ]
                        }
                      },
                      "required": [
                        "dose",
                        "doseUnit",
                        "frequency",
                        "route",
                        "prn"
                      ],
                      "additionalProperties": false
                    },
                    {
                      "type": "null"
                    }
                  ]
                },
                "format": {
                  "type": "string",
                  "enum": [
                    "structured",
                    "free_text"
                  ]
                },
                "quantity": {
                  "anyOf": [
                    {
                      "type": "object",
                      "properties": {
                        "value": {
                          "type": "number"
                        },
                        "unit": {
                          "type": "string"
                        }
                      },
                      "required": [
                        "value",
                        "unit"
                      ],
                      "additionalProperties": false
                    },
                    {
                      "type": "null"
                    }
                  ]
                },
                "daysSupply": {
                  "anyOf": [
                    {
                      "type": "integer"
                    },
                    {
                      "type": "null"
                    }
                  ]
                },
                "daysSupplySource": {
                  "type": "string",
                  "enum": [
                    "manual",
                    "calculated",
                    "preset",
                    "missing"
                  ]
                },
                "refills": {
                  "type": "integer"
                },
                "shippingOptions": {
                  "type": "array",
                  "items": {
                    "type": "object",
                    "properties": {
                      "amountCents": {
                        "type": "integer",
                        "allOf": [
                          {
                            "minimum": 0
                          }
                        ]
                      },
                      "carrier": {
                        "anyOf": [
                          {
                            "type": "string"
                          },
                          {
                            "type": "null"
                          }
                        ]
                      },
                      "currency": {
                        "type": "string",
                        "enum": [
                          "USD"
                        ]
                      },
                      "estimatedDaysMax": {
                        "anyOf": [
                          {
                            "type": "integer",
                            "allOf": [
                              {
                                "minimum": 0
                              }
                            ]
                          },
                          {
                            "type": "null"
                          }
                        ]
                      },
                      "estimatedDaysMin": {
                        "anyOf": [
                          {
                            "type": "integer",
                            "allOf": [
                              {
                                "minimum": 0
                              }
                            ]
                          },
                          {
                            "type": "null"
                          }
                        ]
                      },
                      "id": {
                        "type": "string",
                        "allOf": [
                          {
                            "pattern": "^shp_[0-7][0-9a-hjkmnp-tv-z]{25}$",
                            "examples": [
                              "shp_01j2y8m6jcc9tt24af5pw9x1bc"
                            ]
                          }
                        ]
                      },
                      "label": {
                        "type": "string"
                      },
                      "serviceLevel": {
                        "type": "string"
                      },
                      "temperature": {
                        "type": "string",
                        "enum": [
                          "ambient",
                          "refrigerated"
                        ]
                      }
                    },
                    "required": [
                      "amountCents",
                      "carrier",
                      "currency",
                      "estimatedDaysMax",
                      "estimatedDaysMin",
                      "id",
                      "label",
                      "serviceLevel",
                      "temperature"
                    ],
                    "additionalProperties": false
                  },
                  "maxItems": 50
                },
                "shippingOptionId": {
                  "anyOf": [
                    {
                      "type": "string",
                      "pattern": "^shp_[0-7][0-9a-hjkmnp-tv-z]{25}$",
                      "examples": [
                        "shp_01j2y8m6jcc9tt24af5pw9x1bc"
                      ]
                    },
                    {
                      "type": "null"
                    }
                  ]
                },
                "medicationSubtotalCents": {
                  "anyOf": [
                    {
                      "type": "integer"
                    },
                    {
                      "type": "null"
                    }
                  ]
                },
                "shippingAmountCents": {
                  "anyOf": [
                    {
                      "type": "integer"
                    },
                    {
                      "type": "null"
                    }
                  ]
                }
              },
              "required": [
                "medicationId",
                "revision",
                "directions",
                "structuredSig",
                "format",
                "quantity",
                "daysSupply",
                "daysSupplySource",
                "refills",
                "shippingOptions",
                "shippingOptionId",
                "medicationSubtotalCents",
                "shippingAmountCents"
              ],
              "additionalProperties": false
            }
          },
          "issues": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "code": {
                  "type": "string"
                },
                "path": {
                  "type": "string"
                },
                "message": {
                  "type": "string"
                }
              },
              "required": [
                "code",
                "path",
                "message"
              ],
              "additionalProperties": false
            }
          },
          "status": {
            "type": "string",
            "enum": [
              "complete",
              "incomplete"
            ]
          },
          "orderInput": {
            "anyOf": [
              {
                "type": "object",
                "properties": {
                  "otcItems": {
                    "anyOf": [
                      {
                        "type": "array",
                        "items": {
                          "type": "object",
                          "properties": {
                            "catalogItemId": {
                              "type": "string",
                              "allOf": [
                                {
                                  "pattern": "^cat_[0-7][0-9a-hjkmnp-tv-z]{25}$",
                                  "examples": [
                                    "cat_01j2y8m6jcc9tt24af5pw9x1bc"
                                  ]
                                }
                              ]
                            },
                            "quantity": {
                              "type": "integer",
                              "allOf": [
                                {
                                  "minimum": 1,
                                  "maximum": 100
                                }
                              ]
                            }
                          },
                          "required": [
                            "catalogItemId",
                            "quantity"
                          ],
                          "additionalProperties": false
                        },
                        "allOf": [
                          {
                            "maxItems": 20
                          }
                        ]
                      },
                      {
                        "type": "null"
                      }
                    ]
                  },
                  "practiceId": {
                    "type": "string",
                    "pattern": "^prac_[0-7][0-9a-hjkmnp-tv-z]{25}$",
                    "examples": [
                      "prac_01j2y8m6jcc9tt24af5pw9x1bc"
                    ]
                  },
                  "userId": {
                    "anyOf": [
                      {
                        "type": "string",
                        "allOf": [
                          {
                            "pattern": "^user_[0-7][0-9a-hjkmnp-tv-z]{25}$",
                            "examples": [
                              "user_01j2y8m6jcc9tt24af5pw9x1bc"
                            ]
                          }
                        ]
                      },
                      {
                        "type": "null"
                      }
                    ]
                  },
                  "prescriber": {
                    "anyOf": [
                      {
                        "type": "object",
                        "properties": {
                          "id": {
                            "anyOf": [
                              {
                                "type": "string",
                                "allOf": [
                                  {
                                    "pattern": "^prov_[0-7][0-9a-hjkmnp-tv-z]{25}$",
                                    "examples": [
                                      "prov_01j2y8m6jcc9tt24af5pw9x1bc"
                                    ]
                                  }
                                ]
                              },
                              {
                                "type": "null"
                              }
                            ]
                          },
                          "npi": {
                            "anyOf": [
                              {
                                "type": "string"
                              },
                              {
                                "type": "null"
                              }
                            ]
                          },
                          "externalId": {
                            "anyOf": [
                              {
                                "type": "string"
                              },
                              {
                                "type": "null"
                              }
                            ]
                          },
                          "profile": {
                            "anyOf": [
                              {
                                "type": "object",
                                "properties": {
                                  "email": {
                                    "anyOf": [
                                      {
                                        "type": "string",
                                        "allOf": [
                                          {
                                            "pattern": "^[^\\s@]+@[^\\s@]+\\.[^\\s@]+$"
                                          }
                                        ]
                                      },
                                      {
                                        "type": "null"
                                      }
                                    ]
                                  },
                                  "phone": {
                                    "anyOf": [
                                      {
                                        "type": "string"
                                      },
                                      {
                                        "type": "null"
                                      }
                                    ]
                                  }
                                },
                                "additionalProperties": false
                              },
                              {
                                "type": "null"
                              }
                            ]
                          }
                        },
                        "additionalProperties": false
                      },
                      {
                        "type": "null"
                      }
                    ]
                  },
                  "shippingAddressId": {
                    "anyOf": [
                      {
                        "type": "string",
                        "allOf": [
                          {
                            "pattern": "^addr_[0-7][0-9a-hjkmnp-tv-z]{25}$",
                            "examples": [
                              "addr_01j2y8m6jcc9tt24af5pw9x1bc"
                            ]
                          }
                        ]
                      },
                      {
                        "type": "null"
                      }
                    ]
                  },
                  "externalOrderId": {
                    "anyOf": [
                      {
                        "type": "string",
                        "allOf": [
                          {
                            "minLength": 1
                          },
                          {
                            "maxLength": 200
                          },
                          {
                            "pattern": "\\S"
                          },
                          {
                            "pattern": "^[^\\p{Cc}\\p{Cs}]*$"
                          }
                        ]
                      },
                      {
                        "type": "null"
                      }
                    ]
                  },
                  "prescriptions": {
                    "type": "array",
                    "items": {
                      "type": "object",
                      "properties": {
                        "externalPrescriptionId": {
                          "anyOf": [
                            {
                              "type": "string",
                              "allOf": [
                                {
                                  "minLength": 1
                                },
                                {
                                  "maxLength": 200
                                },
                                {
                                  "pattern": "\\S"
                                },
                                {
                                  "pattern": "^[^\\p{Cc}\\p{Cs}]*$"
                                }
                              ]
                            },
                            {
                              "type": "null"
                            }
                          ]
                        },
                        "clinical": {
                          "anyOf": [
                            {
                              "type": "object",
                              "properties": {
                                "compoundingReason": {
                                  "anyOf": [
                                    {
                                      "type": "object",
                                      "properties": {
                                        "category": {
                                          "anyOf": [
                                            {
                                              "type": "string",
                                              "enum": [
                                                "alcohol_free",
                                                "drug_shortage",
                                                "commercial_product_discontinued",
                                                "modified_release",
                                                "inactive_ingredient_sensitivity",
                                                "inactive_ingredient_toxicity",
                                                "concentration_adjustment",
                                                "alternate_route",
                                                "dosage_form_unavailable",
                                                "flavor_adjustment",
                                                "tablet_burden",
                                                "patient_cannot_use_commercial_product",
                                                "no_approved_product_available",
                                                "no_rationale_required",
                                                "other_patient_specific_need"
                                              ]
                                            },
                                            {
                                              "type": "null"
                                            }
                                          ]
                                        },
                                        "context": {
                                          "anyOf": [
                                            {
                                              "type": "string"
                                            },
                                            {
                                              "type": "null"
                                            }
                                          ]
                                        }
                                      },
                                      "additionalProperties": false
                                    },
                                    {
                                      "type": "null"
                                    }
                                  ]
                                },
                                "medicationReviewStatus": {
                                  "anyOf": [
                                    {
                                      "type": "string",
                                      "enum": [
                                        "not_reviewed",
                                        "none",
                                        "recorded"
                                      ]
                                    },
                                    {
                                      "type": "null"
                                    }
                                  ]
                                },
                                "diagnosisReviewStatus": {
                                  "anyOf": [
                                    {
                                      "type": "string",
                                      "enum": [
                                        "not_reviewed",
                                        "none",
                                        "recorded"
                                      ]
                                    },
                                    {
                                      "type": "null"
                                    }
                                  ]
                                },
                                "currentMedications": {
                                  "anyOf": [
                                    {
                                      "type": "array",
                                      "items": {
                                        "type": "string"
                                      },
                                      "allOf": [
                                        {
                                          "maxItems": 100
                                        }
                                      ]
                                    },
                                    {
                                      "type": "null"
                                    }
                                  ]
                                },
                                "diagnoses": {
                                  "anyOf": [
                                    {
                                      "type": "array",
                                      "items": {
                                        "type": "object",
                                        "properties": {
                                          "code": {
                                            "type": "string"
                                          },
                                          "display": {
                                            "type": "string"
                                          }
                                        },
                                        "required": [
                                          "code",
                                          "display"
                                        ],
                                        "additionalProperties": false
                                      },
                                      "allOf": [
                                        {
                                          "maxItems": 20
                                        }
                                      ]
                                    },
                                    {
                                      "type": "null"
                                    }
                                  ]
                                },
                                "observations": {
                                  "anyOf": [
                                    {
                                      "type": "array",
                                      "items": {
                                        "type": "object",
                                        "properties": {
                                          "display": {
                                            "type": "string"
                                          },
                                          "unit": {
                                            "type": "string"
                                          },
                                          "value": {
                                            "anyOf": [
                                              {
                                                "type": "number",
                                                "allOf": [
                                                  {
                                                    "exclusiveMinimum": 0
                                                  }
                                                ]
                                              },
                                              {
                                                "type": "string",
                                                "enum": [
                                                  "Infinity",
                                                  "-Infinity",
                                                  "NaN"
                                                ]
                                              }
                                            ]
                                          }
                                        },
                                        "required": [
                                          "display",
                                          "unit",
                                          "value"
                                        ],
                                        "additionalProperties": false
                                      },
                                      "allOf": [
                                        {
                                          "maxItems": 20
                                        }
                                      ]
                                    },
                                    {
                                      "type": "null"
                                    }
                                  ]
                                }
                              },
                              "additionalProperties": false
                            },
                            {
                              "type": "null"
                            }
                          ]
                        },
                        "pharmacyId": {
                          "anyOf": [
                            {
                              "type": "string",
                              "allOf": [
                                {
                                  "pattern": "^pharm_[0-7][0-9a-hjkmnp-tv-z]{25}$",
                                  "examples": [
                                    "pharm_01j2y8m6jcc9tt24af5pw9x1bc"
                                  ]
                                }
                              ]
                            },
                            {
                              "type": "null"
                            }
                          ]
                        },
                        "daysSupply": {
                          "type": "integer",
                          "minimum": 1,
                          "maximum": 365
                        },
                        "dispensing": {
                          "type": "object",
                          "properties": {
                            "dispenseUponAcceptance": {
                              "anyOf": [
                                {
                                  "type": "boolean"
                                },
                                {
                                  "type": "null"
                                }
                              ]
                            },
                            "shippingOptionId": {
                              "anyOf": [
                                {
                                  "type": "string",
                                  "pattern": "^shp_[0-7][0-9a-hjkmnp-tv-z]{25}$",
                                  "examples": [
                                    "shp_01j2y8m6jcc9tt24af5pw9x1bc"
                                  ]
                                },
                                {
                                  "type": "null"
                                }
                              ]
                            },
                            "shippingAmountCents": {
                              "anyOf": [
                                {
                                  "type": "integer",
                                  "minimum": 0
                                },
                                {
                                  "type": "null"
                                }
                              ],
                              "description": "Reviewed customer shipping rate for the selected service. Preview supplies this value. Shared group rates must not be summed per prescription."
                            },
                            "shippingDestinationType": {
                              "anyOf": [
                                {
                                  "type": "string",
                                  "enum": [
                                    "patient"
                                  ]
                                },
                                {
                                  "type": "null"
                                }
                              ]
                            },
                            "pharmacyNotes": {
                              "anyOf": [
                                {
                                  "type": "string"
                                },
                                {
                                  "type": "null"
                                }
                              ]
                            },
                            "requestedFillDate": {
                              "anyOf": [
                                {
                                  "type": "string",
                                  "pattern": "^\\d{4}-\\d{2}-\\d{2}$"
                                },
                                {
                                  "type": "null"
                                }
                              ]
                            },
                            "substitutionPermitted": {
                              "anyOf": [
                                {
                                  "type": "boolean"
                                },
                                {
                                  "type": "null"
                                }
                              ]
                            }
                          },
                          "additionalProperties": false
                        },
                        "directions": {
                          "type": "string"
                        },
                        "medicationId": {
                          "type": "string",
                          "pattern": "^cat_[0-7][0-9a-hjkmnp-tv-z]{25}$",
                          "examples": [
                            "cat_01j2y8m6jcc9tt24af5pw9x1bc"
                          ]
                        },
                        "quantity": {
                          "type": "number"
                        },
                        "quantityUnit": {
                          "type": "string"
                        },
                        "refills": {
                          "type": "integer",
                          "minimum": 0,
                          "maximum": 99
                        },
                        "structuredSig": {
                          "anyOf": [
                            {
                              "type": "object",
                              "properties": {
                                "dose": {
                                  "type": "string"
                                },
                                "doseUnit": {
                                  "type": "string"
                                },
                                "duration": {
                                  "anyOf": [
                                    {
                                      "type": "string"
                                    },
                                    {
                                      "type": "null"
                                    }
                                  ]
                                },
                                "frequency": {
                                  "type": "string"
                                },
                                "indication": {
                                  "anyOf": [
                                    {
                                      "type": "string"
                                    },
                                    {
                                      "type": "null"
                                    }
                                  ]
                                },
                                "maxDailyUse": {
                                  "anyOf": [
                                    {
                                      "type": "string"
                                    },
                                    {
                                      "type": "null"
                                    }
                                  ]
                                },
                                "prn": {
                                  "anyOf": [
                                    {
                                      "type": "boolean"
                                    },
                                    {
                                      "type": "null"
                                    }
                                  ]
                                },
                                "route": {
                                  "type": "string"
                                },
                                "titrationSchedule": {
                                  "anyOf": [
                                    {
                                      "type": "string"
                                    },
                                    {
                                      "type": "null"
                                    }
                                  ]
                                }
                              },
                              "required": [
                                "dose",
                                "doseUnit",
                                "frequency",
                                "route"
                              ],
                              "additionalProperties": false
                            },
                            {
                              "type": "null"
                            }
                          ]
                        }
                      },
                      "required": [
                        "daysSupply",
                        "dispensing",
                        "directions",
                        "medicationId",
                        "quantity",
                        "quantityUnit",
                        "refills"
                      ],
                      "additionalProperties": false
                    }
                  },
                  "patientId": {
                    "anyOf": [
                      {
                        "type": "string",
                        "pattern": "^pat_[0-7][0-9a-hjkmnp-tv-z]{25}$",
                        "examples": [
                          "pat_01j2y8m6jcc9tt24af5pw9x1bc"
                        ]
                      },
                      {
                        "type": "null"
                      }
                    ]
                  },
                  "patient": {
                    "anyOf": [
                      {
                        "type": "object",
                        "properties": {
                          "address": {
                            "anyOf": [
                              {
                                "anyOf": [
                                  {
                                    "type": "object",
                                    "properties": {
                                      "city": {
                                        "type": "string",
                                        "allOf": [
                                          {
                                            "pattern": "^[^\\u0000\\p{Cs}]*$"
                                          },
                                          {
                                            "pattern": "^[^\\p{Cc}\\u200B\\u2028-\\u202E\\u2066-\\u2069]*$"
                                          }
                                        ]
                                      },
                                      "line1": {
                                        "type": "string",
                                        "allOf": [
                                          {
                                            "pattern": "^[^\\u0000\\p{Cs}]*$"
                                          },
                                          {
                                            "pattern": "^[^\\p{Cc}\\u200B\\u2028-\\u202E\\u2066-\\u2069]*$"
                                          }
                                        ]
                                      },
                                      "line2": {
                                        "anyOf": [
                                          {
                                            "anyOf": [
                                              {
                                                "type": "string",
                                                "allOf": [
                                                  {
                                                    "pattern": "^[^\\u0000\\p{Cs}]*$"
                                                  },
                                                  {
                                                    "pattern": "^[^\\p{Cc}\\u200B\\u2028-\\u202E\\u2066-\\u2069]*$"
                                                  }
                                                ]
                                              },
                                              {
                                                "type": "null"
                                              }
                                            ]
                                          },
                                          {
                                            "type": "null"
                                          }
                                        ]
                                      },
                                      "postalCode": {
                                        "type": "string"
                                      },
                                      "state": {
                                        "type": "string"
                                      },
                                      "country": {
                                        "anyOf": [
                                          {
                                            "type": "string",
                                            "enum": [
                                              "US"
                                            ]
                                          },
                                          {
                                            "type": "null"
                                          }
                                        ]
                                      }
                                    },
                                    "required": [
                                      "city",
                                      "line1",
                                      "postalCode",
                                      "state"
                                    ],
                                    "additionalProperties": false
                                  },
                                  {
                                    "type": "null"
                                  }
                                ]
                              },
                              {
                                "type": "null"
                              }
                            ]
                          },
                          "clinicalProfile": {
                            "anyOf": [
                              {
                                "type": "object",
                                "properties": {
                                  "currentMedications": {
                                    "type": "array",
                                    "items": {
                                      "type": "string",
                                      "allOf": [
                                        {
                                          "pattern": "^[^\\u0000\\p{Cs}]*$"
                                        }
                                      ]
                                    },
                                    "allOf": [
                                      {
                                        "maxItems": 100
                                      }
                                    ]
                                  },
                                  "heightInches": {
                                    "anyOf": [
                                      {
                                        "anyOf": [
                                          {
                                            "anyOf": [
                                              {
                                                "type": "number",
                                                "allOf": [
                                                  {
                                                    "exclusiveMinimum": 0
                                                  }
                                                ]
                                              },
                                              {
                                                "type": "string",
                                                "enum": [
                                                  "Infinity",
                                                  "-Infinity",
                                                  "NaN"
                                                ]
                                              }
                                            ]
                                          },
                                          {
                                            "type": "null"
                                          }
                                        ]
                                      },
                                      {
                                        "type": "null"
                                      }
                                    ]
                                  },
                                  "reviewedAt": {
                                    "anyOf": [
                                      {
                                        "anyOf": [
                                          {
                                            "type": "string"
                                          },
                                          {
                                            "type": "null"
                                          }
                                        ]
                                      },
                                      {
                                        "type": "null"
                                      }
                                    ]
                                  },
                                  "weightPounds": {
                                    "anyOf": [
                                      {
                                        "anyOf": [
                                          {
                                            "anyOf": [
                                              {
                                                "type": "number",
                                                "allOf": [
                                                  {
                                                    "exclusiveMinimum": 0
                                                  }
                                                ]
                                              },
                                              {
                                                "type": "string",
                                                "enum": [
                                                  "Infinity",
                                                  "-Infinity",
                                                  "NaN"
                                                ]
                                              }
                                            ]
                                          },
                                          {
                                            "type": "null"
                                          }
                                        ]
                                      },
                                      {
                                        "type": "null"
                                      }
                                    ]
                                  }
                                },
                                "required": [
                                  "currentMedications"
                                ],
                                "additionalProperties": false
                              },
                              {
                                "type": "null"
                              }
                            ]
                          },
                          "dateOfBirth": {
                            "type": "string",
                            "allOf": [
                              {
                                "pattern": "^\\d{4}-\\d{2}-\\d{2}$"
                              }
                            ]
                          },
                          "email": {
                            "anyOf": [
                              {
                                "anyOf": [
                                  {
                                    "type": "string"
                                  },
                                  {
                                    "type": "null"
                                  }
                                ]
                              },
                              {
                                "type": "null"
                              }
                            ]
                          },
                          "externalId": {
                            "anyOf": [
                              {
                                "type": "string",
                                "allOf": [
                                  {
                                    "pattern": "^[^\\u0000\\p{Cs}]*$"
                                  }
                                ]
                              },
                              {
                                "type": "null"
                              }
                            ]
                          },
                          "externalIdentities": {
                            "anyOf": [
                              {
                                "type": "array",
                                "items": {
                                  "type": "object",
                                  "properties": {
                                    "source": {
                                      "type": "string",
                                      "allOf": [
                                        {
                                          "pattern": "^[^\\u0000\\p{Cs}]*$"
                                        }
                                      ]
                                    },
                                    "value": {
                                      "type": "string",
                                      "allOf": [
                                        {
                                          "pattern": "^[^\\u0000\\p{Cs}]*$"
                                        }
                                      ]
                                    }
                                  },
                                  "required": [
                                    "source",
                                    "value"
                                  ],
                                  "additionalProperties": false
                                },
                                "allOf": [
                                  {
                                    "maxItems": 50
                                  }
                                ]
                              },
                              {
                                "type": "null"
                              }
                            ]
                          },
                          "addresses": {
                            "anyOf": [
                              {
                                "type": "array",
                                "items": {
                                  "type": "object",
                                  "properties": {
                                    "id": {
                                      "anyOf": [
                                        {
                                          "type": "string",
                                          "allOf": [
                                            {
                                              "pattern": "^addr_[0-7][0-9a-hjkmnp-tv-z]{25}$",
                                              "examples": [
                                                "addr_01j2y8m6jcc9tt24af5pw9x1bc"
                                              ]
                                            }
                                          ]
                                        },
                                        {
                                          "type": "null"
                                        }
                                      ]
                                    },
                                    "address": {
                                      "type": "object",
                                      "properties": {
                                        "city": {
                                          "type": "string",
                                          "allOf": [
                                            {
                                              "pattern": "^[^\\u0000\\p{Cs}]*$"
                                            },
                                            {
                                              "pattern": "^[^\\p{Cc}\\u200B\\u2028-\\u202E\\u2066-\\u2069]*$"
                                            }
                                          ]
                                        },
                                        "country": {
                                          "anyOf": [
                                            {
                                              "type": "string",
                                              "enum": [
                                                "US"
                                              ]
                                            },
                                            {
                                              "type": "null"
                                            }
                                          ]
                                        },
                                        "line1": {
                                          "type": "string",
                                          "allOf": [
                                            {
                                              "pattern": "^[^\\u0000\\p{Cs}]*$"
                                            },
                                            {
                                              "pattern": "^[^\\p{Cc}\\u200B\\u2028-\\u202E\\u2066-\\u2069]*$"
                                            }
                                          ]
                                        },
                                        "line2": {
                                          "anyOf": [
                                            {
                                              "anyOf": [
                                                {
                                                  "type": "string",
                                                  "allOf": [
                                                    {
                                                      "pattern": "^[^\\u0000\\p{Cs}]*$"
                                                    },
                                                    {
                                                      "pattern": "^[^\\p{Cc}\\u200B\\u2028-\\u202E\\u2066-\\u2069]*$"
                                                    }
                                                  ]
                                                },
                                                {
                                                  "type": "null"
                                                }
                                              ]
                                            },
                                            {
                                              "type": "null"
                                            }
                                          ]
                                        },
                                        "postalCode": {
                                          "type": "string"
                                        },
                                        "state": {
                                          "type": "string"
                                        }
                                      },
                                      "required": [
                                        "city",
                                        "line1",
                                        "postalCode",
                                        "state"
                                      ],
                                      "additionalProperties": false
                                    },
                                    "label": {
                                      "type": "string",
                                      "allOf": [
                                        {
                                          "pattern": "^[^\\u0000\\p{Cs}]*$"
                                        }
                                      ]
                                    },
                                    "preferredShipping": {
                                      "type": "boolean"
                                    },
                                    "recipientName": {
                                      "anyOf": [
                                        {
                                          "type": "string",
                                          "allOf": [
                                            {
                                              "pattern": "^[^\\u0000\\p{Cs}]*$"
                                            },
                                            {
                                              "pattern": "^[^\\p{Cc}\\u200B\\u2028-\\u202E\\u2066-\\u2069]*$"
                                            }
                                          ]
                                        },
                                        {
                                          "type": "null"
                                        }
                                      ]
                                    }
                                  },
                                  "required": [
                                    "address",
                                    "label",
                                    "preferredShipping",
                                    "recipientName"
                                  ],
                                  "additionalProperties": false
                                },
                                "allOf": [
                                  {
                                    "maxItems": 50
                                  }
                                ]
                              },
                              {
                                "type": "null"
                              }
                            ]
                          },
                          "encounters": {
                            "anyOf": [
                              {
                                "type": "array",
                                "items": {
                                  "type": "object",
                                  "properties": {
                                    "notes": {
                                      "anyOf": [
                                        {
                                          "type": "string",
                                          "allOf": [
                                            {
                                              "pattern": "^[^\\u0000\\p{Cs}]*$"
                                            },
                                            {
                                              "maxLength": 5000
                                            }
                                          ]
                                        },
                                        {
                                          "type": "null"
                                        }
                                      ]
                                    },
                                    "occurredAt": {
                                      "type": "string"
                                    },
                                    "providerName": {
                                      "anyOf": [
                                        {
                                          "type": "string",
                                          "allOf": [
                                            {
                                              "pattern": "^[^\\u0000\\p{Cs}]*$"
                                            }
                                          ]
                                        },
                                        {
                                          "type": "null"
                                        }
                                      ]
                                    },
                                    "type": {
                                      "type": "string",
                                      "allOf": [
                                        {
                                          "pattern": "^[^\\u0000\\p{Cs}]*$"
                                        }
                                      ]
                                    }
                                  },
                                  "required": [
                                    "notes",
                                    "occurredAt",
                                    "providerName",
                                    "type"
                                  ],
                                  "additionalProperties": false
                                }
                              },
                              {
                                "type": "null"
                              }
                            ]
                          },
                          "gender": {
                            "anyOf": [
                              {
                                "type": "string",
                                "enum": [
                                  "f",
                                  "m",
                                  "o",
                                  "u"
                                ]
                              },
                              {
                                "type": "null"
                              }
                            ]
                          },
                          "locationId": {
                            "anyOf": [
                              {
                                "type": "string",
                                "allOf": [
                                  {
                                    "pattern": "^loc_[0-7][0-9a-hjkmnp-tv-z]{25}$",
                                    "examples": [
                                      "loc_01j2y8m6jcc9tt24af5pw9x1bc"
                                    ]
                                  }
                                ]
                              },
                              {
                                "type": "null"
                              }
                            ]
                          },
                          "metadata": {
                            "anyOf": [
                              {
                                "type": "object"
                              },
                              {
                                "type": "null"
                              }
                            ]
                          },
                          "medicalRecordNumber": {
                            "anyOf": [
                              {
                                "anyOf": [
                                  {
                                    "type": "string",
                                    "allOf": [
                                      {
                                        "pattern": "^[^\\u0000\\p{Cs}]*$"
                                      }
                                    ]
                                  },
                                  {
                                    "type": "null"
                                  }
                                ]
                              },
                              {
                                "type": "null"
                              }
                            ]
                          },
                          "measurements": {
                            "anyOf": [
                              {
                                "type": "array",
                                "items": {
                                  "type": "object",
                                  "properties": {
                                    "heightCentimeters": {
                                      "anyOf": [
                                        {
                                          "anyOf": [
                                            {
                                              "type": "number",
                                              "allOf": [
                                                {
                                                  "exclusiveMinimum": 0
                                                }
                                              ]
                                            },
                                            {
                                              "type": "string",
                                              "enum": [
                                                "Infinity",
                                                "-Infinity",
                                                "NaN"
                                              ]
                                            }
                                          ]
                                        },
                                        {
                                          "type": "null"
                                        }
                                      ]
                                    },
                                    "recordedAt": {
                                      "type": "string"
                                    },
                                    "source": {
                                      "type": "string",
                                      "allOf": [
                                        {
                                          "pattern": "^[^\\u0000\\p{Cs}]*$"
                                        }
                                      ]
                                    },
                                    "weightKilograms": {
                                      "anyOf": [
                                        {
                                          "anyOf": [
                                            {
                                              "type": "number",
                                              "allOf": [
                                                {
                                                  "exclusiveMinimum": 0
                                                }
                                              ]
                                            },
                                            {
                                              "type": "string",
                                              "enum": [
                                                "Infinity",
                                                "-Infinity",
                                                "NaN"
                                              ]
                                            }
                                          ]
                                        },
                                        {
                                          "type": "null"
                                        }
                                      ]
                                    }
                                  },
                                  "required": [
                                    "heightCentimeters",
                                    "recordedAt",
                                    "source",
                                    "weightKilograms"
                                  ],
                                  "additionalProperties": false
                                }
                              },
                              {
                                "type": "null"
                              }
                            ]
                          },
                          "name": {
                            "type": "object",
                            "properties": {
                              "first": {
                                "type": "string",
                                "allOf": [
                                  {
                                    "pattern": "^[^\\u0000\\p{Cs}]*$"
                                  },
                                  {
                                    "pattern": "^[^\\p{Cc}\\u200B\\u2028-\\u202E\\u2066-\\u2069]*$"
                                  }
                                ]
                              },
                              "last": {
                                "type": "string",
                                "allOf": [
                                  {
                                    "pattern": "^[^\\u0000\\p{Cs}]*$"
                                  },
                                  {
                                    "pattern": "^[^\\p{Cc}\\u200B\\u2028-\\u202E\\u2066-\\u2069]*$"
                                  }
                                ]
                              },
                              "middle": {
                                "anyOf": [
                                  {
                                    "anyOf": [
                                      {
                                        "type": "string",
                                        "allOf": [
                                          {
                                            "pattern": "^[^\\u0000\\p{Cs}]*$"
                                          },
                                          {
                                            "pattern": "^[^\\p{Cc}\\u200B\\u2028-\\u202E\\u2066-\\u2069]*$"
                                          }
                                        ]
                                      },
                                      {
                                        "type": "null"
                                      }
                                    ]
                                  },
                                  {
                                    "type": "null"
                                  }
                                ]
                              },
                              "preferred": {
                                "anyOf": [
                                  {
                                    "anyOf": [
                                      {
                                        "type": "string",
                                        "allOf": [
                                          {
                                            "pattern": "^[^\\u0000\\p{Cs}]*$"
                                          },
                                          {
                                            "pattern": "^[^\\p{Cc}\\u200B\\u2028-\\u202E\\u2066-\\u2069]*$"
                                          }
                                        ]
                                      },
                                      {
                                        "type": "null"
                                      }
                                    ]
                                  },
                                  {
                                    "type": "null"
                                  }
                                ]
                              }
                            },
                            "required": [
                              "first",
                              "last"
                            ],
                            "additionalProperties": false
                          },
                          "phone": {
                            "anyOf": [
                              {
                                "anyOf": [
                                  {
                                    "type": "string"
                                  },
                                  {
                                    "type": "null"
                                  }
                                ]
                              },
                              {
                                "type": "null"
                              }
                            ]
                          },
                          "programs": {
                            "anyOf": [
                              {
                                "type": "array",
                                "items": {
                                  "type": "object",
                                  "properties": {
                                    "endedAt": {
                                      "anyOf": [
                                        {
                                          "type": "string"
                                        },
                                        {
                                          "type": "null"
                                        }
                                      ]
                                    },
                                    "name": {
                                      "type": "string",
                                      "allOf": [
                                        {
                                          "pattern": "^[^\\u0000\\p{Cs}]*$"
                                        }
                                      ]
                                    },
                                    "startedAt": {
                                      "type": "string"
                                    },
                                    "status": {
                                      "type": "string",
                                      "enum": [
                                        "active",
                                        "completed",
                                        "paused"
                                      ]
                                    }
                                  },
                                  "required": [
                                    "endedAt",
                                    "name",
                                    "startedAt",
                                    "status"
                                  ],
                                  "additionalProperties": false
                                }
                              },
                              {
                                "type": "null"
                              }
                            ]
                          }
                        },
                        "required": [
                          "dateOfBirth",
                          "name"
                        ],
                        "additionalProperties": false
                      },
                      {
                        "type": "null"
                      }
                    ]
                  }
                },
                "required": [
                  "practiceId",
                  "prescriptions"
                ],
                "additionalProperties": false
              },
              {
                "type": "null"
              }
            ]
          }
        },
        "required": [
          "clinicalRequirementsSatisfied",
          "clinicalIssues",
          "clinicalRequirements",
          "otcItems",
          "shippingGroups",
          "totals",
          "object",
          "livemode",
          "prescriptions",
          "issues",
          "status",
          "orderInput"
        ],
        "additionalProperties": false
      },
      "SignOrderRequest": {
        "type": "object",
        "properties": {
          "practiceId": {
            "type": "string",
            "pattern": "^prac_[0-7][0-9a-hjkmnp-tv-z]{25}$",
            "examples": [
              "prac_01j2y8m6jcc9tt24af5pw9x1bc"
            ]
          },
          "userId": {
            "anyOf": [
              {
                "type": "string",
                "pattern": "^user_[0-7][0-9a-hjkmnp-tv-z]{25}$",
                "examples": [
                  "user_01j2y8m6jcc9tt24af5pw9x1bc"
                ]
              },
              {
                "type": "null"
              }
            ]
          },
          "prescriber": {
            "anyOf": [
              {
                "type": "object",
                "properties": {
                  "id": {
                    "anyOf": [
                      {
                        "type": "string",
                        "pattern": "^prov_[0-7][0-9a-hjkmnp-tv-z]{25}$",
                        "examples": [
                          "prov_01j2y8m6jcc9tt24af5pw9x1bc"
                        ]
                      },
                      {
                        "type": "null"
                      }
                    ]
                  },
                  "npi": {
                    "anyOf": [
                      {
                        "type": "string"
                      },
                      {
                        "type": "null"
                      }
                    ]
                  },
                  "externalId": {
                    "anyOf": [
                      {
                        "type": "string"
                      },
                      {
                        "type": "null"
                      }
                    ]
                  },
                  "profile": {
                    "anyOf": [
                      {
                        "type": "object",
                        "properties": {
                          "email": {
                            "anyOf": [
                              {
                                "type": "string",
                                "pattern": "^[^\\s@]+@[^\\s@]+\\.[^\\s@]+$"
                              },
                              {
                                "type": "null"
                              }
                            ]
                          },
                          "phone": {
                            "anyOf": [
                              {
                                "type": "string"
                              },
                              {
                                "type": "null"
                              }
                            ]
                          }
                        },
                        "additionalProperties": false
                      },
                      {
                        "type": "null"
                      }
                    ]
                  }
                },
                "additionalProperties": false
              },
              {
                "type": "null"
              }
            ]
          },
          "signatureAttestation": {
            "type": "boolean",
            "enum": [
              true
            ]
          },
          "expectedRevision": {
            "anyOf": [
              {
                "type": "string",
                "pattern": "^rev_[a-f0-9]{64}$",
                "description": "Opaque revision of the complete order prescription set. Send the revision you reviewed as expectedRevision; never replace it automatically after a conflict."
              },
              {
                "type": "null"
              }
            ]
          },
          "expectedVersions": {
            "anyOf": [
              {
                "type": "array",
                "items": {
                  "type": "object",
                  "properties": {
                    "prescriptionId": {
                      "type": "string",
                      "pattern": "^rx_[0-7][0-9a-hjkmnp-tv-z]{25}$",
                      "examples": [
                        "rx_01j2y8m6jcc9tt24af5pw9x1bc"
                      ]
                    },
                    "version": {
                      "type": "integer",
                      "minimum": 1
                    }
                  },
                  "required": [
                    "prescriptionId",
                    "version"
                  ],
                  "additionalProperties": false
                },
                "minItems": 1,
                "maxItems": 20
              },
              {
                "type": "null"
              }
            ]
          }
        },
        "required": [
          "practiceId",
          "signatureAttestation"
        ],
        "additionalProperties": false,
        "allOf": [
          {
            "oneOf": [
              {
                "required": [
                  "expectedRevision"
                ]
              },
              {
                "required": [
                  "expectedVersions"
                ]
              }
            ]
          }
        ],
        "title": "SignOrderRequest"
      },
      "SignOrderResponse": {
        "title": "SignOrderResponse",
        "type": "object",
        "properties": {
          "orderId": {
            "type": "string",
            "pattern": "^ord_[0-7][0-9a-hjkmnp-tv-z]{25}$",
            "examples": [
              "ord_01j2y8m6jcc9tt24af5pw9x1bc"
            ]
          },
          "prescriptions": {
            "type": "array",
            "items": {
              "type": "string",
              "pattern": "^rx_[0-7][0-9a-hjkmnp-tv-z]{25}$",
              "examples": [
                "rx_01j2y8m6jcc9tt24af5pw9x1bc"
              ]
            }
          },
          "signedAt": {
            "type": "string"
          },
          "status": {
            "type": "string",
            "enum": [
              "ready"
            ]
          }
        },
        "required": [
          "orderId",
          "prescriptions",
          "signedAt",
          "status"
        ],
        "additionalProperties": false
      },
      "SignAndSubmitOrderRequest": {
        "type": "object",
        "properties": {
          "practiceId": {
            "type": "string",
            "pattern": "^prac_[0-7][0-9a-hjkmnp-tv-z]{25}$",
            "examples": [
              "prac_01j2y8m6jcc9tt24af5pw9x1bc"
            ]
          },
          "userId": {
            "anyOf": [
              {
                "type": "string",
                "pattern": "^user_[0-7][0-9a-hjkmnp-tv-z]{25}$",
                "examples": [
                  "user_01j2y8m6jcc9tt24af5pw9x1bc"
                ]
              },
              {
                "type": "null"
              }
            ]
          },
          "prescriber": {
            "anyOf": [
              {
                "type": "object",
                "properties": {
                  "id": {
                    "anyOf": [
                      {
                        "type": "string",
                        "pattern": "^prov_[0-7][0-9a-hjkmnp-tv-z]{25}$",
                        "examples": [
                          "prov_01j2y8m6jcc9tt24af5pw9x1bc"
                        ]
                      },
                      {
                        "type": "null"
                      }
                    ]
                  },
                  "npi": {
                    "anyOf": [
                      {
                        "type": "string"
                      },
                      {
                        "type": "null"
                      }
                    ]
                  },
                  "externalId": {
                    "anyOf": [
                      {
                        "type": "string"
                      },
                      {
                        "type": "null"
                      }
                    ]
                  },
                  "profile": {
                    "anyOf": [
                      {
                        "type": "object",
                        "properties": {
                          "email": {
                            "anyOf": [
                              {
                                "type": "string",
                                "pattern": "^[^\\s@]+@[^\\s@]+\\.[^\\s@]+$"
                              },
                              {
                                "type": "null"
                              }
                            ]
                          },
                          "phone": {
                            "anyOf": [
                              {
                                "type": "string"
                              },
                              {
                                "type": "null"
                              }
                            ]
                          }
                        },
                        "additionalProperties": false
                      },
                      {
                        "type": "null"
                      }
                    ]
                  }
                },
                "additionalProperties": false
              },
              {
                "type": "null"
              }
            ]
          },
          "signatureAttestation": {
            "type": "boolean",
            "enum": [
              true
            ]
          },
          "expectedRevision": {
            "anyOf": [
              {
                "type": "string",
                "pattern": "^rev_[a-f0-9]{64}$",
                "description": "Opaque revision of the complete order prescription set. Send the revision you reviewed as expectedRevision; never replace it automatically after a conflict."
              },
              {
                "type": "null"
              }
            ]
          },
          "expectedVersions": {
            "anyOf": [
              {
                "type": "array",
                "items": {
                  "type": "object",
                  "properties": {
                    "prescriptionId": {
                      "type": "string",
                      "pattern": "^rx_[0-7][0-9a-hjkmnp-tv-z]{25}$",
                      "examples": [
                        "rx_01j2y8m6jcc9tt24af5pw9x1bc"
                      ]
                    },
                    "version": {
                      "type": "integer",
                      "minimum": 1
                    }
                  },
                  "required": [
                    "prescriptionId",
                    "version"
                  ],
                  "additionalProperties": false
                },
                "minItems": 1,
                "maxItems": 20
              },
              {
                "type": "null"
              }
            ]
          }
        },
        "required": [
          "practiceId",
          "signatureAttestation"
        ],
        "additionalProperties": false,
        "allOf": [
          {
            "oneOf": [
              {
                "required": [
                  "expectedRevision"
                ]
              },
              {
                "required": [
                  "expectedVersions"
                ]
              }
            ]
          }
        ],
        "title": "SignAndSubmitOrderRequest"
      },
      "SignAndSubmitOrderResponse": {
        "title": "SignAndSubmitOrderResponse",
        "type": "object",
        "properties": {
          "object": {
            "type": "string",
            "enum": [
              "order_sign_and_submission"
            ]
          },
          "orderId": {
            "type": "string",
            "pattern": "^ord_[0-7][0-9a-hjkmnp-tv-z]{25}$",
            "examples": [
              "ord_01j2y8m6jcc9tt24af5pw9x1bc"
            ]
          },
          "signedAt": {
            "type": "string"
          },
          "status": {
            "type": "string",
            "enum": [
              "submitted",
              "partially_submitted",
              "not_submitted"
            ]
          },
          "prescriptions": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "prescriptionId": {
                  "type": "string",
                  "pattern": "^rx_[0-7][0-9a-hjkmnp-tv-z]{25}$",
                  "examples": [
                    "rx_01j2y8m6jcc9tt24af5pw9x1bc"
                  ]
                },
                "status": {
                  "type": "string",
                  "enum": [
                    "submitted",
                    "failed"
                  ]
                },
                "fulfillmentOrderId": {
                  "anyOf": [
                    {
                      "type": "string",
                      "pattern": "^ord_[0-7][0-9a-hjkmnp-tv-z]{25}$",
                      "examples": [
                        "ord_01j2y8m6jcc9tt24af5pw9x1bc"
                      ]
                    },
                    {
                      "type": "null"
                    }
                  ]
                },
                "error": {
                  "anyOf": [
                    {
                      "type": "object",
                      "properties": {
                        "code": {
                          "type": "string"
                        },
                        "detail": {
                          "type": "string"
                        },
                        "status": {
                          "anyOf": [
                            {
                              "type": "number"
                            },
                            {
                              "type": "string",
                              "enum": [
                                "Infinity",
                                "-Infinity",
                                "NaN"
                              ]
                            }
                          ]
                        }
                      },
                      "required": [
                        "code",
                        "detail",
                        "status"
                      ],
                      "additionalProperties": false
                    },
                    {
                      "type": "null"
                    }
                  ]
                }
              },
              "required": [
                "prescriptionId",
                "status",
                "fulfillmentOrderId",
                "error"
              ],
              "additionalProperties": false
            }
          }
        },
        "required": [
          "object",
          "orderId",
          "signedAt",
          "status",
          "prescriptions"
        ],
        "additionalProperties": false
      },
      "SubmitOrderRequest": {
        "type": "object",
        "properties": {
          "practiceId": {
            "type": "string",
            "pattern": "^prac_[0-7][0-9a-hjkmnp-tv-z]{25}$",
            "examples": [
              "prac_01j2y8m6jcc9tt24af5pw9x1bc"
            ]
          },
          "userId": {
            "anyOf": [
              {
                "type": "string",
                "pattern": "^user_[0-7][0-9a-hjkmnp-tv-z]{25}$",
                "examples": [
                  "user_01j2y8m6jcc9tt24af5pw9x1bc"
                ]
              },
              {
                "type": "null"
              }
            ]
          },
          "prescriber": {
            "anyOf": [
              {
                "type": "object",
                "properties": {
                  "id": {
                    "anyOf": [
                      {
                        "type": "string",
                        "pattern": "^prov_[0-7][0-9a-hjkmnp-tv-z]{25}$",
                        "examples": [
                          "prov_01j2y8m6jcc9tt24af5pw9x1bc"
                        ]
                      },
                      {
                        "type": "null"
                      }
                    ]
                  },
                  "npi": {
                    "anyOf": [
                      {
                        "type": "string"
                      },
                      {
                        "type": "null"
                      }
                    ]
                  },
                  "externalId": {
                    "anyOf": [
                      {
                        "type": "string"
                      },
                      {
                        "type": "null"
                      }
                    ]
                  },
                  "profile": {
                    "anyOf": [
                      {
                        "type": "object",
                        "properties": {
                          "email": {
                            "anyOf": [
                              {
                                "type": "string",
                                "pattern": "^[^\\s@]+@[^\\s@]+\\.[^\\s@]+$"
                              },
                              {
                                "type": "null"
                              }
                            ]
                          },
                          "phone": {
                            "anyOf": [
                              {
                                "type": "string"
                              },
                              {
                                "type": "null"
                              }
                            ]
                          }
                        },
                        "additionalProperties": false
                      },
                      {
                        "type": "null"
                      }
                    ]
                  }
                },
                "additionalProperties": false
              },
              {
                "type": "null"
              }
            ]
          }
        },
        "required": [
          "practiceId"
        ],
        "additionalProperties": false,
        "title": "SubmitOrderRequest"
      },
      "SubmitOrderResponse": {
        "title": "SubmitOrderResponse",
        "type": "object",
        "properties": {
          "object": {
            "type": "string",
            "enum": [
              "order_submission"
            ]
          },
          "orderId": {
            "type": "string",
            "pattern": "^ord_[0-7][0-9a-hjkmnp-tv-z]{25}$",
            "examples": [
              "ord_01j2y8m6jcc9tt24af5pw9x1bc"
            ]
          },
          "status": {
            "type": "string",
            "enum": [
              "submitted"
            ]
          }
        },
        "required": [
          "object",
          "orderId",
          "status"
        ],
        "additionalProperties": false
      },
      "RejectOrderRequest": {
        "type": "object",
        "properties": {
          "practiceId": {
            "type": "string",
            "pattern": "^prac_[0-7][0-9a-hjkmnp-tv-z]{25}$",
            "examples": [
              "prac_01j2y8m6jcc9tt24af5pw9x1bc"
            ]
          },
          "userId": {
            "anyOf": [
              {
                "type": "string",
                "pattern": "^user_[0-7][0-9a-hjkmnp-tv-z]{25}$",
                "examples": [
                  "user_01j2y8m6jcc9tt24af5pw9x1bc"
                ]
              },
              {
                "type": "null"
              }
            ]
          },
          "prescriber": {
            "anyOf": [
              {
                "type": "object",
                "properties": {
                  "id": {
                    "anyOf": [
                      {
                        "type": "string",
                        "pattern": "^prov_[0-7][0-9a-hjkmnp-tv-z]{25}$",
                        "examples": [
                          "prov_01j2y8m6jcc9tt24af5pw9x1bc"
                        ]
                      },
                      {
                        "type": "null"
                      }
                    ]
                  },
                  "npi": {
                    "anyOf": [
                      {
                        "type": "string"
                      },
                      {
                        "type": "null"
                      }
                    ]
                  },
                  "externalId": {
                    "anyOf": [
                      {
                        "type": "string"
                      },
                      {
                        "type": "null"
                      }
                    ]
                  },
                  "profile": {
                    "anyOf": [
                      {
                        "type": "object",
                        "properties": {
                          "email": {
                            "anyOf": [
                              {
                                "type": "string",
                                "pattern": "^[^\\s@]+@[^\\s@]+\\.[^\\s@]+$"
                              },
                              {
                                "type": "null"
                              }
                            ]
                          },
                          "phone": {
                            "anyOf": [
                              {
                                "type": "string"
                              },
                              {
                                "type": "null"
                              }
                            ]
                          }
                        },
                        "additionalProperties": false
                      },
                      {
                        "type": "null"
                      }
                    ]
                  }
                },
                "additionalProperties": false
              },
              {
                "type": "null"
              }
            ]
          },
          "reason": {
            "type": "string"
          },
          "expectedRevision": {
            "anyOf": [
              {
                "type": "string",
                "pattern": "^rev_[a-f0-9]{64}$",
                "description": "Opaque revision of the complete order prescription set. Send the revision you reviewed as expectedRevision; never replace it automatically after a conflict."
              },
              {
                "type": "null"
              }
            ]
          },
          "expectedVersions": {
            "anyOf": [
              {
                "type": "array",
                "items": {
                  "type": "object",
                  "properties": {
                    "prescriptionId": {
                      "type": "string",
                      "pattern": "^rx_[0-7][0-9a-hjkmnp-tv-z]{25}$",
                      "examples": [
                        "rx_01j2y8m6jcc9tt24af5pw9x1bc"
                      ]
                    },
                    "version": {
                      "type": "integer",
                      "minimum": 1
                    }
                  },
                  "required": [
                    "prescriptionId",
                    "version"
                  ],
                  "additionalProperties": false
                },
                "minItems": 1,
                "maxItems": 20
              },
              {
                "type": "null"
              }
            ]
          }
        },
        "required": [
          "practiceId",
          "reason"
        ],
        "additionalProperties": false,
        "allOf": [
          {
            "oneOf": [
              {
                "required": [
                  "expectedRevision"
                ]
              },
              {
                "required": [
                  "expectedVersions"
                ]
              }
            ]
          }
        ],
        "title": "RejectOrderRequest"
      },
      "RejectOrderResponse": {
        "title": "RejectOrderResponse",
        "type": "object",
        "properties": {
          "orderId": {
            "type": "string",
            "pattern": "^ord_[0-7][0-9a-hjkmnp-tv-z]{25}$",
            "examples": [
              "ord_01j2y8m6jcc9tt24af5pw9x1bc"
            ]
          },
          "rejectedAt": {
            "type": "string"
          },
          "reason": {
            "type": "string"
          },
          "status": {
            "type": "string",
            "enum": [
              "rejected"
            ]
          }
        },
        "required": [
          "orderId",
          "rejectedAt",
          "reason",
          "status"
        ],
        "additionalProperties": false
      },
      "RegisterUserRequest": {
        "type": "object",
        "properties": {
          "externalId": {
            "type": "string"
          },
          "email": {
            "type": "string",
            "pattern": "^[^\\s@]+@[^\\s@]+\\.[^\\s@]+$"
          },
          "name": {
            "type": "string"
          },
          "role": {
            "type": "string",
            "enum": [
              "administrator",
              "prescriber",
              "clinical_staff",
              "billing",
              "developer"
            ]
          },
          "roles": {
            "anyOf": [
              {
                "type": "array",
                "items": {
                  "type": "string",
                  "enum": [
                    "owner",
                    "administrator",
                    "prescriber",
                    "clinical_staff",
                    "billing",
                    "developer"
                  ]
                },
                "minItems": 1,
                "maxItems": 6
              },
              {
                "type": "null"
              }
            ]
          },
          "profileDetails": {
            "anyOf": [
              {
                "type": "object",
                "properties": {
                  "firstName": {
                    "anyOf": [
                      {
                        "type": "string"
                      },
                      {
                        "type": "null"
                      }
                    ]
                  },
                  "middleName": {
                    "anyOf": [
                      {
                        "type": "string"
                      },
                      {
                        "type": "null"
                      }
                    ]
                  },
                  "lastName": {
                    "anyOf": [
                      {
                        "type": "string"
                      },
                      {
                        "type": "null"
                      }
                    ]
                  },
                  "namePrefix": {
                    "anyOf": [
                      {
                        "type": "string"
                      },
                      {
                        "type": "null"
                      }
                    ]
                  },
                  "nameSuffix": {
                    "anyOf": [
                      {
                        "type": "string"
                      },
                      {
                        "type": "null"
                      }
                    ]
                  },
                  "fax": {
                    "anyOf": [
                      {
                        "type": "string"
                      },
                      {
                        "type": "null"
                      }
                    ]
                  },
                  "specialties": {
                    "anyOf": [
                      {
                        "type": "array",
                        "items": {
                          "type": "object",
                          "properties": {
                            "code": {
                              "type": "string"
                            },
                            "description": {
                              "type": "string"
                            },
                            "primary": {
                              "type": "boolean"
                            }
                          },
                          "required": [
                            "code",
                            "description",
                            "primary"
                          ],
                          "additionalProperties": false
                        },
                        "maxItems": 100
                      },
                      {
                        "type": "null"
                      }
                    ]
                  },
                  "addresses": {
                    "anyOf": [
                      {
                        "type": "array",
                        "items": {
                          "type": "object",
                          "properties": {
                            "purpose": {
                              "type": "string"
                            },
                            "line1": {
                              "type": "string"
                            },
                            "line2": {
                              "type": "string"
                            },
                            "city": {
                              "type": "string"
                            },
                            "state": {
                              "type": "string"
                            },
                            "postalCode": {
                              "type": "string"
                            },
                            "country": {
                              "type": "string"
                            },
                            "phone": {
                              "type": "string"
                            },
                            "fax": {
                              "type": "string"
                            }
                          },
                          "required": [
                            "purpose",
                            "line1",
                            "line2",
                            "city",
                            "state",
                            "postalCode",
                            "country",
                            "phone",
                            "fax"
                          ],
                          "additionalProperties": false
                        },
                        "maxItems": 100
                      },
                      {
                        "type": "null"
                      }
                    ]
                  },
                  "otherNames": {
                    "anyOf": [
                      {
                        "type": "array",
                        "items": {
                          "type": "object",
                          "properties": {
                            "name": {
                              "type": "string"
                            },
                            "credentials": {
                              "type": "string"
                            },
                            "type": {
                              "type": "string"
                            }
                          },
                          "required": [
                            "name",
                            "credentials",
                            "type"
                          ],
                          "additionalProperties": false
                        },
                        "maxItems": 100
                      },
                      {
                        "type": "null"
                      }
                    ]
                  },
                  "identifiers": {
                    "anyOf": [
                      {
                        "type": "array",
                        "items": {
                          "type": "object",
                          "properties": {
                            "identifier": {
                              "type": "string"
                            },
                            "issuer": {
                              "type": "string"
                            },
                            "state": {
                              "type": "string"
                            },
                            "description": {
                              "type": "string"
                            }
                          },
                          "required": [
                            "identifier",
                            "issuer",
                            "state",
                            "description"
                          ],
                          "additionalProperties": false
                        },
                        "maxItems": 100
                      },
                      {
                        "type": "null"
                      }
                    ]
                  },
                  "endpoints": {
                    "anyOf": [
                      {
                        "type": "array",
                        "items": {
                          "type": "object",
                          "properties": {
                            "endpoint": {
                              "type": "string"
                            },
                            "type": {
                              "type": "string"
                            },
                            "description": {
                              "type": "string"
                            },
                            "use": {
                              "type": "string"
                            },
                            "affiliation": {
                              "type": "string"
                            }
                          },
                          "required": [
                            "endpoint",
                            "type",
                            "description",
                            "use",
                            "affiliation"
                          ],
                          "additionalProperties": false
                        },
                        "maxItems": 100
                      },
                      {
                        "type": "null"
                      }
                    ]
                  },
                  "certifications": {
                    "anyOf": [
                      {
                        "type": "array",
                        "items": {
                          "type": "object",
                          "properties": {
                            "name": {
                              "type": "string"
                            },
                            "issuer": {
                              "type": "string"
                            },
                            "expiresAt": {
                              "type": "string"
                            }
                          },
                          "required": [
                            "name",
                            "issuer",
                            "expiresAt"
                          ],
                          "additionalProperties": false
                        },
                        "maxItems": 100
                      },
                      {
                        "type": "null"
                      }
                    ]
                  }
                },
                "additionalProperties": false
              },
              {
                "type": "null"
              }
            ]
          },
          "npi": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ]
          },
          "licenses": {
            "anyOf": [
              {
                "type": "array",
                "items": {
                  "type": "object",
                  "properties": {
                    "state": {
                      "type": "string"
                    },
                    "licenseNumber": {
                      "type": "string"
                    },
                    "expiresAt": {
                      "anyOf": [
                        {
                          "anyOf": [
                            {
                              "type": "string"
                            },
                            {
                              "type": "null"
                            }
                          ]
                        },
                        {
                          "type": "null"
                        }
                      ]
                    }
                  },
                  "required": [
                    "state",
                    "licenseNumber"
                  ],
                  "additionalProperties": false
                },
                "maxItems": 60
              },
              {
                "type": "null"
              }
            ]
          },
          "legalName": {
            "anyOf": [
              {
                "anyOf": [
                  {
                    "type": "string"
                  },
                  {
                    "type": "null"
                  }
                ]
              },
              {
                "type": "null"
              }
            ]
          },
          "displayName": {
            "anyOf": [
              {
                "anyOf": [
                  {
                    "type": "string"
                  },
                  {
                    "type": "null"
                  }
                ]
              },
              {
                "type": "null"
              }
            ]
          },
          "credentials": {
            "anyOf": [
              {
                "anyOf": [
                  {
                    "type": "string"
                  },
                  {
                    "type": "null"
                  }
                ]
              },
              {
                "type": "null"
              }
            ]
          },
          "address": {
            "anyOf": [
              {
                "anyOf": [
                  {
                    "type": "object",
                    "properties": {
                      "city": {
                        "type": "string"
                      },
                      "country": {
                        "type": "string"
                      },
                      "line1": {
                        "type": "string"
                      },
                      "line2": {
                        "anyOf": [
                          {
                            "type": "string"
                          },
                          {
                            "type": "null"
                          }
                        ]
                      },
                      "postalCode": {
                        "type": "string"
                      },
                      "state": {
                        "type": "string"
                      }
                    },
                    "required": [
                      "city",
                      "country",
                      "line1",
                      "postalCode",
                      "state"
                    ],
                    "additionalProperties": false
                  },
                  {
                    "type": "null"
                  }
                ]
              },
              {
                "type": "null"
              }
            ]
          },
          "phone": {
            "anyOf": [
              {
                "anyOf": [
                  {
                    "type": "string"
                  },
                  {
                    "type": "null"
                  }
                ]
              },
              {
                "type": "null"
              }
            ]
          },
          "locationIds": {
            "anyOf": [
              {
                "type": "array",
                "items": {
                  "type": "string",
                  "pattern": "^loc_[0-7][0-9a-hjkmnp-tv-z]{25}$",
                  "examples": [
                    "loc_01j2y8m6jcc9tt24af5pw9x1bc"
                  ]
                },
                "maxItems": 100
              },
              {
                "type": "null"
              }
            ]
          },
          "identityAttestation": {
            "type": "boolean",
            "enum": [
              true
            ]
          }
        },
        "required": [
          "externalId",
          "email",
          "name",
          "role",
          "identityAttestation"
        ],
        "additionalProperties": false,
        "title": "RegisterUserRequest"
      },
      "RegisterUserResponse": {
        "title": "RegisterUserResponse",
        "type": "object",
        "properties": {
          "object": {
            "type": "string",
            "enum": [
              "registered_user"
            ]
          },
          "id": {
            "type": "string",
            "pattern": "^user_[0-7][0-9a-hjkmnp-tv-z]{25}$",
            "examples": [
              "user_01j2y8m6jcc9tt24af5pw9x1bc"
            ]
          },
          "practiceId": {
            "type": "string",
            "pattern": "^prac_[0-7][0-9a-hjkmnp-tv-z]{25}$",
            "examples": [
              "prac_01j2y8m6jcc9tt24af5pw9x1bc"
            ]
          },
          "memberId": {
            "type": "string",
            "pattern": "^mbr_[0-7][0-9a-hjkmnp-tv-z]{25}$",
            "examples": [
              "mbr_01j2y8m6jcc9tt24af5pw9x1bc"
            ]
          },
          "prescriberId": {
            "anyOf": [
              {
                "type": "string",
                "pattern": "^prov_[0-7][0-9a-hjkmnp-tv-z]{25}$",
                "examples": [
                  "prov_01j2y8m6jcc9tt24af5pw9x1bc"
                ]
              },
              {
                "type": "null"
              }
            ]
          },
          "externalId": {
            "type": "string"
          },
          "livemode": {
            "type": "boolean"
          }
        },
        "required": [
          "object",
          "id",
          "practiceId",
          "memberId",
          "prescriberId",
          "externalId",
          "livemode"
        ],
        "additionalProperties": false
      },
      "ListPatientAddressesResponse": {
        "title": "ListPatientAddressesResponse",
        "type": "object",
        "properties": {
          "data": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "id": {
                  "type": "string",
                  "allOf": [
                    {
                      "pattern": "^addr_[0-7][0-9a-hjkmnp-tv-z]{25}$",
                      "examples": [
                        "addr_01j2y8m6jcc9tt24af5pw9x1bc"
                      ]
                    }
                  ]
                },
                "address": {
                  "type": "object",
                  "properties": {
                    "city": {
                      "type": "string",
                      "allOf": [
                        {
                          "pattern": "^[^\\u0000\\p{Cs}]*$"
                        },
                        {
                          "pattern": "^[^\\p{Cc}\\u200B\\u2028-\\u202E\\u2066-\\u2069]*$"
                        }
                      ]
                    },
                    "country": {
                      "anyOf": [
                        {
                          "type": "string",
                          "allOf": [
                            {
                              "pattern": "^[^\\u0000\\p{Cs}]*$"
                            },
                            {
                              "pattern": "^[^\\p{Cc}\\u200B\\u2028-\\u202E\\u2066-\\u2069]*$"
                            }
                          ]
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "line1": {
                      "type": "string",
                      "allOf": [
                        {
                          "pattern": "^[^\\u0000\\p{Cs}]*$"
                        },
                        {
                          "pattern": "^[^\\p{Cc}\\u200B\\u2028-\\u202E\\u2066-\\u2069]*$"
                        }
                      ]
                    },
                    "line2": {
                      "anyOf": [
                        {
                          "anyOf": [
                            {
                              "type": "string",
                              "allOf": [
                                {
                                  "pattern": "^[^\\u0000\\p{Cs}]*$"
                                },
                                {
                                  "pattern": "^[^\\p{Cc}\\u200B\\u2028-\\u202E\\u2066-\\u2069]*$"
                                }
                              ]
                            },
                            {
                              "type": "null"
                            }
                          ]
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "postalCode": {
                      "type": "string",
                      "allOf": [
                        {
                          "pattern": "^[^\\u0000\\p{Cs}]*$"
                        },
                        {
                          "pattern": "^[^\\p{Cc}\\u200B\\u2028-\\u202E\\u2066-\\u2069]*$"
                        }
                      ]
                    },
                    "state": {
                      "type": "string",
                      "allOf": [
                        {
                          "pattern": "^[^\\u0000\\p{Cs}]*$"
                        },
                        {
                          "pattern": "^[^\\p{Cc}\\u200B\\u2028-\\u202E\\u2066-\\u2069]*$"
                        }
                      ]
                    }
                  },
                  "required": [
                    "city",
                    "line1",
                    "postalCode",
                    "state"
                  ],
                  "additionalProperties": false
                },
                "label": {
                  "type": "string",
                  "allOf": [
                    {
                      "pattern": "^[^\\u0000\\p{Cs}]*$"
                    }
                  ]
                },
                "preferredShipping": {
                  "type": "boolean"
                },
                "recipientName": {
                  "anyOf": [
                    {
                      "type": "string",
                      "allOf": [
                        {
                          "pattern": "^[^\\u0000\\p{Cs}]*$"
                        },
                        {
                          "pattern": "^[^\\p{Cc}\\u200B\\u2028-\\u202E\\u2066-\\u2069]*$"
                        }
                      ]
                    },
                    {
                      "type": "null"
                    }
                  ]
                },
                "archivedAt": {
                  "anyOf": [
                    {
                      "type": "string"
                    },
                    {
                      "type": "null"
                    }
                  ]
                }
              },
              "required": [
                "id",
                "address",
                "label",
                "preferredShipping",
                "recipientName",
                "archivedAt"
              ],
              "additionalProperties": false
            }
          },
          "object": {
            "type": "string",
            "enum": [
              "list"
            ]
          },
          "hasMore": {
            "type": "boolean"
          },
          "url": {
            "type": "string"
          }
        },
        "required": [
          "data",
          "object",
          "hasMore",
          "url"
        ],
        "additionalProperties": false
      },
      "CreatePatientAddressRequest": {
        "type": "object",
        "properties": {
          "address": {
            "type": "object",
            "properties": {
              "city": {
                "type": "string",
                "pattern": "^[^\\u0000\\p{Cs}]*$",
                "allOf": [
                  {
                    "pattern": "^[^\\p{Cc}\\u200B\\u2028-\\u202E\\u2066-\\u2069]*$"
                  }
                ]
              },
              "country": {
                "anyOf": [
                  {
                    "type": "string",
                    "enum": [
                      "US"
                    ]
                  },
                  {
                    "type": "null"
                  }
                ]
              },
              "line1": {
                "type": "string",
                "pattern": "^[^\\u0000\\p{Cs}]*$",
                "allOf": [
                  {
                    "pattern": "^[^\\p{Cc}\\u200B\\u2028-\\u202E\\u2066-\\u2069]*$"
                  }
                ]
              },
              "line2": {
                "anyOf": [
                  {
                    "anyOf": [
                      {
                        "type": "string",
                        "pattern": "^[^\\u0000\\p{Cs}]*$",
                        "allOf": [
                          {
                            "pattern": "^[^\\p{Cc}\\u200B\\u2028-\\u202E\\u2066-\\u2069]*$"
                          }
                        ]
                      },
                      {
                        "type": "null"
                      }
                    ]
                  },
                  {
                    "type": "null"
                  }
                ]
              },
              "postalCode": {
                "type": "string"
              },
              "state": {
                "type": "string"
              }
            },
            "required": [
              "city",
              "line1",
              "postalCode",
              "state"
            ],
            "additionalProperties": false
          },
          "label": {
            "anyOf": [
              {
                "type": "string",
                "pattern": "^[^\\u0000\\p{Cs}]*$"
              },
              {
                "type": "null"
              }
            ]
          },
          "preferredShipping": {
            "anyOf": [
              {
                "type": "boolean"
              },
              {
                "type": "null"
              }
            ]
          },
          "recipientName": {
            "anyOf": [
              {
                "anyOf": [
                  {
                    "type": "string",
                    "pattern": "^[^\\u0000\\p{Cs}]*$",
                    "allOf": [
                      {
                        "pattern": "^[^\\p{Cc}\\u200B\\u2028-\\u202E\\u2066-\\u2069]*$"
                      }
                    ]
                  },
                  {
                    "type": "null"
                  }
                ]
              },
              {
                "type": "null"
              }
            ]
          }
        },
        "required": [
          "address"
        ],
        "additionalProperties": false,
        "title": "CreatePatientAddressRequest"
      },
      "CreatePatientAddressResponse": {
        "title": "CreatePatientAddressResponse",
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "pattern": "^addr_[0-7][0-9a-hjkmnp-tv-z]{25}$",
            "examples": [
              "addr_01j2y8m6jcc9tt24af5pw9x1bc"
            ]
          },
          "address": {
            "type": "object",
            "properties": {
              "city": {
                "type": "string",
                "allOf": [
                  {
                    "pattern": "^[^\\u0000\\p{Cs}]*$"
                  },
                  {
                    "pattern": "^[^\\p{Cc}\\u200B\\u2028-\\u202E\\u2066-\\u2069]*$"
                  }
                ]
              },
              "country": {
                "anyOf": [
                  {
                    "type": "string",
                    "allOf": [
                      {
                        "pattern": "^[^\\u0000\\p{Cs}]*$"
                      },
                      {
                        "pattern": "^[^\\p{Cc}\\u200B\\u2028-\\u202E\\u2066-\\u2069]*$"
                      }
                    ]
                  },
                  {
                    "type": "null"
                  }
                ]
              },
              "line1": {
                "type": "string",
                "allOf": [
                  {
                    "pattern": "^[^\\u0000\\p{Cs}]*$"
                  },
                  {
                    "pattern": "^[^\\p{Cc}\\u200B\\u2028-\\u202E\\u2066-\\u2069]*$"
                  }
                ]
              },
              "line2": {
                "anyOf": [
                  {
                    "anyOf": [
                      {
                        "type": "string",
                        "allOf": [
                          {
                            "pattern": "^[^\\u0000\\p{Cs}]*$"
                          },
                          {
                            "pattern": "^[^\\p{Cc}\\u200B\\u2028-\\u202E\\u2066-\\u2069]*$"
                          }
                        ]
                      },
                      {
                        "type": "null"
                      }
                    ]
                  },
                  {
                    "type": "null"
                  }
                ]
              },
              "postalCode": {
                "type": "string",
                "allOf": [
                  {
                    "pattern": "^[^\\u0000\\p{Cs}]*$"
                  },
                  {
                    "pattern": "^[^\\p{Cc}\\u200B\\u2028-\\u202E\\u2066-\\u2069]*$"
                  }
                ]
              },
              "state": {
                "type": "string",
                "allOf": [
                  {
                    "pattern": "^[^\\u0000\\p{Cs}]*$"
                  },
                  {
                    "pattern": "^[^\\p{Cc}\\u200B\\u2028-\\u202E\\u2066-\\u2069]*$"
                  }
                ]
              }
            },
            "required": [
              "city",
              "line1",
              "postalCode",
              "state"
            ],
            "additionalProperties": false
          },
          "label": {
            "type": "string",
            "pattern": "^[^\\u0000\\p{Cs}]*$"
          },
          "preferredShipping": {
            "type": "boolean"
          },
          "recipientName": {
            "anyOf": [
              {
                "type": "string",
                "allOf": [
                  {
                    "pattern": "^[^\\u0000\\p{Cs}]*$"
                  },
                  {
                    "pattern": "^[^\\p{Cc}\\u200B\\u2028-\\u202E\\u2066-\\u2069]*$"
                  }
                ]
              },
              {
                "type": "null"
              }
            ]
          },
          "archivedAt": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ]
          }
        },
        "required": [
          "id",
          "address",
          "label",
          "preferredShipping",
          "recipientName",
          "archivedAt"
        ],
        "additionalProperties": false
      },
      "UpdatePatientAddressRequest": {
        "type": "object",
        "properties": {
          "address": {
            "anyOf": [
              {
                "type": "object",
                "properties": {
                  "city": {
                    "type": "string",
                    "pattern": "^[^\\u0000\\p{Cs}]*$",
                    "allOf": [
                      {
                        "pattern": "^[^\\p{Cc}\\u200B\\u2028-\\u202E\\u2066-\\u2069]*$"
                      }
                    ]
                  },
                  "country": {
                    "anyOf": [
                      {
                        "type": "string",
                        "enum": [
                          "US"
                        ]
                      },
                      {
                        "type": "null"
                      }
                    ]
                  },
                  "line1": {
                    "type": "string",
                    "pattern": "^[^\\u0000\\p{Cs}]*$",
                    "allOf": [
                      {
                        "pattern": "^[^\\p{Cc}\\u200B\\u2028-\\u202E\\u2066-\\u2069]*$"
                      }
                    ]
                  },
                  "line2": {
                    "anyOf": [
                      {
                        "anyOf": [
                          {
                            "type": "string",
                            "pattern": "^[^\\u0000\\p{Cs}]*$",
                            "allOf": [
                              {
                                "pattern": "^[^\\p{Cc}\\u200B\\u2028-\\u202E\\u2066-\\u2069]*$"
                              }
                            ]
                          },
                          {
                            "type": "null"
                          }
                        ]
                      },
                      {
                        "type": "null"
                      }
                    ]
                  },
                  "postalCode": {
                    "type": "string"
                  },
                  "state": {
                    "type": "string"
                  }
                },
                "required": [
                  "city",
                  "line1",
                  "postalCode",
                  "state"
                ],
                "additionalProperties": false
              },
              {
                "type": "null"
              }
            ]
          },
          "label": {
            "anyOf": [
              {
                "type": "string",
                "pattern": "^[^\\u0000\\p{Cs}]*$"
              },
              {
                "type": "null"
              }
            ]
          },
          "recipientName": {
            "anyOf": [
              {
                "anyOf": [
                  {
                    "type": "string",
                    "pattern": "^[^\\u0000\\p{Cs}]*$",
                    "allOf": [
                      {
                        "pattern": "^[^\\p{Cc}\\u200B\\u2028-\\u202E\\u2066-\\u2069]*$"
                      }
                    ]
                  },
                  {
                    "type": "null"
                  }
                ]
              },
              {
                "type": "null"
              }
            ]
          },
          "preferredShipping": {
            "anyOf": [
              {
                "type": "boolean"
              },
              {
                "type": "null"
              }
            ]
          }
        },
        "additionalProperties": false,
        "title": "UpdatePatientAddressRequest"
      },
      "UpdatePatientAddressResponse": {
        "title": "UpdatePatientAddressResponse",
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "pattern": "^addr_[0-7][0-9a-hjkmnp-tv-z]{25}$",
            "examples": [
              "addr_01j2y8m6jcc9tt24af5pw9x1bc"
            ]
          },
          "address": {
            "type": "object",
            "properties": {
              "city": {
                "type": "string",
                "allOf": [
                  {
                    "pattern": "^[^\\u0000\\p{Cs}]*$"
                  },
                  {
                    "pattern": "^[^\\p{Cc}\\u200B\\u2028-\\u202E\\u2066-\\u2069]*$"
                  }
                ]
              },
              "country": {
                "anyOf": [
                  {
                    "type": "string",
                    "allOf": [
                      {
                        "pattern": "^[^\\u0000\\p{Cs}]*$"
                      },
                      {
                        "pattern": "^[^\\p{Cc}\\u200B\\u2028-\\u202E\\u2066-\\u2069]*$"
                      }
                    ]
                  },
                  {
                    "type": "null"
                  }
                ]
              },
              "line1": {
                "type": "string",
                "allOf": [
                  {
                    "pattern": "^[^\\u0000\\p{Cs}]*$"
                  },
                  {
                    "pattern": "^[^\\p{Cc}\\u200B\\u2028-\\u202E\\u2066-\\u2069]*$"
                  }
                ]
              },
              "line2": {
                "anyOf": [
                  {
                    "anyOf": [
                      {
                        "type": "string",
                        "allOf": [
                          {
                            "pattern": "^[^\\u0000\\p{Cs}]*$"
                          },
                          {
                            "pattern": "^[^\\p{Cc}\\u200B\\u2028-\\u202E\\u2066-\\u2069]*$"
                          }
                        ]
                      },
                      {
                        "type": "null"
                      }
                    ]
                  },
                  {
                    "type": "null"
                  }
                ]
              },
              "postalCode": {
                "type": "string",
                "allOf": [
                  {
                    "pattern": "^[^\\u0000\\p{Cs}]*$"
                  },
                  {
                    "pattern": "^[^\\p{Cc}\\u200B\\u2028-\\u202E\\u2066-\\u2069]*$"
                  }
                ]
              },
              "state": {
                "type": "string",
                "allOf": [
                  {
                    "pattern": "^[^\\u0000\\p{Cs}]*$"
                  },
                  {
                    "pattern": "^[^\\p{Cc}\\u200B\\u2028-\\u202E\\u2066-\\u2069]*$"
                  }
                ]
              }
            },
            "required": [
              "city",
              "line1",
              "postalCode",
              "state"
            ],
            "additionalProperties": false
          },
          "label": {
            "type": "string",
            "pattern": "^[^\\u0000\\p{Cs}]*$"
          },
          "preferredShipping": {
            "type": "boolean"
          },
          "recipientName": {
            "anyOf": [
              {
                "type": "string",
                "allOf": [
                  {
                    "pattern": "^[^\\u0000\\p{Cs}]*$"
                  },
                  {
                    "pattern": "^[^\\p{Cc}\\u200B\\u2028-\\u202E\\u2066-\\u2069]*$"
                  }
                ]
              },
              {
                "type": "null"
              }
            ]
          },
          "archivedAt": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ]
          }
        },
        "required": [
          "id",
          "address",
          "label",
          "preferredShipping",
          "recipientName",
          "archivedAt"
        ],
        "additionalProperties": false
      },
      "ArchivePatientAddressResponse": {
        "title": "ArchivePatientAddressResponse",
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "pattern": "^addr_[0-7][0-9a-hjkmnp-tv-z]{25}$",
            "examples": [
              "addr_01j2y8m6jcc9tt24af5pw9x1bc"
            ]
          },
          "address": {
            "type": "object",
            "properties": {
              "city": {
                "type": "string",
                "allOf": [
                  {
                    "pattern": "^[^\\u0000\\p{Cs}]*$"
                  },
                  {
                    "pattern": "^[^\\p{Cc}\\u200B\\u2028-\\u202E\\u2066-\\u2069]*$"
                  }
                ]
              },
              "country": {
                "anyOf": [
                  {
                    "type": "string",
                    "allOf": [
                      {
                        "pattern": "^[^\\u0000\\p{Cs}]*$"
                      },
                      {
                        "pattern": "^[^\\p{Cc}\\u200B\\u2028-\\u202E\\u2066-\\u2069]*$"
                      }
                    ]
                  },
                  {
                    "type": "null"
                  }
                ]
              },
              "line1": {
                "type": "string",
                "allOf": [
                  {
                    "pattern": "^[^\\u0000\\p{Cs}]*$"
                  },
                  {
                    "pattern": "^[^\\p{Cc}\\u200B\\u2028-\\u202E\\u2066-\\u2069]*$"
                  }
                ]
              },
              "line2": {
                "anyOf": [
                  {
                    "anyOf": [
                      {
                        "type": "string",
                        "allOf": [
                          {
                            "pattern": "^[^\\u0000\\p{Cs}]*$"
                          },
                          {
                            "pattern": "^[^\\p{Cc}\\u200B\\u2028-\\u202E\\u2066-\\u2069]*$"
                          }
                        ]
                      },
                      {
                        "type": "null"
                      }
                    ]
                  },
                  {
                    "type": "null"
                  }
                ]
              },
              "postalCode": {
                "type": "string",
                "allOf": [
                  {
                    "pattern": "^[^\\u0000\\p{Cs}]*$"
                  },
                  {
                    "pattern": "^[^\\p{Cc}\\u200B\\u2028-\\u202E\\u2066-\\u2069]*$"
                  }
                ]
              },
              "state": {
                "type": "string",
                "allOf": [
                  {
                    "pattern": "^[^\\u0000\\p{Cs}]*$"
                  },
                  {
                    "pattern": "^[^\\p{Cc}\\u200B\\u2028-\\u202E\\u2066-\\u2069]*$"
                  }
                ]
              }
            },
            "required": [
              "city",
              "line1",
              "postalCode",
              "state"
            ],
            "additionalProperties": false
          },
          "label": {
            "type": "string",
            "pattern": "^[^\\u0000\\p{Cs}]*$"
          },
          "preferredShipping": {
            "type": "boolean"
          },
          "recipientName": {
            "anyOf": [
              {
                "type": "string",
                "allOf": [
                  {
                    "pattern": "^[^\\u0000\\p{Cs}]*$"
                  },
                  {
                    "pattern": "^[^\\p{Cc}\\u200B\\u2028-\\u202E\\u2066-\\u2069]*$"
                  }
                ]
              },
              {
                "type": "null"
              }
            ]
          },
          "archivedAt": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ]
          }
        },
        "required": [
          "id",
          "address",
          "label",
          "preferredShipping",
          "recipientName",
          "archivedAt"
        ],
        "additionalProperties": false
      },
      "SetDefaultPatientAddressResponse": {
        "title": "SetDefaultPatientAddressResponse",
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "pattern": "^addr_[0-7][0-9a-hjkmnp-tv-z]{25}$",
            "examples": [
              "addr_01j2y8m6jcc9tt24af5pw9x1bc"
            ]
          },
          "address": {
            "type": "object",
            "properties": {
              "city": {
                "type": "string",
                "allOf": [
                  {
                    "pattern": "^[^\\u0000\\p{Cs}]*$"
                  },
                  {
                    "pattern": "^[^\\p{Cc}\\u200B\\u2028-\\u202E\\u2066-\\u2069]*$"
                  }
                ]
              },
              "country": {
                "anyOf": [
                  {
                    "type": "string",
                    "allOf": [
                      {
                        "pattern": "^[^\\u0000\\p{Cs}]*$"
                      },
                      {
                        "pattern": "^[^\\p{Cc}\\u200B\\u2028-\\u202E\\u2066-\\u2069]*$"
                      }
                    ]
                  },
                  {
                    "type": "null"
                  }
                ]
              },
              "line1": {
                "type": "string",
                "allOf": [
                  {
                    "pattern": "^[^\\u0000\\p{Cs}]*$"
                  },
                  {
                    "pattern": "^[^\\p{Cc}\\u200B\\u2028-\\u202E\\u2066-\\u2069]*$"
                  }
                ]
              },
              "line2": {
                "anyOf": [
                  {
                    "anyOf": [
                      {
                        "type": "string",
                        "allOf": [
                          {
                            "pattern": "^[^\\u0000\\p{Cs}]*$"
                          },
                          {
                            "pattern": "^[^\\p{Cc}\\u200B\\u2028-\\u202E\\u2066-\\u2069]*$"
                          }
                        ]
                      },
                      {
                        "type": "null"
                      }
                    ]
                  },
                  {
                    "type": "null"
                  }
                ]
              },
              "postalCode": {
                "type": "string",
                "allOf": [
                  {
                    "pattern": "^[^\\u0000\\p{Cs}]*$"
                  },
                  {
                    "pattern": "^[^\\p{Cc}\\u200B\\u2028-\\u202E\\u2066-\\u2069]*$"
                  }
                ]
              },
              "state": {
                "type": "string",
                "allOf": [
                  {
                    "pattern": "^[^\\u0000\\p{Cs}]*$"
                  },
                  {
                    "pattern": "^[^\\p{Cc}\\u200B\\u2028-\\u202E\\u2066-\\u2069]*$"
                  }
                ]
              }
            },
            "required": [
              "city",
              "line1",
              "postalCode",
              "state"
            ],
            "additionalProperties": false
          },
          "label": {
            "type": "string",
            "pattern": "^[^\\u0000\\p{Cs}]*$"
          },
          "preferredShipping": {
            "type": "boolean"
          },
          "recipientName": {
            "anyOf": [
              {
                "type": "string",
                "allOf": [
                  {
                    "pattern": "^[^\\u0000\\p{Cs}]*$"
                  },
                  {
                    "pattern": "^[^\\p{Cc}\\u200B\\u2028-\\u202E\\u2066-\\u2069]*$"
                  }
                ]
              },
              {
                "type": "null"
              }
            ]
          },
          "archivedAt": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ]
          }
        },
        "required": [
          "id",
          "address",
          "label",
          "preferredShipping",
          "recipientName",
          "archivedAt"
        ],
        "additionalProperties": false
      },
      "InvitePracticeTeamPersonRequest": {
        "type": "object",
        "properties": {
          "externalId": {
            "type": "string"
          },
          "email": {
            "type": "string",
            "pattern": "^[^\\s@]+@[^\\s@]+\\.[^\\s@]+$"
          },
          "name": {
            "type": "string"
          },
          "role": {
            "anyOf": [
              {
                "type": "string",
                "enum": [
                  "owner",
                  "administrator",
                  "prescriber",
                  "clinical_staff",
                  "billing",
                  "developer"
                ]
              },
              {
                "type": "null"
              }
            ]
          },
          "roles": {
            "anyOf": [
              {
                "type": "array",
                "items": {
                  "type": "string",
                  "enum": [
                    "owner",
                    "administrator",
                    "prescriber",
                    "clinical_staff",
                    "billing",
                    "developer"
                  ]
                },
                "minItems": 1,
                "maxItems": 6
              },
              {
                "type": "null"
              }
            ]
          },
          "profileDetails": {
            "anyOf": [
              {
                "type": "object",
                "properties": {
                  "firstName": {
                    "anyOf": [
                      {
                        "type": "string"
                      },
                      {
                        "type": "null"
                      }
                    ]
                  },
                  "middleName": {
                    "anyOf": [
                      {
                        "type": "string"
                      },
                      {
                        "type": "null"
                      }
                    ]
                  },
                  "lastName": {
                    "anyOf": [
                      {
                        "type": "string"
                      },
                      {
                        "type": "null"
                      }
                    ]
                  },
                  "namePrefix": {
                    "anyOf": [
                      {
                        "type": "string"
                      },
                      {
                        "type": "null"
                      }
                    ]
                  },
                  "nameSuffix": {
                    "anyOf": [
                      {
                        "type": "string"
                      },
                      {
                        "type": "null"
                      }
                    ]
                  },
                  "fax": {
                    "anyOf": [
                      {
                        "type": "string"
                      },
                      {
                        "type": "null"
                      }
                    ]
                  },
                  "specialties": {
                    "anyOf": [
                      {
                        "type": "array",
                        "items": {
                          "type": "object",
                          "properties": {
                            "code": {
                              "type": "string"
                            },
                            "description": {
                              "type": "string"
                            },
                            "primary": {
                              "type": "boolean"
                            }
                          },
                          "required": [
                            "code",
                            "description",
                            "primary"
                          ],
                          "additionalProperties": false
                        },
                        "maxItems": 100
                      },
                      {
                        "type": "null"
                      }
                    ]
                  },
                  "addresses": {
                    "anyOf": [
                      {
                        "type": "array",
                        "items": {
                          "type": "object",
                          "properties": {
                            "purpose": {
                              "type": "string"
                            },
                            "line1": {
                              "type": "string"
                            },
                            "line2": {
                              "type": "string"
                            },
                            "city": {
                              "type": "string"
                            },
                            "state": {
                              "type": "string"
                            },
                            "postalCode": {
                              "type": "string"
                            },
                            "country": {
                              "type": "string"
                            },
                            "phone": {
                              "type": "string"
                            },
                            "fax": {
                              "type": "string"
                            }
                          },
                          "required": [
                            "purpose",
                            "line1",
                            "line2",
                            "city",
                            "state",
                            "postalCode",
                            "country",
                            "phone",
                            "fax"
                          ],
                          "additionalProperties": false
                        },
                        "maxItems": 100
                      },
                      {
                        "type": "null"
                      }
                    ]
                  },
                  "otherNames": {
                    "anyOf": [
                      {
                        "type": "array",
                        "items": {
                          "type": "object",
                          "properties": {
                            "name": {
                              "type": "string"
                            },
                            "credentials": {
                              "type": "string"
                            },
                            "type": {
                              "type": "string"
                            }
                          },
                          "required": [
                            "name",
                            "credentials",
                            "type"
                          ],
                          "additionalProperties": false
                        },
                        "maxItems": 100
                      },
                      {
                        "type": "null"
                      }
                    ]
                  },
                  "identifiers": {
                    "anyOf": [
                      {
                        "type": "array",
                        "items": {
                          "type": "object",
                          "properties": {
                            "identifier": {
                              "type": "string"
                            },
                            "issuer": {
                              "type": "string"
                            },
                            "state": {
                              "type": "string"
                            },
                            "description": {
                              "type": "string"
                            }
                          },
                          "required": [
                            "identifier",
                            "issuer",
                            "state",
                            "description"
                          ],
                          "additionalProperties": false
                        },
                        "maxItems": 100
                      },
                      {
                        "type": "null"
                      }
                    ]
                  },
                  "endpoints": {
                    "anyOf": [
                      {
                        "type": "array",
                        "items": {
                          "type": "object",
                          "properties": {
                            "endpoint": {
                              "type": "string"
                            },
                            "type": {
                              "type": "string"
                            },
                            "description": {
                              "type": "string"
                            },
                            "use": {
                              "type": "string"
                            },
                            "affiliation": {
                              "type": "string"
                            }
                          },
                          "required": [
                            "endpoint",
                            "type",
                            "description",
                            "use",
                            "affiliation"
                          ],
                          "additionalProperties": false
                        },
                        "maxItems": 100
                      },
                      {
                        "type": "null"
                      }
                    ]
                  },
                  "certifications": {
                    "anyOf": [
                      {
                        "type": "array",
                        "items": {
                          "type": "object",
                          "properties": {
                            "name": {
                              "type": "string"
                            },
                            "issuer": {
                              "type": "string"
                            },
                            "expiresAt": {
                              "type": "string"
                            }
                          },
                          "required": [
                            "name",
                            "issuer",
                            "expiresAt"
                          ],
                          "additionalProperties": false
                        },
                        "maxItems": 100
                      },
                      {
                        "type": "null"
                      }
                    ]
                  }
                },
                "additionalProperties": false
              },
              {
                "type": "null"
              }
            ]
          },
          "npi": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ]
          },
          "licenses": {
            "anyOf": [
              {
                "type": "array",
                "items": {
                  "type": "object",
                  "properties": {
                    "state": {
                      "type": "string"
                    },
                    "licenseNumber": {
                      "type": "string"
                    },
                    "expiresAt": {
                      "anyOf": [
                        {
                          "anyOf": [
                            {
                              "type": "string"
                            },
                            {
                              "type": "null"
                            }
                          ]
                        },
                        {
                          "type": "null"
                        }
                      ]
                    }
                  },
                  "required": [
                    "state",
                    "licenseNumber"
                  ],
                  "additionalProperties": false
                },
                "maxItems": 60
              },
              {
                "type": "null"
              }
            ]
          },
          "legalName": {
            "anyOf": [
              {
                "anyOf": [
                  {
                    "type": "string"
                  },
                  {
                    "type": "null"
                  }
                ]
              },
              {
                "type": "null"
              }
            ]
          },
          "displayName": {
            "anyOf": [
              {
                "anyOf": [
                  {
                    "type": "string"
                  },
                  {
                    "type": "null"
                  }
                ]
              },
              {
                "type": "null"
              }
            ]
          },
          "credentials": {
            "anyOf": [
              {
                "anyOf": [
                  {
                    "type": "string"
                  },
                  {
                    "type": "null"
                  }
                ]
              },
              {
                "type": "null"
              }
            ]
          },
          "address": {
            "anyOf": [
              {
                "anyOf": [
                  {
                    "type": "object",
                    "properties": {
                      "city": {
                        "type": "string"
                      },
                      "country": {
                        "type": "string"
                      },
                      "line1": {
                        "type": "string"
                      },
                      "line2": {
                        "anyOf": [
                          {
                            "type": "string"
                          },
                          {
                            "type": "null"
                          }
                        ]
                      },
                      "postalCode": {
                        "type": "string"
                      },
                      "state": {
                        "type": "string"
                      }
                    },
                    "required": [
                      "city",
                      "country",
                      "line1",
                      "postalCode",
                      "state"
                    ],
                    "additionalProperties": false
                  },
                  {
                    "type": "null"
                  }
                ]
              },
              {
                "type": "null"
              }
            ]
          },
          "phone": {
            "anyOf": [
              {
                "anyOf": [
                  {
                    "type": "string"
                  },
                  {
                    "type": "null"
                  }
                ]
              },
              {
                "type": "null"
              }
            ]
          },
          "locationIds": {
            "anyOf": [
              {
                "type": "array",
                "items": {
                  "type": "string",
                  "pattern": "^loc_[0-7][0-9a-hjkmnp-tv-z]{25}$",
                  "examples": [
                    "loc_01j2y8m6jcc9tt24af5pw9x1bc"
                  ]
                },
                "maxItems": 100
              },
              {
                "type": "null"
              }
            ]
          }
        },
        "required": [
          "externalId",
          "email",
          "name"
        ],
        "additionalProperties": false,
        "title": "InvitePracticeTeamPersonRequest"
      },
      "InvitePracticeTeamPersonResponse": {
        "title": "InvitePracticeTeamPersonResponse",
        "type": "object",
        "properties": {
          "person": {
            "type": "object",
            "properties": {
              "id": {
                "type": "string",
                "allOf": [
                  {
                    "pattern": "^user_[0-7][0-9a-hjkmnp-tv-z]{25}$",
                    "examples": [
                      "user_01j2y8m6jcc9tt24af5pw9x1bc"
                    ]
                  }
                ]
              },
              "object": {
                "type": "string",
                "enum": [
                  "team_person"
                ]
              },
              "externalId": {
                "type": "string"
              },
              "email": {
                "anyOf": [
                  {
                    "type": "string"
                  },
                  {
                    "type": "null"
                  }
                ]
              },
              "name": {
                "anyOf": [
                  {
                    "type": "string"
                  },
                  {
                    "type": "null"
                  }
                ]
              },
              "status": {
                "type": "string"
              },
              "invitation": {
                "anyOf": [
                  {
                    "type": "object",
                    "properties": {
                      "id": {
                        "type": "string",
                        "allOf": [
                          {
                            "pattern": "^invite_[0-7][0-9a-hjkmnp-tv-z]{25}$",
                            "examples": [
                              "invite_01j2y8m6jcc9tt24af5pw9x1bc"
                            ]
                          }
                        ]
                      },
                      "status": {
                        "type": "string",
                        "enum": [
                          "accepted",
                          "declined",
                          "pending",
                          "expired",
                          "revoked"
                        ]
                      },
                      "expiresAt": {
                        "type": "string"
                      },
                      "roles": {
                        "type": "array",
                        "items": {
                          "type": "object",
                          "properties": {
                            "id": {
                              "type": "string",
                              "allOf": [
                                {
                                  "pattern": "^role_[0-7][0-9a-hjkmnp-tv-z]{25}$",
                                  "examples": [
                                    "role_01j2y8m6jcc9tt24af5pw9x1bc"
                                  ]
                                }
                              ]
                            },
                            "name": {
                              "type": "string"
                            },
                            "key": {
                              "anyOf": [
                                {
                                  "type": "string"
                                },
                                {
                                  "type": "null"
                                }
                              ]
                            }
                          },
                          "required": [
                            "id",
                            "name",
                            "key"
                          ],
                          "additionalProperties": false
                        }
                      }
                    },
                    "required": [
                      "id",
                      "status",
                      "expiresAt",
                      "roles"
                    ],
                    "additionalProperties": false
                  },
                  {
                    "type": "null"
                  }
                ]
              },
              "account": {
                "anyOf": [
                  {
                    "type": "object",
                    "properties": {
                      "accountId": {
                        "type": "string"
                      },
                      "emailVerified": {
                        "type": "boolean"
                      },
                      "membershipId": {
                        "type": "string",
                        "allOf": [
                          {
                            "pattern": "^mbr_[0-7][0-9a-hjkmnp-tv-z]{25}$",
                            "examples": [
                              "mbr_01j2y8m6jcc9tt24af5pw9x1bc"
                            ]
                          }
                        ]
                      },
                      "membershipStatus": {
                        "type": "string"
                      },
                      "roles": {
                        "type": "array",
                        "items": {
                          "type": "object",
                          "properties": {
                            "id": {
                              "type": "string",
                              "allOf": [
                                {
                                  "pattern": "^role_[0-7][0-9a-hjkmnp-tv-z]{25}$",
                                  "examples": [
                                    "role_01j2y8m6jcc9tt24af5pw9x1bc"
                                  ]
                                }
                              ]
                            },
                            "name": {
                              "type": "string"
                            },
                            "key": {
                              "anyOf": [
                                {
                                  "type": "string"
                                },
                                {
                                  "type": "null"
                                }
                              ]
                            }
                          },
                          "required": [
                            "id",
                            "name",
                            "key"
                          ],
                          "additionalProperties": false
                        }
                      },
                      "prescriberConnection": {
                        "anyOf": [
                          {
                            "type": "object",
                            "properties": {
                              "status": {
                                "type": "string"
                              },
                              "provider": {
                                "type": "object",
                                "properties": {
                                  "id": {
                                    "type": "string",
                                    "allOf": [
                                      {
                                        "pattern": "^prov_[0-7][0-9a-hjkmnp-tv-z]{25}$",
                                        "examples": [
                                          "prov_01j2y8m6jcc9tt24af5pw9x1bc"
                                        ]
                                      }
                                    ]
                                  },
                                  "name": {
                                    "type": "string"
                                  },
                                  "legalName": {
                                    "type": "string"
                                  },
                                  "credentials": {
                                    "anyOf": [
                                      {
                                        "type": "string"
                                      },
                                      {
                                        "type": "null"
                                      }
                                    ]
                                  },
                                  "phone": {
                                    "anyOf": [
                                      {
                                        "type": "string"
                                      },
                                      {
                                        "type": "null"
                                      }
                                    ]
                                  },
                                  "address": {
                                    "anyOf": [
                                      {
                                        "type": "object",
                                        "properties": {
                                          "line1": {
                                            "type": "string"
                                          },
                                          "line2": {
                                            "anyOf": [
                                              {
                                                "type": "string"
                                              },
                                              {
                                                "type": "null"
                                              }
                                            ]
                                          },
                                          "city": {
                                            "type": "string"
                                          },
                                          "state": {
                                            "type": "string"
                                          },
                                          "postalCode": {
                                            "type": "string"
                                          },
                                          "country": {
                                            "type": "string"
                                          }
                                        },
                                        "required": [
                                          "line1",
                                          "city",
                                          "state",
                                          "postalCode",
                                          "country"
                                        ],
                                        "additionalProperties": false
                                      },
                                      {
                                        "type": "null"
                                      }
                                    ]
                                  },
                                  "npi": {
                                    "type": "string"
                                  },
                                  "practiceStatus": {
                                    "type": "string"
                                  },
                                  "licenses": {
                                    "type": "array",
                                    "items": {
                                      "type": "object",
                                      "properties": {
                                        "id": {
                                          "type": "string",
                                          "allOf": [
                                            {
                                              "pattern": "^lic_[0-7][0-9a-hjkmnp-tv-z]{25}$",
                                              "examples": [
                                                "lic_01j2y8m6jcc9tt24af5pw9x1bc"
                                              ]
                                            }
                                          ]
                                        },
                                        "state": {
                                          "type": "string"
                                        },
                                        "licenseNumber": {
                                          "type": "string"
                                        },
                                        "expiresAt": {
                                          "anyOf": [
                                            {
                                              "type": "string"
                                            },
                                            {
                                              "type": "null"
                                            }
                                          ]
                                        }
                                      },
                                      "required": [
                                        "id",
                                        "state",
                                        "licenseNumber",
                                        "expiresAt"
                                      ],
                                      "additionalProperties": false
                                    }
                                  }
                                },
                                "required": [
                                  "id",
                                  "name",
                                  "legalName",
                                  "credentials",
                                  "phone",
                                  "address",
                                  "npi",
                                  "practiceStatus",
                                  "licenses"
                                ],
                                "additionalProperties": false
                              }
                            },
                            "required": [
                              "status",
                              "provider"
                            ],
                            "additionalProperties": false
                          },
                          {
                            "type": "null"
                          }
                        ]
                      }
                    },
                    "required": [
                      "accountId",
                      "emailVerified",
                      "membershipId",
                      "membershipStatus",
                      "roles",
                      "prescriberConnection"
                    ],
                    "additionalProperties": false
                  },
                  {
                    "type": "null"
                  }
                ]
              },
              "nextActions": {
                "type": "array",
                "items": {
                  "type": "string"
                }
              }
            },
            "required": [
              "id",
              "object",
              "externalId",
              "email",
              "name",
              "status",
              "invitation",
              "account",
              "nextActions"
            ],
            "additionalProperties": false
          },
          "delivery": {
            "type": "string",
            "enum": [
              "sent",
              "already_accepted"
            ]
          }
        },
        "required": [
          "person",
          "delivery"
        ],
        "additionalProperties": false
      },
      "ListPracticeTeamInvitationsResponse": {
        "title": "ListPracticeTeamInvitationsResponse",
        "type": "object",
        "properties": {
          "data": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "id": {
                  "type": "string",
                  "allOf": [
                    {
                      "pattern": "^invite_[0-7][0-9a-hjkmnp-tv-z]{25}$",
                      "examples": [
                        "invite_01j2y8m6jcc9tt24af5pw9x1bc"
                      ]
                    }
                  ]
                },
                "object": {
                  "type": "string",
                  "enum": [
                    "team_invitation"
                  ]
                },
                "email": {
                  "type": "string"
                },
                "name": {
                  "anyOf": [
                    {
                      "type": "string"
                    },
                    {
                      "type": "null"
                    }
                  ]
                },
                "status": {
                  "type": "string",
                  "enum": [
                    "accepted",
                    "declined",
                    "pending",
                    "expired",
                    "revoked"
                  ]
                },
                "roles": {
                  "type": "array",
                  "items": {
                    "type": "object",
                    "properties": {
                      "id": {
                        "type": "string",
                        "allOf": [
                          {
                            "pattern": "^role_[0-7][0-9a-hjkmnp-tv-z]{25}$",
                            "examples": [
                              "role_01j2y8m6jcc9tt24af5pw9x1bc"
                            ]
                          }
                        ]
                      },
                      "name": {
                        "type": "string"
                      },
                      "key": {
                        "anyOf": [
                          {
                            "type": "string"
                          },
                          {
                            "type": "null"
                          }
                        ]
                      }
                    },
                    "required": [
                      "id",
                      "name",
                      "key"
                    ],
                    "additionalProperties": false
                  }
                },
                "locationIds": {
                  "type": "array",
                  "items": {
                    "type": "string",
                    "allOf": [
                      {
                        "pattern": "^loc_[0-7][0-9a-hjkmnp-tv-z]{25}$",
                        "examples": [
                          "loc_01j2y8m6jcc9tt24af5pw9x1bc"
                        ]
                      }
                    ]
                  }
                },
                "createdAt": {
                  "type": "string"
                },
                "expiresAt": {
                  "type": "string"
                },
                "acceptedAt": {
                  "anyOf": [
                    {
                      "type": "string"
                    },
                    {
                      "type": "null"
                    }
                  ]
                },
                "userId": {
                  "anyOf": [
                    {
                      "type": "string",
                      "allOf": [
                        {
                          "pattern": "^user_[0-7][0-9a-hjkmnp-tv-z]{25}$",
                          "examples": [
                            "user_01j2y8m6jcc9tt24af5pw9x1bc"
                          ]
                        }
                      ]
                    },
                    {
                      "type": "null"
                    }
                  ],
                  "description": "This integration's mode-scoped user ID, used for draft attribution and sessions after acceptance. Null for invitations outside this integration."
                },
                "externalId": {
                  "anyOf": [
                    {
                      "type": "string"
                    },
                    {
                      "type": "null"
                    }
                  ]
                },
                "memberId": {
                  "anyOf": [
                    {
                      "type": "string",
                      "allOf": [
                        {
                          "pattern": "^mbr_[0-7][0-9a-hjkmnp-tv-z]{25}$",
                          "examples": [
                            "mbr_01j2y8m6jcc9tt24af5pw9x1bc"
                          ]
                        }
                      ]
                    },
                    {
                      "type": "null"
                    }
                  ]
                },
                "prescriberId": {
                  "anyOf": [
                    {
                      "type": "string",
                      "allOf": [
                        {
                          "pattern": "^prov_[0-7][0-9a-hjkmnp-tv-z]{25}$",
                          "examples": [
                            "prov_01j2y8m6jcc9tt24af5pw9x1bc"
                          ]
                        }
                      ]
                    },
                    {
                      "type": "null"
                    }
                  ]
                },
                "person": {
                  "anyOf": [
                    {
                      "type": "object",
                      "properties": {
                        "id": {
                          "type": "string",
                          "allOf": [
                            {
                              "pattern": "^user_[0-7][0-9a-hjkmnp-tv-z]{25}$",
                              "examples": [
                                "user_01j2y8m6jcc9tt24af5pw9x1bc"
                              ]
                            }
                          ]
                        },
                        "object": {
                          "type": "string",
                          "enum": [
                            "team_person"
                          ]
                        },
                        "externalId": {
                          "type": "string"
                        },
                        "email": {
                          "anyOf": [
                            {
                              "type": "string"
                            },
                            {
                              "type": "null"
                            }
                          ]
                        },
                        "name": {
                          "anyOf": [
                            {
                              "type": "string"
                            },
                            {
                              "type": "null"
                            }
                          ]
                        },
                        "status": {
                          "type": "string"
                        },
                        "invitation": {
                          "anyOf": [
                            {
                              "type": "object",
                              "properties": {
                                "id": {
                                  "type": "string",
                                  "allOf": [
                                    {
                                      "pattern": "^invite_[0-7][0-9a-hjkmnp-tv-z]{25}$",
                                      "examples": [
                                        "invite_01j2y8m6jcc9tt24af5pw9x1bc"
                                      ]
                                    }
                                  ]
                                },
                                "status": {
                                  "type": "string",
                                  "enum": [
                                    "accepted",
                                    "declined",
                                    "pending",
                                    "expired",
                                    "revoked"
                                  ]
                                },
                                "expiresAt": {
                                  "type": "string"
                                },
                                "roles": {
                                  "type": "array",
                                  "items": {
                                    "type": "object",
                                    "properties": {
                                      "id": {
                                        "type": "string",
                                        "allOf": [
                                          {
                                            "pattern": "^role_[0-7][0-9a-hjkmnp-tv-z]{25}$",
                                            "examples": [
                                              "role_01j2y8m6jcc9tt24af5pw9x1bc"
                                            ]
                                          }
                                        ]
                                      },
                                      "name": {
                                        "type": "string"
                                      },
                                      "key": {
                                        "anyOf": [
                                          {
                                            "type": "string"
                                          },
                                          {
                                            "type": "null"
                                          }
                                        ]
                                      }
                                    },
                                    "required": [
                                      "id",
                                      "name",
                                      "key"
                                    ],
                                    "additionalProperties": false
                                  }
                                }
                              },
                              "required": [
                                "id",
                                "status",
                                "expiresAt",
                                "roles"
                              ],
                              "additionalProperties": false
                            },
                            {
                              "type": "null"
                            }
                          ]
                        },
                        "account": {
                          "anyOf": [
                            {
                              "type": "object",
                              "properties": {
                                "accountId": {
                                  "type": "string"
                                },
                                "emailVerified": {
                                  "type": "boolean"
                                },
                                "membershipId": {
                                  "type": "string",
                                  "allOf": [
                                    {
                                      "pattern": "^mbr_[0-7][0-9a-hjkmnp-tv-z]{25}$",
                                      "examples": [
                                        "mbr_01j2y8m6jcc9tt24af5pw9x1bc"
                                      ]
                                    }
                                  ]
                                },
                                "membershipStatus": {
                                  "type": "string"
                                },
                                "roles": {
                                  "type": "array",
                                  "items": {
                                    "type": "object",
                                    "properties": {
                                      "id": {
                                        "type": "string",
                                        "allOf": [
                                          {
                                            "pattern": "^role_[0-7][0-9a-hjkmnp-tv-z]{25}$",
                                            "examples": [
                                              "role_01j2y8m6jcc9tt24af5pw9x1bc"
                                            ]
                                          }
                                        ]
                                      },
                                      "name": {
                                        "type": "string"
                                      },
                                      "key": {
                                        "anyOf": [
                                          {
                                            "type": "string"
                                          },
                                          {
                                            "type": "null"
                                          }
                                        ]
                                      }
                                    },
                                    "required": [
                                      "id",
                                      "name",
                                      "key"
                                    ],
                                    "additionalProperties": false
                                  }
                                },
                                "prescriberConnection": {
                                  "anyOf": [
                                    {
                                      "type": "object",
                                      "properties": {
                                        "status": {
                                          "type": "string"
                                        },
                                        "provider": {
                                          "type": "object",
                                          "properties": {
                                            "id": {
                                              "type": "string",
                                              "allOf": [
                                                {
                                                  "pattern": "^prov_[0-7][0-9a-hjkmnp-tv-z]{25}$",
                                                  "examples": [
                                                    "prov_01j2y8m6jcc9tt24af5pw9x1bc"
                                                  ]
                                                }
                                              ]
                                            },
                                            "name": {
                                              "type": "string"
                                            },
                                            "legalName": {
                                              "type": "string"
                                            },
                                            "credentials": {
                                              "anyOf": [
                                                {
                                                  "type": "string"
                                                },
                                                {
                                                  "type": "null"
                                                }
                                              ]
                                            },
                                            "phone": {
                                              "anyOf": [
                                                {
                                                  "type": "string"
                                                },
                                                {
                                                  "type": "null"
                                                }
                                              ]
                                            },
                                            "address": {
                                              "anyOf": [
                                                {
                                                  "type": "object",
                                                  "properties": {
                                                    "line1": {
                                                      "type": "string"
                                                    },
                                                    "line2": {
                                                      "anyOf": [
                                                        {
                                                          "type": "string"
                                                        },
                                                        {
                                                          "type": "null"
                                                        }
                                                      ]
                                                    },
                                                    "city": {
                                                      "type": "string"
                                                    },
                                                    "state": {
                                                      "type": "string"
                                                    },
                                                    "postalCode": {
                                                      "type": "string"
                                                    },
                                                    "country": {
                                                      "type": "string"
                                                    }
                                                  },
                                                  "required": [
                                                    "line1",
                                                    "city",
                                                    "state",
                                                    "postalCode",
                                                    "country"
                                                  ],
                                                  "additionalProperties": false
                                                },
                                                {
                                                  "type": "null"
                                                }
                                              ]
                                            },
                                            "npi": {
                                              "type": "string"
                                            },
                                            "practiceStatus": {
                                              "type": "string"
                                            },
                                            "licenses": {
                                              "type": "array",
                                              "items": {
                                                "type": "object",
                                                "properties": {
                                                  "id": {
                                                    "type": "string",
                                                    "allOf": [
                                                      {
                                                        "pattern": "^lic_[0-7][0-9a-hjkmnp-tv-z]{25}$",
                                                        "examples": [
                                                          "lic_01j2y8m6jcc9tt24af5pw9x1bc"
                                                        ]
                                                      }
                                                    ]
                                                  },
                                                  "state": {
                                                    "type": "string"
                                                  },
                                                  "licenseNumber": {
                                                    "type": "string"
                                                  },
                                                  "expiresAt": {
                                                    "anyOf": [
                                                      {
                                                        "type": "string"
                                                      },
                                                      {
                                                        "type": "null"
                                                      }
                                                    ]
                                                  }
                                                },
                                                "required": [
                                                  "id",
                                                  "state",
                                                  "licenseNumber",
                                                  "expiresAt"
                                                ],
                                                "additionalProperties": false
                                              }
                                            }
                                          },
                                          "required": [
                                            "id",
                                            "name",
                                            "legalName",
                                            "credentials",
                                            "phone",
                                            "address",
                                            "npi",
                                            "practiceStatus",
                                            "licenses"
                                          ],
                                          "additionalProperties": false
                                        }
                                      },
                                      "required": [
                                        "status",
                                        "provider"
                                      ],
                                      "additionalProperties": false
                                    },
                                    {
                                      "type": "null"
                                    }
                                  ]
                                }
                              },
                              "required": [
                                "accountId",
                                "emailVerified",
                                "membershipId",
                                "membershipStatus",
                                "roles",
                                "prescriberConnection"
                              ],
                              "additionalProperties": false
                            },
                            {
                              "type": "null"
                            }
                          ]
                        },
                        "nextActions": {
                          "type": "array",
                          "items": {
                            "type": "string"
                          }
                        }
                      },
                      "required": [
                        "id",
                        "object",
                        "externalId",
                        "email",
                        "name",
                        "status",
                        "invitation",
                        "account",
                        "nextActions"
                      ],
                      "additionalProperties": false
                    },
                    {
                      "type": "null"
                    }
                  ],
                  "description": "This integration's current onboarding and account-connection state. Null for invitations outside this integration."
                }
              },
              "required": [
                "id",
                "object",
                "email",
                "name",
                "status",
                "roles",
                "locationIds",
                "createdAt",
                "expiresAt",
                "acceptedAt",
                "userId",
                "externalId",
                "memberId",
                "prescriberId",
                "person"
              ],
              "additionalProperties": false
            }
          },
          "hasMore": {
            "type": "boolean"
          },
          "object": {
            "type": "string",
            "enum": [
              "list"
            ]
          },
          "url": {
            "type": "string"
          }
        },
        "required": [
          "data",
          "hasMore",
          "object",
          "url"
        ],
        "additionalProperties": false
      },
      "GetPracticeTeamResponse": {
        "title": "GetPracticeTeamResponse",
        "type": "object",
        "properties": {
          "object": {
            "type": "string",
            "enum": [
              "team"
            ]
          },
          "practiceId": {
            "type": "string",
            "pattern": "^prac_[0-7][0-9a-hjkmnp-tv-z]{25}$",
            "examples": [
              "prac_01j2y8m6jcc9tt24af5pw9x1bc"
            ]
          },
          "members": {
            "type": "object",
            "properties": {
              "total": {
                "anyOf": [
                  {
                    "type": "number"
                  },
                  {
                    "type": "string",
                    "enum": [
                      "Infinity",
                      "-Infinity",
                      "NaN"
                    ]
                  }
                ]
              },
              "active": {
                "anyOf": [
                  {
                    "type": "number"
                  },
                  {
                    "type": "string",
                    "enum": [
                      "Infinity",
                      "-Infinity",
                      "NaN"
                    ]
                  }
                ]
              },
              "disabled": {
                "anyOf": [
                  {
                    "type": "number"
                  },
                  {
                    "type": "string",
                    "enum": [
                      "Infinity",
                      "-Infinity",
                      "NaN"
                    ]
                  }
                ]
              }
            },
            "required": [
              "total",
              "active",
              "disabled"
            ],
            "additionalProperties": false
          },
          "invitations": {
            "type": "object",
            "properties": {
              "pending": {
                "anyOf": [
                  {
                    "type": "number"
                  },
                  {
                    "type": "string",
                    "enum": [
                      "Infinity",
                      "-Infinity",
                      "NaN"
                    ]
                  }
                ]
              },
              "expired": {
                "anyOf": [
                  {
                    "type": "number"
                  },
                  {
                    "type": "string",
                    "enum": [
                      "Infinity",
                      "-Infinity",
                      "NaN"
                    ]
                  }
                ]
              }
            },
            "required": [
              "pending",
              "expired"
            ],
            "additionalProperties": false
          },
          "prescribers": {
            "type": "object",
            "properties": {
              "total": {
                "anyOf": [
                  {
                    "type": "number"
                  },
                  {
                    "type": "string",
                    "enum": [
                      "Infinity",
                      "-Infinity",
                      "NaN"
                    ]
                  }
                ]
              },
              "active": {
                "anyOf": [
                  {
                    "type": "number"
                  },
                  {
                    "type": "string",
                    "enum": [
                      "Infinity",
                      "-Infinity",
                      "NaN"
                    ]
                  }
                ]
              }
            },
            "required": [
              "total",
              "active"
            ],
            "additionalProperties": false
          }
        },
        "required": [
          "object",
          "practiceId",
          "members",
          "invitations",
          "prescribers"
        ],
        "additionalProperties": false
      },
      "ListPracticeTeamMembersResponse": {
        "title": "ListPracticeTeamMembersResponse",
        "type": "object",
        "properties": {
          "data": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "id": {
                  "type": "string",
                  "pattern": "^mbr_[0-7][0-9a-hjkmnp-tv-z]{25}$",
                  "examples": [
                    "mbr_01j2y8m6jcc9tt24af5pw9x1bc"
                  ]
                },
                "externalId": {
                  "anyOf": [
                    {
                      "type": "string"
                    },
                    {
                      "type": "null"
                    }
                  ],
                  "description": "This integration's external ID for the accepted invitee in the API key's mode. Null for members invited outside this integration."
                },
                "name": {
                  "type": "string"
                },
                "email": {
                  "anyOf": [
                    {
                      "type": "string"
                    },
                    {
                      "type": "null"
                    }
                  ]
                },
                "locationIds": {
                  "type": "array",
                  "items": {
                    "type": "string",
                    "allOf": [
                      {
                        "pattern": "^loc_[0-7][0-9a-hjkmnp-tv-z]{25}$",
                        "examples": [
                          "loc_01j2y8m6jcc9tt24af5pw9x1bc"
                        ]
                      }
                    ]
                  }
                },
                "account": {
                  "type": "object",
                  "properties": {
                    "accountId": {
                      "type": "string"
                    },
                    "emailVerified": {
                      "type": "boolean"
                    },
                    "membershipId": {
                      "type": "string",
                      "allOf": [
                        {
                          "pattern": "^mbr_[0-7][0-9a-hjkmnp-tv-z]{25}$",
                          "examples": [
                            "mbr_01j2y8m6jcc9tt24af5pw9x1bc"
                          ]
                        }
                      ]
                    },
                    "membershipStatus": {
                      "type": "string"
                    },
                    "roles": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "id": {
                            "type": "string",
                            "allOf": [
                              {
                                "pattern": "^role_[0-7][0-9a-hjkmnp-tv-z]{25}$",
                                "examples": [
                                  "role_01j2y8m6jcc9tt24af5pw9x1bc"
                                ]
                              }
                            ]
                          },
                          "name": {
                            "type": "string"
                          },
                          "key": {
                            "anyOf": [
                              {
                                "type": "string"
                              },
                              {
                                "type": "null"
                              }
                            ]
                          }
                        },
                        "required": [
                          "id",
                          "name",
                          "key"
                        ],
                        "additionalProperties": false
                      }
                    },
                    "prescriberConnection": {
                      "anyOf": [
                        {
                          "type": "object",
                          "properties": {
                            "status": {
                              "type": "string"
                            },
                            "provider": {
                              "type": "object",
                              "properties": {
                                "id": {
                                  "type": "string",
                                  "allOf": [
                                    {
                                      "pattern": "^prov_[0-7][0-9a-hjkmnp-tv-z]{25}$",
                                      "examples": [
                                        "prov_01j2y8m6jcc9tt24af5pw9x1bc"
                                      ]
                                    }
                                  ]
                                },
                                "name": {
                                  "type": "string"
                                },
                                "legalName": {
                                  "type": "string"
                                },
                                "credentials": {
                                  "anyOf": [
                                    {
                                      "type": "string"
                                    },
                                    {
                                      "type": "null"
                                    }
                                  ]
                                },
                                "phone": {
                                  "anyOf": [
                                    {
                                      "type": "string"
                                    },
                                    {
                                      "type": "null"
                                    }
                                  ]
                                },
                                "address": {
                                  "anyOf": [
                                    {
                                      "type": "object",
                                      "properties": {
                                        "line1": {
                                          "type": "string"
                                        },
                                        "line2": {
                                          "anyOf": [
                                            {
                                              "type": "string"
                                            },
                                            {
                                              "type": "null"
                                            }
                                          ]
                                        },
                                        "city": {
                                          "type": "string"
                                        },
                                        "state": {
                                          "type": "string"
                                        },
                                        "postalCode": {
                                          "type": "string"
                                        },
                                        "country": {
                                          "type": "string"
                                        }
                                      },
                                      "required": [
                                        "line1",
                                        "city",
                                        "state",
                                        "postalCode",
                                        "country"
                                      ],
                                      "additionalProperties": false
                                    },
                                    {
                                      "type": "null"
                                    }
                                  ]
                                },
                                "npi": {
                                  "type": "string"
                                },
                                "practiceStatus": {
                                  "type": "string"
                                },
                                "licenses": {
                                  "type": "array",
                                  "items": {
                                    "type": "object",
                                    "properties": {
                                      "id": {
                                        "type": "string",
                                        "allOf": [
                                          {
                                            "pattern": "^lic_[0-7][0-9a-hjkmnp-tv-z]{25}$",
                                            "examples": [
                                              "lic_01j2y8m6jcc9tt24af5pw9x1bc"
                                            ]
                                          }
                                        ]
                                      },
                                      "state": {
                                        "type": "string"
                                      },
                                      "licenseNumber": {
                                        "type": "string"
                                      },
                                      "expiresAt": {
                                        "anyOf": [
                                          {
                                            "type": "string"
                                          },
                                          {
                                            "type": "null"
                                          }
                                        ]
                                      }
                                    },
                                    "required": [
                                      "id",
                                      "state",
                                      "licenseNumber",
                                      "expiresAt"
                                    ],
                                    "additionalProperties": false
                                  }
                                }
                              },
                              "required": [
                                "id",
                                "name",
                                "legalName",
                                "credentials",
                                "phone",
                                "address",
                                "npi",
                                "practiceStatus",
                                "licenses"
                              ],
                              "additionalProperties": false
                            }
                          },
                          "required": [
                            "status",
                            "provider"
                          ],
                          "additionalProperties": false
                        },
                        {
                          "type": "null"
                        }
                      ]
                    }
                  },
                  "required": [
                    "accountId",
                    "emailVerified",
                    "membershipId",
                    "membershipStatus",
                    "roles",
                    "prescriberConnection"
                  ],
                  "additionalProperties": false
                },
                "nextActions": {
                  "type": "array",
                  "items": {
                    "type": "string"
                  }
                }
              },
              "required": [
                "id",
                "externalId",
                "name",
                "email",
                "locationIds",
                "account",
                "nextActions"
              ],
              "additionalProperties": false
            }
          },
          "hasMore": {
            "type": "boolean"
          },
          "object": {
            "type": "string",
            "enum": [
              "list"
            ]
          },
          "url": {
            "type": "string"
          }
        },
        "required": [
          "data",
          "hasMore",
          "object",
          "url"
        ],
        "additionalProperties": false
      },
      "ListPracticeTeamPrescribersResponse": {
        "title": "ListPracticeTeamPrescribersResponse",
        "type": "object",
        "properties": {
          "data": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "id": {
                  "type": "string",
                  "allOf": [
                    {
                      "pattern": "^prov_[0-7][0-9a-hjkmnp-tv-z]{25}$",
                      "examples": [
                        "prov_01j2y8m6jcc9tt24af5pw9x1bc"
                      ]
                    }
                  ]
                },
                "name": {
                  "type": "string"
                },
                "legalName": {
                  "type": "string"
                },
                "credentials": {
                  "anyOf": [
                    {
                      "type": "string"
                    },
                    {
                      "type": "null"
                    }
                  ]
                },
                "phone": {
                  "anyOf": [
                    {
                      "type": "string"
                    },
                    {
                      "type": "null"
                    }
                  ]
                },
                "address": {
                  "anyOf": [
                    {
                      "type": "object",
                      "properties": {
                        "line1": {
                          "type": "string"
                        },
                        "line2": {
                          "anyOf": [
                            {
                              "type": "string"
                            },
                            {
                              "type": "null"
                            }
                          ]
                        },
                        "city": {
                          "type": "string"
                        },
                        "state": {
                          "type": "string"
                        },
                        "postalCode": {
                          "type": "string"
                        },
                        "country": {
                          "type": "string"
                        }
                      },
                      "required": [
                        "line1",
                        "city",
                        "state",
                        "postalCode",
                        "country"
                      ],
                      "additionalProperties": false
                    },
                    {
                      "type": "null"
                    }
                  ]
                },
                "npi": {
                  "type": "string"
                },
                "practiceStatus": {
                  "type": "string"
                },
                "licenses": {
                  "type": "array",
                  "items": {
                    "type": "object",
                    "properties": {
                      "id": {
                        "type": "string",
                        "allOf": [
                          {
                            "pattern": "^lic_[0-7][0-9a-hjkmnp-tv-z]{25}$",
                            "examples": [
                              "lic_01j2y8m6jcc9tt24af5pw9x1bc"
                            ]
                          }
                        ]
                      },
                      "state": {
                        "type": "string"
                      },
                      "licenseNumber": {
                        "type": "string"
                      },
                      "expiresAt": {
                        "anyOf": [
                          {
                            "type": "string"
                          },
                          {
                            "type": "null"
                          }
                        ]
                      }
                    },
                    "required": [
                      "id",
                      "state",
                      "licenseNumber",
                      "expiresAt"
                    ],
                    "additionalProperties": false
                  }
                }
              },
              "required": [
                "id",
                "name",
                "legalName",
                "credentials",
                "phone",
                "address",
                "npi",
                "practiceStatus",
                "licenses"
              ],
              "additionalProperties": false
            }
          },
          "hasMore": {
            "type": "boolean"
          },
          "object": {
            "type": "string",
            "enum": [
              "list"
            ]
          },
          "url": {
            "type": "string"
          }
        },
        "required": [
          "data",
          "hasMore",
          "object",
          "url"
        ],
        "additionalProperties": false
      },
      "GetPracticeTeamMemberResponse": {
        "title": "GetPracticeTeamMemberResponse",
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "pattern": "^mbr_[0-7][0-9a-hjkmnp-tv-z]{25}$",
            "examples": [
              "mbr_01j2y8m6jcc9tt24af5pw9x1bc"
            ]
          },
          "externalId": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "This integration's external ID for the accepted invitee in the API key's mode. Null for members invited outside this integration."
          },
          "name": {
            "type": "string"
          },
          "email": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ]
          },
          "locationIds": {
            "type": "array",
            "items": {
              "type": "string",
              "allOf": [
                {
                  "pattern": "^loc_[0-7][0-9a-hjkmnp-tv-z]{25}$",
                  "examples": [
                    "loc_01j2y8m6jcc9tt24af5pw9x1bc"
                  ]
                }
              ]
            }
          },
          "account": {
            "type": "object",
            "properties": {
              "accountId": {
                "type": "string"
              },
              "emailVerified": {
                "type": "boolean"
              },
              "membershipId": {
                "type": "string",
                "allOf": [
                  {
                    "pattern": "^mbr_[0-7][0-9a-hjkmnp-tv-z]{25}$",
                    "examples": [
                      "mbr_01j2y8m6jcc9tt24af5pw9x1bc"
                    ]
                  }
                ]
              },
              "membershipStatus": {
                "type": "string"
              },
              "roles": {
                "type": "array",
                "items": {
                  "type": "object",
                  "properties": {
                    "id": {
                      "type": "string",
                      "allOf": [
                        {
                          "pattern": "^role_[0-7][0-9a-hjkmnp-tv-z]{25}$",
                          "examples": [
                            "role_01j2y8m6jcc9tt24af5pw9x1bc"
                          ]
                        }
                      ]
                    },
                    "name": {
                      "type": "string"
                    },
                    "key": {
                      "anyOf": [
                        {
                          "type": "string"
                        },
                        {
                          "type": "null"
                        }
                      ]
                    }
                  },
                  "required": [
                    "id",
                    "name",
                    "key"
                  ],
                  "additionalProperties": false
                }
              },
              "prescriberConnection": {
                "anyOf": [
                  {
                    "type": "object",
                    "properties": {
                      "status": {
                        "type": "string"
                      },
                      "provider": {
                        "type": "object",
                        "properties": {
                          "id": {
                            "type": "string",
                            "allOf": [
                              {
                                "pattern": "^prov_[0-7][0-9a-hjkmnp-tv-z]{25}$",
                                "examples": [
                                  "prov_01j2y8m6jcc9tt24af5pw9x1bc"
                                ]
                              }
                            ]
                          },
                          "name": {
                            "type": "string"
                          },
                          "legalName": {
                            "type": "string"
                          },
                          "credentials": {
                            "anyOf": [
                              {
                                "type": "string"
                              },
                              {
                                "type": "null"
                              }
                            ]
                          },
                          "phone": {
                            "anyOf": [
                              {
                                "type": "string"
                              },
                              {
                                "type": "null"
                              }
                            ]
                          },
                          "address": {
                            "anyOf": [
                              {
                                "type": "object",
                                "properties": {
                                  "line1": {
                                    "type": "string"
                                  },
                                  "line2": {
                                    "anyOf": [
                                      {
                                        "type": "string"
                                      },
                                      {
                                        "type": "null"
                                      }
                                    ]
                                  },
                                  "city": {
                                    "type": "string"
                                  },
                                  "state": {
                                    "type": "string"
                                  },
                                  "postalCode": {
                                    "type": "string"
                                  },
                                  "country": {
                                    "type": "string"
                                  }
                                },
                                "required": [
                                  "line1",
                                  "city",
                                  "state",
                                  "postalCode",
                                  "country"
                                ],
                                "additionalProperties": false
                              },
                              {
                                "type": "null"
                              }
                            ]
                          },
                          "npi": {
                            "type": "string"
                          },
                          "practiceStatus": {
                            "type": "string"
                          },
                          "licenses": {
                            "type": "array",
                            "items": {
                              "type": "object",
                              "properties": {
                                "id": {
                                  "type": "string",
                                  "allOf": [
                                    {
                                      "pattern": "^lic_[0-7][0-9a-hjkmnp-tv-z]{25}$",
                                      "examples": [
                                        "lic_01j2y8m6jcc9tt24af5pw9x1bc"
                                      ]
                                    }
                                  ]
                                },
                                "state": {
                                  "type": "string"
                                },
                                "licenseNumber": {
                                  "type": "string"
                                },
                                "expiresAt": {
                                  "anyOf": [
                                    {
                                      "type": "string"
                                    },
                                    {
                                      "type": "null"
                                    }
                                  ]
                                }
                              },
                              "required": [
                                "id",
                                "state",
                                "licenseNumber",
                                "expiresAt"
                              ],
                              "additionalProperties": false
                            }
                          }
                        },
                        "required": [
                          "id",
                          "name",
                          "legalName",
                          "credentials",
                          "phone",
                          "address",
                          "npi",
                          "practiceStatus",
                          "licenses"
                        ],
                        "additionalProperties": false
                      }
                    },
                    "required": [
                      "status",
                      "provider"
                    ],
                    "additionalProperties": false
                  },
                  {
                    "type": "null"
                  }
                ]
              }
            },
            "required": [
              "accountId",
              "emailVerified",
              "membershipId",
              "membershipStatus",
              "roles",
              "prescriberConnection"
            ],
            "additionalProperties": false
          },
          "nextActions": {
            "type": "array",
            "items": {
              "type": "string"
            }
          }
        },
        "required": [
          "id",
          "externalId",
          "name",
          "email",
          "locationIds",
          "account",
          "nextActions"
        ],
        "additionalProperties": false
      },
      "UpdatePracticeTeamMemberRequest": {
        "type": "object",
        "properties": {
          "role": {
            "anyOf": [
              {
                "type": "string",
                "enum": [
                  "owner",
                  "administrator",
                  "prescriber",
                  "clinical_staff",
                  "billing",
                  "developer"
                ]
              },
              {
                "type": "null"
              }
            ]
          },
          "roles": {
            "anyOf": [
              {
                "type": "array",
                "items": {
                  "type": "string",
                  "enum": [
                    "owner",
                    "administrator",
                    "prescriber",
                    "clinical_staff",
                    "billing",
                    "developer"
                  ]
                },
                "minItems": 1,
                "maxItems": 6
              },
              {
                "type": "null"
              }
            ]
          },
          "status": {
            "anyOf": [
              {
                "type": "string",
                "enum": [
                  "active",
                  "disabled"
                ]
              },
              {
                "type": "null"
              }
            ]
          },
          "locationIds": {
            "anyOf": [
              {
                "type": "array",
                "items": {
                  "type": "string",
                  "pattern": "^loc_[0-7][0-9a-hjkmnp-tv-z]{25}$",
                  "examples": [
                    "loc_01j2y8m6jcc9tt24af5pw9x1bc"
                  ]
                },
                "maxItems": 100
              },
              {
                "type": "null"
              }
            ],
            "description": "Replace location access. An empty array grants access to all practice locations."
          }
        },
        "additionalProperties": false,
        "title": "UpdatePracticeTeamMemberRequest"
      },
      "UpdatePracticeTeamMemberResponse": {
        "title": "UpdatePracticeTeamMemberResponse",
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "pattern": "^mbr_[0-7][0-9a-hjkmnp-tv-z]{25}$",
            "examples": [
              "mbr_01j2y8m6jcc9tt24af5pw9x1bc"
            ]
          },
          "externalId": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "This integration's external ID for the accepted invitee in the API key's mode. Null for members invited outside this integration."
          },
          "name": {
            "type": "string"
          },
          "email": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ]
          },
          "locationIds": {
            "type": "array",
            "items": {
              "type": "string",
              "allOf": [
                {
                  "pattern": "^loc_[0-7][0-9a-hjkmnp-tv-z]{25}$",
                  "examples": [
                    "loc_01j2y8m6jcc9tt24af5pw9x1bc"
                  ]
                }
              ]
            }
          },
          "account": {
            "type": "object",
            "properties": {
              "accountId": {
                "type": "string"
              },
              "emailVerified": {
                "type": "boolean"
              },
              "membershipId": {
                "type": "string",
                "allOf": [
                  {
                    "pattern": "^mbr_[0-7][0-9a-hjkmnp-tv-z]{25}$",
                    "examples": [
                      "mbr_01j2y8m6jcc9tt24af5pw9x1bc"
                    ]
                  }
                ]
              },
              "membershipStatus": {
                "type": "string"
              },
              "roles": {
                "type": "array",
                "items": {
                  "type": "object",
                  "properties": {
                    "id": {
                      "type": "string",
                      "allOf": [
                        {
                          "pattern": "^role_[0-7][0-9a-hjkmnp-tv-z]{25}$",
                          "examples": [
                            "role_01j2y8m6jcc9tt24af5pw9x1bc"
                          ]
                        }
                      ]
                    },
                    "name": {
                      "type": "string"
                    },
                    "key": {
                      "anyOf": [
                        {
                          "type": "string"
                        },
                        {
                          "type": "null"
                        }
                      ]
                    }
                  },
                  "required": [
                    "id",
                    "name",
                    "key"
                  ],
                  "additionalProperties": false
                }
              },
              "prescriberConnection": {
                "anyOf": [
                  {
                    "type": "object",
                    "properties": {
                      "status": {
                        "type": "string"
                      },
                      "provider": {
                        "type": "object",
                        "properties": {
                          "id": {
                            "type": "string",
                            "allOf": [
                              {
                                "pattern": "^prov_[0-7][0-9a-hjkmnp-tv-z]{25}$",
                                "examples": [
                                  "prov_01j2y8m6jcc9tt24af5pw9x1bc"
                                ]
                              }
                            ]
                          },
                          "name": {
                            "type": "string"
                          },
                          "legalName": {
                            "type": "string"
                          },
                          "credentials": {
                            "anyOf": [
                              {
                                "type": "string"
                              },
                              {
                                "type": "null"
                              }
                            ]
                          },
                          "phone": {
                            "anyOf": [
                              {
                                "type": "string"
                              },
                              {
                                "type": "null"
                              }
                            ]
                          },
                          "address": {
                            "anyOf": [
                              {
                                "type": "object",
                                "properties": {
                                  "line1": {
                                    "type": "string"
                                  },
                                  "line2": {
                                    "anyOf": [
                                      {
                                        "type": "string"
                                      },
                                      {
                                        "type": "null"
                                      }
                                    ]
                                  },
                                  "city": {
                                    "type": "string"
                                  },
                                  "state": {
                                    "type": "string"
                                  },
                                  "postalCode": {
                                    "type": "string"
                                  },
                                  "country": {
                                    "type": "string"
                                  }
                                },
                                "required": [
                                  "line1",
                                  "city",
                                  "state",
                                  "postalCode",
                                  "country"
                                ],
                                "additionalProperties": false
                              },
                              {
                                "type": "null"
                              }
                            ]
                          },
                          "npi": {
                            "type": "string"
                          },
                          "practiceStatus": {
                            "type": "string"
                          },
                          "licenses": {
                            "type": "array",
                            "items": {
                              "type": "object",
                              "properties": {
                                "id": {
                                  "type": "string",
                                  "allOf": [
                                    {
                                      "pattern": "^lic_[0-7][0-9a-hjkmnp-tv-z]{25}$",
                                      "examples": [
                                        "lic_01j2y8m6jcc9tt24af5pw9x1bc"
                                      ]
                                    }
                                  ]
                                },
                                "state": {
                                  "type": "string"
                                },
                                "licenseNumber": {
                                  "type": "string"
                                },
                                "expiresAt": {
                                  "anyOf": [
                                    {
                                      "type": "string"
                                    },
                                    {
                                      "type": "null"
                                    }
                                  ]
                                }
                              },
                              "required": [
                                "id",
                                "state",
                                "licenseNumber",
                                "expiresAt"
                              ],
                              "additionalProperties": false
                            }
                          }
                        },
                        "required": [
                          "id",
                          "name",
                          "legalName",
                          "credentials",
                          "phone",
                          "address",
                          "npi",
                          "practiceStatus",
                          "licenses"
                        ],
                        "additionalProperties": false
                      }
                    },
                    "required": [
                      "status",
                      "provider"
                    ],
                    "additionalProperties": false
                  },
                  {
                    "type": "null"
                  }
                ]
              }
            },
            "required": [
              "accountId",
              "emailVerified",
              "membershipId",
              "membershipStatus",
              "roles",
              "prescriberConnection"
            ],
            "additionalProperties": false
          },
          "nextActions": {
            "type": "array",
            "items": {
              "type": "string"
            }
          }
        },
        "required": [
          "id",
          "externalId",
          "name",
          "email",
          "locationIds",
          "account",
          "nextActions"
        ],
        "additionalProperties": false
      },
      "GetPracticeTeamPrescriberResponse": {
        "title": "GetPracticeTeamPrescriberResponse",
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "pattern": "^prov_[0-7][0-9a-hjkmnp-tv-z]{25}$",
            "examples": [
              "prov_01j2y8m6jcc9tt24af5pw9x1bc"
            ]
          },
          "name": {
            "type": "string"
          },
          "legalName": {
            "type": "string"
          },
          "credentials": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ]
          },
          "phone": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ]
          },
          "address": {
            "anyOf": [
              {
                "type": "object",
                "properties": {
                  "line1": {
                    "type": "string"
                  },
                  "line2": {
                    "anyOf": [
                      {
                        "type": "string"
                      },
                      {
                        "type": "null"
                      }
                    ]
                  },
                  "city": {
                    "type": "string"
                  },
                  "state": {
                    "type": "string"
                  },
                  "postalCode": {
                    "type": "string"
                  },
                  "country": {
                    "type": "string"
                  }
                },
                "required": [
                  "line1",
                  "city",
                  "state",
                  "postalCode",
                  "country"
                ],
                "additionalProperties": false
              },
              {
                "type": "null"
              }
            ]
          },
          "npi": {
            "type": "string"
          },
          "practiceStatus": {
            "type": "string"
          },
          "licenses": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "id": {
                  "type": "string",
                  "allOf": [
                    {
                      "pattern": "^lic_[0-7][0-9a-hjkmnp-tv-z]{25}$",
                      "examples": [
                        "lic_01j2y8m6jcc9tt24af5pw9x1bc"
                      ]
                    }
                  ]
                },
                "state": {
                  "type": "string"
                },
                "licenseNumber": {
                  "type": "string"
                },
                "expiresAt": {
                  "anyOf": [
                    {
                      "type": "string"
                    },
                    {
                      "type": "null"
                    }
                  ]
                }
              },
              "required": [
                "id",
                "state",
                "licenseNumber",
                "expiresAt"
              ],
              "additionalProperties": false
            }
          }
        },
        "required": [
          "id",
          "name",
          "legalName",
          "credentials",
          "phone",
          "address",
          "npi",
          "practiceStatus",
          "licenses"
        ],
        "additionalProperties": false
      },
      "UpdatePracticeTeamPrescriberRequest": {
        "type": "object",
        "properties": {
          "displayName": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ]
          },
          "legalName": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ]
          },
          "credentials": {
            "anyOf": [
              {
                "anyOf": [
                  {
                    "type": "string"
                  },
                  {
                    "type": "null"
                  }
                ]
              },
              {
                "type": "null"
              }
            ]
          },
          "phone": {
            "anyOf": [
              {
                "anyOf": [
                  {
                    "type": "string"
                  },
                  {
                    "type": "null"
                  }
                ]
              },
              {
                "type": "null"
              }
            ]
          },
          "address": {
            "anyOf": [
              {
                "anyOf": [
                  {
                    "type": "object",
                    "properties": {
                      "city": {
                        "type": "string"
                      },
                      "country": {
                        "type": "string"
                      },
                      "line1": {
                        "type": "string"
                      },
                      "line2": {
                        "anyOf": [
                          {
                            "type": "string"
                          },
                          {
                            "type": "null"
                          }
                        ]
                      },
                      "postalCode": {
                        "type": "string"
                      },
                      "state": {
                        "type": "string"
                      }
                    },
                    "required": [
                      "city",
                      "country",
                      "line1",
                      "postalCode",
                      "state"
                    ],
                    "additionalProperties": false
                  },
                  {
                    "type": "null"
                  }
                ]
              },
              {
                "type": "null"
              }
            ]
          },
          "practiceStatus": {
            "type": "string",
            "enum": [
              "active",
              "inactive"
            ]
          }
        },
        "additionalProperties": false,
        "title": "UpdatePracticeTeamPrescriberRequest"
      },
      "UpdatePracticeTeamPrescriberResponse": {
        "title": "UpdatePracticeTeamPrescriberResponse",
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "pattern": "^prov_[0-7][0-9a-hjkmnp-tv-z]{25}$",
            "examples": [
              "prov_01j2y8m6jcc9tt24af5pw9x1bc"
            ]
          },
          "name": {
            "type": "string"
          },
          "legalName": {
            "type": "string"
          },
          "credentials": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ]
          },
          "phone": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ]
          },
          "address": {
            "anyOf": [
              {
                "type": "object",
                "properties": {
                  "line1": {
                    "type": "string"
                  },
                  "line2": {
                    "anyOf": [
                      {
                        "type": "string"
                      },
                      {
                        "type": "null"
                      }
                    ]
                  },
                  "city": {
                    "type": "string"
                  },
                  "state": {
                    "type": "string"
                  },
                  "postalCode": {
                    "type": "string"
                  },
                  "country": {
                    "type": "string"
                  }
                },
                "required": [
                  "line1",
                  "city",
                  "state",
                  "postalCode",
                  "country"
                ],
                "additionalProperties": false
              },
              {
                "type": "null"
              }
            ]
          },
          "npi": {
            "type": "string"
          },
          "practiceStatus": {
            "type": "string"
          },
          "licenses": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "id": {
                  "type": "string",
                  "allOf": [
                    {
                      "pattern": "^lic_[0-7][0-9a-hjkmnp-tv-z]{25}$",
                      "examples": [
                        "lic_01j2y8m6jcc9tt24af5pw9x1bc"
                      ]
                    }
                  ]
                },
                "state": {
                  "type": "string"
                },
                "licenseNumber": {
                  "type": "string"
                },
                "expiresAt": {
                  "anyOf": [
                    {
                      "type": "string"
                    },
                    {
                      "type": "null"
                    }
                  ]
                }
              },
              "required": [
                "id",
                "state",
                "licenseNumber",
                "expiresAt"
              ],
              "additionalProperties": false
            }
          }
        },
        "required": [
          "id",
          "name",
          "legalName",
          "credentials",
          "phone",
          "address",
          "npi",
          "practiceStatus",
          "licenses"
        ],
        "additionalProperties": false
      },
      "CreatePracticeTeamLicenseRequest": {
        "type": "object",
        "properties": {
          "state": {
            "type": "string"
          },
          "licenseNumber": {
            "type": "string"
          },
          "expiresAt": {
            "anyOf": [
              {
                "anyOf": [
                  {
                    "type": "string"
                  },
                  {
                    "type": "null"
                  }
                ]
              },
              {
                "type": "null"
              }
            ]
          }
        },
        "required": [
          "state",
          "licenseNumber"
        ],
        "additionalProperties": false,
        "title": "CreatePracticeTeamLicenseRequest"
      },
      "CreatePracticeTeamLicenseResponse": {
        "title": "CreatePracticeTeamLicenseResponse",
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "pattern": "^lic_[0-7][0-9a-hjkmnp-tv-z]{25}$",
            "examples": [
              "lic_01j2y8m6jcc9tt24af5pw9x1bc"
            ]
          },
          "state": {
            "type": "string"
          },
          "licenseNumber": {
            "type": "string"
          },
          "expiresAt": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ]
          }
        },
        "required": [
          "id",
          "state",
          "licenseNumber",
          "expiresAt"
        ],
        "additionalProperties": false
      },
      "UpdatePracticeTeamLicenseRequest": {
        "type": "object",
        "properties": {
          "state": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ]
          },
          "licenseNumber": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ]
          },
          "expiresAt": {
            "anyOf": [
              {
                "anyOf": [
                  {
                    "type": "string"
                  },
                  {
                    "type": "null"
                  }
                ]
              },
              {
                "type": "null"
              }
            ]
          }
        },
        "additionalProperties": false,
        "title": "UpdatePracticeTeamLicenseRequest"
      },
      "UpdatePracticeTeamLicenseResponse": {
        "title": "UpdatePracticeTeamLicenseResponse",
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "pattern": "^lic_[0-7][0-9a-hjkmnp-tv-z]{25}$",
            "examples": [
              "lic_01j2y8m6jcc9tt24af5pw9x1bc"
            ]
          },
          "state": {
            "type": "string"
          },
          "licenseNumber": {
            "type": "string"
          },
          "expiresAt": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ]
          }
        },
        "required": [
          "id",
          "state",
          "licenseNumber",
          "expiresAt"
        ],
        "additionalProperties": false
      },
      "GetPracticeTeamInvitationResponse": {
        "title": "GetPracticeTeamInvitationResponse",
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "pattern": "^invite_[0-7][0-9a-hjkmnp-tv-z]{25}$",
            "examples": [
              "invite_01j2y8m6jcc9tt24af5pw9x1bc"
            ]
          },
          "object": {
            "type": "string",
            "enum": [
              "team_invitation"
            ]
          },
          "email": {
            "type": "string"
          },
          "name": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ]
          },
          "status": {
            "type": "string",
            "enum": [
              "accepted",
              "declined",
              "pending",
              "expired",
              "revoked"
            ]
          },
          "roles": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "id": {
                  "type": "string",
                  "allOf": [
                    {
                      "pattern": "^role_[0-7][0-9a-hjkmnp-tv-z]{25}$",
                      "examples": [
                        "role_01j2y8m6jcc9tt24af5pw9x1bc"
                      ]
                    }
                  ]
                },
                "name": {
                  "type": "string"
                },
                "key": {
                  "anyOf": [
                    {
                      "type": "string"
                    },
                    {
                      "type": "null"
                    }
                  ]
                }
              },
              "required": [
                "id",
                "name",
                "key"
              ],
              "additionalProperties": false
            }
          },
          "locationIds": {
            "type": "array",
            "items": {
              "type": "string",
              "allOf": [
                {
                  "pattern": "^loc_[0-7][0-9a-hjkmnp-tv-z]{25}$",
                  "examples": [
                    "loc_01j2y8m6jcc9tt24af5pw9x1bc"
                  ]
                }
              ]
            }
          },
          "createdAt": {
            "type": "string"
          },
          "expiresAt": {
            "type": "string"
          },
          "acceptedAt": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ]
          },
          "userId": {
            "anyOf": [
              {
                "type": "string",
                "allOf": [
                  {
                    "pattern": "^user_[0-7][0-9a-hjkmnp-tv-z]{25}$",
                    "examples": [
                      "user_01j2y8m6jcc9tt24af5pw9x1bc"
                    ]
                  }
                ]
              },
              {
                "type": "null"
              }
            ],
            "description": "This integration's mode-scoped user ID, used for draft attribution and sessions after acceptance. Null for invitations outside this integration."
          },
          "externalId": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ]
          },
          "memberId": {
            "anyOf": [
              {
                "type": "string",
                "allOf": [
                  {
                    "pattern": "^mbr_[0-7][0-9a-hjkmnp-tv-z]{25}$",
                    "examples": [
                      "mbr_01j2y8m6jcc9tt24af5pw9x1bc"
                    ]
                  }
                ]
              },
              {
                "type": "null"
              }
            ]
          },
          "prescriberId": {
            "anyOf": [
              {
                "type": "string",
                "allOf": [
                  {
                    "pattern": "^prov_[0-7][0-9a-hjkmnp-tv-z]{25}$",
                    "examples": [
                      "prov_01j2y8m6jcc9tt24af5pw9x1bc"
                    ]
                  }
                ]
              },
              {
                "type": "null"
              }
            ]
          },
          "person": {
            "anyOf": [
              {
                "type": "object",
                "properties": {
                  "id": {
                    "type": "string",
                    "allOf": [
                      {
                        "pattern": "^user_[0-7][0-9a-hjkmnp-tv-z]{25}$",
                        "examples": [
                          "user_01j2y8m6jcc9tt24af5pw9x1bc"
                        ]
                      }
                    ]
                  },
                  "object": {
                    "type": "string",
                    "enum": [
                      "team_person"
                    ]
                  },
                  "externalId": {
                    "type": "string"
                  },
                  "email": {
                    "anyOf": [
                      {
                        "type": "string"
                      },
                      {
                        "type": "null"
                      }
                    ]
                  },
                  "name": {
                    "anyOf": [
                      {
                        "type": "string"
                      },
                      {
                        "type": "null"
                      }
                    ]
                  },
                  "status": {
                    "type": "string"
                  },
                  "invitation": {
                    "anyOf": [
                      {
                        "type": "object",
                        "properties": {
                          "id": {
                            "type": "string",
                            "allOf": [
                              {
                                "pattern": "^invite_[0-7][0-9a-hjkmnp-tv-z]{25}$",
                                "examples": [
                                  "invite_01j2y8m6jcc9tt24af5pw9x1bc"
                                ]
                              }
                            ]
                          },
                          "status": {
                            "type": "string",
                            "enum": [
                              "accepted",
                              "declined",
                              "pending",
                              "expired",
                              "revoked"
                            ]
                          },
                          "expiresAt": {
                            "type": "string"
                          },
                          "roles": {
                            "type": "array",
                            "items": {
                              "type": "object",
                              "properties": {
                                "id": {
                                  "type": "string",
                                  "allOf": [
                                    {
                                      "pattern": "^role_[0-7][0-9a-hjkmnp-tv-z]{25}$",
                                      "examples": [
                                        "role_01j2y8m6jcc9tt24af5pw9x1bc"
                                      ]
                                    }
                                  ]
                                },
                                "name": {
                                  "type": "string"
                                },
                                "key": {
                                  "anyOf": [
                                    {
                                      "type": "string"
                                    },
                                    {
                                      "type": "null"
                                    }
                                  ]
                                }
                              },
                              "required": [
                                "id",
                                "name",
                                "key"
                              ],
                              "additionalProperties": false
                            }
                          }
                        },
                        "required": [
                          "id",
                          "status",
                          "expiresAt",
                          "roles"
                        ],
                        "additionalProperties": false
                      },
                      {
                        "type": "null"
                      }
                    ]
                  },
                  "account": {
                    "anyOf": [
                      {
                        "type": "object",
                        "properties": {
                          "accountId": {
                            "type": "string"
                          },
                          "emailVerified": {
                            "type": "boolean"
                          },
                          "membershipId": {
                            "type": "string",
                            "allOf": [
                              {
                                "pattern": "^mbr_[0-7][0-9a-hjkmnp-tv-z]{25}$",
                                "examples": [
                                  "mbr_01j2y8m6jcc9tt24af5pw9x1bc"
                                ]
                              }
                            ]
                          },
                          "membershipStatus": {
                            "type": "string"
                          },
                          "roles": {
                            "type": "array",
                            "items": {
                              "type": "object",
                              "properties": {
                                "id": {
                                  "type": "string",
                                  "allOf": [
                                    {
                                      "pattern": "^role_[0-7][0-9a-hjkmnp-tv-z]{25}$",
                                      "examples": [
                                        "role_01j2y8m6jcc9tt24af5pw9x1bc"
                                      ]
                                    }
                                  ]
                                },
                                "name": {
                                  "type": "string"
                                },
                                "key": {
                                  "anyOf": [
                                    {
                                      "type": "string"
                                    },
                                    {
                                      "type": "null"
                                    }
                                  ]
                                }
                              },
                              "required": [
                                "id",
                                "name",
                                "key"
                              ],
                              "additionalProperties": false
                            }
                          },
                          "prescriberConnection": {
                            "anyOf": [
                              {
                                "type": "object",
                                "properties": {
                                  "status": {
                                    "type": "string"
                                  },
                                  "provider": {
                                    "type": "object",
                                    "properties": {
                                      "id": {
                                        "type": "string",
                                        "allOf": [
                                          {
                                            "pattern": "^prov_[0-7][0-9a-hjkmnp-tv-z]{25}$",
                                            "examples": [
                                              "prov_01j2y8m6jcc9tt24af5pw9x1bc"
                                            ]
                                          }
                                        ]
                                      },
                                      "name": {
                                        "type": "string"
                                      },
                                      "legalName": {
                                        "type": "string"
                                      },
                                      "credentials": {
                                        "anyOf": [
                                          {
                                            "type": "string"
                                          },
                                          {
                                            "type": "null"
                                          }
                                        ]
                                      },
                                      "phone": {
                                        "anyOf": [
                                          {
                                            "type": "string"
                                          },
                                          {
                                            "type": "null"
                                          }
                                        ]
                                      },
                                      "address": {
                                        "anyOf": [
                                          {
                                            "type": "object",
                                            "properties": {
                                              "line1": {
                                                "type": "string"
                                              },
                                              "line2": {
                                                "anyOf": [
                                                  {
                                                    "type": "string"
                                                  },
                                                  {
                                                    "type": "null"
                                                  }
                                                ]
                                              },
                                              "city": {
                                                "type": "string"
                                              },
                                              "state": {
                                                "type": "string"
                                              },
                                              "postalCode": {
                                                "type": "string"
                                              },
                                              "country": {
                                                "type": "string"
                                              }
                                            },
                                            "required": [
                                              "line1",
                                              "city",
                                              "state",
                                              "postalCode",
                                              "country"
                                            ],
                                            "additionalProperties": false
                                          },
                                          {
                                            "type": "null"
                                          }
                                        ]
                                      },
                                      "npi": {
                                        "type": "string"
                                      },
                                      "practiceStatus": {
                                        "type": "string"
                                      },
                                      "licenses": {
                                        "type": "array",
                                        "items": {
                                          "type": "object",
                                          "properties": {
                                            "id": {
                                              "type": "string",
                                              "allOf": [
                                                {
                                                  "pattern": "^lic_[0-7][0-9a-hjkmnp-tv-z]{25}$",
                                                  "examples": [
                                                    "lic_01j2y8m6jcc9tt24af5pw9x1bc"
                                                  ]
                                                }
                                              ]
                                            },
                                            "state": {
                                              "type": "string"
                                            },
                                            "licenseNumber": {
                                              "type": "string"
                                            },
                                            "expiresAt": {
                                              "anyOf": [
                                                {
                                                  "type": "string"
                                                },
                                                {
                                                  "type": "null"
                                                }
                                              ]
                                            }
                                          },
                                          "required": [
                                            "id",
                                            "state",
                                            "licenseNumber",
                                            "expiresAt"
                                          ],
                                          "additionalProperties": false
                                        }
                                      }
                                    },
                                    "required": [
                                      "id",
                                      "name",
                                      "legalName",
                                      "credentials",
                                      "phone",
                                      "address",
                                      "npi",
                                      "practiceStatus",
                                      "licenses"
                                    ],
                                    "additionalProperties": false
                                  }
                                },
                                "required": [
                                  "status",
                                  "provider"
                                ],
                                "additionalProperties": false
                              },
                              {
                                "type": "null"
                              }
                            ]
                          }
                        },
                        "required": [
                          "accountId",
                          "emailVerified",
                          "membershipId",
                          "membershipStatus",
                          "roles",
                          "prescriberConnection"
                        ],
                        "additionalProperties": false
                      },
                      {
                        "type": "null"
                      }
                    ]
                  },
                  "nextActions": {
                    "type": "array",
                    "items": {
                      "type": "string"
                    }
                  }
                },
                "required": [
                  "id",
                  "object",
                  "externalId",
                  "email",
                  "name",
                  "status",
                  "invitation",
                  "account",
                  "nextActions"
                ],
                "additionalProperties": false
              },
              {
                "type": "null"
              }
            ],
            "description": "This integration's current onboarding and account-connection state. Null for invitations outside this integration."
          }
        },
        "required": [
          "id",
          "object",
          "email",
          "name",
          "status",
          "roles",
          "locationIds",
          "createdAt",
          "expiresAt",
          "acceptedAt",
          "userId",
          "externalId",
          "memberId",
          "prescriberId",
          "person"
        ],
        "additionalProperties": false
      },
      "RevokePracticeTeamInvitationResponse": {
        "title": "RevokePracticeTeamInvitationResponse",
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "pattern": "^invite_[0-7][0-9a-hjkmnp-tv-z]{25}$",
            "examples": [
              "invite_01j2y8m6jcc9tt24af5pw9x1bc"
            ]
          },
          "object": {
            "type": "string",
            "enum": [
              "team_invitation"
            ]
          },
          "email": {
            "type": "string"
          },
          "name": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ]
          },
          "status": {
            "type": "string",
            "enum": [
              "accepted",
              "declined",
              "pending",
              "expired",
              "revoked"
            ]
          },
          "roles": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "id": {
                  "type": "string",
                  "allOf": [
                    {
                      "pattern": "^role_[0-7][0-9a-hjkmnp-tv-z]{25}$",
                      "examples": [
                        "role_01j2y8m6jcc9tt24af5pw9x1bc"
                      ]
                    }
                  ]
                },
                "name": {
                  "type": "string"
                },
                "key": {
                  "anyOf": [
                    {
                      "type": "string"
                    },
                    {
                      "type": "null"
                    }
                  ]
                }
              },
              "required": [
                "id",
                "name",
                "key"
              ],
              "additionalProperties": false
            }
          },
          "locationIds": {
            "type": "array",
            "items": {
              "type": "string",
              "allOf": [
                {
                  "pattern": "^loc_[0-7][0-9a-hjkmnp-tv-z]{25}$",
                  "examples": [
                    "loc_01j2y8m6jcc9tt24af5pw9x1bc"
                  ]
                }
              ]
            }
          },
          "createdAt": {
            "type": "string"
          },
          "expiresAt": {
            "type": "string"
          },
          "acceptedAt": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ]
          },
          "userId": {
            "anyOf": [
              {
                "type": "string",
                "allOf": [
                  {
                    "pattern": "^user_[0-7][0-9a-hjkmnp-tv-z]{25}$",
                    "examples": [
                      "user_01j2y8m6jcc9tt24af5pw9x1bc"
                    ]
                  }
                ]
              },
              {
                "type": "null"
              }
            ],
            "description": "This integration's mode-scoped user ID, used for draft attribution and sessions after acceptance. Null for invitations outside this integration."
          },
          "externalId": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ]
          },
          "memberId": {
            "anyOf": [
              {
                "type": "string",
                "allOf": [
                  {
                    "pattern": "^mbr_[0-7][0-9a-hjkmnp-tv-z]{25}$",
                    "examples": [
                      "mbr_01j2y8m6jcc9tt24af5pw9x1bc"
                    ]
                  }
                ]
              },
              {
                "type": "null"
              }
            ]
          },
          "prescriberId": {
            "anyOf": [
              {
                "type": "string",
                "allOf": [
                  {
                    "pattern": "^prov_[0-7][0-9a-hjkmnp-tv-z]{25}$",
                    "examples": [
                      "prov_01j2y8m6jcc9tt24af5pw9x1bc"
                    ]
                  }
                ]
              },
              {
                "type": "null"
              }
            ]
          },
          "person": {
            "anyOf": [
              {
                "type": "object",
                "properties": {
                  "id": {
                    "type": "string",
                    "allOf": [
                      {
                        "pattern": "^user_[0-7][0-9a-hjkmnp-tv-z]{25}$",
                        "examples": [
                          "user_01j2y8m6jcc9tt24af5pw9x1bc"
                        ]
                      }
                    ]
                  },
                  "object": {
                    "type": "string",
                    "enum": [
                      "team_person"
                    ]
                  },
                  "externalId": {
                    "type": "string"
                  },
                  "email": {
                    "anyOf": [
                      {
                        "type": "string"
                      },
                      {
                        "type": "null"
                      }
                    ]
                  },
                  "name": {
                    "anyOf": [
                      {
                        "type": "string"
                      },
                      {
                        "type": "null"
                      }
                    ]
                  },
                  "status": {
                    "type": "string"
                  },
                  "invitation": {
                    "anyOf": [
                      {
                        "type": "object",
                        "properties": {
                          "id": {
                            "type": "string",
                            "allOf": [
                              {
                                "pattern": "^invite_[0-7][0-9a-hjkmnp-tv-z]{25}$",
                                "examples": [
                                  "invite_01j2y8m6jcc9tt24af5pw9x1bc"
                                ]
                              }
                            ]
                          },
                          "status": {
                            "type": "string",
                            "enum": [
                              "accepted",
                              "declined",
                              "pending",
                              "expired",
                              "revoked"
                            ]
                          },
                          "expiresAt": {
                            "type": "string"
                          },
                          "roles": {
                            "type": "array",
                            "items": {
                              "type": "object",
                              "properties": {
                                "id": {
                                  "type": "string",
                                  "allOf": [
                                    {
                                      "pattern": "^role_[0-7][0-9a-hjkmnp-tv-z]{25}$",
                                      "examples": [
                                        "role_01j2y8m6jcc9tt24af5pw9x1bc"
                                      ]
                                    }
                                  ]
                                },
                                "name": {
                                  "type": "string"
                                },
                                "key": {
                                  "anyOf": [
                                    {
                                      "type": "string"
                                    },
                                    {
                                      "type": "null"
                                    }
                                  ]
                                }
                              },
                              "required": [
                                "id",
                                "name",
                                "key"
                              ],
                              "additionalProperties": false
                            }
                          }
                        },
                        "required": [
                          "id",
                          "status",
                          "expiresAt",
                          "roles"
                        ],
                        "additionalProperties": false
                      },
                      {
                        "type": "null"
                      }
                    ]
                  },
                  "account": {
                    "anyOf": [
                      {
                        "type": "object",
                        "properties": {
                          "accountId": {
                            "type": "string"
                          },
                          "emailVerified": {
                            "type": "boolean"
                          },
                          "membershipId": {
                            "type": "string",
                            "allOf": [
                              {
                                "pattern": "^mbr_[0-7][0-9a-hjkmnp-tv-z]{25}$",
                                "examples": [
                                  "mbr_01j2y8m6jcc9tt24af5pw9x1bc"
                                ]
                              }
                            ]
                          },
                          "membershipStatus": {
                            "type": "string"
                          },
                          "roles": {
                            "type": "array",
                            "items": {
                              "type": "object",
                              "properties": {
                                "id": {
                                  "type": "string",
                                  "allOf": [
                                    {
                                      "pattern": "^role_[0-7][0-9a-hjkmnp-tv-z]{25}$",
                                      "examples": [
                                        "role_01j2y8m6jcc9tt24af5pw9x1bc"
                                      ]
                                    }
                                  ]
                                },
                                "name": {
                                  "type": "string"
                                },
                                "key": {
                                  "anyOf": [
                                    {
                                      "type": "string"
                                    },
                                    {
                                      "type": "null"
                                    }
                                  ]
                                }
                              },
                              "required": [
                                "id",
                                "name",
                                "key"
                              ],
                              "additionalProperties": false
                            }
                          },
                          "prescriberConnection": {
                            "anyOf": [
                              {
                                "type": "object",
                                "properties": {
                                  "status": {
                                    "type": "string"
                                  },
                                  "provider": {
                                    "type": "object",
                                    "properties": {
                                      "id": {
                                        "type": "string",
                                        "allOf": [
                                          {
                                            "pattern": "^prov_[0-7][0-9a-hjkmnp-tv-z]{25}$",
                                            "examples": [
                                              "prov_01j2y8m6jcc9tt24af5pw9x1bc"
                                            ]
                                          }
                                        ]
                                      },
                                      "name": {
                                        "type": "string"
                                      },
                                      "legalName": {
                                        "type": "string"
                                      },
                                      "credentials": {
                                        "anyOf": [
                                          {
                                            "type": "string"
                                          },
                                          {
                                            "type": "null"
                                          }
                                        ]
                                      },
                                      "phone": {
                                        "anyOf": [
                                          {
                                            "type": "string"
                                          },
                                          {
                                            "type": "null"
                                          }
                                        ]
                                      },
                                      "address": {
                                        "anyOf": [
                                          {
                                            "type": "object",
                                            "properties": {
                                              "line1": {
                                                "type": "string"
                                              },
                                              "line2": {
                                                "anyOf": [
                                                  {
                                                    "type": "string"
                                                  },
                                                  {
                                                    "type": "null"
                                                  }
                                                ]
                                              },
                                              "city": {
                                                "type": "string"
                                              },
                                              "state": {
                                                "type": "string"
                                              },
                                              "postalCode": {
                                                "type": "string"
                                              },
                                              "country": {
                                                "type": "string"
                                              }
                                            },
                                            "required": [
                                              "line1",
                                              "city",
                                              "state",
                                              "postalCode",
                                              "country"
                                            ],
                                            "additionalProperties": false
                                          },
                                          {
                                            "type": "null"
                                          }
                                        ]
                                      },
                                      "npi": {
                                        "type": "string"
                                      },
                                      "practiceStatus": {
                                        "type": "string"
                                      },
                                      "licenses": {
                                        "type": "array",
                                        "items": {
                                          "type": "object",
                                          "properties": {
                                            "id": {
                                              "type": "string",
                                              "allOf": [
                                                {
                                                  "pattern": "^lic_[0-7][0-9a-hjkmnp-tv-z]{25}$",
                                                  "examples": [
                                                    "lic_01j2y8m6jcc9tt24af5pw9x1bc"
                                                  ]
                                                }
                                              ]
                                            },
                                            "state": {
                                              "type": "string"
                                            },
                                            "licenseNumber": {
                                              "type": "string"
                                            },
                                            "expiresAt": {
                                              "anyOf": [
                                                {
                                                  "type": "string"
                                                },
                                                {
                                                  "type": "null"
                                                }
                                              ]
                                            }
                                          },
                                          "required": [
                                            "id",
                                            "state",
                                            "licenseNumber",
                                            "expiresAt"
                                          ],
                                          "additionalProperties": false
                                        }
                                      }
                                    },
                                    "required": [
                                      "id",
                                      "name",
                                      "legalName",
                                      "credentials",
                                      "phone",
                                      "address",
                                      "npi",
                                      "practiceStatus",
                                      "licenses"
                                    ],
                                    "additionalProperties": false
                                  }
                                },
                                "required": [
                                  "status",
                                  "provider"
                                ],
                                "additionalProperties": false
                              },
                              {
                                "type": "null"
                              }
                            ]
                          }
                        },
                        "required": [
                          "accountId",
                          "emailVerified",
                          "membershipId",
                          "membershipStatus",
                          "roles",
                          "prescriberConnection"
                        ],
                        "additionalProperties": false
                      },
                      {
                        "type": "null"
                      }
                    ]
                  },
                  "nextActions": {
                    "type": "array",
                    "items": {
                      "type": "string"
                    }
                  }
                },
                "required": [
                  "id",
                  "object",
                  "externalId",
                  "email",
                  "name",
                  "status",
                  "invitation",
                  "account",
                  "nextActions"
                ],
                "additionalProperties": false
              },
              {
                "type": "null"
              }
            ],
            "description": "This integration's current onboarding and account-connection state. Null for invitations outside this integration."
          }
        },
        "required": [
          "id",
          "object",
          "email",
          "name",
          "status",
          "roles",
          "locationIds",
          "createdAt",
          "expiresAt",
          "acceptedAt",
          "userId",
          "externalId",
          "memberId",
          "prescriberId",
          "person"
        ],
        "additionalProperties": false
      },
      "ResendPracticeTeamInvitationResponse": {
        "title": "ResendPracticeTeamInvitationResponse",
        "type": "object",
        "properties": {
          "invitation": {
            "type": "object",
            "properties": {
              "id": {
                "type": "string",
                "allOf": [
                  {
                    "pattern": "^invite_[0-7][0-9a-hjkmnp-tv-z]{25}$",
                    "examples": [
                      "invite_01j2y8m6jcc9tt24af5pw9x1bc"
                    ]
                  }
                ]
              },
              "object": {
                "type": "string",
                "enum": [
                  "team_invitation"
                ]
              },
              "email": {
                "type": "string"
              },
              "name": {
                "anyOf": [
                  {
                    "type": "string"
                  },
                  {
                    "type": "null"
                  }
                ]
              },
              "status": {
                "type": "string",
                "enum": [
                  "accepted",
                  "declined",
                  "pending",
                  "expired",
                  "revoked"
                ]
              },
              "roles": {
                "type": "array",
                "items": {
                  "type": "object",
                  "properties": {
                    "id": {
                      "type": "string",
                      "allOf": [
                        {
                          "pattern": "^role_[0-7][0-9a-hjkmnp-tv-z]{25}$",
                          "examples": [
                            "role_01j2y8m6jcc9tt24af5pw9x1bc"
                          ]
                        }
                      ]
                    },
                    "name": {
                      "type": "string"
                    },
                    "key": {
                      "anyOf": [
                        {
                          "type": "string"
                        },
                        {
                          "type": "null"
                        }
                      ]
                    }
                  },
                  "required": [
                    "id",
                    "name",
                    "key"
                  ],
                  "additionalProperties": false
                }
              },
              "locationIds": {
                "type": "array",
                "items": {
                  "type": "string",
                  "allOf": [
                    {
                      "pattern": "^loc_[0-7][0-9a-hjkmnp-tv-z]{25}$",
                      "examples": [
                        "loc_01j2y8m6jcc9tt24af5pw9x1bc"
                      ]
                    }
                  ]
                }
              },
              "createdAt": {
                "type": "string"
              },
              "expiresAt": {
                "type": "string"
              },
              "acceptedAt": {
                "anyOf": [
                  {
                    "type": "string"
                  },
                  {
                    "type": "null"
                  }
                ]
              },
              "userId": {
                "anyOf": [
                  {
                    "type": "string",
                    "allOf": [
                      {
                        "pattern": "^user_[0-7][0-9a-hjkmnp-tv-z]{25}$",
                        "examples": [
                          "user_01j2y8m6jcc9tt24af5pw9x1bc"
                        ]
                      }
                    ]
                  },
                  {
                    "type": "null"
                  }
                ],
                "description": "This integration's mode-scoped user ID, used for draft attribution and sessions after acceptance. Null for invitations outside this integration."
              },
              "externalId": {
                "anyOf": [
                  {
                    "type": "string"
                  },
                  {
                    "type": "null"
                  }
                ]
              },
              "memberId": {
                "anyOf": [
                  {
                    "type": "string",
                    "allOf": [
                      {
                        "pattern": "^mbr_[0-7][0-9a-hjkmnp-tv-z]{25}$",
                        "examples": [
                          "mbr_01j2y8m6jcc9tt24af5pw9x1bc"
                        ]
                      }
                    ]
                  },
                  {
                    "type": "null"
                  }
                ]
              },
              "prescriberId": {
                "anyOf": [
                  {
                    "type": "string",
                    "allOf": [
                      {
                        "pattern": "^prov_[0-7][0-9a-hjkmnp-tv-z]{25}$",
                        "examples": [
                          "prov_01j2y8m6jcc9tt24af5pw9x1bc"
                        ]
                      }
                    ]
                  },
                  {
                    "type": "null"
                  }
                ]
              },
              "person": {
                "anyOf": [
                  {
                    "type": "object",
                    "properties": {
                      "id": {
                        "type": "string",
                        "allOf": [
                          {
                            "pattern": "^user_[0-7][0-9a-hjkmnp-tv-z]{25}$",
                            "examples": [
                              "user_01j2y8m6jcc9tt24af5pw9x1bc"
                            ]
                          }
                        ]
                      },
                      "object": {
                        "type": "string",
                        "enum": [
                          "team_person"
                        ]
                      },
                      "externalId": {
                        "type": "string"
                      },
                      "email": {
                        "anyOf": [
                          {
                            "type": "string"
                          },
                          {
                            "type": "null"
                          }
                        ]
                      },
                      "name": {
                        "anyOf": [
                          {
                            "type": "string"
                          },
                          {
                            "type": "null"
                          }
                        ]
                      },
                      "status": {
                        "type": "string"
                      },
                      "invitation": {
                        "anyOf": [
                          {
                            "type": "object",
                            "properties": {
                              "id": {
                                "type": "string",
                                "allOf": [
                                  {
                                    "pattern": "^invite_[0-7][0-9a-hjkmnp-tv-z]{25}$",
                                    "examples": [
                                      "invite_01j2y8m6jcc9tt24af5pw9x1bc"
                                    ]
                                  }
                                ]
                              },
                              "status": {
                                "type": "string",
                                "enum": [
                                  "accepted",
                                  "declined",
                                  "pending",
                                  "expired",
                                  "revoked"
                                ]
                              },
                              "expiresAt": {
                                "type": "string"
                              },
                              "roles": {
                                "type": "array",
                                "items": {
                                  "type": "object",
                                  "properties": {
                                    "id": {
                                      "type": "string",
                                      "allOf": [
                                        {
                                          "pattern": "^role_[0-7][0-9a-hjkmnp-tv-z]{25}$",
                                          "examples": [
                                            "role_01j2y8m6jcc9tt24af5pw9x1bc"
                                          ]
                                        }
                                      ]
                                    },
                                    "name": {
                                      "type": "string"
                                    },
                                    "key": {
                                      "anyOf": [
                                        {
                                          "type": "string"
                                        },
                                        {
                                          "type": "null"
                                        }
                                      ]
                                    }
                                  },
                                  "required": [
                                    "id",
                                    "name",
                                    "key"
                                  ],
                                  "additionalProperties": false
                                }
                              }
                            },
                            "required": [
                              "id",
                              "status",
                              "expiresAt",
                              "roles"
                            ],
                            "additionalProperties": false
                          },
                          {
                            "type": "null"
                          }
                        ]
                      },
                      "account": {
                        "anyOf": [
                          {
                            "type": "object",
                            "properties": {
                              "accountId": {
                                "type": "string"
                              },
                              "emailVerified": {
                                "type": "boolean"
                              },
                              "membershipId": {
                                "type": "string",
                                "allOf": [
                                  {
                                    "pattern": "^mbr_[0-7][0-9a-hjkmnp-tv-z]{25}$",
                                    "examples": [
                                      "mbr_01j2y8m6jcc9tt24af5pw9x1bc"
                                    ]
                                  }
                                ]
                              },
                              "membershipStatus": {
                                "type": "string"
                              },
                              "roles": {
                                "type": "array",
                                "items": {
                                  "type": "object",
                                  "properties": {
                                    "id": {
                                      "type": "string",
                                      "allOf": [
                                        {
                                          "pattern": "^role_[0-7][0-9a-hjkmnp-tv-z]{25}$",
                                          "examples": [
                                            "role_01j2y8m6jcc9tt24af5pw9x1bc"
                                          ]
                                        }
                                      ]
                                    },
                                    "name": {
                                      "type": "string"
                                    },
                                    "key": {
                                      "anyOf": [
                                        {
                                          "type": "string"
                                        },
                                        {
                                          "type": "null"
                                        }
                                      ]
                                    }
                                  },
                                  "required": [
                                    "id",
                                    "name",
                                    "key"
                                  ],
                                  "additionalProperties": false
                                }
                              },
                              "prescriberConnection": {
                                "anyOf": [
                                  {
                                    "type": "object",
                                    "properties": {
                                      "status": {
                                        "type": "string"
                                      },
                                      "provider": {
                                        "type": "object",
                                        "properties": {
                                          "id": {
                                            "type": "string",
                                            "allOf": [
                                              {
                                                "pattern": "^prov_[0-7][0-9a-hjkmnp-tv-z]{25}$",
                                                "examples": [
                                                  "prov_01j2y8m6jcc9tt24af5pw9x1bc"
                                                ]
                                              }
                                            ]
                                          },
                                          "name": {
                                            "type": "string"
                                          },
                                          "legalName": {
                                            "type": "string"
                                          },
                                          "credentials": {
                                            "anyOf": [
                                              {
                                                "type": "string"
                                              },
                                              {
                                                "type": "null"
                                              }
                                            ]
                                          },
                                          "phone": {
                                            "anyOf": [
                                              {
                                                "type": "string"
                                              },
                                              {
                                                "type": "null"
                                              }
                                            ]
                                          },
                                          "address": {
                                            "anyOf": [
                                              {
                                                "type": "object",
                                                "properties": {
                                                  "line1": {
                                                    "type": "string"
                                                  },
                                                  "line2": {
                                                    "anyOf": [
                                                      {
                                                        "type": "string"
                                                      },
                                                      {
                                                        "type": "null"
                                                      }
                                                    ]
                                                  },
                                                  "city": {
                                                    "type": "string"
                                                  },
                                                  "state": {
                                                    "type": "string"
                                                  },
                                                  "postalCode": {
                                                    "type": "string"
                                                  },
                                                  "country": {
                                                    "type": "string"
                                                  }
                                                },
                                                "required": [
                                                  "line1",
                                                  "city",
                                                  "state",
                                                  "postalCode",
                                                  "country"
                                                ],
                                                "additionalProperties": false
                                              },
                                              {
                                                "type": "null"
                                              }
                                            ]
                                          },
                                          "npi": {
                                            "type": "string"
                                          },
                                          "practiceStatus": {
                                            "type": "string"
                                          },
                                          "licenses": {
                                            "type": "array",
                                            "items": {
                                              "type": "object",
                                              "properties": {
                                                "id": {
                                                  "type": "string",
                                                  "allOf": [
                                                    {
                                                      "pattern": "^lic_[0-7][0-9a-hjkmnp-tv-z]{25}$",
                                                      "examples": [
                                                        "lic_01j2y8m6jcc9tt24af5pw9x1bc"
                                                      ]
                                                    }
                                                  ]
                                                },
                                                "state": {
                                                  "type": "string"
                                                },
                                                "licenseNumber": {
                                                  "type": "string"
                                                },
                                                "expiresAt": {
                                                  "anyOf": [
                                                    {
                                                      "type": "string"
                                                    },
                                                    {
                                                      "type": "null"
                                                    }
                                                  ]
                                                }
                                              },
                                              "required": [
                                                "id",
                                                "state",
                                                "licenseNumber",
                                                "expiresAt"
                                              ],
                                              "additionalProperties": false
                                            }
                                          }
                                        },
                                        "required": [
                                          "id",
                                          "name",
                                          "legalName",
                                          "credentials",
                                          "phone",
                                          "address",
                                          "npi",
                                          "practiceStatus",
                                          "licenses"
                                        ],
                                        "additionalProperties": false
                                      }
                                    },
                                    "required": [
                                      "status",
                                      "provider"
                                    ],
                                    "additionalProperties": false
                                  },
                                  {
                                    "type": "null"
                                  }
                                ]
                              }
                            },
                            "required": [
                              "accountId",
                              "emailVerified",
                              "membershipId",
                              "membershipStatus",
                              "roles",
                              "prescriberConnection"
                            ],
                            "additionalProperties": false
                          },
                          {
                            "type": "null"
                          }
                        ]
                      },
                      "nextActions": {
                        "type": "array",
                        "items": {
                          "type": "string"
                        }
                      }
                    },
                    "required": [
                      "id",
                      "object",
                      "externalId",
                      "email",
                      "name",
                      "status",
                      "invitation",
                      "account",
                      "nextActions"
                    ],
                    "additionalProperties": false
                  },
                  {
                    "type": "null"
                  }
                ],
                "description": "This integration's current onboarding and account-connection state. Null for invitations outside this integration."
              }
            },
            "required": [
              "id",
              "object",
              "email",
              "name",
              "status",
              "roles",
              "locationIds",
              "createdAt",
              "expiresAt",
              "acceptedAt",
              "userId",
              "externalId",
              "memberId",
              "prescriberId",
              "person"
            ],
            "additionalProperties": false
          },
          "delivery": {
            "type": "string",
            "enum": [
              "sent"
            ]
          }
        },
        "required": [
          "invitation",
          "delivery"
        ],
        "additionalProperties": false
      },
      "GetApiAccessResponse": {
        "title": "GetApiAccessResponse",
        "type": "object",
        "properties": {
          "apiKey": {
            "type": "object",
            "properties": {
              "id": {
                "type": "string",
                "pattern": "^key_[0-7][0-9a-hjkmnp-tv-z]{25}$",
                "examples": [
                  "key_01j2y8m6jcc9tt24af5pw9x1bc"
                ]
              },
              "keyPrefix": {
                "type": "string"
              },
              "object": {
                "type": "string",
                "enum": [
                  "api_key"
                ]
              }
            },
            "required": [
              "id",
              "keyPrefix",
              "object"
            ],
            "additionalProperties": false
          },
          "livemode": {
            "type": "boolean"
          },
          "object": {
            "type": "string",
            "enum": [
              "api_access"
            ]
          },
          "scopes": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "serviceAccount": {
            "type": "object",
            "properties": {
              "apiVersion": {
                "anyOf": [
                  {
                    "type": "string",
                    "enum": [
                      "2026-09-28"
                    ]
                  }
                ]
              },
              "id": {
                "type": "string",
                "pattern": "^sa_[0-7][0-9a-hjkmnp-tv-z]{25}$",
                "examples": [
                  "sa_01j2y8m6jcc9tt24af5pw9x1bc"
                ]
              },
              "object": {
                "type": "string",
                "enum": [
                  "service_account"
                ]
              },
              "subjectId": {
                "type": "string"
              },
              "subjectType": {
                "type": "string"
              }
            },
            "required": [
              "apiVersion",
              "id",
              "object",
              "subjectId",
              "subjectType"
            ],
            "additionalProperties": false
          }
        },
        "required": [
          "apiKey",
          "livemode",
          "object",
          "scopes",
          "serviceAccount"
        ],
        "additionalProperties": false
      },
      "ListPracticesResponse": {
        "title": "ListPracticesResponse",
        "type": "object",
        "properties": {
          "data": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "address": {
                  "anyOf": [
                    {
                      "type": "object",
                      "properties": {
                        "city": {
                          "type": "string",
                          "allOf": [
                            {
                              "pattern": "^[^\\u0000\\p{Cs}]*$"
                            },
                            {
                              "pattern": "^[^\\p{Cc}\\u200B\\u2028-\\u202E\\u2066-\\u2069]*$"
                            }
                          ]
                        },
                        "country": {
                          "anyOf": [
                            {
                              "type": "string",
                              "allOf": [
                                {
                                  "pattern": "^[^\\u0000\\p{Cs}]*$"
                                },
                                {
                                  "pattern": "^[^\\p{Cc}\\u200B\\u2028-\\u202E\\u2066-\\u2069]*$"
                                }
                              ]
                            },
                            {
                              "type": "null"
                            }
                          ]
                        },
                        "line1": {
                          "type": "string",
                          "allOf": [
                            {
                              "pattern": "^[^\\u0000\\p{Cs}]*$"
                            },
                            {
                              "pattern": "^[^\\p{Cc}\\u200B\\u2028-\\u202E\\u2066-\\u2069]*$"
                            }
                          ]
                        },
                        "line2": {
                          "anyOf": [
                            {
                              "anyOf": [
                                {
                                  "type": "string",
                                  "allOf": [
                                    {
                                      "pattern": "^[^\\u0000\\p{Cs}]*$"
                                    },
                                    {
                                      "pattern": "^[^\\p{Cc}\\u200B\\u2028-\\u202E\\u2066-\\u2069]*$"
                                    }
                                  ]
                                },
                                {
                                  "type": "null"
                                }
                              ]
                            },
                            {
                              "type": "null"
                            }
                          ]
                        },
                        "postalCode": {
                          "type": "string",
                          "allOf": [
                            {
                              "pattern": "^[^\\u0000\\p{Cs}]*$"
                            },
                            {
                              "pattern": "^[^\\p{Cc}\\u200B\\u2028-\\u202E\\u2066-\\u2069]*$"
                            }
                          ]
                        },
                        "state": {
                          "type": "string",
                          "allOf": [
                            {
                              "pattern": "^[^\\u0000\\p{Cs}]*$"
                            },
                            {
                              "pattern": "^[^\\p{Cc}\\u200B\\u2028-\\u202E\\u2066-\\u2069]*$"
                            }
                          ]
                        }
                      },
                      "required": [
                        "city",
                        "line1",
                        "postalCode",
                        "state"
                      ],
                      "additionalProperties": false
                    },
                    {
                      "type": "null"
                    }
                  ]
                },
                "contacts": {
                  "type": "object",
                  "properties": {
                    "compliance": {
                      "anyOf": [
                        {
                          "type": "object",
                          "properties": {
                            "email": {
                              "type": "string"
                            },
                            "name": {
                              "type": "string"
                            },
                            "phone": {
                              "anyOf": [
                                {
                                  "anyOf": [
                                    {
                                      "type": "string"
                                    },
                                    {
                                      "type": "null"
                                    }
                                  ]
                                },
                                {
                                  "type": "null"
                                }
                              ]
                            }
                          },
                          "required": [
                            "email",
                            "name"
                          ],
                          "additionalProperties": false
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "primary": {
                      "anyOf": [
                        {
                          "type": "object",
                          "properties": {
                            "email": {
                              "type": "string"
                            },
                            "name": {
                              "type": "string"
                            },
                            "phone": {
                              "anyOf": [
                                {
                                  "anyOf": [
                                    {
                                      "type": "string"
                                    },
                                    {
                                      "type": "null"
                                    }
                                  ]
                                },
                                {
                                  "type": "null"
                                }
                              ]
                            }
                          },
                          "required": [
                            "email",
                            "name"
                          ],
                          "additionalProperties": false
                        },
                        {
                          "type": "null"
                        }
                      ]
                    }
                  },
                  "required": [
                    "compliance",
                    "primary"
                  ],
                  "additionalProperties": false
                },
                "createdAt": {
                  "type": "string"
                },
                "externalId": {
                  "anyOf": [
                    {
                      "type": "string"
                    },
                    {
                      "type": "null"
                    }
                  ]
                },
                "id": {
                  "type": "string",
                  "pattern": "^prac_[0-7][0-9a-hjkmnp-tv-z]{25}$",
                  "examples": [
                    "prac_01j2y8m6jcc9tt24af5pw9x1bc"
                  ]
                },
                "legalName": {
                  "anyOf": [
                    {
                      "type": "string"
                    },
                    {
                      "type": "null"
                    }
                  ]
                },
                "livemode": {
                  "type": "boolean"
                },
                "metadata": {
                  "type": "object"
                },
                "name": {
                  "type": "string"
                },
                "object": {
                  "type": "string",
                  "enum": [
                    "practice"
                  ]
                },
                "prescribers": {
                  "type": "array",
                  "items": {
                    "type": "object",
                    "properties": {
                      "credentials": {
                        "anyOf": [
                          {
                            "anyOf": [
                              {
                                "type": "string"
                              },
                              {
                                "type": "null"
                              }
                            ]
                          },
                          {
                            "type": "null"
                          }
                        ]
                      },
                      "licenseStates": {
                        "type": "array",
                        "items": {
                          "type": "string"
                        }
                      },
                      "name": {
                        "type": "string"
                      },
                      "npi": {
                        "type": "string"
                      }
                    },
                    "required": [
                      "licenseStates",
                      "name",
                      "npi"
                    ],
                    "additionalProperties": false
                  }
                },
                "liveEnabled": {
                  "type": "boolean",
                  "description": "Whether this practice currently has Live access. False for Test practices."
                },
                "supportEmail": {
                  "anyOf": [
                    {
                      "type": "string"
                    },
                    {
                      "type": "null"
                    }
                  ]
                },
                "supportPhone": {
                  "anyOf": [
                    {
                      "type": "string"
                    },
                    {
                      "type": "null"
                    }
                  ]
                },
                "timezone": {
                  "anyOf": [
                    {
                      "type": "string"
                    },
                    {
                      "type": "null"
                    }
                  ]
                }
              },
              "required": [
                "address",
                "contacts",
                "createdAt",
                "externalId",
                "id",
                "legalName",
                "livemode",
                "metadata",
                "name",
                "object",
                "prescribers",
                "liveEnabled",
                "supportEmail",
                "supportPhone",
                "timezone"
              ],
              "additionalProperties": false
            }
          },
          "hasMore": {
            "type": "boolean"
          },
          "object": {
            "type": "string",
            "enum": [
              "list"
            ]
          },
          "url": {
            "type": "string",
            "enum": [
              "/v1/practices"
            ]
          }
        },
        "required": [
          "data",
          "hasMore",
          "object",
          "url"
        ],
        "additionalProperties": false
      },
      "CreatePracticeRequest": {
        "type": "object",
        "properties": {
          "liveEnabled": {
            "type": "boolean",
            "description": "Enable Live access at creation. Requires an approved platform and a Live request. Defaults to false."
          },
          "address": {
            "type": "object",
            "properties": {
              "city": {
                "type": "string",
                "pattern": "^[^\\u0000\\p{Cs}]*$",
                "allOf": [
                  {
                    "pattern": "^[^\\p{Cc}\\u200B\\u2028-\\u202E\\u2066-\\u2069]*$"
                  }
                ]
              },
              "country": {
                "anyOf": [
                  {
                    "type": "string",
                    "pattern": "^[^\\u0000\\p{Cs}]*$",
                    "allOf": [
                      {
                        "pattern": "^[^\\p{Cc}\\u200B\\u2028-\\u202E\\u2066-\\u2069]*$"
                      }
                    ]
                  },
                  {
                    "type": "null"
                  }
                ]
              },
              "line1": {
                "type": "string",
                "pattern": "^[^\\u0000\\p{Cs}]*$",
                "allOf": [
                  {
                    "pattern": "^[^\\p{Cc}\\u200B\\u2028-\\u202E\\u2066-\\u2069]*$"
                  }
                ]
              },
              "line2": {
                "anyOf": [
                  {
                    "anyOf": [
                      {
                        "type": "string",
                        "pattern": "^[^\\u0000\\p{Cs}]*$",
                        "allOf": [
                          {
                            "pattern": "^[^\\p{Cc}\\u200B\\u2028-\\u202E\\u2066-\\u2069]*$"
                          }
                        ]
                      },
                      {
                        "type": "null"
                      }
                    ]
                  },
                  {
                    "type": "null"
                  }
                ]
              },
              "postalCode": {
                "type": "string",
                "pattern": "^[^\\u0000\\p{Cs}]*$",
                "allOf": [
                  {
                    "pattern": "^[^\\p{Cc}\\u200B\\u2028-\\u202E\\u2066-\\u2069]*$"
                  }
                ]
              },
              "state": {
                "type": "string",
                "pattern": "^[^\\u0000\\p{Cs}]*$",
                "allOf": [
                  {
                    "pattern": "^[^\\p{Cc}\\u200B\\u2028-\\u202E\\u2066-\\u2069]*$"
                  }
                ]
              }
            },
            "required": [
              "city",
              "line1",
              "postalCode",
              "state"
            ],
            "additionalProperties": false
          },
          "attestations": {
            "type": "object",
            "properties": {
              "authorizedPracticeRelationship": {
                "type": "boolean"
              },
              "authorizedPhiTransfer": {
                "type": "boolean"
              },
              "minimumNecessaryPhi": {
                "type": "boolean"
              },
              "providerDataAccuracy": {
                "type": "boolean"
              }
            },
            "required": [
              "authorizedPracticeRelationship",
              "authorizedPhiTransfer",
              "minimumNecessaryPhi",
              "providerDataAccuracy"
            ],
            "additionalProperties": false
          },
          "complianceContact": {
            "anyOf": [
              {
                "anyOf": [
                  {
                    "type": "object",
                    "properties": {
                      "email": {
                        "type": "string"
                      },
                      "name": {
                        "type": "string"
                      },
                      "phone": {
                        "anyOf": [
                          {
                            "anyOf": [
                              {
                                "type": "string"
                              },
                              {
                                "type": "null"
                              }
                            ]
                          },
                          {
                            "type": "null"
                          }
                        ]
                      }
                    },
                    "required": [
                      "email",
                      "name"
                    ],
                    "additionalProperties": false
                  },
                  {
                    "type": "null"
                  }
                ]
              },
              {
                "type": "null"
              }
            ]
          },
          "externalId": {
            "anyOf": [
              {
                "anyOf": [
                  {
                    "type": "string"
                  },
                  {
                    "type": "null"
                  }
                ]
              },
              {
                "type": "null"
              }
            ]
          },
          "legalName": {
            "anyOf": [
              {
                "anyOf": [
                  {
                    "type": "string"
                  },
                  {
                    "type": "null"
                  }
                ]
              },
              {
                "type": "null"
              }
            ]
          },
          "metadata": {
            "anyOf": [
              {
                "type": "object"
              },
              {
                "type": "null"
              }
            ]
          },
          "name": {
            "type": "string"
          },
          "prescribers": {
            "anyOf": [
              {
                "type": "array",
                "items": {
                  "type": "object",
                  "properties": {
                    "credentials": {
                      "anyOf": [
                        {
                          "anyOf": [
                            {
                              "type": "string"
                            },
                            {
                              "type": "null"
                            }
                          ]
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "licenseStates": {
                      "type": "array",
                      "items": {
                        "type": "string"
                      }
                    },
                    "name": {
                      "type": "string"
                    },
                    "npi": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "licenseStates",
                    "name",
                    "npi"
                  ],
                  "additionalProperties": false
                }
              },
              {
                "type": "null"
              }
            ]
          },
          "primaryContact": {
            "anyOf": [
              {
                "anyOf": [
                  {
                    "type": "object",
                    "properties": {
                      "email": {
                        "type": "string"
                      },
                      "name": {
                        "type": "string"
                      },
                      "phone": {
                        "anyOf": [
                          {
                            "anyOf": [
                              {
                                "type": "string"
                              },
                              {
                                "type": "null"
                              }
                            ]
                          },
                          {
                            "type": "null"
                          }
                        ]
                      }
                    },
                    "required": [
                      "email",
                      "name"
                    ],
                    "additionalProperties": false
                  },
                  {
                    "type": "null"
                  }
                ]
              },
              {
                "type": "null"
              }
            ]
          },
          "supportEmail": {
            "anyOf": [
              {
                "anyOf": [
                  {
                    "type": "string"
                  },
                  {
                    "type": "null"
                  }
                ]
              },
              {
                "type": "null"
              }
            ]
          },
          "supportPhone": {
            "anyOf": [
              {
                "anyOf": [
                  {
                    "type": "string"
                  },
                  {
                    "type": "null"
                  }
                ]
              },
              {
                "type": "null"
              }
            ]
          },
          "timezone": {
            "anyOf": [
              {
                "anyOf": [
                  {
                    "type": "string"
                  },
                  {
                    "type": "null"
                  }
                ]
              },
              {
                "type": "null"
              }
            ],
            "description": "Optional IANA timezone override. Omit to leave unchanged; null clears it. No timezone is inferred when creating a record."
          }
        },
        "required": [
          "address",
          "attestations",
          "name"
        ],
        "additionalProperties": false,
        "examples": [
          {
            "address": {
              "city": "Los Angeles",
              "country": "US",
              "line1": "100 Practice Way",
              "line2": null,
              "postalCode": "90001",
              "state": "CA"
            },
            "attestations": {
              "authorizedPracticeRelationship": true,
              "authorizedPhiTransfer": true,
              "minimumNecessaryPhi": true,
              "providerDataAccuracy": true
            },
            "complianceContact": null,
            "externalId": "practice_123",
            "legalName": "Example Medical Group PLLC",
            "metadata": {},
            "name": "Example Medical Group",
            "prescribers": [
              {
                "credentials": "MD",
                "licenseStates": [
                  "CA"
                ],
                "name": "Alex Morgan",
                "npi": "1234567893"
              }
            ],
            "primaryContact": {
              "email": "operations@example-practice.com",
              "name": "Jordan Lee",
              "phone": null
            },
            "supportEmail": "support@example-practice.com",
            "supportPhone": null
          }
        ],
        "title": "CreatePracticeRequest"
      },
      "CreatePracticeResponse": {
        "title": "CreatePracticeResponse",
        "type": "object",
        "properties": {
          "address": {
            "anyOf": [
              {
                "type": "object",
                "properties": {
                  "city": {
                    "type": "string",
                    "allOf": [
                      {
                        "pattern": "^[^\\u0000\\p{Cs}]*$"
                      },
                      {
                        "pattern": "^[^\\p{Cc}\\u200B\\u2028-\\u202E\\u2066-\\u2069]*$"
                      }
                    ]
                  },
                  "country": {
                    "anyOf": [
                      {
                        "type": "string",
                        "allOf": [
                          {
                            "pattern": "^[^\\u0000\\p{Cs}]*$"
                          },
                          {
                            "pattern": "^[^\\p{Cc}\\u200B\\u2028-\\u202E\\u2066-\\u2069]*$"
                          }
                        ]
                      },
                      {
                        "type": "null"
                      }
                    ]
                  },
                  "line1": {
                    "type": "string",
                    "allOf": [
                      {
                        "pattern": "^[^\\u0000\\p{Cs}]*$"
                      },
                      {
                        "pattern": "^[^\\p{Cc}\\u200B\\u2028-\\u202E\\u2066-\\u2069]*$"
                      }
                    ]
                  },
                  "line2": {
                    "anyOf": [
                      {
                        "anyOf": [
                          {
                            "type": "string",
                            "allOf": [
                              {
                                "pattern": "^[^\\u0000\\p{Cs}]*$"
                              },
                              {
                                "pattern": "^[^\\p{Cc}\\u200B\\u2028-\\u202E\\u2066-\\u2069]*$"
                              }
                            ]
                          },
                          {
                            "type": "null"
                          }
                        ]
                      },
                      {
                        "type": "null"
                      }
                    ]
                  },
                  "postalCode": {
                    "type": "string",
                    "allOf": [
                      {
                        "pattern": "^[^\\u0000\\p{Cs}]*$"
                      },
                      {
                        "pattern": "^[^\\p{Cc}\\u200B\\u2028-\\u202E\\u2066-\\u2069]*$"
                      }
                    ]
                  },
                  "state": {
                    "type": "string",
                    "allOf": [
                      {
                        "pattern": "^[^\\u0000\\p{Cs}]*$"
                      },
                      {
                        "pattern": "^[^\\p{Cc}\\u200B\\u2028-\\u202E\\u2066-\\u2069]*$"
                      }
                    ]
                  }
                },
                "required": [
                  "city",
                  "line1",
                  "postalCode",
                  "state"
                ],
                "additionalProperties": false
              },
              {
                "type": "null"
              }
            ]
          },
          "contacts": {
            "type": "object",
            "properties": {
              "compliance": {
                "anyOf": [
                  {
                    "type": "object",
                    "properties": {
                      "email": {
                        "type": "string"
                      },
                      "name": {
                        "type": "string"
                      },
                      "phone": {
                        "anyOf": [
                          {
                            "anyOf": [
                              {
                                "type": "string"
                              },
                              {
                                "type": "null"
                              }
                            ]
                          },
                          {
                            "type": "null"
                          }
                        ]
                      }
                    },
                    "required": [
                      "email",
                      "name"
                    ],
                    "additionalProperties": false
                  },
                  {
                    "type": "null"
                  }
                ]
              },
              "primary": {
                "anyOf": [
                  {
                    "type": "object",
                    "properties": {
                      "email": {
                        "type": "string"
                      },
                      "name": {
                        "type": "string"
                      },
                      "phone": {
                        "anyOf": [
                          {
                            "anyOf": [
                              {
                                "type": "string"
                              },
                              {
                                "type": "null"
                              }
                            ]
                          },
                          {
                            "type": "null"
                          }
                        ]
                      }
                    },
                    "required": [
                      "email",
                      "name"
                    ],
                    "additionalProperties": false
                  },
                  {
                    "type": "null"
                  }
                ]
              }
            },
            "required": [
              "compliance",
              "primary"
            ],
            "additionalProperties": false
          },
          "createdAt": {
            "type": "string"
          },
          "externalId": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ]
          },
          "id": {
            "type": "string",
            "pattern": "^prac_[0-7][0-9a-hjkmnp-tv-z]{25}$",
            "examples": [
              "prac_01j2y8m6jcc9tt24af5pw9x1bc"
            ]
          },
          "legalName": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ]
          },
          "livemode": {
            "type": "boolean"
          },
          "metadata": {
            "type": "object"
          },
          "name": {
            "type": "string"
          },
          "object": {
            "type": "string",
            "enum": [
              "practice"
            ]
          },
          "prescribers": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "credentials": {
                  "anyOf": [
                    {
                      "anyOf": [
                        {
                          "type": "string"
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    {
                      "type": "null"
                    }
                  ]
                },
                "licenseStates": {
                  "type": "array",
                  "items": {
                    "type": "string"
                  }
                },
                "name": {
                  "type": "string"
                },
                "npi": {
                  "type": "string"
                }
              },
              "required": [
                "licenseStates",
                "name",
                "npi"
              ],
              "additionalProperties": false
            }
          },
          "liveEnabled": {
            "type": "boolean",
            "description": "Whether this practice currently has Live access. False for Test practices."
          },
          "supportEmail": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ]
          },
          "supportPhone": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ]
          },
          "timezone": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ]
          }
        },
        "required": [
          "address",
          "contacts",
          "createdAt",
          "externalId",
          "id",
          "legalName",
          "livemode",
          "metadata",
          "name",
          "object",
          "prescribers",
          "liveEnabled",
          "supportEmail",
          "supportPhone",
          "timezone"
        ],
        "additionalProperties": false
      },
      "GetPracticeResponse": {
        "title": "GetPracticeResponse",
        "type": "object",
        "properties": {
          "address": {
            "anyOf": [
              {
                "type": "object",
                "properties": {
                  "city": {
                    "type": "string",
                    "allOf": [
                      {
                        "pattern": "^[^\\u0000\\p{Cs}]*$"
                      },
                      {
                        "pattern": "^[^\\p{Cc}\\u200B\\u2028-\\u202E\\u2066-\\u2069]*$"
                      }
                    ]
                  },
                  "country": {
                    "anyOf": [
                      {
                        "type": "string",
                        "allOf": [
                          {
                            "pattern": "^[^\\u0000\\p{Cs}]*$"
                          },
                          {
                            "pattern": "^[^\\p{Cc}\\u200B\\u2028-\\u202E\\u2066-\\u2069]*$"
                          }
                        ]
                      },
                      {
                        "type": "null"
                      }
                    ]
                  },
                  "line1": {
                    "type": "string",
                    "allOf": [
                      {
                        "pattern": "^[^\\u0000\\p{Cs}]*$"
                      },
                      {
                        "pattern": "^[^\\p{Cc}\\u200B\\u2028-\\u202E\\u2066-\\u2069]*$"
                      }
                    ]
                  },
                  "line2": {
                    "anyOf": [
                      {
                        "anyOf": [
                          {
                            "type": "string",
                            "allOf": [
                              {
                                "pattern": "^[^\\u0000\\p{Cs}]*$"
                              },
                              {
                                "pattern": "^[^\\p{Cc}\\u200B\\u2028-\\u202E\\u2066-\\u2069]*$"
                              }
                            ]
                          },
                          {
                            "type": "null"
                          }
                        ]
                      },
                      {
                        "type": "null"
                      }
                    ]
                  },
                  "postalCode": {
                    "type": "string",
                    "allOf": [
                      {
                        "pattern": "^[^\\u0000\\p{Cs}]*$"
                      },
                      {
                        "pattern": "^[^\\p{Cc}\\u200B\\u2028-\\u202E\\u2066-\\u2069]*$"
                      }
                    ]
                  },
                  "state": {
                    "type": "string",
                    "allOf": [
                      {
                        "pattern": "^[^\\u0000\\p{Cs}]*$"
                      },
                      {
                        "pattern": "^[^\\p{Cc}\\u200B\\u2028-\\u202E\\u2066-\\u2069]*$"
                      }
                    ]
                  }
                },
                "required": [
                  "city",
                  "line1",
                  "postalCode",
                  "state"
                ],
                "additionalProperties": false
              },
              {
                "type": "null"
              }
            ]
          },
          "contacts": {
            "type": "object",
            "properties": {
              "compliance": {
                "anyOf": [
                  {
                    "type": "object",
                    "properties": {
                      "email": {
                        "type": "string"
                      },
                      "name": {
                        "type": "string"
                      },
                      "phone": {
                        "anyOf": [
                          {
                            "anyOf": [
                              {
                                "type": "string"
                              },
                              {
                                "type": "null"
                              }
                            ]
                          },
                          {
                            "type": "null"
                          }
                        ]
                      }
                    },
                    "required": [
                      "email",
                      "name"
                    ],
                    "additionalProperties": false
                  },
                  {
                    "type": "null"
                  }
                ]
              },
              "primary": {
                "anyOf": [
                  {
                    "type": "object",
                    "properties": {
                      "email": {
                        "type": "string"
                      },
                      "name": {
                        "type": "string"
                      },
                      "phone": {
                        "anyOf": [
                          {
                            "anyOf": [
                              {
                                "type": "string"
                              },
                              {
                                "type": "null"
                              }
                            ]
                          },
                          {
                            "type": "null"
                          }
                        ]
                      }
                    },
                    "required": [
                      "email",
                      "name"
                    ],
                    "additionalProperties": false
                  },
                  {
                    "type": "null"
                  }
                ]
              }
            },
            "required": [
              "compliance",
              "primary"
            ],
            "additionalProperties": false
          },
          "createdAt": {
            "type": "string"
          },
          "externalId": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ]
          },
          "id": {
            "type": "string",
            "pattern": "^prac_[0-7][0-9a-hjkmnp-tv-z]{25}$",
            "examples": [
              "prac_01j2y8m6jcc9tt24af5pw9x1bc"
            ]
          },
          "legalName": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ]
          },
          "livemode": {
            "type": "boolean"
          },
          "metadata": {
            "type": "object"
          },
          "name": {
            "type": "string"
          },
          "object": {
            "type": "string",
            "enum": [
              "practice"
            ]
          },
          "prescribers": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "credentials": {
                  "anyOf": [
                    {
                      "anyOf": [
                        {
                          "type": "string"
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    {
                      "type": "null"
                    }
                  ]
                },
                "licenseStates": {
                  "type": "array",
                  "items": {
                    "type": "string"
                  }
                },
                "name": {
                  "type": "string"
                },
                "npi": {
                  "type": "string"
                }
              },
              "required": [
                "licenseStates",
                "name",
                "npi"
              ],
              "additionalProperties": false
            }
          },
          "liveEnabled": {
            "type": "boolean",
            "description": "Whether this practice currently has Live access. False for Test practices."
          },
          "supportEmail": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ]
          },
          "supportPhone": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ]
          },
          "timezone": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ]
          }
        },
        "required": [
          "address",
          "contacts",
          "createdAt",
          "externalId",
          "id",
          "legalName",
          "livemode",
          "metadata",
          "name",
          "object",
          "prescribers",
          "liveEnabled",
          "supportEmail",
          "supportPhone",
          "timezone"
        ],
        "additionalProperties": false
      },
      "UpdatePracticeRequest": {
        "type": "object",
        "properties": {
          "liveEnabled": {
            "type": "boolean",
            "description": "Enable or disable Live access for an owned practice. Requires an approved platform and a Live request. Affinity Admin decisions take precedence."
          },
          "address": {
            "anyOf": [
              {
                "type": "object",
                "properties": {
                  "city": {
                    "type": "string",
                    "pattern": "^[^\\u0000\\p{Cs}]*$",
                    "allOf": [
                      {
                        "pattern": "^[^\\p{Cc}\\u200B\\u2028-\\u202E\\u2066-\\u2069]*$"
                      }
                    ]
                  },
                  "country": {
                    "anyOf": [
                      {
                        "type": "string",
                        "pattern": "^[^\\u0000\\p{Cs}]*$",
                        "allOf": [
                          {
                            "pattern": "^[^\\p{Cc}\\u200B\\u2028-\\u202E\\u2066-\\u2069]*$"
                          }
                        ]
                      },
                      {
                        "type": "null"
                      }
                    ]
                  },
                  "line1": {
                    "type": "string",
                    "pattern": "^[^\\u0000\\p{Cs}]*$",
                    "allOf": [
                      {
                        "pattern": "^[^\\p{Cc}\\u200B\\u2028-\\u202E\\u2066-\\u2069]*$"
                      }
                    ]
                  },
                  "line2": {
                    "anyOf": [
                      {
                        "anyOf": [
                          {
                            "type": "string",
                            "pattern": "^[^\\u0000\\p{Cs}]*$",
                            "allOf": [
                              {
                                "pattern": "^[^\\p{Cc}\\u200B\\u2028-\\u202E\\u2066-\\u2069]*$"
                              }
                            ]
                          },
                          {
                            "type": "null"
                          }
                        ]
                      },
                      {
                        "type": "null"
                      }
                    ]
                  },
                  "postalCode": {
                    "type": "string",
                    "pattern": "^[^\\u0000\\p{Cs}]*$",
                    "allOf": [
                      {
                        "pattern": "^[^\\p{Cc}\\u200B\\u2028-\\u202E\\u2066-\\u2069]*$"
                      }
                    ]
                  },
                  "state": {
                    "type": "string",
                    "pattern": "^[^\\u0000\\p{Cs}]*$",
                    "allOf": [
                      {
                        "pattern": "^[^\\p{Cc}\\u200B\\u2028-\\u202E\\u2066-\\u2069]*$"
                      }
                    ]
                  }
                },
                "required": [
                  "city",
                  "line1",
                  "postalCode",
                  "state"
                ],
                "additionalProperties": false
              },
              {
                "type": "null"
              }
            ]
          },
          "attestations": {
            "anyOf": [
              {
                "type": "object",
                "properties": {
                  "authorizedPracticeRelationship": {
                    "type": "boolean"
                  },
                  "authorizedPhiTransfer": {
                    "type": "boolean"
                  },
                  "minimumNecessaryPhi": {
                    "type": "boolean"
                  },
                  "providerDataAccuracy": {
                    "type": "boolean"
                  }
                },
                "required": [
                  "authorizedPracticeRelationship",
                  "authorizedPhiTransfer",
                  "minimumNecessaryPhi",
                  "providerDataAccuracy"
                ],
                "additionalProperties": false
              },
              {
                "type": "null"
              }
            ]
          },
          "complianceContact": {
            "anyOf": [
              {
                "anyOf": [
                  {
                    "type": "object",
                    "properties": {
                      "email": {
                        "type": "string"
                      },
                      "name": {
                        "type": "string"
                      },
                      "phone": {
                        "anyOf": [
                          {
                            "anyOf": [
                              {
                                "type": "string"
                              },
                              {
                                "type": "null"
                              }
                            ]
                          },
                          {
                            "type": "null"
                          }
                        ]
                      }
                    },
                    "required": [
                      "email",
                      "name"
                    ],
                    "additionalProperties": false
                  },
                  {
                    "type": "null"
                  }
                ]
              },
              {
                "type": "null"
              }
            ]
          },
          "externalId": {
            "anyOf": [
              {
                "anyOf": [
                  {
                    "type": "string"
                  },
                  {
                    "type": "null"
                  }
                ]
              },
              {
                "type": "null"
              }
            ]
          },
          "legalName": {
            "anyOf": [
              {
                "anyOf": [
                  {
                    "type": "string"
                  },
                  {
                    "type": "null"
                  }
                ]
              },
              {
                "type": "null"
              }
            ]
          },
          "metadata": {
            "anyOf": [
              {
                "type": "object"
              },
              {
                "type": "null"
              }
            ]
          },
          "name": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ]
          },
          "prescribers": {
            "anyOf": [
              {
                "type": "array",
                "items": {
                  "type": "object",
                  "properties": {
                    "credentials": {
                      "anyOf": [
                        {
                          "anyOf": [
                            {
                              "type": "string"
                            },
                            {
                              "type": "null"
                            }
                          ]
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "licenseStates": {
                      "type": "array",
                      "items": {
                        "type": "string"
                      }
                    },
                    "name": {
                      "type": "string"
                    },
                    "npi": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "licenseStates",
                    "name",
                    "npi"
                  ],
                  "additionalProperties": false
                }
              },
              {
                "type": "null"
              }
            ]
          },
          "primaryContact": {
            "anyOf": [
              {
                "anyOf": [
                  {
                    "type": "object",
                    "properties": {
                      "email": {
                        "type": "string"
                      },
                      "name": {
                        "type": "string"
                      },
                      "phone": {
                        "anyOf": [
                          {
                            "anyOf": [
                              {
                                "type": "string"
                              },
                              {
                                "type": "null"
                              }
                            ]
                          },
                          {
                            "type": "null"
                          }
                        ]
                      }
                    },
                    "required": [
                      "email",
                      "name"
                    ],
                    "additionalProperties": false
                  },
                  {
                    "type": "null"
                  }
                ]
              },
              {
                "type": "null"
              }
            ]
          },
          "supportEmail": {
            "anyOf": [
              {
                "anyOf": [
                  {
                    "type": "string"
                  },
                  {
                    "type": "null"
                  }
                ]
              },
              {
                "type": "null"
              }
            ]
          },
          "supportPhone": {
            "anyOf": [
              {
                "anyOf": [
                  {
                    "type": "string"
                  },
                  {
                    "type": "null"
                  }
                ]
              },
              {
                "type": "null"
              }
            ]
          },
          "timezone": {
            "anyOf": [
              {
                "anyOf": [
                  {
                    "type": "string"
                  },
                  {
                    "type": "null"
                  }
                ]
              },
              {
                "type": "null"
              }
            ],
            "description": "Optional IANA timezone override. Omit to leave unchanged; null clears it. No timezone is inferred when creating a record."
          }
        },
        "additionalProperties": false,
        "title": "UpdatePracticeRequest"
      },
      "UpdatePracticeResponse": {
        "title": "UpdatePracticeResponse",
        "type": "object",
        "properties": {
          "address": {
            "anyOf": [
              {
                "type": "object",
                "properties": {
                  "city": {
                    "type": "string",
                    "allOf": [
                      {
                        "pattern": "^[^\\u0000\\p{Cs}]*$"
                      },
                      {
                        "pattern": "^[^\\p{Cc}\\u200B\\u2028-\\u202E\\u2066-\\u2069]*$"
                      }
                    ]
                  },
                  "country": {
                    "anyOf": [
                      {
                        "type": "string",
                        "allOf": [
                          {
                            "pattern": "^[^\\u0000\\p{Cs}]*$"
                          },
                          {
                            "pattern": "^[^\\p{Cc}\\u200B\\u2028-\\u202E\\u2066-\\u2069]*$"
                          }
                        ]
                      },
                      {
                        "type": "null"
                      }
                    ]
                  },
                  "line1": {
                    "type": "string",
                    "allOf": [
                      {
                        "pattern": "^[^\\u0000\\p{Cs}]*$"
                      },
                      {
                        "pattern": "^[^\\p{Cc}\\u200B\\u2028-\\u202E\\u2066-\\u2069]*$"
                      }
                    ]
                  },
                  "line2": {
                    "anyOf": [
                      {
                        "anyOf": [
                          {
                            "type": "string",
                            "allOf": [
                              {
                                "pattern": "^[^\\u0000\\p{Cs}]*$"
                              },
                              {
                                "pattern": "^[^\\p{Cc}\\u200B\\u2028-\\u202E\\u2066-\\u2069]*$"
                              }
                            ]
                          },
                          {
                            "type": "null"
                          }
                        ]
                      },
                      {
                        "type": "null"
                      }
                    ]
                  },
                  "postalCode": {
                    "type": "string",
                    "allOf": [
                      {
                        "pattern": "^[^\\u0000\\p{Cs}]*$"
                      },
                      {
                        "pattern": "^[^\\p{Cc}\\u200B\\u2028-\\u202E\\u2066-\\u2069]*$"
                      }
                    ]
                  },
                  "state": {
                    "type": "string",
                    "allOf": [
                      {
                        "pattern": "^[^\\u0000\\p{Cs}]*$"
                      },
                      {
                        "pattern": "^[^\\p{Cc}\\u200B\\u2028-\\u202E\\u2066-\\u2069]*$"
                      }
                    ]
                  }
                },
                "required": [
                  "city",
                  "line1",
                  "postalCode",
                  "state"
                ],
                "additionalProperties": false
              },
              {
                "type": "null"
              }
            ]
          },
          "contacts": {
            "type": "object",
            "properties": {
              "compliance": {
                "anyOf": [
                  {
                    "type": "object",
                    "properties": {
                      "email": {
                        "type": "string"
                      },
                      "name": {
                        "type": "string"
                      },
                      "phone": {
                        "anyOf": [
                          {
                            "anyOf": [
                              {
                                "type": "string"
                              },
                              {
                                "type": "null"
                              }
                            ]
                          },
                          {
                            "type": "null"
                          }
                        ]
                      }
                    },
                    "required": [
                      "email",
                      "name"
                    ],
                    "additionalProperties": false
                  },
                  {
                    "type": "null"
                  }
                ]
              },
              "primary": {
                "anyOf": [
                  {
                    "type": "object",
                    "properties": {
                      "email": {
                        "type": "string"
                      },
                      "name": {
                        "type": "string"
                      },
                      "phone": {
                        "anyOf": [
                          {
                            "anyOf": [
                              {
                                "type": "string"
                              },
                              {
                                "type": "null"
                              }
                            ]
                          },
                          {
                            "type": "null"
                          }
                        ]
                      }
                    },
                    "required": [
                      "email",
                      "name"
                    ],
                    "additionalProperties": false
                  },
                  {
                    "type": "null"
                  }
                ]
              }
            },
            "required": [
              "compliance",
              "primary"
            ],
            "additionalProperties": false
          },
          "createdAt": {
            "type": "string"
          },
          "externalId": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ]
          },
          "id": {
            "type": "string",
            "pattern": "^prac_[0-7][0-9a-hjkmnp-tv-z]{25}$",
            "examples": [
              "prac_01j2y8m6jcc9tt24af5pw9x1bc"
            ]
          },
          "legalName": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ]
          },
          "livemode": {
            "type": "boolean"
          },
          "metadata": {
            "type": "object"
          },
          "name": {
            "type": "string"
          },
          "object": {
            "type": "string",
            "enum": [
              "practice"
            ]
          },
          "prescribers": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "credentials": {
                  "anyOf": [
                    {
                      "anyOf": [
                        {
                          "type": "string"
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    {
                      "type": "null"
                    }
                  ]
                },
                "licenseStates": {
                  "type": "array",
                  "items": {
                    "type": "string"
                  }
                },
                "name": {
                  "type": "string"
                },
                "npi": {
                  "type": "string"
                }
              },
              "required": [
                "licenseStates",
                "name",
                "npi"
              ],
              "additionalProperties": false
            }
          },
          "liveEnabled": {
            "type": "boolean",
            "description": "Whether this practice currently has Live access. False for Test practices."
          },
          "supportEmail": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ]
          },
          "supportPhone": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ]
          },
          "timezone": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ]
          }
        },
        "required": [
          "address",
          "contacts",
          "createdAt",
          "externalId",
          "id",
          "legalName",
          "livemode",
          "metadata",
          "name",
          "object",
          "prescribers",
          "liveEnabled",
          "supportEmail",
          "supportPhone",
          "timezone"
        ],
        "additionalProperties": false
      },
      "ListPatientsResponse": {
        "title": "ListPatientsResponse",
        "type": "object",
        "properties": {
          "data": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "address": {
                  "anyOf": [
                    {
                      "type": "object",
                      "properties": {
                        "city": {
                          "type": "string",
                          "allOf": [
                            {
                              "pattern": "^[^\\u0000\\p{Cs}]*$"
                            },
                            {
                              "pattern": "^[^\\p{Cc}\\u200B\\u2028-\\u202E\\u2066-\\u2069]*$"
                            }
                          ]
                        },
                        "country": {
                          "anyOf": [
                            {
                              "type": "string",
                              "allOf": [
                                {
                                  "pattern": "^[^\\u0000\\p{Cs}]*$"
                                },
                                {
                                  "pattern": "^[^\\p{Cc}\\u200B\\u2028-\\u202E\\u2066-\\u2069]*$"
                                }
                              ]
                            },
                            {
                              "type": "null"
                            }
                          ]
                        },
                        "line1": {
                          "type": "string",
                          "allOf": [
                            {
                              "pattern": "^[^\\u0000\\p{Cs}]*$"
                            },
                            {
                              "pattern": "^[^\\p{Cc}\\u200B\\u2028-\\u202E\\u2066-\\u2069]*$"
                            }
                          ]
                        },
                        "line2": {
                          "anyOf": [
                            {
                              "anyOf": [
                                {
                                  "type": "string",
                                  "allOf": [
                                    {
                                      "pattern": "^[^\\u0000\\p{Cs}]*$"
                                    },
                                    {
                                      "pattern": "^[^\\p{Cc}\\u200B\\u2028-\\u202E\\u2066-\\u2069]*$"
                                    }
                                  ]
                                },
                                {
                                  "type": "null"
                                }
                              ]
                            },
                            {
                              "type": "null"
                            }
                          ]
                        },
                        "postalCode": {
                          "type": "string",
                          "allOf": [
                            {
                              "pattern": "^[^\\u0000\\p{Cs}]*$"
                            },
                            {
                              "pattern": "^[^\\p{Cc}\\u200B\\u2028-\\u202E\\u2066-\\u2069]*$"
                            }
                          ]
                        },
                        "state": {
                          "type": "string",
                          "allOf": [
                            {
                              "pattern": "^[^\\u0000\\p{Cs}]*$"
                            },
                            {
                              "pattern": "^[^\\p{Cc}\\u200B\\u2028-\\u202E\\u2066-\\u2069]*$"
                            }
                          ]
                        }
                      },
                      "required": [
                        "city",
                        "line1",
                        "postalCode",
                        "state"
                      ],
                      "additionalProperties": false
                    },
                    {
                      "type": "null"
                    }
                  ]
                },
                "defaultShippingAddressId": {
                  "anyOf": [
                    {
                      "type": "string",
                      "allOf": [
                        {
                          "pattern": "^addr_[0-7][0-9a-hjkmnp-tv-z]{25}$",
                          "examples": [
                            "addr_01j2y8m6jcc9tt24af5pw9x1bc"
                          ]
                        }
                      ]
                    },
                    {
                      "type": "null"
                    }
                  ]
                },
                "shippingAddress": {
                  "anyOf": [
                    {
                      "type": "object",
                      "properties": {
                        "city": {
                          "type": "string",
                          "allOf": [
                            {
                              "pattern": "^[^\\u0000\\p{Cs}]*$"
                            },
                            {
                              "pattern": "^[^\\p{Cc}\\u200B\\u2028-\\u202E\\u2066-\\u2069]*$"
                            }
                          ]
                        },
                        "country": {
                          "anyOf": [
                            {
                              "type": "string",
                              "allOf": [
                                {
                                  "pattern": "^[^\\u0000\\p{Cs}]*$"
                                },
                                {
                                  "pattern": "^[^\\p{Cc}\\u200B\\u2028-\\u202E\\u2066-\\u2069]*$"
                                }
                              ]
                            },
                            {
                              "type": "null"
                            }
                          ]
                        },
                        "line1": {
                          "type": "string",
                          "allOf": [
                            {
                              "pattern": "^[^\\u0000\\p{Cs}]*$"
                            },
                            {
                              "pattern": "^[^\\p{Cc}\\u200B\\u2028-\\u202E\\u2066-\\u2069]*$"
                            }
                          ]
                        },
                        "line2": {
                          "anyOf": [
                            {
                              "anyOf": [
                                {
                                  "type": "string",
                                  "allOf": [
                                    {
                                      "pattern": "^[^\\u0000\\p{Cs}]*$"
                                    },
                                    {
                                      "pattern": "^[^\\p{Cc}\\u200B\\u2028-\\u202E\\u2066-\\u2069]*$"
                                    }
                                  ]
                                },
                                {
                                  "type": "null"
                                }
                              ]
                            },
                            {
                              "type": "null"
                            }
                          ]
                        },
                        "postalCode": {
                          "type": "string",
                          "allOf": [
                            {
                              "pattern": "^[^\\u0000\\p{Cs}]*$"
                            },
                            {
                              "pattern": "^[^\\p{Cc}\\u200B\\u2028-\\u202E\\u2066-\\u2069]*$"
                            }
                          ]
                        },
                        "state": {
                          "type": "string",
                          "allOf": [
                            {
                              "pattern": "^[^\\u0000\\p{Cs}]*$"
                            },
                            {
                              "pattern": "^[^\\p{Cc}\\u200B\\u2028-\\u202E\\u2066-\\u2069]*$"
                            }
                          ]
                        }
                      },
                      "required": [
                        "city",
                        "line1",
                        "postalCode",
                        "state"
                      ],
                      "additionalProperties": false
                    },
                    {
                      "type": "null"
                    }
                  ]
                },
                "allergyReviewStatus": {
                  "type": "string",
                  "enum": [
                    "not_reviewed",
                    "no_known",
                    "recorded"
                  ]
                },
                "allergySummary": {
                  "type": "array",
                  "items": {
                    "type": "object",
                    "properties": {
                      "reaction": {
                        "anyOf": [
                          {
                            "type": "string"
                          },
                          {
                            "type": "null"
                          }
                        ]
                      },
                      "substance": {
                        "type": "string"
                      }
                    },
                    "required": [
                      "reaction",
                      "substance"
                    ],
                    "additionalProperties": false
                  }
                },
                "createdAt": {
                  "type": "string"
                },
                "clinicalProfile": {
                  "type": "object",
                  "properties": {
                    "currentMedications": {
                      "type": "array",
                      "items": {
                        "type": "string"
                      }
                    },
                    "heightInches": {
                      "anyOf": [
                        {
                          "anyOf": [
                            {
                              "type": "number"
                            },
                            {
                              "type": "string",
                              "enum": [
                                "Infinity",
                                "-Infinity",
                                "NaN"
                              ]
                            }
                          ]
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "reviewedAt": {
                      "anyOf": [
                        {
                          "type": "string"
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "weightPounds": {
                      "anyOf": [
                        {
                          "anyOf": [
                            {
                              "type": "number"
                            },
                            {
                              "type": "string",
                              "enum": [
                                "Infinity",
                                "-Infinity",
                                "NaN"
                              ]
                            }
                          ]
                        },
                        {
                          "type": "null"
                        }
                      ]
                    }
                  },
                  "required": [
                    "currentMedications",
                    "heightInches",
                    "reviewedAt",
                    "weightPounds"
                  ],
                  "additionalProperties": false
                },
                "dateOfBirth": {
                  "type": "string",
                  "pattern": "^\\d{4}-\\d{2}-\\d{2}$"
                },
                "email": {
                  "anyOf": [
                    {
                      "type": "string"
                    },
                    {
                      "type": "null"
                    }
                  ]
                },
                "externalId": {
                  "anyOf": [
                    {
                      "type": "string",
                      "allOf": [
                        {
                          "pattern": "^[^\\u0000\\p{Cs}]*$"
                        }
                      ]
                    },
                    {
                      "type": "null"
                    }
                  ]
                },
                "externalIdentities": {
                  "type": "array",
                  "items": {
                    "type": "object",
                    "properties": {
                      "source": {
                        "type": "string",
                        "allOf": [
                          {
                            "pattern": "^[^\\u0000\\p{Cs}]*$"
                          }
                        ]
                      },
                      "value": {
                        "type": "string",
                        "allOf": [
                          {
                            "pattern": "^[^\\u0000\\p{Cs}]*$"
                          }
                        ]
                      }
                    },
                    "required": [
                      "source",
                      "value"
                    ],
                    "additionalProperties": false
                  }
                },
                "addresses": {
                  "type": "array",
                  "items": {
                    "type": "object",
                    "properties": {
                      "id": {
                        "type": "string",
                        "allOf": [
                          {
                            "pattern": "^addr_[0-7][0-9a-hjkmnp-tv-z]{25}$",
                            "examples": [
                              "addr_01j2y8m6jcc9tt24af5pw9x1bc"
                            ]
                          }
                        ]
                      },
                      "address": {
                        "type": "object",
                        "properties": {
                          "city": {
                            "type": "string",
                            "allOf": [
                              {
                                "pattern": "^[^\\u0000\\p{Cs}]*$"
                              },
                              {
                                "pattern": "^[^\\p{Cc}\\u200B\\u2028-\\u202E\\u2066-\\u2069]*$"
                              }
                            ]
                          },
                          "country": {
                            "anyOf": [
                              {
                                "type": "string",
                                "allOf": [
                                  {
                                    "pattern": "^[^\\u0000\\p{Cs}]*$"
                                  },
                                  {
                                    "pattern": "^[^\\p{Cc}\\u200B\\u2028-\\u202E\\u2066-\\u2069]*$"
                                  }
                                ]
                              },
                              {
                                "type": "null"
                              }
                            ]
                          },
                          "line1": {
                            "type": "string",
                            "allOf": [
                              {
                                "pattern": "^[^\\u0000\\p{Cs}]*$"
                              },
                              {
                                "pattern": "^[^\\p{Cc}\\u200B\\u2028-\\u202E\\u2066-\\u2069]*$"
                              }
                            ]
                          },
                          "line2": {
                            "anyOf": [
                              {
                                "anyOf": [
                                  {
                                    "type": "string",
                                    "allOf": [
                                      {
                                        "pattern": "^[^\\u0000\\p{Cs}]*$"
                                      },
                                      {
                                        "pattern": "^[^\\p{Cc}\\u200B\\u2028-\\u202E\\u2066-\\u2069]*$"
                                      }
                                    ]
                                  },
                                  {
                                    "type": "null"
                                  }
                                ]
                              },
                              {
                                "type": "null"
                              }
                            ]
                          },
                          "postalCode": {
                            "type": "string",
                            "allOf": [
                              {
                                "pattern": "^[^\\u0000\\p{Cs}]*$"
                              },
                              {
                                "pattern": "^[^\\p{Cc}\\u200B\\u2028-\\u202E\\u2066-\\u2069]*$"
                              }
                            ]
                          },
                          "state": {
                            "type": "string",
                            "allOf": [
                              {
                                "pattern": "^[^\\u0000\\p{Cs}]*$"
                              },
                              {
                                "pattern": "^[^\\p{Cc}\\u200B\\u2028-\\u202E\\u2066-\\u2069]*$"
                              }
                            ]
                          }
                        },
                        "required": [
                          "city",
                          "line1",
                          "postalCode",
                          "state"
                        ],
                        "additionalProperties": false
                      },
                      "label": {
                        "type": "string",
                        "allOf": [
                          {
                            "pattern": "^[^\\u0000\\p{Cs}]*$"
                          }
                        ]
                      },
                      "preferredShipping": {
                        "type": "boolean"
                      },
                      "recipientName": {
                        "anyOf": [
                          {
                            "type": "string",
                            "allOf": [
                              {
                                "pattern": "^[^\\u0000\\p{Cs}]*$"
                              },
                              {
                                "pattern": "^[^\\p{Cc}\\u200B\\u2028-\\u202E\\u2066-\\u2069]*$"
                              }
                            ]
                          },
                          {
                            "type": "null"
                          }
                        ]
                      },
                      "archivedAt": {
                        "anyOf": [
                          {
                            "type": "string"
                          },
                          {
                            "type": "null"
                          }
                        ]
                      }
                    },
                    "required": [
                      "id",
                      "address",
                      "label",
                      "preferredShipping",
                      "recipientName",
                      "archivedAt"
                    ],
                    "additionalProperties": false
                  }
                },
                "encounters": {
                  "type": "array",
                  "items": {
                    "type": "object",
                    "properties": {
                      "notes": {
                        "anyOf": [
                          {
                            "type": "string",
                            "allOf": [
                              {
                                "pattern": "^[^\\u0000\\p{Cs}]*$"
                              },
                              {
                                "maxLength": 5000
                              }
                            ]
                          },
                          {
                            "type": "null"
                          }
                        ]
                      },
                      "occurredAt": {
                        "type": "string"
                      },
                      "providerName": {
                        "anyOf": [
                          {
                            "type": "string",
                            "allOf": [
                              {
                                "pattern": "^[^\\u0000\\p{Cs}]*$"
                              }
                            ]
                          },
                          {
                            "type": "null"
                          }
                        ]
                      },
                      "type": {
                        "type": "string",
                        "allOf": [
                          {
                            "pattern": "^[^\\u0000\\p{Cs}]*$"
                          }
                        ]
                      }
                    },
                    "required": [
                      "notes",
                      "occurredAt",
                      "providerName",
                      "type"
                    ],
                    "additionalProperties": false
                  }
                },
                "gender": {
                  "type": "string",
                  "enum": [
                    "f",
                    "m",
                    "o",
                    "u"
                  ]
                },
                "id": {
                  "type": "string",
                  "pattern": "^pat_[0-7][0-9a-hjkmnp-tv-z]{25}$",
                  "examples": [
                    "pat_01j2y8m6jcc9tt24af5pw9x1bc"
                  ]
                },
                "livemode": {
                  "type": "boolean"
                },
                "location": {
                  "type": "object",
                  "properties": {
                    "id": {
                      "type": "string",
                      "allOf": [
                        {
                          "pattern": "^loc_[0-7][0-9a-hjkmnp-tv-z]{25}$",
                          "examples": [
                            "loc_01j2y8m6jcc9tt24af5pw9x1bc"
                          ]
                        }
                      ]
                    },
                    "name": {
                      "type": "string"
                    },
                    "state": {
                      "anyOf": [
                        {
                          "type": "string"
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "status": {
                      "type": "string",
                      "enum": [
                        "active",
                        "archived"
                      ]
                    }
                  },
                  "required": [
                    "id",
                    "name",
                    "state",
                    "status"
                  ],
                  "additionalProperties": false
                },
                "locationId": {
                  "type": "string",
                  "pattern": "^loc_[0-7][0-9a-hjkmnp-tv-z]{25}$",
                  "examples": [
                    "loc_01j2y8m6jcc9tt24af5pw9x1bc"
                  ]
                },
                "metadata": {
                  "type": "object"
                },
                "medicalRecordNumber": {
                  "anyOf": [
                    {
                      "type": "string"
                    },
                    {
                      "type": "null"
                    }
                  ]
                },
                "measurements": {
                  "type": "array",
                  "items": {
                    "type": "object",
                    "properties": {
                      "heightCentimeters": {
                        "anyOf": [
                          {
                            "anyOf": [
                              {
                                "type": "number",
                                "allOf": [
                                  {
                                    "exclusiveMinimum": 0
                                  }
                                ]
                              },
                              {
                                "type": "string",
                                "enum": [
                                  "Infinity",
                                  "-Infinity",
                                  "NaN"
                                ]
                              }
                            ]
                          },
                          {
                            "type": "null"
                          }
                        ]
                      },
                      "recordedAt": {
                        "type": "string"
                      },
                      "source": {
                        "type": "string",
                        "allOf": [
                          {
                            "pattern": "^[^\\u0000\\p{Cs}]*$"
                          }
                        ]
                      },
                      "weightKilograms": {
                        "anyOf": [
                          {
                            "anyOf": [
                              {
                                "type": "number",
                                "allOf": [
                                  {
                                    "exclusiveMinimum": 0
                                  }
                                ]
                              },
                              {
                                "type": "string",
                                "enum": [
                                  "Infinity",
                                  "-Infinity",
                                  "NaN"
                                ]
                              }
                            ]
                          },
                          {
                            "type": "null"
                          }
                        ]
                      }
                    },
                    "required": [
                      "heightCentimeters",
                      "recordedAt",
                      "source",
                      "weightKilograms"
                    ],
                    "additionalProperties": false
                  }
                },
                "name": {
                  "type": "object",
                  "properties": {
                    "first": {
                      "type": "string"
                    },
                    "last": {
                      "type": "string"
                    },
                    "middle": {
                      "anyOf": [
                        {
                          "type": "string"
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "preferred": {
                      "anyOf": [
                        {
                          "type": "string"
                        },
                        {
                          "type": "null"
                        }
                      ]
                    }
                  },
                  "required": [
                    "first",
                    "last",
                    "middle",
                    "preferred"
                  ],
                  "additionalProperties": false
                },
                "object": {
                  "type": "string",
                  "enum": [
                    "patient"
                  ]
                },
                "phone": {
                  "anyOf": [
                    {
                      "type": "string"
                    },
                    {
                      "type": "null"
                    }
                  ]
                },
                "programs": {
                  "type": "array",
                  "items": {
                    "type": "object",
                    "properties": {
                      "endedAt": {
                        "anyOf": [
                          {
                            "type": "string"
                          },
                          {
                            "type": "null"
                          }
                        ]
                      },
                      "name": {
                        "type": "string",
                        "allOf": [
                          {
                            "pattern": "^[^\\u0000\\p{Cs}]*$"
                          }
                        ]
                      },
                      "startedAt": {
                        "type": "string"
                      },
                      "status": {
                        "type": "string",
                        "enum": [
                          "active",
                          "completed",
                          "paused"
                        ]
                      }
                    },
                    "required": [
                      "endedAt",
                      "name",
                      "startedAt",
                      "status"
                    ],
                    "additionalProperties": false
                  }
                },
                "practiceId": {
                  "type": "string",
                  "pattern": "^prac_[0-7][0-9a-hjkmnp-tv-z]{25}$",
                  "examples": [
                    "prac_01j2y8m6jcc9tt24af5pw9x1bc"
                  ]
                },
                "status": {
                  "type": "string",
                  "enum": [
                    "active",
                    "inactive"
                  ]
                },
                "updatedAt": {
                  "type": "string"
                }
              },
              "required": [
                "address",
                "defaultShippingAddressId",
                "shippingAddress",
                "allergyReviewStatus",
                "allergySummary",
                "createdAt",
                "clinicalProfile",
                "dateOfBirth",
                "email",
                "externalId",
                "externalIdentities",
                "addresses",
                "encounters",
                "gender",
                "id",
                "livemode",
                "location",
                "locationId",
                "metadata",
                "medicalRecordNumber",
                "measurements",
                "name",
                "object",
                "phone",
                "programs",
                "practiceId",
                "status",
                "updatedAt"
              ],
              "additionalProperties": false
            }
          },
          "hasMore": {
            "type": "boolean"
          },
          "object": {
            "type": "string",
            "enum": [
              "list"
            ]
          },
          "url": {
            "type": "string"
          }
        },
        "required": [
          "data",
          "hasMore",
          "object",
          "url"
        ],
        "additionalProperties": false
      },
      "CreatePatientRequest": {
        "type": "object",
        "properties": {
          "address": {
            "anyOf": [
              {
                "anyOf": [
                  {
                    "type": "object",
                    "properties": {
                      "city": {
                        "type": "string",
                        "pattern": "^[^\\u0000\\p{Cs}]*$",
                        "allOf": [
                          {
                            "pattern": "^[^\\p{Cc}\\u200B\\u2028-\\u202E\\u2066-\\u2069]*$"
                          }
                        ]
                      },
                      "line1": {
                        "type": "string",
                        "pattern": "^[^\\u0000\\p{Cs}]*$",
                        "allOf": [
                          {
                            "pattern": "^[^\\p{Cc}\\u200B\\u2028-\\u202E\\u2066-\\u2069]*$"
                          }
                        ]
                      },
                      "line2": {
                        "anyOf": [
                          {
                            "anyOf": [
                              {
                                "type": "string",
                                "pattern": "^[^\\u0000\\p{Cs}]*$",
                                "allOf": [
                                  {
                                    "pattern": "^[^\\p{Cc}\\u200B\\u2028-\\u202E\\u2066-\\u2069]*$"
                                  }
                                ]
                              },
                              {
                                "type": "null"
                              }
                            ]
                          },
                          {
                            "type": "null"
                          }
                        ]
                      },
                      "postalCode": {
                        "type": "string"
                      },
                      "state": {
                        "type": "string"
                      },
                      "country": {
                        "anyOf": [
                          {
                            "type": "string",
                            "enum": [
                              "US"
                            ]
                          },
                          {
                            "type": "null"
                          }
                        ]
                      }
                    },
                    "required": [
                      "city",
                      "line1",
                      "postalCode",
                      "state"
                    ],
                    "additionalProperties": false
                  },
                  {
                    "type": "null"
                  }
                ]
              },
              {
                "type": "null"
              }
            ]
          },
          "clinicalProfile": {
            "anyOf": [
              {
                "type": "object",
                "properties": {
                  "currentMedications": {
                    "type": "array",
                    "items": {
                      "type": "string",
                      "pattern": "^[^\\u0000\\p{Cs}]*$"
                    },
                    "maxItems": 100
                  },
                  "heightInches": {
                    "anyOf": [
                      {
                        "anyOf": [
                          {
                            "anyOf": [
                              {
                                "type": "number",
                                "exclusiveMinimum": 0
                              },
                              {
                                "type": "string",
                                "enum": [
                                  "Infinity",
                                  "-Infinity",
                                  "NaN"
                                ]
                              }
                            ]
                          },
                          {
                            "type": "null"
                          }
                        ]
                      },
                      {
                        "type": "null"
                      }
                    ]
                  },
                  "reviewedAt": {
                    "anyOf": [
                      {
                        "anyOf": [
                          {
                            "type": "string"
                          },
                          {
                            "type": "null"
                          }
                        ]
                      },
                      {
                        "type": "null"
                      }
                    ]
                  },
                  "weightPounds": {
                    "anyOf": [
                      {
                        "anyOf": [
                          {
                            "anyOf": [
                              {
                                "type": "number",
                                "exclusiveMinimum": 0
                              },
                              {
                                "type": "string",
                                "enum": [
                                  "Infinity",
                                  "-Infinity",
                                  "NaN"
                                ]
                              }
                            ]
                          },
                          {
                            "type": "null"
                          }
                        ]
                      },
                      {
                        "type": "null"
                      }
                    ]
                  }
                },
                "required": [
                  "currentMedications"
                ],
                "additionalProperties": false
              },
              {
                "type": "null"
              }
            ]
          },
          "dateOfBirth": {
            "type": "string",
            "pattern": "^\\d{4}-\\d{2}-\\d{2}$"
          },
          "email": {
            "anyOf": [
              {
                "anyOf": [
                  {
                    "type": "string"
                  },
                  {
                    "type": "null"
                  }
                ]
              },
              {
                "type": "null"
              }
            ]
          },
          "externalId": {
            "anyOf": [
              {
                "type": "string",
                "pattern": "^[^\\u0000\\p{Cs}]*$"
              },
              {
                "type": "null"
              }
            ]
          },
          "externalIdentities": {
            "anyOf": [
              {
                "type": "array",
                "items": {
                  "type": "object",
                  "properties": {
                    "source": {
                      "type": "string",
                      "pattern": "^[^\\u0000\\p{Cs}]*$"
                    },
                    "value": {
                      "type": "string",
                      "pattern": "^[^\\u0000\\p{Cs}]*$"
                    }
                  },
                  "required": [
                    "source",
                    "value"
                  ],
                  "additionalProperties": false
                },
                "maxItems": 50
              },
              {
                "type": "null"
              }
            ]
          },
          "addresses": {
            "anyOf": [
              {
                "type": "array",
                "items": {
                  "type": "object",
                  "properties": {
                    "id": {
                      "anyOf": [
                        {
                          "type": "string",
                          "pattern": "^addr_[0-7][0-9a-hjkmnp-tv-z]{25}$",
                          "examples": [
                            "addr_01j2y8m6jcc9tt24af5pw9x1bc"
                          ]
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "address": {
                      "type": "object",
                      "properties": {
                        "city": {
                          "type": "string",
                          "pattern": "^[^\\u0000\\p{Cs}]*$",
                          "allOf": [
                            {
                              "pattern": "^[^\\p{Cc}\\u200B\\u2028-\\u202E\\u2066-\\u2069]*$"
                            }
                          ]
                        },
                        "country": {
                          "anyOf": [
                            {
                              "type": "string",
                              "enum": [
                                "US"
                              ]
                            },
                            {
                              "type": "null"
                            }
                          ]
                        },
                        "line1": {
                          "type": "string",
                          "pattern": "^[^\\u0000\\p{Cs}]*$",
                          "allOf": [
                            {
                              "pattern": "^[^\\p{Cc}\\u200B\\u2028-\\u202E\\u2066-\\u2069]*$"
                            }
                          ]
                        },
                        "line2": {
                          "anyOf": [
                            {
                              "anyOf": [
                                {
                                  "type": "string",
                                  "pattern": "^[^\\u0000\\p{Cs}]*$",
                                  "allOf": [
                                    {
                                      "pattern": "^[^\\p{Cc}\\u200B\\u2028-\\u202E\\u2066-\\u2069]*$"
                                    }
                                  ]
                                },
                                {
                                  "type": "null"
                                }
                              ]
                            },
                            {
                              "type": "null"
                            }
                          ]
                        },
                        "postalCode": {
                          "type": "string"
                        },
                        "state": {
                          "type": "string"
                        }
                      },
                      "required": [
                        "city",
                        "line1",
                        "postalCode",
                        "state"
                      ],
                      "additionalProperties": false
                    },
                    "label": {
                      "type": "string",
                      "pattern": "^[^\\u0000\\p{Cs}]*$"
                    },
                    "preferredShipping": {
                      "type": "boolean"
                    },
                    "recipientName": {
                      "anyOf": [
                        {
                          "type": "string",
                          "pattern": "^[^\\u0000\\p{Cs}]*$",
                          "allOf": [
                            {
                              "pattern": "^[^\\p{Cc}\\u200B\\u2028-\\u202E\\u2066-\\u2069]*$"
                            }
                          ]
                        },
                        {
                          "type": "null"
                        }
                      ]
                    }
                  },
                  "required": [
                    "address",
                    "label",
                    "preferredShipping",
                    "recipientName"
                  ],
                  "additionalProperties": false
                },
                "maxItems": 50
              },
              {
                "type": "null"
              }
            ]
          },
          "encounters": {
            "anyOf": [
              {
                "type": "array",
                "items": {
                  "type": "object",
                  "properties": {
                    "notes": {
                      "anyOf": [
                        {
                          "type": "string",
                          "pattern": "^[^\\u0000\\p{Cs}]*$",
                          "maxLength": 5000
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "occurredAt": {
                      "type": "string"
                    },
                    "providerName": {
                      "anyOf": [
                        {
                          "type": "string",
                          "pattern": "^[^\\u0000\\p{Cs}]*$"
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "type": {
                      "type": "string",
                      "pattern": "^[^\\u0000\\p{Cs}]*$"
                    }
                  },
                  "required": [
                    "notes",
                    "occurredAt",
                    "providerName",
                    "type"
                  ],
                  "additionalProperties": false
                }
              },
              {
                "type": "null"
              }
            ]
          },
          "gender": {
            "anyOf": [
              {
                "type": "string",
                "enum": [
                  "f",
                  "m",
                  "o",
                  "u"
                ]
              },
              {
                "type": "null"
              }
            ]
          },
          "locationId": {
            "anyOf": [
              {
                "type": "string",
                "pattern": "^loc_[0-7][0-9a-hjkmnp-tv-z]{25}$",
                "examples": [
                  "loc_01j2y8m6jcc9tt24af5pw9x1bc"
                ]
              },
              {
                "type": "null"
              }
            ]
          },
          "metadata": {
            "anyOf": [
              {
                "type": "object"
              },
              {
                "type": "null"
              }
            ]
          },
          "medicalRecordNumber": {
            "anyOf": [
              {
                "anyOf": [
                  {
                    "type": "string",
                    "pattern": "^[^\\u0000\\p{Cs}]*$"
                  },
                  {
                    "type": "null"
                  }
                ]
              },
              {
                "type": "null"
              }
            ]
          },
          "measurements": {
            "anyOf": [
              {
                "type": "array",
                "items": {
                  "type": "object",
                  "properties": {
                    "heightCentimeters": {
                      "anyOf": [
                        {
                          "anyOf": [
                            {
                              "type": "number",
                              "exclusiveMinimum": 0
                            },
                            {
                              "type": "string",
                              "enum": [
                                "Infinity",
                                "-Infinity",
                                "NaN"
                              ]
                            }
                          ]
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "recordedAt": {
                      "type": "string"
                    },
                    "source": {
                      "type": "string",
                      "pattern": "^[^\\u0000\\p{Cs}]*$"
                    },
                    "weightKilograms": {
                      "anyOf": [
                        {
                          "anyOf": [
                            {
                              "type": "number",
                              "exclusiveMinimum": 0
                            },
                            {
                              "type": "string",
                              "enum": [
                                "Infinity",
                                "-Infinity",
                                "NaN"
                              ]
                            }
                          ]
                        },
                        {
                          "type": "null"
                        }
                      ]
                    }
                  },
                  "required": [
                    "heightCentimeters",
                    "recordedAt",
                    "source",
                    "weightKilograms"
                  ],
                  "additionalProperties": false
                }
              },
              {
                "type": "null"
              }
            ]
          },
          "name": {
            "type": "object",
            "properties": {
              "first": {
                "type": "string",
                "pattern": "^[^\\u0000\\p{Cs}]*$",
                "allOf": [
                  {
                    "pattern": "^[^\\p{Cc}\\u200B\\u2028-\\u202E\\u2066-\\u2069]*$"
                  }
                ]
              },
              "last": {
                "type": "string",
                "pattern": "^[^\\u0000\\p{Cs}]*$",
                "allOf": [
                  {
                    "pattern": "^[^\\p{Cc}\\u200B\\u2028-\\u202E\\u2066-\\u2069]*$"
                  }
                ]
              },
              "middle": {
                "anyOf": [
                  {
                    "anyOf": [
                      {
                        "type": "string",
                        "pattern": "^[^\\u0000\\p{Cs}]*$",
                        "allOf": [
                          {
                            "pattern": "^[^\\p{Cc}\\u200B\\u2028-\\u202E\\u2066-\\u2069]*$"
                          }
                        ]
                      },
                      {
                        "type": "null"
                      }
                    ]
                  },
                  {
                    "type": "null"
                  }
                ]
              },
              "preferred": {
                "anyOf": [
                  {
                    "anyOf": [
                      {
                        "type": "string",
                        "pattern": "^[^\\u0000\\p{Cs}]*$",
                        "allOf": [
                          {
                            "pattern": "^[^\\p{Cc}\\u200B\\u2028-\\u202E\\u2066-\\u2069]*$"
                          }
                        ]
                      },
                      {
                        "type": "null"
                      }
                    ]
                  },
                  {
                    "type": "null"
                  }
                ]
              }
            },
            "required": [
              "first",
              "last"
            ],
            "additionalProperties": false
          },
          "phone": {
            "anyOf": [
              {
                "anyOf": [
                  {
                    "type": "string"
                  },
                  {
                    "type": "null"
                  }
                ]
              },
              {
                "type": "null"
              }
            ]
          },
          "programs": {
            "anyOf": [
              {
                "type": "array",
                "items": {
                  "type": "object",
                  "properties": {
                    "endedAt": {
                      "anyOf": [
                        {
                          "type": "string"
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "name": {
                      "type": "string",
                      "pattern": "^[^\\u0000\\p{Cs}]*$"
                    },
                    "startedAt": {
                      "type": "string"
                    },
                    "status": {
                      "type": "string",
                      "enum": [
                        "active",
                        "completed",
                        "paused"
                      ]
                    }
                  },
                  "required": [
                    "endedAt",
                    "name",
                    "startedAt",
                    "status"
                  ],
                  "additionalProperties": false
                }
              },
              {
                "type": "null"
              }
            ]
          }
        },
        "required": [
          "dateOfBirth",
          "name"
        ],
        "additionalProperties": false,
        "title": "CreatePatientRequest"
      },
      "CreatePatientResponse": {
        "title": "CreatePatientResponse",
        "type": "object",
        "properties": {
          "address": {
            "anyOf": [
              {
                "type": "object",
                "properties": {
                  "city": {
                    "type": "string",
                    "allOf": [
                      {
                        "pattern": "^[^\\u0000\\p{Cs}]*$"
                      },
                      {
                        "pattern": "^[^\\p{Cc}\\u200B\\u2028-\\u202E\\u2066-\\u2069]*$"
                      }
                    ]
                  },
                  "country": {
                    "anyOf": [
                      {
                        "type": "string",
                        "allOf": [
                          {
                            "pattern": "^[^\\u0000\\p{Cs}]*$"
                          },
                          {
                            "pattern": "^[^\\p{Cc}\\u200B\\u2028-\\u202E\\u2066-\\u2069]*$"
                          }
                        ]
                      },
                      {
                        "type": "null"
                      }
                    ]
                  },
                  "line1": {
                    "type": "string",
                    "allOf": [
                      {
                        "pattern": "^[^\\u0000\\p{Cs}]*$"
                      },
                      {
                        "pattern": "^[^\\p{Cc}\\u200B\\u2028-\\u202E\\u2066-\\u2069]*$"
                      }
                    ]
                  },
                  "line2": {
                    "anyOf": [
                      {
                        "anyOf": [
                          {
                            "type": "string",
                            "allOf": [
                              {
                                "pattern": "^[^\\u0000\\p{Cs}]*$"
                              },
                              {
                                "pattern": "^[^\\p{Cc}\\u200B\\u2028-\\u202E\\u2066-\\u2069]*$"
                              }
                            ]
                          },
                          {
                            "type": "null"
                          }
                        ]
                      },
                      {
                        "type": "null"
                      }
                    ]
                  },
                  "postalCode": {
                    "type": "string",
                    "allOf": [
                      {
                        "pattern": "^[^\\u0000\\p{Cs}]*$"
                      },
                      {
                        "pattern": "^[^\\p{Cc}\\u200B\\u2028-\\u202E\\u2066-\\u2069]*$"
                      }
                    ]
                  },
                  "state": {
                    "type": "string",
                    "allOf": [
                      {
                        "pattern": "^[^\\u0000\\p{Cs}]*$"
                      },
                      {
                        "pattern": "^[^\\p{Cc}\\u200B\\u2028-\\u202E\\u2066-\\u2069]*$"
                      }
                    ]
                  }
                },
                "required": [
                  "city",
                  "line1",
                  "postalCode",
                  "state"
                ],
                "additionalProperties": false
              },
              {
                "type": "null"
              }
            ]
          },
          "defaultShippingAddressId": {
            "anyOf": [
              {
                "type": "string",
                "allOf": [
                  {
                    "pattern": "^addr_[0-7][0-9a-hjkmnp-tv-z]{25}$",
                    "examples": [
                      "addr_01j2y8m6jcc9tt24af5pw9x1bc"
                    ]
                  }
                ]
              },
              {
                "type": "null"
              }
            ]
          },
          "shippingAddress": {
            "anyOf": [
              {
                "type": "object",
                "properties": {
                  "city": {
                    "type": "string",
                    "allOf": [
                      {
                        "pattern": "^[^\\u0000\\p{Cs}]*$"
                      },
                      {
                        "pattern": "^[^\\p{Cc}\\u200B\\u2028-\\u202E\\u2066-\\u2069]*$"
                      }
                    ]
                  },
                  "country": {
                    "anyOf": [
                      {
                        "type": "string",
                        "allOf": [
                          {
                            "pattern": "^[^\\u0000\\p{Cs}]*$"
                          },
                          {
                            "pattern": "^[^\\p{Cc}\\u200B\\u2028-\\u202E\\u2066-\\u2069]*$"
                          }
                        ]
                      },
                      {
                        "type": "null"
                      }
                    ]
                  },
                  "line1": {
                    "type": "string",
                    "allOf": [
                      {
                        "pattern": "^[^\\u0000\\p{Cs}]*$"
                      },
                      {
                        "pattern": "^[^\\p{Cc}\\u200B\\u2028-\\u202E\\u2066-\\u2069]*$"
                      }
                    ]
                  },
                  "line2": {
                    "anyOf": [
                      {
                        "anyOf": [
                          {
                            "type": "string",
                            "allOf": [
                              {
                                "pattern": "^[^\\u0000\\p{Cs}]*$"
                              },
                              {
                                "pattern": "^[^\\p{Cc}\\u200B\\u2028-\\u202E\\u2066-\\u2069]*$"
                              }
                            ]
                          },
                          {
                            "type": "null"
                          }
                        ]
                      },
                      {
                        "type": "null"
                      }
                    ]
                  },
                  "postalCode": {
                    "type": "string",
                    "allOf": [
                      {
                        "pattern": "^[^\\u0000\\p{Cs}]*$"
                      },
                      {
                        "pattern": "^[^\\p{Cc}\\u200B\\u2028-\\u202E\\u2066-\\u2069]*$"
                      }
                    ]
                  },
                  "state": {
                    "type": "string",
                    "allOf": [
                      {
                        "pattern": "^[^\\u0000\\p{Cs}]*$"
                      },
                      {
                        "pattern": "^[^\\p{Cc}\\u200B\\u2028-\\u202E\\u2066-\\u2069]*$"
                      }
                    ]
                  }
                },
                "required": [
                  "city",
                  "line1",
                  "postalCode",
                  "state"
                ],
                "additionalProperties": false
              },
              {
                "type": "null"
              }
            ]
          },
          "allergyReviewStatus": {
            "type": "string",
            "enum": [
              "not_reviewed",
              "no_known",
              "recorded"
            ]
          },
          "allergySummary": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "reaction": {
                  "anyOf": [
                    {
                      "type": "string"
                    },
                    {
                      "type": "null"
                    }
                  ]
                },
                "substance": {
                  "type": "string"
                }
              },
              "required": [
                "reaction",
                "substance"
              ],
              "additionalProperties": false
            }
          },
          "createdAt": {
            "type": "string"
          },
          "clinicalProfile": {
            "type": "object",
            "properties": {
              "currentMedications": {
                "type": "array",
                "items": {
                  "type": "string"
                }
              },
              "heightInches": {
                "anyOf": [
                  {
                    "anyOf": [
                      {
                        "type": "number"
                      },
                      {
                        "type": "string",
                        "enum": [
                          "Infinity",
                          "-Infinity",
                          "NaN"
                        ]
                      }
                    ]
                  },
                  {
                    "type": "null"
                  }
                ]
              },
              "reviewedAt": {
                "anyOf": [
                  {
                    "type": "string"
                  },
                  {
                    "type": "null"
                  }
                ]
              },
              "weightPounds": {
                "anyOf": [
                  {
                    "anyOf": [
                      {
                        "type": "number"
                      },
                      {
                        "type": "string",
                        "enum": [
                          "Infinity",
                          "-Infinity",
                          "NaN"
                        ]
                      }
                    ]
                  },
                  {
                    "type": "null"
                  }
                ]
              }
            },
            "required": [
              "currentMedications",
              "heightInches",
              "reviewedAt",
              "weightPounds"
            ],
            "additionalProperties": false
          },
          "dateOfBirth": {
            "type": "string",
            "pattern": "^\\d{4}-\\d{2}-\\d{2}$"
          },
          "email": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ]
          },
          "externalId": {
            "anyOf": [
              {
                "type": "string",
                "allOf": [
                  {
                    "pattern": "^[^\\u0000\\p{Cs}]*$"
                  }
                ]
              },
              {
                "type": "null"
              }
            ]
          },
          "externalIdentities": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "source": {
                  "type": "string",
                  "allOf": [
                    {
                      "pattern": "^[^\\u0000\\p{Cs}]*$"
                    }
                  ]
                },
                "value": {
                  "type": "string",
                  "allOf": [
                    {
                      "pattern": "^[^\\u0000\\p{Cs}]*$"
                    }
                  ]
                }
              },
              "required": [
                "source",
                "value"
              ],
              "additionalProperties": false
            }
          },
          "addresses": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "id": {
                  "type": "string",
                  "allOf": [
                    {
                      "pattern": "^addr_[0-7][0-9a-hjkmnp-tv-z]{25}$",
                      "examples": [
                        "addr_01j2y8m6jcc9tt24af5pw9x1bc"
                      ]
                    }
                  ]
                },
                "address": {
                  "type": "object",
                  "properties": {
                    "city": {
                      "type": "string",
                      "allOf": [
                        {
                          "pattern": "^[^\\u0000\\p{Cs}]*$"
                        },
                        {
                          "pattern": "^[^\\p{Cc}\\u200B\\u2028-\\u202E\\u2066-\\u2069]*$"
                        }
                      ]
                    },
                    "country": {
                      "anyOf": [
                        {
                          "type": "string",
                          "allOf": [
                            {
                              "pattern": "^[^\\u0000\\p{Cs}]*$"
                            },
                            {
                              "pattern": "^[^\\p{Cc}\\u200B\\u2028-\\u202E\\u2066-\\u2069]*$"
                            }
                          ]
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "line1": {
                      "type": "string",
                      "allOf": [
                        {
                          "pattern": "^[^\\u0000\\p{Cs}]*$"
                        },
                        {
                          "pattern": "^[^\\p{Cc}\\u200B\\u2028-\\u202E\\u2066-\\u2069]*$"
                        }
                      ]
                    },
                    "line2": {
                      "anyOf": [
                        {
                          "anyOf": [
                            {
                              "type": "string",
                              "allOf": [
                                {
                                  "pattern": "^[^\\u0000\\p{Cs}]*$"
                                },
                                {
                                  "pattern": "^[^\\p{Cc}\\u200B\\u2028-\\u202E\\u2066-\\u2069]*$"
                                }
                              ]
                            },
                            {
                              "type": "null"
                            }
                          ]
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "postalCode": {
                      "type": "string",
                      "allOf": [
                        {
                          "pattern": "^[^\\u0000\\p{Cs}]*$"
                        },
                        {
                          "pattern": "^[^\\p{Cc}\\u200B\\u2028-\\u202E\\u2066-\\u2069]*$"
                        }
                      ]
                    },
                    "state": {
                      "type": "string",
                      "allOf": [
                        {
                          "pattern": "^[^\\u0000\\p{Cs}]*$"
                        },
                        {
                          "pattern": "^[^\\p{Cc}\\u200B\\u2028-\\u202E\\u2066-\\u2069]*$"
                        }
                      ]
                    }
                  },
                  "required": [
                    "city",
                    "line1",
                    "postalCode",
                    "state"
                  ],
                  "additionalProperties": false
                },
                "label": {
                  "type": "string",
                  "allOf": [
                    {
                      "pattern": "^[^\\u0000\\p{Cs}]*$"
                    }
                  ]
                },
                "preferredShipping": {
                  "type": "boolean"
                },
                "recipientName": {
                  "anyOf": [
                    {
                      "type": "string",
                      "allOf": [
                        {
                          "pattern": "^[^\\u0000\\p{Cs}]*$"
                        },
                        {
                          "pattern": "^[^\\p{Cc}\\u200B\\u2028-\\u202E\\u2066-\\u2069]*$"
                        }
                      ]
                    },
                    {
                      "type": "null"
                    }
                  ]
                },
                "archivedAt": {
                  "anyOf": [
                    {
                      "type": "string"
                    },
                    {
                      "type": "null"
                    }
                  ]
                }
              },
              "required": [
                "id",
                "address",
                "label",
                "preferredShipping",
                "recipientName",
                "archivedAt"
              ],
              "additionalProperties": false
            }
          },
          "encounters": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "notes": {
                  "anyOf": [
                    {
                      "type": "string",
                      "allOf": [
                        {
                          "pattern": "^[^\\u0000\\p{Cs}]*$"
                        },
                        {
                          "maxLength": 5000
                        }
                      ]
                    },
                    {
                      "type": "null"
                    }
                  ]
                },
                "occurredAt": {
                  "type": "string"
                },
                "providerName": {
                  "anyOf": [
                    {
                      "type": "string",
                      "allOf": [
                        {
                          "pattern": "^[^\\u0000\\p{Cs}]*$"
                        }
                      ]
                    },
                    {
                      "type": "null"
                    }
                  ]
                },
                "type": {
                  "type": "string",
                  "allOf": [
                    {
                      "pattern": "^[^\\u0000\\p{Cs}]*$"
                    }
                  ]
                }
              },
              "required": [
                "notes",
                "occurredAt",
                "providerName",
                "type"
              ],
              "additionalProperties": false
            }
          },
          "gender": {
            "type": "string",
            "enum": [
              "f",
              "m",
              "o",
              "u"
            ]
          },
          "id": {
            "type": "string",
            "pattern": "^pat_[0-7][0-9a-hjkmnp-tv-z]{25}$",
            "examples": [
              "pat_01j2y8m6jcc9tt24af5pw9x1bc"
            ]
          },
          "livemode": {
            "type": "boolean"
          },
          "location": {
            "type": "object",
            "properties": {
              "id": {
                "type": "string",
                "allOf": [
                  {
                    "pattern": "^loc_[0-7][0-9a-hjkmnp-tv-z]{25}$",
                    "examples": [
                      "loc_01j2y8m6jcc9tt24af5pw9x1bc"
                    ]
                  }
                ]
              },
              "name": {
                "type": "string"
              },
              "state": {
                "anyOf": [
                  {
                    "type": "string"
                  },
                  {
                    "type": "null"
                  }
                ]
              },
              "status": {
                "type": "string",
                "enum": [
                  "active",
                  "archived"
                ]
              }
            },
            "required": [
              "id",
              "name",
              "state",
              "status"
            ],
            "additionalProperties": false
          },
          "locationId": {
            "type": "string",
            "pattern": "^loc_[0-7][0-9a-hjkmnp-tv-z]{25}$",
            "examples": [
              "loc_01j2y8m6jcc9tt24af5pw9x1bc"
            ]
          },
          "metadata": {
            "type": "object"
          },
          "medicalRecordNumber": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ]
          },
          "measurements": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "heightCentimeters": {
                  "anyOf": [
                    {
                      "anyOf": [
                        {
                          "type": "number",
                          "allOf": [
                            {
                              "exclusiveMinimum": 0
                            }
                          ]
                        },
                        {
                          "type": "string",
                          "enum": [
                            "Infinity",
                            "-Infinity",
                            "NaN"
                          ]
                        }
                      ]
                    },
                    {
                      "type": "null"
                    }
                  ]
                },
                "recordedAt": {
                  "type": "string"
                },
                "source": {
                  "type": "string",
                  "allOf": [
                    {
                      "pattern": "^[^\\u0000\\p{Cs}]*$"
                    }
                  ]
                },
                "weightKilograms": {
                  "anyOf": [
                    {
                      "anyOf": [
                        {
                          "type": "number",
                          "allOf": [
                            {
                              "exclusiveMinimum": 0
                            }
                          ]
                        },
                        {
                          "type": "string",
                          "enum": [
                            "Infinity",
                            "-Infinity",
                            "NaN"
                          ]
                        }
                      ]
                    },
                    {
                      "type": "null"
                    }
                  ]
                }
              },
              "required": [
                "heightCentimeters",
                "recordedAt",
                "source",
                "weightKilograms"
              ],
              "additionalProperties": false
            }
          },
          "name": {
            "type": "object",
            "properties": {
              "first": {
                "type": "string"
              },
              "last": {
                "type": "string"
              },
              "middle": {
                "anyOf": [
                  {
                    "type": "string"
                  },
                  {
                    "type": "null"
                  }
                ]
              },
              "preferred": {
                "anyOf": [
                  {
                    "type": "string"
                  },
                  {
                    "type": "null"
                  }
                ]
              }
            },
            "required": [
              "first",
              "last",
              "middle",
              "preferred"
            ],
            "additionalProperties": false
          },
          "object": {
            "type": "string",
            "enum": [
              "patient"
            ]
          },
          "phone": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ]
          },
          "programs": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "endedAt": {
                  "anyOf": [
                    {
                      "type": "string"
                    },
                    {
                      "type": "null"
                    }
                  ]
                },
                "name": {
                  "type": "string",
                  "allOf": [
                    {
                      "pattern": "^[^\\u0000\\p{Cs}]*$"
                    }
                  ]
                },
                "startedAt": {
                  "type": "string"
                },
                "status": {
                  "type": "string",
                  "enum": [
                    "active",
                    "completed",
                    "paused"
                  ]
                }
              },
              "required": [
                "endedAt",
                "name",
                "startedAt",
                "status"
              ],
              "additionalProperties": false
            }
          },
          "practiceId": {
            "type": "string",
            "pattern": "^prac_[0-7][0-9a-hjkmnp-tv-z]{25}$",
            "examples": [
              "prac_01j2y8m6jcc9tt24af5pw9x1bc"
            ]
          },
          "status": {
            "type": "string",
            "enum": [
              "active",
              "inactive"
            ]
          },
          "updatedAt": {
            "type": "string"
          }
        },
        "required": [
          "address",
          "defaultShippingAddressId",
          "shippingAddress",
          "allergyReviewStatus",
          "allergySummary",
          "createdAt",
          "clinicalProfile",
          "dateOfBirth",
          "email",
          "externalId",
          "externalIdentities",
          "addresses",
          "encounters",
          "gender",
          "id",
          "livemode",
          "location",
          "locationId",
          "metadata",
          "medicalRecordNumber",
          "measurements",
          "name",
          "object",
          "phone",
          "programs",
          "practiceId",
          "status",
          "updatedAt"
        ],
        "additionalProperties": false
      },
      "GetPatientResponse": {
        "title": "GetPatientResponse",
        "type": "object",
        "properties": {
          "address": {
            "anyOf": [
              {
                "type": "object",
                "properties": {
                  "city": {
                    "type": "string",
                    "allOf": [
                      {
                        "pattern": "^[^\\u0000\\p{Cs}]*$"
                      },
                      {
                        "pattern": "^[^\\p{Cc}\\u200B\\u2028-\\u202E\\u2066-\\u2069]*$"
                      }
                    ]
                  },
                  "country": {
                    "anyOf": [
                      {
                        "type": "string",
                        "allOf": [
                          {
                            "pattern": "^[^\\u0000\\p{Cs}]*$"
                          },
                          {
                            "pattern": "^[^\\p{Cc}\\u200B\\u2028-\\u202E\\u2066-\\u2069]*$"
                          }
                        ]
                      },
                      {
                        "type": "null"
                      }
                    ]
                  },
                  "line1": {
                    "type": "string",
                    "allOf": [
                      {
                        "pattern": "^[^\\u0000\\p{Cs}]*$"
                      },
                      {
                        "pattern": "^[^\\p{Cc}\\u200B\\u2028-\\u202E\\u2066-\\u2069]*$"
                      }
                    ]
                  },
                  "line2": {
                    "anyOf": [
                      {
                        "anyOf": [
                          {
                            "type": "string",
                            "allOf": [
                              {
                                "pattern": "^[^\\u0000\\p{Cs}]*$"
                              },
                              {
                                "pattern": "^[^\\p{Cc}\\u200B\\u2028-\\u202E\\u2066-\\u2069]*$"
                              }
                            ]
                          },
                          {
                            "type": "null"
                          }
                        ]
                      },
                      {
                        "type": "null"
                      }
                    ]
                  },
                  "postalCode": {
                    "type": "string",
                    "allOf": [
                      {
                        "pattern": "^[^\\u0000\\p{Cs}]*$"
                      },
                      {
                        "pattern": "^[^\\p{Cc}\\u200B\\u2028-\\u202E\\u2066-\\u2069]*$"
                      }
                    ]
                  },
                  "state": {
                    "type": "string",
                    "allOf": [
                      {
                        "pattern": "^[^\\u0000\\p{Cs}]*$"
                      },
                      {
                        "pattern": "^[^\\p{Cc}\\u200B\\u2028-\\u202E\\u2066-\\u2069]*$"
                      }
                    ]
                  }
                },
                "required": [
                  "city",
                  "line1",
                  "postalCode",
                  "state"
                ],
                "additionalProperties": false
              },
              {
                "type": "null"
              }
            ]
          },
          "defaultShippingAddressId": {
            "anyOf": [
              {
                "type": "string",
                "allOf": [
                  {
                    "pattern": "^addr_[0-7][0-9a-hjkmnp-tv-z]{25}$",
                    "examples": [
                      "addr_01j2y8m6jcc9tt24af5pw9x1bc"
                    ]
                  }
                ]
              },
              {
                "type": "null"
              }
            ]
          },
          "shippingAddress": {
            "anyOf": [
              {
                "type": "object",
                "properties": {
                  "city": {
                    "type": "string",
                    "allOf": [
                      {
                        "pattern": "^[^\\u0000\\p{Cs}]*$"
                      },
                      {
                        "pattern": "^[^\\p{Cc}\\u200B\\u2028-\\u202E\\u2066-\\u2069]*$"
                      }
                    ]
                  },
                  "country": {
                    "anyOf": [
                      {
                        "type": "string",
                        "allOf": [
                          {
                            "pattern": "^[^\\u0000\\p{Cs}]*$"
                          },
                          {
                            "pattern": "^[^\\p{Cc}\\u200B\\u2028-\\u202E\\u2066-\\u2069]*$"
                          }
                        ]
                      },
                      {
                        "type": "null"
                      }
                    ]
                  },
                  "line1": {
                    "type": "string",
                    "allOf": [
                      {
                        "pattern": "^[^\\u0000\\p{Cs}]*$"
                      },
                      {
                        "pattern": "^[^\\p{Cc}\\u200B\\u2028-\\u202E\\u2066-\\u2069]*$"
                      }
                    ]
                  },
                  "line2": {
                    "anyOf": [
                      {
                        "anyOf": [
                          {
                            "type": "string",
                            "allOf": [
                              {
                                "pattern": "^[^\\u0000\\p{Cs}]*$"
                              },
                              {
                                "pattern": "^[^\\p{Cc}\\u200B\\u2028-\\u202E\\u2066-\\u2069]*$"
                              }
                            ]
                          },
                          {
                            "type": "null"
                          }
                        ]
                      },
                      {
                        "type": "null"
                      }
                    ]
                  },
                  "postalCode": {
                    "type": "string",
                    "allOf": [
                      {
                        "pattern": "^[^\\u0000\\p{Cs}]*$"
                      },
                      {
                        "pattern": "^[^\\p{Cc}\\u200B\\u2028-\\u202E\\u2066-\\u2069]*$"
                      }
                    ]
                  },
                  "state": {
                    "type": "string",
                    "allOf": [
                      {
                        "pattern": "^[^\\u0000\\p{Cs}]*$"
                      },
                      {
                        "pattern": "^[^\\p{Cc}\\u200B\\u2028-\\u202E\\u2066-\\u2069]*$"
                      }
                    ]
                  }
                },
                "required": [
                  "city",
                  "line1",
                  "postalCode",
                  "state"
                ],
                "additionalProperties": false
              },
              {
                "type": "null"
              }
            ]
          },
          "allergyReviewStatus": {
            "type": "string",
            "enum": [
              "not_reviewed",
              "no_known",
              "recorded"
            ]
          },
          "allergySummary": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "reaction": {
                  "anyOf": [
                    {
                      "type": "string"
                    },
                    {
                      "type": "null"
                    }
                  ]
                },
                "substance": {
                  "type": "string"
                }
              },
              "required": [
                "reaction",
                "substance"
              ],
              "additionalProperties": false
            }
          },
          "createdAt": {
            "type": "string"
          },
          "clinicalProfile": {
            "type": "object",
            "properties": {
              "currentMedications": {
                "type": "array",
                "items": {
                  "type": "string"
                }
              },
              "heightInches": {
                "anyOf": [
                  {
                    "anyOf": [
                      {
                        "type": "number"
                      },
                      {
                        "type": "string",
                        "enum": [
                          "Infinity",
                          "-Infinity",
                          "NaN"
                        ]
                      }
                    ]
                  },
                  {
                    "type": "null"
                  }
                ]
              },
              "reviewedAt": {
                "anyOf": [
                  {
                    "type": "string"
                  },
                  {
                    "type": "null"
                  }
                ]
              },
              "weightPounds": {
                "anyOf": [
                  {
                    "anyOf": [
                      {
                        "type": "number"
                      },
                      {
                        "type": "string",
                        "enum": [
                          "Infinity",
                          "-Infinity",
                          "NaN"
                        ]
                      }
                    ]
                  },
                  {
                    "type": "null"
                  }
                ]
              }
            },
            "required": [
              "currentMedications",
              "heightInches",
              "reviewedAt",
              "weightPounds"
            ],
            "additionalProperties": false
          },
          "dateOfBirth": {
            "type": "string",
            "pattern": "^\\d{4}-\\d{2}-\\d{2}$"
          },
          "email": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ]
          },
          "externalId": {
            "anyOf": [
              {
                "type": "string",
                "allOf": [
                  {
                    "pattern": "^[^\\u0000\\p{Cs}]*$"
                  }
                ]
              },
              {
                "type": "null"
              }
            ]
          },
          "externalIdentities": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "source": {
                  "type": "string",
                  "allOf": [
                    {
                      "pattern": "^[^\\u0000\\p{Cs}]*$"
                    }
                  ]
                },
                "value": {
                  "type": "string",
                  "allOf": [
                    {
                      "pattern": "^[^\\u0000\\p{Cs}]*$"
                    }
                  ]
                }
              },
              "required": [
                "source",
                "value"
              ],
              "additionalProperties": false
            }
          },
          "addresses": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "id": {
                  "type": "string",
                  "allOf": [
                    {
                      "pattern": "^addr_[0-7][0-9a-hjkmnp-tv-z]{25}$",
                      "examples": [
                        "addr_01j2y8m6jcc9tt24af5pw9x1bc"
                      ]
                    }
                  ]
                },
                "address": {
                  "type": "object",
                  "properties": {
                    "city": {
                      "type": "string",
                      "allOf": [
                        {
                          "pattern": "^[^\\u0000\\p{Cs}]*$"
                        },
                        {
                          "pattern": "^[^\\p{Cc}\\u200B\\u2028-\\u202E\\u2066-\\u2069]*$"
                        }
                      ]
                    },
                    "country": {
                      "anyOf": [
                        {
                          "type": "string",
                          "allOf": [
                            {
                              "pattern": "^[^\\u0000\\p{Cs}]*$"
                            },
                            {
                              "pattern": "^[^\\p{Cc}\\u200B\\u2028-\\u202E\\u2066-\\u2069]*$"
                            }
                          ]
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "line1": {
                      "type": "string",
                      "allOf": [
                        {
                          "pattern": "^[^\\u0000\\p{Cs}]*$"
                        },
                        {
                          "pattern": "^[^\\p{Cc}\\u200B\\u2028-\\u202E\\u2066-\\u2069]*$"
                        }
                      ]
                    },
                    "line2": {
                      "anyOf": [
                        {
                          "anyOf": [
                            {
                              "type": "string",
                              "allOf": [
                                {
                                  "pattern": "^[^\\u0000\\p{Cs}]*$"
                                },
                                {
                                  "pattern": "^[^\\p{Cc}\\u200B\\u2028-\\u202E\\u2066-\\u2069]*$"
                                }
                              ]
                            },
                            {
                              "type": "null"
                            }
                          ]
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "postalCode": {
                      "type": "string",
                      "allOf": [
                        {
                          "pattern": "^[^\\u0000\\p{Cs}]*$"
                        },
                        {
                          "pattern": "^[^\\p{Cc}\\u200B\\u2028-\\u202E\\u2066-\\u2069]*$"
                        }
                      ]
                    },
                    "state": {
                      "type": "string",
                      "allOf": [
                        {
                          "pattern": "^[^\\u0000\\p{Cs}]*$"
                        },
                        {
                          "pattern": "^[^\\p{Cc}\\u200B\\u2028-\\u202E\\u2066-\\u2069]*$"
                        }
                      ]
                    }
                  },
                  "required": [
                    "city",
                    "line1",
                    "postalCode",
                    "state"
                  ],
                  "additionalProperties": false
                },
                "label": {
                  "type": "string",
                  "allOf": [
                    {
                      "pattern": "^[^\\u0000\\p{Cs}]*$"
                    }
                  ]
                },
                "preferredShipping": {
                  "type": "boolean"
                },
                "recipientName": {
                  "anyOf": [
                    {
                      "type": "string",
                      "allOf": [
                        {
                          "pattern": "^[^\\u0000\\p{Cs}]*$"
                        },
                        {
                          "pattern": "^[^\\p{Cc}\\u200B\\u2028-\\u202E\\u2066-\\u2069]*$"
                        }
                      ]
                    },
                    {
                      "type": "null"
                    }
                  ]
                },
                "archivedAt": {
                  "anyOf": [
                    {
                      "type": "string"
                    },
                    {
                      "type": "null"
                    }
                  ]
                }
              },
              "required": [
                "id",
                "address",
                "label",
                "preferredShipping",
                "recipientName",
                "archivedAt"
              ],
              "additionalProperties": false
            }
          },
          "encounters": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "notes": {
                  "anyOf": [
                    {
                      "type": "string",
                      "allOf": [
                        {
                          "pattern": "^[^\\u0000\\p{Cs}]*$"
                        },
                        {
                          "maxLength": 5000
                        }
                      ]
                    },
                    {
                      "type": "null"
                    }
                  ]
                },
                "occurredAt": {
                  "type": "string"
                },
                "providerName": {
                  "anyOf": [
                    {
                      "type": "string",
                      "allOf": [
                        {
                          "pattern": "^[^\\u0000\\p{Cs}]*$"
                        }
                      ]
                    },
                    {
                      "type": "null"
                    }
                  ]
                },
                "type": {
                  "type": "string",
                  "allOf": [
                    {
                      "pattern": "^[^\\u0000\\p{Cs}]*$"
                    }
                  ]
                }
              },
              "required": [
                "notes",
                "occurredAt",
                "providerName",
                "type"
              ],
              "additionalProperties": false
            }
          },
          "gender": {
            "type": "string",
            "enum": [
              "f",
              "m",
              "o",
              "u"
            ]
          },
          "id": {
            "type": "string",
            "pattern": "^pat_[0-7][0-9a-hjkmnp-tv-z]{25}$",
            "examples": [
              "pat_01j2y8m6jcc9tt24af5pw9x1bc"
            ]
          },
          "livemode": {
            "type": "boolean"
          },
          "location": {
            "type": "object",
            "properties": {
              "id": {
                "type": "string",
                "allOf": [
                  {
                    "pattern": "^loc_[0-7][0-9a-hjkmnp-tv-z]{25}$",
                    "examples": [
                      "loc_01j2y8m6jcc9tt24af5pw9x1bc"
                    ]
                  }
                ]
              },
              "name": {
                "type": "string"
              },
              "state": {
                "anyOf": [
                  {
                    "type": "string"
                  },
                  {
                    "type": "null"
                  }
                ]
              },
              "status": {
                "type": "string",
                "enum": [
                  "active",
                  "archived"
                ]
              }
            },
            "required": [
              "id",
              "name",
              "state",
              "status"
            ],
            "additionalProperties": false
          },
          "locationId": {
            "type": "string",
            "pattern": "^loc_[0-7][0-9a-hjkmnp-tv-z]{25}$",
            "examples": [
              "loc_01j2y8m6jcc9tt24af5pw9x1bc"
            ]
          },
          "metadata": {
            "type": "object"
          },
          "medicalRecordNumber": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ]
          },
          "measurements": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "heightCentimeters": {
                  "anyOf": [
                    {
                      "anyOf": [
                        {
                          "type": "number",
                          "allOf": [
                            {
                              "exclusiveMinimum": 0
                            }
                          ]
                        },
                        {
                          "type": "string",
                          "enum": [
                            "Infinity",
                            "-Infinity",
                            "NaN"
                          ]
                        }
                      ]
                    },
                    {
                      "type": "null"
                    }
                  ]
                },
                "recordedAt": {
                  "type": "string"
                },
                "source": {
                  "type": "string",
                  "allOf": [
                    {
                      "pattern": "^[^\\u0000\\p{Cs}]*$"
                    }
                  ]
                },
                "weightKilograms": {
                  "anyOf": [
                    {
                      "anyOf": [
                        {
                          "type": "number",
                          "allOf": [
                            {
                              "exclusiveMinimum": 0
                            }
                          ]
                        },
                        {
                          "type": "string",
                          "enum": [
                            "Infinity",
                            "-Infinity",
                            "NaN"
                          ]
                        }
                      ]
                    },
                    {
                      "type": "null"
                    }
                  ]
                }
              },
              "required": [
                "heightCentimeters",
                "recordedAt",
                "source",
                "weightKilograms"
              ],
              "additionalProperties": false
            }
          },
          "name": {
            "type": "object",
            "properties": {
              "first": {
                "type": "string"
              },
              "last": {
                "type": "string"
              },
              "middle": {
                "anyOf": [
                  {
                    "type": "string"
                  },
                  {
                    "type": "null"
                  }
                ]
              },
              "preferred": {
                "anyOf": [
                  {
                    "type": "string"
                  },
                  {
                    "type": "null"
                  }
                ]
              }
            },
            "required": [
              "first",
              "last",
              "middle",
              "preferred"
            ],
            "additionalProperties": false
          },
          "object": {
            "type": "string",
            "enum": [
              "patient"
            ]
          },
          "phone": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ]
          },
          "programs": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "endedAt": {
                  "anyOf": [
                    {
                      "type": "string"
                    },
                    {
                      "type": "null"
                    }
                  ]
                },
                "name": {
                  "type": "string",
                  "allOf": [
                    {
                      "pattern": "^[^\\u0000\\p{Cs}]*$"
                    }
                  ]
                },
                "startedAt": {
                  "type": "string"
                },
                "status": {
                  "type": "string",
                  "enum": [
                    "active",
                    "completed",
                    "paused"
                  ]
                }
              },
              "required": [
                "endedAt",
                "name",
                "startedAt",
                "status"
              ],
              "additionalProperties": false
            }
          },
          "practiceId": {
            "type": "string",
            "pattern": "^prac_[0-7][0-9a-hjkmnp-tv-z]{25}$",
            "examples": [
              "prac_01j2y8m6jcc9tt24af5pw9x1bc"
            ]
          },
          "status": {
            "type": "string",
            "enum": [
              "active",
              "inactive"
            ]
          },
          "updatedAt": {
            "type": "string"
          }
        },
        "required": [
          "address",
          "defaultShippingAddressId",
          "shippingAddress",
          "allergyReviewStatus",
          "allergySummary",
          "createdAt",
          "clinicalProfile",
          "dateOfBirth",
          "email",
          "externalId",
          "externalIdentities",
          "addresses",
          "encounters",
          "gender",
          "id",
          "livemode",
          "location",
          "locationId",
          "metadata",
          "medicalRecordNumber",
          "measurements",
          "name",
          "object",
          "phone",
          "programs",
          "practiceId",
          "status",
          "updatedAt"
        ],
        "additionalProperties": false
      },
      "DeletePatientResponse": {
        "title": "DeletePatientResponse",
        "type": "object",
        "properties": {
          "deleted": {
            "type": "boolean",
            "enum": [
              true
            ]
          },
          "id": {
            "type": "string",
            "pattern": "^pat_[0-7][0-9a-hjkmnp-tv-z]{25}$",
            "examples": [
              "pat_01j2y8m6jcc9tt24af5pw9x1bc"
            ]
          },
          "object": {
            "type": "string",
            "enum": [
              "patient"
            ]
          }
        },
        "required": [
          "deleted",
          "id",
          "object"
        ],
        "additionalProperties": false
      },
      "UpdatePatientRequest": {
        "type": "object",
        "properties": {
          "address": {
            "anyOf": [
              {
                "anyOf": [
                  {
                    "type": "object",
                    "properties": {
                      "city": {
                        "type": "string",
                        "pattern": "^[^\\u0000\\p{Cs}]*$",
                        "allOf": [
                          {
                            "pattern": "^[^\\p{Cc}\\u200B\\u2028-\\u202E\\u2066-\\u2069]*$"
                          }
                        ]
                      },
                      "line1": {
                        "type": "string",
                        "pattern": "^[^\\u0000\\p{Cs}]*$",
                        "allOf": [
                          {
                            "pattern": "^[^\\p{Cc}\\u200B\\u2028-\\u202E\\u2066-\\u2069]*$"
                          }
                        ]
                      },
                      "line2": {
                        "anyOf": [
                          {
                            "anyOf": [
                              {
                                "type": "string",
                                "pattern": "^[^\\u0000\\p{Cs}]*$",
                                "allOf": [
                                  {
                                    "pattern": "^[^\\p{Cc}\\u200B\\u2028-\\u202E\\u2066-\\u2069]*$"
                                  }
                                ]
                              },
                              {
                                "type": "null"
                              }
                            ]
                          },
                          {
                            "type": "null"
                          }
                        ]
                      },
                      "postalCode": {
                        "type": "string"
                      },
                      "state": {
                        "type": "string"
                      },
                      "country": {
                        "anyOf": [
                          {
                            "type": "string",
                            "enum": [
                              "US"
                            ]
                          },
                          {
                            "type": "null"
                          }
                        ]
                      }
                    },
                    "required": [
                      "city",
                      "line1",
                      "postalCode",
                      "state"
                    ],
                    "additionalProperties": false
                  },
                  {
                    "type": "null"
                  }
                ]
              },
              {
                "type": "null"
              }
            ]
          },
          "clinicalProfile": {
            "anyOf": [
              {
                "type": "object",
                "properties": {
                  "currentMedications": {
                    "anyOf": [
                      {
                        "type": "array",
                        "items": {
                          "type": "string",
                          "pattern": "^[^\\u0000\\p{Cs}]*$"
                        },
                        "maxItems": 100
                      },
                      {
                        "type": "null"
                      }
                    ]
                  },
                  "heightInches": {
                    "anyOf": [
                      {
                        "anyOf": [
                          {
                            "anyOf": [
                              {
                                "type": "number",
                                "exclusiveMinimum": 0
                              },
                              {
                                "type": "string",
                                "enum": [
                                  "Infinity",
                                  "-Infinity",
                                  "NaN"
                                ]
                              }
                            ]
                          },
                          {
                            "type": "null"
                          }
                        ]
                      },
                      {
                        "type": "null"
                      }
                    ]
                  },
                  "reviewedAt": {
                    "anyOf": [
                      {
                        "anyOf": [
                          {
                            "type": "string"
                          },
                          {
                            "type": "null"
                          }
                        ]
                      },
                      {
                        "type": "null"
                      }
                    ]
                  },
                  "weightPounds": {
                    "anyOf": [
                      {
                        "anyOf": [
                          {
                            "anyOf": [
                              {
                                "type": "number",
                                "exclusiveMinimum": 0
                              },
                              {
                                "type": "string",
                                "enum": [
                                  "Infinity",
                                  "-Infinity",
                                  "NaN"
                                ]
                              }
                            ]
                          },
                          {
                            "type": "null"
                          }
                        ]
                      },
                      {
                        "type": "null"
                      }
                    ]
                  }
                },
                "additionalProperties": false
              },
              {
                "type": "null"
              }
            ]
          },
          "dateOfBirth": {
            "anyOf": [
              {
                "type": "string",
                "pattern": "^\\d{4}-\\d{2}-\\d{2}$"
              },
              {
                "type": "null"
              }
            ]
          },
          "email": {
            "anyOf": [
              {
                "anyOf": [
                  {
                    "type": "string"
                  },
                  {
                    "type": "null"
                  }
                ]
              },
              {
                "type": "null"
              }
            ]
          },
          "externalId": {
            "anyOf": [
              {
                "anyOf": [
                  {
                    "type": "string",
                    "pattern": "^[^\\u0000\\p{Cs}]*$"
                  },
                  {
                    "type": "null"
                  }
                ]
              },
              {
                "type": "null"
              }
            ]
          },
          "externalIdentities": {
            "anyOf": [
              {
                "type": "array",
                "items": {
                  "type": "object",
                  "properties": {
                    "source": {
                      "type": "string",
                      "pattern": "^[^\\u0000\\p{Cs}]*$"
                    },
                    "value": {
                      "type": "string",
                      "pattern": "^[^\\u0000\\p{Cs}]*$"
                    }
                  },
                  "required": [
                    "source",
                    "value"
                  ],
                  "additionalProperties": false
                },
                "maxItems": 50
              },
              {
                "type": "null"
              }
            ]
          },
          "addresses": {
            "anyOf": [
              {
                "type": "array",
                "items": {
                  "type": "object",
                  "properties": {
                    "id": {
                      "anyOf": [
                        {
                          "type": "string",
                          "pattern": "^addr_[0-7][0-9a-hjkmnp-tv-z]{25}$",
                          "examples": [
                            "addr_01j2y8m6jcc9tt24af5pw9x1bc"
                          ]
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "address": {
                      "type": "object",
                      "properties": {
                        "city": {
                          "type": "string",
                          "pattern": "^[^\\u0000\\p{Cs}]*$",
                          "allOf": [
                            {
                              "pattern": "^[^\\p{Cc}\\u200B\\u2028-\\u202E\\u2066-\\u2069]*$"
                            }
                          ]
                        },
                        "country": {
                          "anyOf": [
                            {
                              "type": "string",
                              "enum": [
                                "US"
                              ]
                            },
                            {
                              "type": "null"
                            }
                          ]
                        },
                        "line1": {
                          "type": "string",
                          "pattern": "^[^\\u0000\\p{Cs}]*$",
                          "allOf": [
                            {
                              "pattern": "^[^\\p{Cc}\\u200B\\u2028-\\u202E\\u2066-\\u2069]*$"
                            }
                          ]
                        },
                        "line2": {
                          "anyOf": [
                            {
                              "anyOf": [
                                {
                                  "type": "string",
                                  "pattern": "^[^\\u0000\\p{Cs}]*$",
                                  "allOf": [
                                    {
                                      "pattern": "^[^\\p{Cc}\\u200B\\u2028-\\u202E\\u2066-\\u2069]*$"
                                    }
                                  ]
                                },
                                {
                                  "type": "null"
                                }
                              ]
                            },
                            {
                              "type": "null"
                            }
                          ]
                        },
                        "postalCode": {
                          "type": "string"
                        },
                        "state": {
                          "type": "string"
                        }
                      },
                      "required": [
                        "city",
                        "line1",
                        "postalCode",
                        "state"
                      ],
                      "additionalProperties": false
                    },
                    "label": {
                      "type": "string",
                      "pattern": "^[^\\u0000\\p{Cs}]*$"
                    },
                    "preferredShipping": {
                      "type": "boolean"
                    },
                    "recipientName": {
                      "anyOf": [
                        {
                          "type": "string",
                          "pattern": "^[^\\u0000\\p{Cs}]*$",
                          "allOf": [
                            {
                              "pattern": "^[^\\p{Cc}\\u200B\\u2028-\\u202E\\u2066-\\u2069]*$"
                            }
                          ]
                        },
                        {
                          "type": "null"
                        }
                      ]
                    }
                  },
                  "required": [
                    "address",
                    "label",
                    "preferredShipping",
                    "recipientName"
                  ],
                  "additionalProperties": false
                },
                "maxItems": 50
              },
              {
                "type": "null"
              }
            ]
          },
          "encounters": {
            "anyOf": [
              {
                "type": "array",
                "items": {
                  "type": "object",
                  "properties": {
                    "notes": {
                      "anyOf": [
                        {
                          "type": "string",
                          "pattern": "^[^\\u0000\\p{Cs}]*$",
                          "maxLength": 5000
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "occurredAt": {
                      "type": "string"
                    },
                    "providerName": {
                      "anyOf": [
                        {
                          "type": "string",
                          "pattern": "^[^\\u0000\\p{Cs}]*$"
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "type": {
                      "type": "string",
                      "pattern": "^[^\\u0000\\p{Cs}]*$"
                    }
                  },
                  "required": [
                    "notes",
                    "occurredAt",
                    "providerName",
                    "type"
                  ],
                  "additionalProperties": false
                }
              },
              {
                "type": "null"
              }
            ]
          },
          "gender": {
            "anyOf": [
              {
                "type": "string",
                "enum": [
                  "f",
                  "m",
                  "o",
                  "u"
                ]
              },
              {
                "type": "null"
              }
            ]
          },
          "locationId": {
            "anyOf": [
              {
                "type": "string",
                "pattern": "^loc_[0-7][0-9a-hjkmnp-tv-z]{25}$",
                "examples": [
                  "loc_01j2y8m6jcc9tt24af5pw9x1bc"
                ]
              },
              {
                "type": "null"
              }
            ]
          },
          "metadata": {
            "anyOf": [
              {
                "type": "object"
              },
              {
                "type": "null"
              }
            ]
          },
          "medicalRecordNumber": {
            "anyOf": [
              {
                "anyOf": [
                  {
                    "type": "string",
                    "pattern": "^[^\\u0000\\p{Cs}]*$"
                  },
                  {
                    "type": "null"
                  }
                ]
              },
              {
                "type": "null"
              }
            ]
          },
          "measurements": {
            "anyOf": [
              {
                "type": "array",
                "items": {
                  "type": "object",
                  "properties": {
                    "heightCentimeters": {
                      "anyOf": [
                        {
                          "anyOf": [
                            {
                              "type": "number",
                              "exclusiveMinimum": 0
                            },
                            {
                              "type": "string",
                              "enum": [
                                "Infinity",
                                "-Infinity",
                                "NaN"
                              ]
                            }
                          ]
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "recordedAt": {
                      "type": "string"
                    },
                    "source": {
                      "type": "string",
                      "pattern": "^[^\\u0000\\p{Cs}]*$"
                    },
                    "weightKilograms": {
                      "anyOf": [
                        {
                          "anyOf": [
                            {
                              "type": "number",
                              "exclusiveMinimum": 0
                            },
                            {
                              "type": "string",
                              "enum": [
                                "Infinity",
                                "-Infinity",
                                "NaN"
                              ]
                            }
                          ]
                        },
                        {
                          "type": "null"
                        }
                      ]
                    }
                  },
                  "required": [
                    "heightCentimeters",
                    "recordedAt",
                    "source",
                    "weightKilograms"
                  ],
                  "additionalProperties": false
                }
              },
              {
                "type": "null"
              }
            ]
          },
          "name": {
            "anyOf": [
              {
                "type": "object",
                "properties": {
                  "first": {
                    "anyOf": [
                      {
                        "type": "string",
                        "pattern": "^[^\\u0000\\p{Cs}]*$",
                        "allOf": [
                          {
                            "pattern": "^[^\\p{Cc}\\u200B\\u2028-\\u202E\\u2066-\\u2069]*$"
                          }
                        ]
                      },
                      {
                        "type": "null"
                      }
                    ]
                  },
                  "last": {
                    "anyOf": [
                      {
                        "type": "string",
                        "pattern": "^[^\\u0000\\p{Cs}]*$",
                        "allOf": [
                          {
                            "pattern": "^[^\\p{Cc}\\u200B\\u2028-\\u202E\\u2066-\\u2069]*$"
                          }
                        ]
                      },
                      {
                        "type": "null"
                      }
                    ]
                  },
                  "middle": {
                    "anyOf": [
                      {
                        "anyOf": [
                          {
                            "type": "string",
                            "pattern": "^[^\\u0000\\p{Cs}]*$",
                            "allOf": [
                              {
                                "pattern": "^[^\\p{Cc}\\u200B\\u2028-\\u202E\\u2066-\\u2069]*$"
                              }
                            ]
                          },
                          {
                            "type": "null"
                          }
                        ]
                      },
                      {
                        "type": "null"
                      }
                    ]
                  },
                  "preferred": {
                    "anyOf": [
                      {
                        "anyOf": [
                          {
                            "type": "string",
                            "pattern": "^[^\\u0000\\p{Cs}]*$",
                            "allOf": [
                              {
                                "pattern": "^[^\\p{Cc}\\u200B\\u2028-\\u202E\\u2066-\\u2069]*$"
                              }
                            ]
                          },
                          {
                            "type": "null"
                          }
                        ]
                      },
                      {
                        "type": "null"
                      }
                    ]
                  }
                },
                "additionalProperties": false
              },
              {
                "type": "null"
              }
            ]
          },
          "programs": {
            "anyOf": [
              {
                "type": "array",
                "items": {
                  "type": "object",
                  "properties": {
                    "endedAt": {
                      "anyOf": [
                        {
                          "type": "string"
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "name": {
                      "type": "string",
                      "pattern": "^[^\\u0000\\p{Cs}]*$"
                    },
                    "startedAt": {
                      "type": "string"
                    },
                    "status": {
                      "type": "string",
                      "enum": [
                        "active",
                        "completed",
                        "paused"
                      ]
                    }
                  },
                  "required": [
                    "endedAt",
                    "name",
                    "startedAt",
                    "status"
                  ],
                  "additionalProperties": false
                }
              },
              {
                "type": "null"
              }
            ]
          },
          "phone": {
            "anyOf": [
              {
                "anyOf": [
                  {
                    "type": "string"
                  },
                  {
                    "type": "null"
                  }
                ]
              },
              {
                "type": "null"
              }
            ]
          },
          "status": {
            "anyOf": [
              {
                "type": "string",
                "enum": [
                  "active",
                  "inactive"
                ]
              },
              {
                "type": "null"
              }
            ]
          }
        },
        "additionalProperties": false,
        "title": "UpdatePatientRequest"
      },
      "UpdatePatientResponse": {
        "title": "UpdatePatientResponse",
        "type": "object",
        "properties": {
          "address": {
            "anyOf": [
              {
                "type": "object",
                "properties": {
                  "city": {
                    "type": "string",
                    "allOf": [
                      {
                        "pattern": "^[^\\u0000\\p{Cs}]*$"
                      },
                      {
                        "pattern": "^[^\\p{Cc}\\u200B\\u2028-\\u202E\\u2066-\\u2069]*$"
                      }
                    ]
                  },
                  "country": {
                    "anyOf": [
                      {
                        "type": "string",
                        "allOf": [
                          {
                            "pattern": "^[^\\u0000\\p{Cs}]*$"
                          },
                          {
                            "pattern": "^[^\\p{Cc}\\u200B\\u2028-\\u202E\\u2066-\\u2069]*$"
                          }
                        ]
                      },
                      {
                        "type": "null"
                      }
                    ]
                  },
                  "line1": {
                    "type": "string",
                    "allOf": [
                      {
                        "pattern": "^[^\\u0000\\p{Cs}]*$"
                      },
                      {
                        "pattern": "^[^\\p{Cc}\\u200B\\u2028-\\u202E\\u2066-\\u2069]*$"
                      }
                    ]
                  },
                  "line2": {
                    "anyOf": [
                      {
                        "anyOf": [
                          {
                            "type": "string",
                            "allOf": [
                              {
                                "pattern": "^[^\\u0000\\p{Cs}]*$"
                              },
                              {
                                "pattern": "^[^\\p{Cc}\\u200B\\u2028-\\u202E\\u2066-\\u2069]*$"
                              }
                            ]
                          },
                          {
                            "type": "null"
                          }
                        ]
                      },
                      {
                        "type": "null"
                      }
                    ]
                  },
                  "postalCode": {
                    "type": "string",
                    "allOf": [
                      {
                        "pattern": "^[^\\u0000\\p{Cs}]*$"
                      },
                      {
                        "pattern": "^[^\\p{Cc}\\u200B\\u2028-\\u202E\\u2066-\\u2069]*$"
                      }
                    ]
                  },
                  "state": {
                    "type": "string",
                    "allOf": [
                      {
                        "pattern": "^[^\\u0000\\p{Cs}]*$"
                      },
                      {
                        "pattern": "^[^\\p{Cc}\\u200B\\u2028-\\u202E\\u2066-\\u2069]*$"
                      }
                    ]
                  }
                },
                "required": [
                  "city",
                  "line1",
                  "postalCode",
                  "state"
                ],
                "additionalProperties": false
              },
              {
                "type": "null"
              }
            ]
          },
          "defaultShippingAddressId": {
            "anyOf": [
              {
                "type": "string",
                "allOf": [
                  {
                    "pattern": "^addr_[0-7][0-9a-hjkmnp-tv-z]{25}$",
                    "examples": [
                      "addr_01j2y8m6jcc9tt24af5pw9x1bc"
                    ]
                  }
                ]
              },
              {
                "type": "null"
              }
            ]
          },
          "shippingAddress": {
            "anyOf": [
              {
                "type": "object",
                "properties": {
                  "city": {
                    "type": "string",
                    "allOf": [
                      {
                        "pattern": "^[^\\u0000\\p{Cs}]*$"
                      },
                      {
                        "pattern": "^[^\\p{Cc}\\u200B\\u2028-\\u202E\\u2066-\\u2069]*$"
                      }
                    ]
                  },
                  "country": {
                    "anyOf": [
                      {
                        "type": "string",
                        "allOf": [
                          {
                            "pattern": "^[^\\u0000\\p{Cs}]*$"
                          },
                          {
                            "pattern": "^[^\\p{Cc}\\u200B\\u2028-\\u202E\\u2066-\\u2069]*$"
                          }
                        ]
                      },
                      {
                        "type": "null"
                      }
                    ]
                  },
                  "line1": {
                    "type": "string",
                    "allOf": [
                      {
                        "pattern": "^[^\\u0000\\p{Cs}]*$"
                      },
                      {
                        "pattern": "^[^\\p{Cc}\\u200B\\u2028-\\u202E\\u2066-\\u2069]*$"
                      }
                    ]
                  },
                  "line2": {
                    "anyOf": [
                      {
                        "anyOf": [
                          {
                            "type": "string",
                            "allOf": [
                              {
                                "pattern": "^[^\\u0000\\p{Cs}]*$"
                              },
                              {
                                "pattern": "^[^\\p{Cc}\\u200B\\u2028-\\u202E\\u2066-\\u2069]*$"
                              }
                            ]
                          },
                          {
                            "type": "null"
                          }
                        ]
                      },
                      {
                        "type": "null"
                      }
                    ]
                  },
                  "postalCode": {
                    "type": "string",
                    "allOf": [
                      {
                        "pattern": "^[^\\u0000\\p{Cs}]*$"
                      },
                      {
                        "pattern": "^[^\\p{Cc}\\u200B\\u2028-\\u202E\\u2066-\\u2069]*$"
                      }
                    ]
                  },
                  "state": {
                    "type": "string",
                    "allOf": [
                      {
                        "pattern": "^[^\\u0000\\p{Cs}]*$"
                      },
                      {
                        "pattern": "^[^\\p{Cc}\\u200B\\u2028-\\u202E\\u2066-\\u2069]*$"
                      }
                    ]
                  }
                },
                "required": [
                  "city",
                  "line1",
                  "postalCode",
                  "state"
                ],
                "additionalProperties": false
              },
              {
                "type": "null"
              }
            ]
          },
          "allergyReviewStatus": {
            "type": "string",
            "enum": [
              "not_reviewed",
              "no_known",
              "recorded"
            ]
          },
          "allergySummary": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "reaction": {
                  "anyOf": [
                    {
                      "type": "string"
                    },
                    {
                      "type": "null"
                    }
                  ]
                },
                "substance": {
                  "type": "string"
                }
              },
              "required": [
                "reaction",
                "substance"
              ],
              "additionalProperties": false
            }
          },
          "createdAt": {
            "type": "string"
          },
          "clinicalProfile": {
            "type": "object",
            "properties": {
              "currentMedications": {
                "type": "array",
                "items": {
                  "type": "string"
                }
              },
              "heightInches": {
                "anyOf": [
                  {
                    "anyOf": [
                      {
                        "type": "number"
                      },
                      {
                        "type": "string",
                        "enum": [
                          "Infinity",
                          "-Infinity",
                          "NaN"
                        ]
                      }
                    ]
                  },
                  {
                    "type": "null"
                  }
                ]
              },
              "reviewedAt": {
                "anyOf": [
                  {
                    "type": "string"
                  },
                  {
                    "type": "null"
                  }
                ]
              },
              "weightPounds": {
                "anyOf": [
                  {
                    "anyOf": [
                      {
                        "type": "number"
                      },
                      {
                        "type": "string",
                        "enum": [
                          "Infinity",
                          "-Infinity",
                          "NaN"
                        ]
                      }
                    ]
                  },
                  {
                    "type": "null"
                  }
                ]
              }
            },
            "required": [
              "currentMedications",
              "heightInches",
              "reviewedAt",
              "weightPounds"
            ],
            "additionalProperties": false
          },
          "dateOfBirth": {
            "type": "string",
            "pattern": "^\\d{4}-\\d{2}-\\d{2}$"
          },
          "email": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ]
          },
          "externalId": {
            "anyOf": [
              {
                "type": "string",
                "allOf": [
                  {
                    "pattern": "^[^\\u0000\\p{Cs}]*$"
                  }
                ]
              },
              {
                "type": "null"
              }
            ]
          },
          "externalIdentities": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "source": {
                  "type": "string",
                  "allOf": [
                    {
                      "pattern": "^[^\\u0000\\p{Cs}]*$"
                    }
                  ]
                },
                "value": {
                  "type": "string",
                  "allOf": [
                    {
                      "pattern": "^[^\\u0000\\p{Cs}]*$"
                    }
                  ]
                }
              },
              "required": [
                "source",
                "value"
              ],
              "additionalProperties": false
            }
          },
          "addresses": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "id": {
                  "type": "string",
                  "allOf": [
                    {
                      "pattern": "^addr_[0-7][0-9a-hjkmnp-tv-z]{25}$",
                      "examples": [
                        "addr_01j2y8m6jcc9tt24af5pw9x1bc"
                      ]
                    }
                  ]
                },
                "address": {
                  "type": "object",
                  "properties": {
                    "city": {
                      "type": "string",
                      "allOf": [
                        {
                          "pattern": "^[^\\u0000\\p{Cs}]*$"
                        },
                        {
                          "pattern": "^[^\\p{Cc}\\u200B\\u2028-\\u202E\\u2066-\\u2069]*$"
                        }
                      ]
                    },
                    "country": {
                      "anyOf": [
                        {
                          "type": "string",
                          "allOf": [
                            {
                              "pattern": "^[^\\u0000\\p{Cs}]*$"
                            },
                            {
                              "pattern": "^[^\\p{Cc}\\u200B\\u2028-\\u202E\\u2066-\\u2069]*$"
                            }
                          ]
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "line1": {
                      "type": "string",
                      "allOf": [
                        {
                          "pattern": "^[^\\u0000\\p{Cs}]*$"
                        },
                        {
                          "pattern": "^[^\\p{Cc}\\u200B\\u2028-\\u202E\\u2066-\\u2069]*$"
                        }
                      ]
                    },
                    "line2": {
                      "anyOf": [
                        {
                          "anyOf": [
                            {
                              "type": "string",
                              "allOf": [
                                {
                                  "pattern": "^[^\\u0000\\p{Cs}]*$"
                                },
                                {
                                  "pattern": "^[^\\p{Cc}\\u200B\\u2028-\\u202E\\u2066-\\u2069]*$"
                                }
                              ]
                            },
                            {
                              "type": "null"
                            }
                          ]
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "postalCode": {
                      "type": "string",
                      "allOf": [
                        {
                          "pattern": "^[^\\u0000\\p{Cs}]*$"
                        },
                        {
                          "pattern": "^[^\\p{Cc}\\u200B\\u2028-\\u202E\\u2066-\\u2069]*$"
                        }
                      ]
                    },
                    "state": {
                      "type": "string",
                      "allOf": [
                        {
                          "pattern": "^[^\\u0000\\p{Cs}]*$"
                        },
                        {
                          "pattern": "^[^\\p{Cc}\\u200B\\u2028-\\u202E\\u2066-\\u2069]*$"
                        }
                      ]
                    }
                  },
                  "required": [
                    "city",
                    "line1",
                    "postalCode",
                    "state"
                  ],
                  "additionalProperties": false
                },
                "label": {
                  "type": "string",
                  "allOf": [
                    {
                      "pattern": "^[^\\u0000\\p{Cs}]*$"
                    }
                  ]
                },
                "preferredShipping": {
                  "type": "boolean"
                },
                "recipientName": {
                  "anyOf": [
                    {
                      "type": "string",
                      "allOf": [
                        {
                          "pattern": "^[^\\u0000\\p{Cs}]*$"
                        },
                        {
                          "pattern": "^[^\\p{Cc}\\u200B\\u2028-\\u202E\\u2066-\\u2069]*$"
                        }
                      ]
                    },
                    {
                      "type": "null"
                    }
                  ]
                },
                "archivedAt": {
                  "anyOf": [
                    {
                      "type": "string"
                    },
                    {
                      "type": "null"
                    }
                  ]
                }
              },
              "required": [
                "id",
                "address",
                "label",
                "preferredShipping",
                "recipientName",
                "archivedAt"
              ],
              "additionalProperties": false
            }
          },
          "encounters": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "notes": {
                  "anyOf": [
                    {
                      "type": "string",
                      "allOf": [
                        {
                          "pattern": "^[^\\u0000\\p{Cs}]*$"
                        },
                        {
                          "maxLength": 5000
                        }
                      ]
                    },
                    {
                      "type": "null"
                    }
                  ]
                },
                "occurredAt": {
                  "type": "string"
                },
                "providerName": {
                  "anyOf": [
                    {
                      "type": "string",
                      "allOf": [
                        {
                          "pattern": "^[^\\u0000\\p{Cs}]*$"
                        }
                      ]
                    },
                    {
                      "type": "null"
                    }
                  ]
                },
                "type": {
                  "type": "string",
                  "allOf": [
                    {
                      "pattern": "^[^\\u0000\\p{Cs}]*$"
                    }
                  ]
                }
              },
              "required": [
                "notes",
                "occurredAt",
                "providerName",
                "type"
              ],
              "additionalProperties": false
            }
          },
          "gender": {
            "type": "string",
            "enum": [
              "f",
              "m",
              "o",
              "u"
            ]
          },
          "id": {
            "type": "string",
            "pattern": "^pat_[0-7][0-9a-hjkmnp-tv-z]{25}$",
            "examples": [
              "pat_01j2y8m6jcc9tt24af5pw9x1bc"
            ]
          },
          "livemode": {
            "type": "boolean"
          },
          "location": {
            "type": "object",
            "properties": {
              "id": {
                "type": "string",
                "allOf": [
                  {
                    "pattern": "^loc_[0-7][0-9a-hjkmnp-tv-z]{25}$",
                    "examples": [
                      "loc_01j2y8m6jcc9tt24af5pw9x1bc"
                    ]
                  }
                ]
              },
              "name": {
                "type": "string"
              },
              "state": {
                "anyOf": [
                  {
                    "type": "string"
                  },
                  {
                    "type": "null"
                  }
                ]
              },
              "status": {
                "type": "string",
                "enum": [
                  "active",
                  "archived"
                ]
              }
            },
            "required": [
              "id",
              "name",
              "state",
              "status"
            ],
            "additionalProperties": false
          },
          "locationId": {
            "type": "string",
            "pattern": "^loc_[0-7][0-9a-hjkmnp-tv-z]{25}$",
            "examples": [
              "loc_01j2y8m6jcc9tt24af5pw9x1bc"
            ]
          },
          "metadata": {
            "type": "object"
          },
          "medicalRecordNumber": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ]
          },
          "measurements": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "heightCentimeters": {
                  "anyOf": [
                    {
                      "anyOf": [
                        {
                          "type": "number",
                          "allOf": [
                            {
                              "exclusiveMinimum": 0
                            }
                          ]
                        },
                        {
                          "type": "string",
                          "enum": [
                            "Infinity",
                            "-Infinity",
                            "NaN"
                          ]
                        }
                      ]
                    },
                    {
                      "type": "null"
                    }
                  ]
                },
                "recordedAt": {
                  "type": "string"
                },
                "source": {
                  "type": "string",
                  "allOf": [
                    {
                      "pattern": "^[^\\u0000\\p{Cs}]*$"
                    }
                  ]
                },
                "weightKilograms": {
                  "anyOf": [
                    {
                      "anyOf": [
                        {
                          "type": "number",
                          "allOf": [
                            {
                              "exclusiveMinimum": 0
                            }
                          ]
                        },
                        {
                          "type": "string",
                          "enum": [
                            "Infinity",
                            "-Infinity",
                            "NaN"
                          ]
                        }
                      ]
                    },
                    {
                      "type": "null"
                    }
                  ]
                }
              },
              "required": [
                "heightCentimeters",
                "recordedAt",
                "source",
                "weightKilograms"
              ],
              "additionalProperties": false
            }
          },
          "name": {
            "type": "object",
            "properties": {
              "first": {
                "type": "string"
              },
              "last": {
                "type": "string"
              },
              "middle": {
                "anyOf": [
                  {
                    "type": "string"
                  },
                  {
                    "type": "null"
                  }
                ]
              },
              "preferred": {
                "anyOf": [
                  {
                    "type": "string"
                  },
                  {
                    "type": "null"
                  }
                ]
              }
            },
            "required": [
              "first",
              "last",
              "middle",
              "preferred"
            ],
            "additionalProperties": false
          },
          "object": {
            "type": "string",
            "enum": [
              "patient"
            ]
          },
          "phone": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ]
          },
          "programs": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "endedAt": {
                  "anyOf": [
                    {
                      "type": "string"
                    },
                    {
                      "type": "null"
                    }
                  ]
                },
                "name": {
                  "type": "string",
                  "allOf": [
                    {
                      "pattern": "^[^\\u0000\\p{Cs}]*$"
                    }
                  ]
                },
                "startedAt": {
                  "type": "string"
                },
                "status": {
                  "type": "string",
                  "enum": [
                    "active",
                    "completed",
                    "paused"
                  ]
                }
              },
              "required": [
                "endedAt",
                "name",
                "startedAt",
                "status"
              ],
              "additionalProperties": false
            }
          },
          "practiceId": {
            "type": "string",
            "pattern": "^prac_[0-7][0-9a-hjkmnp-tv-z]{25}$",
            "examples": [
              "prac_01j2y8m6jcc9tt24af5pw9x1bc"
            ]
          },
          "status": {
            "type": "string",
            "enum": [
              "active",
              "inactive"
            ]
          },
          "updatedAt": {
            "type": "string"
          }
        },
        "required": [
          "address",
          "defaultShippingAddressId",
          "shippingAddress",
          "allergyReviewStatus",
          "allergySummary",
          "createdAt",
          "clinicalProfile",
          "dateOfBirth",
          "email",
          "externalId",
          "externalIdentities",
          "addresses",
          "encounters",
          "gender",
          "id",
          "livemode",
          "location",
          "locationId",
          "metadata",
          "medicalRecordNumber",
          "measurements",
          "name",
          "object",
          "phone",
          "programs",
          "practiceId",
          "status",
          "updatedAt"
        ],
        "additionalProperties": false
      },
      "GetPatientAllergiesResponse": {
        "title": "GetPatientAllergiesResponse",
        "type": "object",
        "properties": {
          "allergies": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "category": {
                  "type": "string",
                  "enum": [
                    "drug",
                    "food",
                    "insect",
                    "latex",
                    "mold",
                    "pet",
                    "pollen",
                    "environmental",
                    "biologic",
                    "other"
                  ]
                },
                "code": {
                  "anyOf": [
                    {
                      "type": "string"
                    },
                    {
                      "type": "null"
                    }
                  ]
                },
                "codeSystem": {
                  "anyOf": [
                    {
                      "type": "string",
                      "enum": [
                        "rxnorm",
                        "snomed-ct"
                      ]
                    },
                    {
                      "type": "null"
                    }
                  ]
                },
                "id": {
                  "type": "string",
                  "allOf": [
                    {
                      "pattern": "^alg_[0-7][0-9a-hjkmnp-tv-z]{25}$",
                      "examples": [
                        "alg_01j2y8m6jcc9tt24af5pw9x1bc"
                      ]
                    }
                  ]
                },
                "reactions": {
                  "type": "array",
                  "items": {
                    "type": "object",
                    "properties": {
                      "code": {
                        "anyOf": [
                          {
                            "type": "string"
                          },
                          {
                            "type": "null"
                          }
                        ]
                      },
                      "codeSystem": {
                        "anyOf": [
                          {
                            "type": "string",
                            "enum": [
                              "snomed-ct"
                            ]
                          },
                          {
                            "type": "null"
                          }
                        ]
                      },
                      "display": {
                        "type": "string"
                      }
                    },
                    "required": [
                      "code",
                      "codeSystem",
                      "display"
                    ],
                    "additionalProperties": false
                  }
                },
                "severity": {
                  "anyOf": [
                    {
                      "type": "string",
                      "enum": [
                        "mild",
                        "moderate",
                        "severe",
                        "unknown"
                      ]
                    },
                    {
                      "type": "null"
                    }
                  ]
                },
                "source": {
                  "type": "string",
                  "enum": [
                    "Doctor",
                    "Patient",
                    "Patient Agent/Guardian",
                    "Pharmacist"
                  ]
                },
                "substance": {
                  "type": "string"
                },
                "type": {
                  "anyOf": [
                    {
                      "type": "string",
                      "enum": [
                        "allergy",
                        "intolerance"
                      ]
                    },
                    {
                      "type": "null"
                    }
                  ]
                },
                "verificationStatus": {
                  "type": "string",
                  "enum": [
                    "unconfirmed",
                    "presumed",
                    "confirmed"
                  ]
                }
              },
              "required": [
                "category",
                "code",
                "codeSystem",
                "id",
                "reactions",
                "severity",
                "source",
                "substance",
                "type",
                "verificationStatus"
              ],
              "additionalProperties": false
            }
          },
          "reviewStatus": {
            "type": "string",
            "enum": [
              "not_reviewed",
              "no_known",
              "recorded"
            ]
          }
        },
        "required": [
          "allergies",
          "reviewStatus"
        ],
        "additionalProperties": false
      },
      "ReplacePatientAllergiesRequest": {
        "type": "object",
        "properties": {
          "allergies": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "category": {
                  "type": "string",
                  "enum": [
                    "drug",
                    "food",
                    "insect",
                    "latex",
                    "mold",
                    "pet",
                    "pollen",
                    "environmental",
                    "biologic",
                    "other"
                  ]
                },
                "code": {
                  "anyOf": [
                    {
                      "anyOf": [
                        {
                          "type": "string"
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    {
                      "type": "null"
                    }
                  ]
                },
                "codeSystem": {
                  "anyOf": [
                    {
                      "anyOf": [
                        {
                          "anyOf": [
                            {
                              "type": "string",
                              "enum": [
                                "rxnorm",
                                "snomed-ct"
                              ]
                            },
                            {
                              "type": "null"
                            }
                          ]
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    {
                      "type": "null"
                    }
                  ]
                },
                "reactions": {
                  "type": "array",
                  "items": {
                    "type": "object",
                    "properties": {
                      "code": {
                        "anyOf": [
                          {
                            "anyOf": [
                              {
                                "type": "string"
                              },
                              {
                                "type": "null"
                              }
                            ]
                          },
                          {
                            "type": "null"
                          }
                        ]
                      },
                      "codeSystem": {
                        "anyOf": [
                          {
                            "anyOf": [
                              {
                                "type": "string",
                                "enum": [
                                  "snomed-ct"
                                ]
                              },
                              {
                                "type": "null"
                              }
                            ]
                          },
                          {
                            "type": "null"
                          }
                        ]
                      },
                      "display": {
                        "type": "string"
                      }
                    },
                    "required": [
                      "display"
                    ],
                    "additionalProperties": false
                  },
                  "maxItems": 20
                },
                "severity": {
                  "anyOf": [
                    {
                      "anyOf": [
                        {
                          "anyOf": [
                            {
                              "type": "string",
                              "enum": [
                                "mild",
                                "moderate",
                                "severe",
                                "unknown"
                              ]
                            },
                            {
                              "type": "null"
                            }
                          ]
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    {
                      "type": "null"
                    }
                  ]
                },
                "source": {
                  "type": "string",
                  "enum": [
                    "Doctor",
                    "Patient",
                    "Patient Agent/Guardian",
                    "Pharmacist"
                  ]
                },
                "substance": {
                  "type": "string"
                },
                "type": {
                  "anyOf": [
                    {
                      "type": "string",
                      "enum": [
                        "allergy",
                        "intolerance"
                      ]
                    },
                    {
                      "type": "null"
                    }
                  ]
                },
                "verificationStatus": {
                  "type": "string",
                  "enum": [
                    "unconfirmed",
                    "presumed",
                    "confirmed"
                  ]
                }
              },
              "required": [
                "category",
                "reactions",
                "source",
                "substance",
                "type",
                "verificationStatus"
              ],
              "additionalProperties": false
            },
            "maxItems": 50
          },
          "reviewStatus": {
            "type": "string",
            "enum": [
              "not_reviewed",
              "no_known",
              "recorded"
            ]
          }
        },
        "required": [
          "allergies",
          "reviewStatus"
        ],
        "additionalProperties": false,
        "title": "ReplacePatientAllergiesRequest"
      },
      "ReplacePatientAllergiesResponse": {
        "title": "ReplacePatientAllergiesResponse",
        "type": "object",
        "properties": {
          "allergies": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "category": {
                  "type": "string",
                  "enum": [
                    "drug",
                    "food",
                    "insect",
                    "latex",
                    "mold",
                    "pet",
                    "pollen",
                    "environmental",
                    "biologic",
                    "other"
                  ]
                },
                "code": {
                  "anyOf": [
                    {
                      "type": "string"
                    },
                    {
                      "type": "null"
                    }
                  ]
                },
                "codeSystem": {
                  "anyOf": [
                    {
                      "type": "string",
                      "enum": [
                        "rxnorm",
                        "snomed-ct"
                      ]
                    },
                    {
                      "type": "null"
                    }
                  ]
                },
                "id": {
                  "type": "string",
                  "allOf": [
                    {
                      "pattern": "^alg_[0-7][0-9a-hjkmnp-tv-z]{25}$",
                      "examples": [
                        "alg_01j2y8m6jcc9tt24af5pw9x1bc"
                      ]
                    }
                  ]
                },
                "reactions": {
                  "type": "array",
                  "items": {
                    "type": "object",
                    "properties": {
                      "code": {
                        "anyOf": [
                          {
                            "type": "string"
                          },
                          {
                            "type": "null"
                          }
                        ]
                      },
                      "codeSystem": {
                        "anyOf": [
                          {
                            "type": "string",
                            "enum": [
                              "snomed-ct"
                            ]
                          },
                          {
                            "type": "null"
                          }
                        ]
                      },
                      "display": {
                        "type": "string"
                      }
                    },
                    "required": [
                      "code",
                      "codeSystem",
                      "display"
                    ],
                    "additionalProperties": false
                  }
                },
                "severity": {
                  "anyOf": [
                    {
                      "type": "string",
                      "enum": [
                        "mild",
                        "moderate",
                        "severe",
                        "unknown"
                      ]
                    },
                    {
                      "type": "null"
                    }
                  ]
                },
                "source": {
                  "type": "string",
                  "enum": [
                    "Doctor",
                    "Patient",
                    "Patient Agent/Guardian",
                    "Pharmacist"
                  ]
                },
                "substance": {
                  "type": "string"
                },
                "type": {
                  "anyOf": [
                    {
                      "type": "string",
                      "enum": [
                        "allergy",
                        "intolerance"
                      ]
                    },
                    {
                      "type": "null"
                    }
                  ]
                },
                "verificationStatus": {
                  "type": "string",
                  "enum": [
                    "unconfirmed",
                    "presumed",
                    "confirmed"
                  ]
                }
              },
              "required": [
                "category",
                "code",
                "codeSystem",
                "id",
                "reactions",
                "severity",
                "source",
                "substance",
                "type",
                "verificationStatus"
              ],
              "additionalProperties": false
            }
          },
          "reviewStatus": {
            "type": "string",
            "enum": [
              "not_reviewed",
              "no_known",
              "recorded"
            ]
          }
        },
        "required": [
          "allergies",
          "reviewStatus"
        ],
        "additionalProperties": false
      },
      "AddOrderPrescriptionRequest": {
        "type": "object",
        "properties": {
          "metadata": {
            "anyOf": [
              {
                "type": "object",
                "additionalProperties": {
                  "anyOf": [
                    {
                      "type": "string",
                      "pattern": "^[^\\p{Cs}]*$",
                      "maxLength": 500
                    },
                    {
                      "type": "number"
                    },
                    {
                      "type": "boolean"
                    },
                    {
                      "type": "null"
                    }
                  ]
                },
                "propertyNames": {
                  "type": "string",
                  "pattern": "^[^\\p{Cs}]*$",
                  "minLength": 1,
                  "maxLength": 40
                },
                "maxProperties": 20
              },
              {
                "type": "null"
              }
            ]
          },
          "practiceId": {
            "type": "string",
            "pattern": "^prac_[0-7][0-9a-hjkmnp-tv-z]{25}$",
            "examples": [
              "prac_01j2y8m6jcc9tt24af5pw9x1bc"
            ]
          },
          "expectedRevision": {
            "anyOf": [
              {
                "type": "string",
                "pattern": "^rev_[a-f0-9]{64}$",
                "description": "Opaque revision of the complete order prescription set. Send the revision you reviewed as expectedRevision; never replace it automatically after a conflict."
              },
              {
                "type": "null"
              }
            ]
          },
          "expectedVersions": {
            "anyOf": [
              {
                "type": "array",
                "items": {
                  "type": "object",
                  "properties": {
                    "prescriptionId": {
                      "type": "string",
                      "pattern": "^rx_[0-7][0-9a-hjkmnp-tv-z]{25}$",
                      "examples": [
                        "rx_01j2y8m6jcc9tt24af5pw9x1bc"
                      ]
                    },
                    "version": {
                      "type": "integer",
                      "minimum": 1
                    }
                  },
                  "required": [
                    "prescriptionId",
                    "version"
                  ],
                  "additionalProperties": false
                },
                "minItems": 1,
                "maxItems": 20
              },
              {
                "type": "null"
              }
            ]
          },
          "prescription": {
            "type": "object",
            "properties": {
              "externalPrescriptionId": {
                "anyOf": [
                  {
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 200,
                    "pattern": "\\S",
                    "allOf": [
                      {
                        "pattern": "^[^\\p{Cc}\\p{Cs}]*$"
                      }
                    ]
                  },
                  {
                    "type": "null"
                  }
                ]
              },
              "clinical": {
                "anyOf": [
                  {
                    "type": "object",
                    "properties": {
                      "compoundingReason": {
                        "anyOf": [
                          {
                            "type": "object",
                            "properties": {
                              "category": {
                                "anyOf": [
                                  {
                                    "type": "string",
                                    "enum": [
                                      "alcohol_free",
                                      "drug_shortage",
                                      "commercial_product_discontinued",
                                      "modified_release",
                                      "inactive_ingredient_sensitivity",
                                      "inactive_ingredient_toxicity",
                                      "concentration_adjustment",
                                      "alternate_route",
                                      "dosage_form_unavailable",
                                      "flavor_adjustment",
                                      "tablet_burden",
                                      "patient_cannot_use_commercial_product",
                                      "no_approved_product_available",
                                      "no_rationale_required",
                                      "other_patient_specific_need"
                                    ]
                                  },
                                  {
                                    "type": "null"
                                  }
                                ]
                              },
                              "context": {
                                "anyOf": [
                                  {
                                    "type": "string"
                                  },
                                  {
                                    "type": "null"
                                  }
                                ]
                              }
                            },
                            "additionalProperties": false
                          },
                          {
                            "type": "null"
                          }
                        ]
                      },
                      "medicationReviewStatus": {
                        "anyOf": [
                          {
                            "type": "string",
                            "enum": [
                              "not_reviewed",
                              "none",
                              "recorded"
                            ]
                          },
                          {
                            "type": "null"
                          }
                        ]
                      },
                      "diagnosisReviewStatus": {
                        "anyOf": [
                          {
                            "type": "string",
                            "enum": [
                              "not_reviewed",
                              "none",
                              "recorded"
                            ]
                          },
                          {
                            "type": "null"
                          }
                        ]
                      },
                      "currentMedications": {
                        "anyOf": [
                          {
                            "type": "array",
                            "items": {
                              "type": "string"
                            },
                            "maxItems": 100
                          },
                          {
                            "type": "null"
                          }
                        ]
                      },
                      "diagnoses": {
                        "anyOf": [
                          {
                            "type": "array",
                            "items": {
                              "type": "object",
                              "properties": {
                                "code": {
                                  "type": "string"
                                },
                                "display": {
                                  "type": "string"
                                }
                              },
                              "required": [
                                "code",
                                "display"
                              ],
                              "additionalProperties": false
                            },
                            "maxItems": 20
                          },
                          {
                            "type": "null"
                          }
                        ]
                      },
                      "observations": {
                        "anyOf": [
                          {
                            "type": "array",
                            "items": {
                              "type": "object",
                              "properties": {
                                "display": {
                                  "type": "string"
                                },
                                "unit": {
                                  "type": "string"
                                },
                                "value": {
                                  "anyOf": [
                                    {
                                      "type": "number",
                                      "exclusiveMinimum": 0
                                    },
                                    {
                                      "type": "string",
                                      "enum": [
                                        "Infinity",
                                        "-Infinity",
                                        "NaN"
                                      ]
                                    }
                                  ]
                                }
                              },
                              "required": [
                                "display",
                                "unit",
                                "value"
                              ],
                              "additionalProperties": false
                            },
                            "maxItems": 20
                          },
                          {
                            "type": "null"
                          }
                        ]
                      }
                    },
                    "additionalProperties": false
                  },
                  {
                    "type": "null"
                  }
                ]
              },
              "pharmacyId": {
                "anyOf": [
                  {
                    "type": "string",
                    "pattern": "^pharm_[0-7][0-9a-hjkmnp-tv-z]{25}$",
                    "examples": [
                      "pharm_01j2y8m6jcc9tt24af5pw9x1bc"
                    ]
                  },
                  {
                    "type": "null"
                  }
                ]
              },
              "daysSupply": {
                "type": "integer",
                "minimum": 1,
                "maximum": 365
              },
              "dispensing": {
                "type": "object",
                "properties": {
                  "dispenseUponAcceptance": {
                    "anyOf": [
                      {
                        "type": "boolean"
                      },
                      {
                        "type": "null"
                      }
                    ]
                  },
                  "shippingOptionId": {
                    "anyOf": [
                      {
                        "type": "string",
                        "pattern": "^shp_[0-7][0-9a-hjkmnp-tv-z]{25}$",
                        "examples": [
                          "shp_01j2y8m6jcc9tt24af5pw9x1bc"
                        ]
                      },
                      {
                        "type": "null"
                      }
                    ]
                  },
                  "shippingAmountCents": {
                    "anyOf": [
                      {
                        "type": "integer",
                        "minimum": 0
                      },
                      {
                        "type": "null"
                      }
                    ],
                    "description": "Reviewed customer shipping rate for the selected service. Preview supplies this value. Shared group rates must not be summed per prescription."
                  },
                  "shippingDestinationType": {
                    "anyOf": [
                      {
                        "type": "string",
                        "enum": [
                          "patient"
                        ]
                      },
                      {
                        "type": "null"
                      }
                    ]
                  },
                  "pharmacyNotes": {
                    "anyOf": [
                      {
                        "type": "string"
                      },
                      {
                        "type": "null"
                      }
                    ]
                  },
                  "requestedFillDate": {
                    "anyOf": [
                      {
                        "type": "string",
                        "pattern": "^\\d{4}-\\d{2}-\\d{2}$"
                      },
                      {
                        "type": "null"
                      }
                    ]
                  },
                  "substitutionPermitted": {
                    "anyOf": [
                      {
                        "type": "boolean"
                      },
                      {
                        "type": "null"
                      }
                    ]
                  }
                },
                "additionalProperties": false
              },
              "directions": {
                "type": "string"
              },
              "medicationId": {
                "type": "string",
                "pattern": "^cat_[0-7][0-9a-hjkmnp-tv-z]{25}$",
                "examples": [
                  "cat_01j2y8m6jcc9tt24af5pw9x1bc"
                ]
              },
              "quantity": {
                "anyOf": [
                  {
                    "type": "number",
                    "exclusiveMinimum": 0,
                    "maximum": 100000
                  },
                  {
                    "type": "string",
                    "enum": [
                      "Infinity",
                      "-Infinity",
                      "NaN"
                    ]
                  }
                ]
              },
              "quantityUnit": {
                "type": "string"
              },
              "refills": {
                "type": "integer",
                "minimum": 0,
                "maximum": 99
              },
              "structuredSig": {
                "anyOf": [
                  {
                    "type": "object",
                    "properties": {
                      "dose": {
                        "type": "string"
                      },
                      "doseUnit": {
                        "type": "string"
                      },
                      "duration": {
                        "anyOf": [
                          {
                            "type": "string"
                          },
                          {
                            "type": "null"
                          }
                        ]
                      },
                      "frequency": {
                        "type": "string"
                      },
                      "indication": {
                        "anyOf": [
                          {
                            "type": "string"
                          },
                          {
                            "type": "null"
                          }
                        ]
                      },
                      "maxDailyUse": {
                        "anyOf": [
                          {
                            "type": "string"
                          },
                          {
                            "type": "null"
                          }
                        ]
                      },
                      "prn": {
                        "anyOf": [
                          {
                            "type": "boolean"
                          },
                          {
                            "type": "null"
                          }
                        ]
                      },
                      "route": {
                        "type": "string"
                      },
                      "titrationSchedule": {
                        "anyOf": [
                          {
                            "type": "string"
                          },
                          {
                            "type": "null"
                          }
                        ]
                      }
                    },
                    "required": [
                      "dose",
                      "doseUnit",
                      "frequency",
                      "route"
                    ],
                    "additionalProperties": false
                  },
                  {
                    "type": "null"
                  }
                ]
              }
            },
            "required": [
              "daysSupply",
              "dispensing",
              "directions",
              "medicationId",
              "quantity",
              "quantityUnit",
              "refills"
            ],
            "additionalProperties": false
          }
        },
        "required": [
          "practiceId",
          "prescription"
        ],
        "additionalProperties": false,
        "allOf": [
          {
            "oneOf": [
              {
                "required": [
                  "expectedRevision"
                ]
              },
              {
                "required": [
                  "expectedVersions"
                ]
              }
            ]
          }
        ],
        "title": "AddOrderPrescriptionRequest"
      },
      "AddOrderPrescriptionResponse": {
        "title": "AddOrderPrescriptionResponse",
        "type": "object",
        "properties": {
          "revision": {
            "type": "string",
            "pattern": "^rev_[a-f0-9]{64}$",
            "description": "Opaque revision of the complete order prescription set. Send the revision you reviewed as expectedRevision; never replace it automatically after a conflict."
          },
          "object": {
            "type": "string",
            "enum": [
              "order_draft_update"
            ]
          },
          "externalOrderId": {
            "anyOf": [
              {
                "type": "string",
                "minLength": 1,
                "maxLength": 200,
                "pattern": "\\S",
                "allOf": [
                  {
                    "pattern": "^[^\\p{Cc}\\p{Cs}]*$"
                  }
                ]
              },
              {
                "type": "null"
              }
            ]
          },
          "metadata": {
            "type": "object",
            "additionalProperties": {
              "anyOf": [
                {
                  "type": "string",
                  "allOf": [
                    {
                      "pattern": "^[^\\p{Cs}]*$"
                    },
                    {
                      "maxLength": 500
                    }
                  ]
                },
                {
                  "type": "number"
                },
                {
                  "type": "boolean"
                },
                {
                  "type": "null"
                }
              ]
            },
            "allOf": [
              {
                "propertyNames": {
                  "type": "string",
                  "allOf": [
                    {
                      "pattern": "^[^\\p{Cs}]*$"
                    },
                    {
                      "minLength": 1
                    },
                    {
                      "maxLength": 40
                    }
                  ]
                }
              },
              {
                "maxProperties": 20
              }
            ]
          },
          "orderId": {
            "type": "string",
            "pattern": "^ord_[0-7][0-9a-hjkmnp-tv-z]{25}$",
            "examples": [
              "ord_01j2y8m6jcc9tt24af5pw9x1bc"
            ]
          },
          "prescriptionId": {
            "type": "string",
            "pattern": "^rx_[0-7][0-9a-hjkmnp-tv-z]{25}$",
            "examples": [
              "rx_01j2y8m6jcc9tt24af5pw9x1bc"
            ]
          },
          "prescriptions": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "id": {
                  "type": "string",
                  "allOf": [
                    {
                      "pattern": "^rx_[0-7][0-9a-hjkmnp-tv-z]{25}$",
                      "examples": [
                        "rx_01j2y8m6jcc9tt24af5pw9x1bc"
                      ]
                    }
                  ]
                },
                "externalPrescriptionId": {
                  "anyOf": [
                    {
                      "type": "string",
                      "allOf": [
                        {
                          "minLength": 1
                        },
                        {
                          "maxLength": 200
                        },
                        {
                          "pattern": "\\S"
                        },
                        {
                          "pattern": "^[^\\p{Cc}\\p{Cs}]*$"
                        }
                      ]
                    },
                    {
                      "type": "null"
                    }
                  ]
                },
                "version": {
                  "type": "integer",
                  "allOf": [
                    {
                      "minimum": 1
                    }
                  ]
                }
              },
              "required": [
                "id",
                "externalPrescriptionId",
                "version"
              ],
              "additionalProperties": false
            },
            "allOf": [
              {
                "minItems": 1
              },
              {
                "maxItems": 20
              }
            ]
          }
        },
        "required": [
          "revision",
          "object",
          "externalOrderId",
          "metadata",
          "orderId",
          "prescriptionId",
          "prescriptions"
        ],
        "additionalProperties": false
      },
      "UpdateOrderPrescriptionRequest": {
        "type": "object",
        "properties": {
          "metadata": {
            "anyOf": [
              {
                "type": "object",
                "additionalProperties": {
                  "anyOf": [
                    {
                      "type": "string",
                      "pattern": "^[^\\p{Cs}]*$",
                      "maxLength": 500
                    },
                    {
                      "type": "number"
                    },
                    {
                      "type": "boolean"
                    },
                    {
                      "type": "null"
                    }
                  ]
                },
                "propertyNames": {
                  "type": "string",
                  "pattern": "^[^\\p{Cs}]*$",
                  "minLength": 1,
                  "maxLength": 40
                },
                "maxProperties": 20
              },
              {
                "type": "null"
              }
            ]
          },
          "practiceId": {
            "type": "string",
            "pattern": "^prac_[0-7][0-9a-hjkmnp-tv-z]{25}$",
            "examples": [
              "prac_01j2y8m6jcc9tt24af5pw9x1bc"
            ]
          },
          "expectedRevision": {
            "anyOf": [
              {
                "type": "string",
                "pattern": "^rev_[a-f0-9]{64}$",
                "description": "Opaque revision of the complete order prescription set. Send the revision you reviewed as expectedRevision; never replace it automatically after a conflict."
              },
              {
                "type": "null"
              }
            ]
          },
          "expectedVersions": {
            "anyOf": [
              {
                "type": "array",
                "items": {
                  "type": "object",
                  "properties": {
                    "prescriptionId": {
                      "type": "string",
                      "pattern": "^rx_[0-7][0-9a-hjkmnp-tv-z]{25}$",
                      "examples": [
                        "rx_01j2y8m6jcc9tt24af5pw9x1bc"
                      ]
                    },
                    "version": {
                      "type": "integer",
                      "minimum": 1
                    }
                  },
                  "required": [
                    "prescriptionId",
                    "version"
                  ],
                  "additionalProperties": false
                },
                "minItems": 1,
                "maxItems": 20
              },
              {
                "type": "null"
              }
            ]
          },
          "prescription": {
            "type": "object",
            "properties": {
              "clinical": {
                "anyOf": [
                  {
                    "type": "object",
                    "properties": {
                      "compoundingReason": {
                        "anyOf": [
                          {
                            "type": "object",
                            "properties": {
                              "category": {
                                "anyOf": [
                                  {
                                    "type": "string",
                                    "enum": [
                                      "alcohol_free",
                                      "drug_shortage",
                                      "commercial_product_discontinued",
                                      "modified_release",
                                      "inactive_ingredient_sensitivity",
                                      "inactive_ingredient_toxicity",
                                      "concentration_adjustment",
                                      "alternate_route",
                                      "dosage_form_unavailable",
                                      "flavor_adjustment",
                                      "tablet_burden",
                                      "patient_cannot_use_commercial_product",
                                      "no_approved_product_available",
                                      "no_rationale_required",
                                      "other_patient_specific_need"
                                    ]
                                  },
                                  {
                                    "type": "null"
                                  }
                                ]
                              },
                              "context": {
                                "anyOf": [
                                  {
                                    "type": "string"
                                  },
                                  {
                                    "type": "null"
                                  }
                                ]
                              }
                            },
                            "additionalProperties": false
                          },
                          {
                            "type": "null"
                          }
                        ]
                      },
                      "medicationReviewStatus": {
                        "anyOf": [
                          {
                            "type": "string",
                            "enum": [
                              "not_reviewed",
                              "none",
                              "recorded"
                            ]
                          },
                          {
                            "type": "null"
                          }
                        ]
                      },
                      "diagnosisReviewStatus": {
                        "anyOf": [
                          {
                            "type": "string",
                            "enum": [
                              "not_reviewed",
                              "none",
                              "recorded"
                            ]
                          },
                          {
                            "type": "null"
                          }
                        ]
                      },
                      "currentMedications": {
                        "anyOf": [
                          {
                            "type": "array",
                            "items": {
                              "type": "string"
                            },
                            "maxItems": 100
                          },
                          {
                            "type": "null"
                          }
                        ]
                      },
                      "diagnoses": {
                        "anyOf": [
                          {
                            "type": "array",
                            "items": {
                              "type": "object",
                              "properties": {
                                "code": {
                                  "type": "string"
                                },
                                "display": {
                                  "type": "string"
                                }
                              },
                              "required": [
                                "code",
                                "display"
                              ],
                              "additionalProperties": false
                            },
                            "maxItems": 20
                          },
                          {
                            "type": "null"
                          }
                        ]
                      },
                      "observations": {
                        "anyOf": [
                          {
                            "type": "array",
                            "items": {
                              "type": "object",
                              "properties": {
                                "display": {
                                  "type": "string"
                                },
                                "unit": {
                                  "type": "string"
                                },
                                "value": {
                                  "anyOf": [
                                    {
                                      "type": "number",
                                      "exclusiveMinimum": 0
                                    },
                                    {
                                      "type": "string",
                                      "enum": [
                                        "Infinity",
                                        "-Infinity",
                                        "NaN"
                                      ]
                                    }
                                  ]
                                }
                              },
                              "required": [
                                "display",
                                "unit",
                                "value"
                              ],
                              "additionalProperties": false
                            },
                            "maxItems": 20
                          },
                          {
                            "type": "null"
                          }
                        ]
                      }
                    },
                    "additionalProperties": false
                  },
                  {
                    "type": "null"
                  }
                ]
              },
              "pharmacyId": {
                "anyOf": [
                  {
                    "type": "string",
                    "pattern": "^pharm_[0-7][0-9a-hjkmnp-tv-z]{25}$",
                    "examples": [
                      "pharm_01j2y8m6jcc9tt24af5pw9x1bc"
                    ]
                  },
                  {
                    "type": "null"
                  }
                ]
              },
              "daysSupply": {
                "type": "integer",
                "minimum": 1,
                "maximum": 365
              },
              "dispensing": {
                "type": "object",
                "properties": {
                  "dispenseUponAcceptance": {
                    "anyOf": [
                      {
                        "type": "boolean"
                      },
                      {
                        "type": "null"
                      }
                    ]
                  },
                  "shippingOptionId": {
                    "anyOf": [
                      {
                        "type": "string",
                        "pattern": "^shp_[0-7][0-9a-hjkmnp-tv-z]{25}$",
                        "examples": [
                          "shp_01j2y8m6jcc9tt24af5pw9x1bc"
                        ]
                      },
                      {
                        "type": "null"
                      }
                    ]
                  },
                  "shippingAmountCents": {
                    "anyOf": [
                      {
                        "type": "integer",
                        "minimum": 0
                      },
                      {
                        "type": "null"
                      }
                    ],
                    "description": "Reviewed customer shipping rate for the selected service. Preview supplies this value. Shared group rates must not be summed per prescription."
                  },
                  "shippingDestinationType": {
                    "anyOf": [
                      {
                        "type": "string",
                        "enum": [
                          "patient"
                        ]
                      },
                      {
                        "type": "null"
                      }
                    ]
                  },
                  "pharmacyNotes": {
                    "anyOf": [
                      {
                        "type": "string"
                      },
                      {
                        "type": "null"
                      }
                    ]
                  },
                  "requestedFillDate": {
                    "anyOf": [
                      {
                        "type": "string",
                        "pattern": "^\\d{4}-\\d{2}-\\d{2}$"
                      },
                      {
                        "type": "null"
                      }
                    ]
                  },
                  "substitutionPermitted": {
                    "anyOf": [
                      {
                        "type": "boolean"
                      },
                      {
                        "type": "null"
                      }
                    ]
                  }
                },
                "additionalProperties": false
              },
              "directions": {
                "type": "string"
              },
              "medicationId": {
                "type": "string",
                "pattern": "^cat_[0-7][0-9a-hjkmnp-tv-z]{25}$",
                "examples": [
                  "cat_01j2y8m6jcc9tt24af5pw9x1bc"
                ]
              },
              "quantity": {
                "anyOf": [
                  {
                    "type": "number",
                    "exclusiveMinimum": 0,
                    "maximum": 100000
                  },
                  {
                    "type": "string",
                    "enum": [
                      "Infinity",
                      "-Infinity",
                      "NaN"
                    ]
                  }
                ]
              },
              "quantityUnit": {
                "type": "string"
              },
              "refills": {
                "type": "integer",
                "minimum": 0,
                "maximum": 99
              },
              "structuredSig": {
                "anyOf": [
                  {
                    "type": "object",
                    "properties": {
                      "dose": {
                        "type": "string"
                      },
                      "doseUnit": {
                        "type": "string"
                      },
                      "duration": {
                        "anyOf": [
                          {
                            "type": "string"
                          },
                          {
                            "type": "null"
                          }
                        ]
                      },
                      "frequency": {
                        "type": "string"
                      },
                      "indication": {
                        "anyOf": [
                          {
                            "type": "string"
                          },
                          {
                            "type": "null"
                          }
                        ]
                      },
                      "maxDailyUse": {
                        "anyOf": [
                          {
                            "type": "string"
                          },
                          {
                            "type": "null"
                          }
                        ]
                      },
                      "prn": {
                        "anyOf": [
                          {
                            "type": "boolean"
                          },
                          {
                            "type": "null"
                          }
                        ]
                      },
                      "route": {
                        "type": "string"
                      },
                      "titrationSchedule": {
                        "anyOf": [
                          {
                            "type": "string"
                          },
                          {
                            "type": "null"
                          }
                        ]
                      }
                    },
                    "required": [
                      "dose",
                      "doseUnit",
                      "frequency",
                      "route"
                    ],
                    "additionalProperties": false
                  },
                  {
                    "type": "null"
                  }
                ]
              }
            },
            "required": [
              "daysSupply",
              "dispensing",
              "directions",
              "medicationId",
              "quantity",
              "quantityUnit",
              "refills"
            ],
            "additionalProperties": false
          }
        },
        "required": [
          "practiceId",
          "prescription"
        ],
        "additionalProperties": false,
        "allOf": [
          {
            "oneOf": [
              {
                "required": [
                  "expectedRevision"
                ]
              },
              {
                "required": [
                  "expectedVersions"
                ]
              }
            ]
          }
        ],
        "title": "UpdateOrderPrescriptionRequest"
      },
      "UpdateOrderPrescriptionResponse": {
        "title": "UpdateOrderPrescriptionResponse",
        "type": "object",
        "properties": {
          "revision": {
            "type": "string",
            "pattern": "^rev_[a-f0-9]{64}$",
            "description": "Opaque revision of the complete order prescription set. Send the revision you reviewed as expectedRevision; never replace it automatically after a conflict."
          },
          "object": {
            "type": "string",
            "enum": [
              "order_draft_update"
            ]
          },
          "externalOrderId": {
            "anyOf": [
              {
                "type": "string",
                "minLength": 1,
                "maxLength": 200,
                "pattern": "\\S",
                "allOf": [
                  {
                    "pattern": "^[^\\p{Cc}\\p{Cs}]*$"
                  }
                ]
              },
              {
                "type": "null"
              }
            ]
          },
          "metadata": {
            "type": "object",
            "additionalProperties": {
              "anyOf": [
                {
                  "type": "string",
                  "allOf": [
                    {
                      "pattern": "^[^\\p{Cs}]*$"
                    },
                    {
                      "maxLength": 500
                    }
                  ]
                },
                {
                  "type": "number"
                },
                {
                  "type": "boolean"
                },
                {
                  "type": "null"
                }
              ]
            },
            "allOf": [
              {
                "propertyNames": {
                  "type": "string",
                  "allOf": [
                    {
                      "pattern": "^[^\\p{Cs}]*$"
                    },
                    {
                      "minLength": 1
                    },
                    {
                      "maxLength": 40
                    }
                  ]
                }
              },
              {
                "maxProperties": 20
              }
            ]
          },
          "orderId": {
            "type": "string",
            "pattern": "^ord_[0-7][0-9a-hjkmnp-tv-z]{25}$",
            "examples": [
              "ord_01j2y8m6jcc9tt24af5pw9x1bc"
            ]
          },
          "prescriptionId": {
            "type": "string",
            "pattern": "^rx_[0-7][0-9a-hjkmnp-tv-z]{25}$",
            "examples": [
              "rx_01j2y8m6jcc9tt24af5pw9x1bc"
            ]
          },
          "prescriptions": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "id": {
                  "type": "string",
                  "allOf": [
                    {
                      "pattern": "^rx_[0-7][0-9a-hjkmnp-tv-z]{25}$",
                      "examples": [
                        "rx_01j2y8m6jcc9tt24af5pw9x1bc"
                      ]
                    }
                  ]
                },
                "externalPrescriptionId": {
                  "anyOf": [
                    {
                      "type": "string",
                      "allOf": [
                        {
                          "minLength": 1
                        },
                        {
                          "maxLength": 200
                        },
                        {
                          "pattern": "\\S"
                        },
                        {
                          "pattern": "^[^\\p{Cc}\\p{Cs}]*$"
                        }
                      ]
                    },
                    {
                      "type": "null"
                    }
                  ]
                },
                "version": {
                  "type": "integer",
                  "allOf": [
                    {
                      "minimum": 1
                    }
                  ]
                }
              },
              "required": [
                "id",
                "externalPrescriptionId",
                "version"
              ],
              "additionalProperties": false
            },
            "allOf": [
              {
                "minItems": 1
              },
              {
                "maxItems": 20
              }
            ]
          }
        },
        "required": [
          "revision",
          "object",
          "externalOrderId",
          "metadata",
          "orderId",
          "prescriptionId",
          "prescriptions"
        ],
        "additionalProperties": false
      },
      "CreateOrderBatchRequest": {
        "type": "object",
        "properties": {
          "practiceId": {
            "type": "string",
            "pattern": "^prac_[0-7][0-9a-hjkmnp-tv-z]{25}$",
            "examples": [
              "prac_01j2y8m6jcc9tt24af5pw9x1bc"
            ]
          },
          "userId": {
            "anyOf": [
              {
                "type": "string",
                "pattern": "^user_[0-7][0-9a-hjkmnp-tv-z]{25}$",
                "examples": [
                  "user_01j2y8m6jcc9tt24af5pw9x1bc"
                ]
              },
              {
                "type": "null"
              }
            ]
          },
          "prescriber": {
            "anyOf": [
              {
                "type": "object",
                "properties": {
                  "id": {
                    "anyOf": [
                      {
                        "type": "string",
                        "pattern": "^prov_[0-7][0-9a-hjkmnp-tv-z]{25}$",
                        "examples": [
                          "prov_01j2y8m6jcc9tt24af5pw9x1bc"
                        ]
                      },
                      {
                        "type": "null"
                      }
                    ]
                  },
                  "npi": {
                    "anyOf": [
                      {
                        "type": "string"
                      },
                      {
                        "type": "null"
                      }
                    ]
                  },
                  "externalId": {
                    "anyOf": [
                      {
                        "type": "string"
                      },
                      {
                        "type": "null"
                      }
                    ]
                  },
                  "profile": {
                    "anyOf": [
                      {
                        "type": "object",
                        "properties": {
                          "email": {
                            "anyOf": [
                              {
                                "type": "string",
                                "pattern": "^[^\\s@]+@[^\\s@]+\\.[^\\s@]+$"
                              },
                              {
                                "type": "null"
                              }
                            ]
                          },
                          "phone": {
                            "anyOf": [
                              {
                                "type": "string"
                              },
                              {
                                "type": "null"
                              }
                            ]
                          }
                        },
                        "additionalProperties": false
                      },
                      {
                        "type": "null"
                      }
                    ]
                  }
                },
                "additionalProperties": false
              },
              {
                "type": "null"
              }
            ]
          },
          "orders": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "otcItems": {
                  "anyOf": [
                    {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "catalogItemId": {
                            "type": "string",
                            "pattern": "^cat_[0-7][0-9a-hjkmnp-tv-z]{25}$",
                            "examples": [
                              "cat_01j2y8m6jcc9tt24af5pw9x1bc"
                            ]
                          },
                          "quantity": {
                            "type": "integer",
                            "minimum": 1,
                            "maximum": 100
                          }
                        },
                        "required": [
                          "catalogItemId",
                          "quantity"
                        ],
                        "additionalProperties": false
                      },
                      "maxItems": 20
                    },
                    {
                      "type": "null"
                    }
                  ]
                },
                "externalOrderId": {
                  "anyOf": [
                    {
                      "type": "string",
                      "minLength": 1,
                      "maxLength": 200,
                      "pattern": "\\S",
                      "allOf": [
                        {
                          "pattern": "^[^\\p{Cc}\\p{Cs}]*$"
                        }
                      ]
                    },
                    {
                      "type": "null"
                    }
                  ]
                },
                "metadata": {
                  "anyOf": [
                    {
                      "type": "object",
                      "additionalProperties": {
                        "anyOf": [
                          {
                            "type": "string",
                            "pattern": "^[^\\p{Cs}]*$",
                            "maxLength": 500
                          },
                          {
                            "type": "number"
                          },
                          {
                            "type": "boolean"
                          },
                          {
                            "type": "null"
                          }
                        ]
                      },
                      "propertyNames": {
                        "type": "string",
                        "pattern": "^[^\\p{Cs}]*$",
                        "minLength": 1,
                        "maxLength": 40
                      },
                      "maxProperties": 20
                    },
                    {
                      "type": "null"
                    }
                  ]
                },
                "patientId": {
                  "anyOf": [
                    {
                      "type": "string",
                      "pattern": "^pat_[0-7][0-9a-hjkmnp-tv-z]{25}$",
                      "examples": [
                        "pat_01j2y8m6jcc9tt24af5pw9x1bc"
                      ]
                    },
                    {
                      "type": "null"
                    }
                  ]
                },
                "patient": {
                  "anyOf": [
                    {
                      "type": "object",
                      "properties": {
                        "address": {
                          "anyOf": [
                            {
                              "anyOf": [
                                {
                                  "type": "object",
                                  "properties": {
                                    "city": {
                                      "type": "string",
                                      "pattern": "^[^\\u0000\\p{Cs}]*$",
                                      "allOf": [
                                        {
                                          "pattern": "^[^\\p{Cc}\\u200B\\u2028-\\u202E\\u2066-\\u2069]*$"
                                        }
                                      ]
                                    },
                                    "line1": {
                                      "type": "string",
                                      "pattern": "^[^\\u0000\\p{Cs}]*$",
                                      "allOf": [
                                        {
                                          "pattern": "^[^\\p{Cc}\\u200B\\u2028-\\u202E\\u2066-\\u2069]*$"
                                        }
                                      ]
                                    },
                                    "line2": {
                                      "anyOf": [
                                        {
                                          "anyOf": [
                                            {
                                              "type": "string",
                                              "pattern": "^[^\\u0000\\p{Cs}]*$",
                                              "allOf": [
                                                {
                                                  "pattern": "^[^\\p{Cc}\\u200B\\u2028-\\u202E\\u2066-\\u2069]*$"
                                                }
                                              ]
                                            },
                                            {
                                              "type": "null"
                                            }
                                          ]
                                        },
                                        {
                                          "type": "null"
                                        }
                                      ]
                                    },
                                    "postalCode": {
                                      "type": "string"
                                    },
                                    "state": {
                                      "type": "string"
                                    },
                                    "country": {
                                      "anyOf": [
                                        {
                                          "type": "string",
                                          "enum": [
                                            "US"
                                          ]
                                        },
                                        {
                                          "type": "null"
                                        }
                                      ]
                                    }
                                  },
                                  "required": [
                                    "city",
                                    "line1",
                                    "postalCode",
                                    "state"
                                  ],
                                  "additionalProperties": false
                                },
                                {
                                  "type": "null"
                                }
                              ]
                            },
                            {
                              "type": "null"
                            }
                          ]
                        },
                        "clinicalProfile": {
                          "anyOf": [
                            {
                              "type": "object",
                              "properties": {
                                "currentMedications": {
                                  "type": "array",
                                  "items": {
                                    "type": "string",
                                    "pattern": "^[^\\u0000\\p{Cs}]*$"
                                  },
                                  "maxItems": 100
                                },
                                "heightInches": {
                                  "anyOf": [
                                    {
                                      "anyOf": [
                                        {
                                          "anyOf": [
                                            {
                                              "type": "number",
                                              "exclusiveMinimum": 0
                                            },
                                            {
                                              "type": "string",
                                              "enum": [
                                                "Infinity",
                                                "-Infinity",
                                                "NaN"
                                              ]
                                            }
                                          ]
                                        },
                                        {
                                          "type": "null"
                                        }
                                      ]
                                    },
                                    {
                                      "type": "null"
                                    }
                                  ]
                                },
                                "reviewedAt": {
                                  "anyOf": [
                                    {
                                      "anyOf": [
                                        {
                                          "type": "string"
                                        },
                                        {
                                          "type": "null"
                                        }
                                      ]
                                    },
                                    {
                                      "type": "null"
                                    }
                                  ]
                                },
                                "weightPounds": {
                                  "anyOf": [
                                    {
                                      "anyOf": [
                                        {
                                          "anyOf": [
                                            {
                                              "type": "number",
                                              "exclusiveMinimum": 0
                                            },
                                            {
                                              "type": "string",
                                              "enum": [
                                                "Infinity",
                                                "-Infinity",
                                                "NaN"
                                              ]
                                            }
                                          ]
                                        },
                                        {
                                          "type": "null"
                                        }
                                      ]
                                    },
                                    {
                                      "type": "null"
                                    }
                                  ]
                                }
                              },
                              "required": [
                                "currentMedications"
                              ],
                              "additionalProperties": false
                            },
                            {
                              "type": "null"
                            }
                          ]
                        },
                        "dateOfBirth": {
                          "type": "string",
                          "pattern": "^\\d{4}-\\d{2}-\\d{2}$"
                        },
                        "email": {
                          "anyOf": [
                            {
                              "anyOf": [
                                {
                                  "type": "string"
                                },
                                {
                                  "type": "null"
                                }
                              ]
                            },
                            {
                              "type": "null"
                            }
                          ]
                        },
                        "externalId": {
                          "anyOf": [
                            {
                              "type": "string",
                              "pattern": "^[^\\u0000\\p{Cs}]*$"
                            },
                            {
                              "type": "null"
                            }
                          ]
                        },
                        "externalIdentities": {
                          "anyOf": [
                            {
                              "type": "array",
                              "items": {
                                "type": "object",
                                "properties": {
                                  "source": {
                                    "type": "string",
                                    "pattern": "^[^\\u0000\\p{Cs}]*$"
                                  },
                                  "value": {
                                    "type": "string",
                                    "pattern": "^[^\\u0000\\p{Cs}]*$"
                                  }
                                },
                                "required": [
                                  "source",
                                  "value"
                                ],
                                "additionalProperties": false
                              },
                              "maxItems": 50
                            },
                            {
                              "type": "null"
                            }
                          ]
                        },
                        "addresses": {
                          "anyOf": [
                            {
                              "type": "array",
                              "items": {
                                "type": "object",
                                "properties": {
                                  "id": {
                                    "anyOf": [
                                      {
                                        "type": "string",
                                        "pattern": "^addr_[0-7][0-9a-hjkmnp-tv-z]{25}$",
                                        "examples": [
                                          "addr_01j2y8m6jcc9tt24af5pw9x1bc"
                                        ]
                                      },
                                      {
                                        "type": "null"
                                      }
                                    ]
                                  },
                                  "address": {
                                    "type": "object",
                                    "properties": {
                                      "city": {
                                        "type": "string",
                                        "pattern": "^[^\\u0000\\p{Cs}]*$",
                                        "allOf": [
                                          {
                                            "pattern": "^[^\\p{Cc}\\u200B\\u2028-\\u202E\\u2066-\\u2069]*$"
                                          }
                                        ]
                                      },
                                      "country": {
                                        "anyOf": [
                                          {
                                            "type": "string",
                                            "enum": [
                                              "US"
                                            ]
                                          },
                                          {
                                            "type": "null"
                                          }
                                        ]
                                      },
                                      "line1": {
                                        "type": "string",
                                        "pattern": "^[^\\u0000\\p{Cs}]*$",
                                        "allOf": [
                                          {
                                            "pattern": "^[^\\p{Cc}\\u200B\\u2028-\\u202E\\u2066-\\u2069]*$"
                                          }
                                        ]
                                      },
                                      "line2": {
                                        "anyOf": [
                                          {
                                            "anyOf": [
                                              {
                                                "type": "string",
                                                "pattern": "^[^\\u0000\\p{Cs}]*$",
                                                "allOf": [
                                                  {
                                                    "pattern": "^[^\\p{Cc}\\u200B\\u2028-\\u202E\\u2066-\\u2069]*$"
                                                  }
                                                ]
                                              },
                                              {
                                                "type": "null"
                                              }
                                            ]
                                          },
                                          {
                                            "type": "null"
                                          }
                                        ]
                                      },
                                      "postalCode": {
                                        "type": "string"
                                      },
                                      "state": {
                                        "type": "string"
                                      }
                                    },
                                    "required": [
                                      "city",
                                      "line1",
                                      "postalCode",
                                      "state"
                                    ],
                                    "additionalProperties": false
                                  },
                                  "label": {
                                    "type": "string",
                                    "pattern": "^[^\\u0000\\p{Cs}]*$"
                                  },
                                  "preferredShipping": {
                                    "type": "boolean"
                                  },
                                  "recipientName": {
                                    "anyOf": [
                                      {
                                        "type": "string",
                                        "pattern": "^[^\\u0000\\p{Cs}]*$",
                                        "allOf": [
                                          {
                                            "pattern": "^[^\\p{Cc}\\u200B\\u2028-\\u202E\\u2066-\\u2069]*$"
                                          }
                                        ]
                                      },
                                      {
                                        "type": "null"
                                      }
                                    ]
                                  }
                                },
                                "required": [
                                  "address",
                                  "label",
                                  "preferredShipping",
                                  "recipientName"
                                ],
                                "additionalProperties": false
                              },
                              "maxItems": 50
                            },
                            {
                              "type": "null"
                            }
                          ]
                        },
                        "encounters": {
                          "anyOf": [
                            {
                              "type": "array",
                              "items": {
                                "type": "object",
                                "properties": {
                                  "notes": {
                                    "anyOf": [
                                      {
                                        "type": "string",
                                        "pattern": "^[^\\u0000\\p{Cs}]*$",
                                        "maxLength": 5000
                                      },
                                      {
                                        "type": "null"
                                      }
                                    ]
                                  },
                                  "occurredAt": {
                                    "type": "string"
                                  },
                                  "providerName": {
                                    "anyOf": [
                                      {
                                        "type": "string",
                                        "pattern": "^[^\\u0000\\p{Cs}]*$"
                                      },
                                      {
                                        "type": "null"
                                      }
                                    ]
                                  },
                                  "type": {
                                    "type": "string",
                                    "pattern": "^[^\\u0000\\p{Cs}]*$"
                                  }
                                },
                                "required": [
                                  "notes",
                                  "occurredAt",
                                  "providerName",
                                  "type"
                                ],
                                "additionalProperties": false
                              }
                            },
                            {
                              "type": "null"
                            }
                          ]
                        },
                        "gender": {
                          "anyOf": [
                            {
                              "type": "string",
                              "enum": [
                                "f",
                                "m",
                                "o",
                                "u"
                              ]
                            },
                            {
                              "type": "null"
                            }
                          ]
                        },
                        "locationId": {
                          "anyOf": [
                            {
                              "type": "string",
                              "pattern": "^loc_[0-7][0-9a-hjkmnp-tv-z]{25}$",
                              "examples": [
                                "loc_01j2y8m6jcc9tt24af5pw9x1bc"
                              ]
                            },
                            {
                              "type": "null"
                            }
                          ]
                        },
                        "metadata": {
                          "anyOf": [
                            {
                              "type": "object"
                            },
                            {
                              "type": "null"
                            }
                          ]
                        },
                        "medicalRecordNumber": {
                          "anyOf": [
                            {
                              "anyOf": [
                                {
                                  "type": "string",
                                  "pattern": "^[^\\u0000\\p{Cs}]*$"
                                },
                                {
                                  "type": "null"
                                }
                              ]
                            },
                            {
                              "type": "null"
                            }
                          ]
                        },
                        "measurements": {
                          "anyOf": [
                            {
                              "type": "array",
                              "items": {
                                "type": "object",
                                "properties": {
                                  "heightCentimeters": {
                                    "anyOf": [
                                      {
                                        "anyOf": [
                                          {
                                            "type": "number",
                                            "exclusiveMinimum": 0
                                          },
                                          {
                                            "type": "string",
                                            "enum": [
                                              "Infinity",
                                              "-Infinity",
                                              "NaN"
                                            ]
                                          }
                                        ]
                                      },
                                      {
                                        "type": "null"
                                      }
                                    ]
                                  },
                                  "recordedAt": {
                                    "type": "string"
                                  },
                                  "source": {
                                    "type": "string",
                                    "pattern": "^[^\\u0000\\p{Cs}]*$"
                                  },
                                  "weightKilograms": {
                                    "anyOf": [
                                      {
                                        "anyOf": [
                                          {
                                            "type": "number",
                                            "exclusiveMinimum": 0
                                          },
                                          {
                                            "type": "string",
                                            "enum": [
                                              "Infinity",
                                              "-Infinity",
                                              "NaN"
                                            ]
                                          }
                                        ]
                                      },
                                      {
                                        "type": "null"
                                      }
                                    ]
                                  }
                                },
                                "required": [
                                  "heightCentimeters",
                                  "recordedAt",
                                  "source",
                                  "weightKilograms"
                                ],
                                "additionalProperties": false
                              }
                            },
                            {
                              "type": "null"
                            }
                          ]
                        },
                        "name": {
                          "type": "object",
                          "properties": {
                            "first": {
                              "type": "string",
                              "pattern": "^[^\\u0000\\p{Cs}]*$",
                              "allOf": [
                                {
                                  "pattern": "^[^\\p{Cc}\\u200B\\u2028-\\u202E\\u2066-\\u2069]*$"
                                }
                              ]
                            },
                            "last": {
                              "type": "string",
                              "pattern": "^[^\\u0000\\p{Cs}]*$",
                              "allOf": [
                                {
                                  "pattern": "^[^\\p{Cc}\\u200B\\u2028-\\u202E\\u2066-\\u2069]*$"
                                }
                              ]
                            },
                            "middle": {
                              "anyOf": [
                                {
                                  "anyOf": [
                                    {
                                      "type": "string",
                                      "pattern": "^[^\\u0000\\p{Cs}]*$",
                                      "allOf": [
                                        {
                                          "pattern": "^[^\\p{Cc}\\u200B\\u2028-\\u202E\\u2066-\\u2069]*$"
                                        }
                                      ]
                                    },
                                    {
                                      "type": "null"
                                    }
                                  ]
                                },
                                {
                                  "type": "null"
                                }
                              ]
                            },
                            "preferred": {
                              "anyOf": [
                                {
                                  "anyOf": [
                                    {
                                      "type": "string",
                                      "pattern": "^[^\\u0000\\p{Cs}]*$",
                                      "allOf": [
                                        {
                                          "pattern": "^[^\\p{Cc}\\u200B\\u2028-\\u202E\\u2066-\\u2069]*$"
                                        }
                                      ]
                                    },
                                    {
                                      "type": "null"
                                    }
                                  ]
                                },
                                {
                                  "type": "null"
                                }
                              ]
                            }
                          },
                          "required": [
                            "first",
                            "last"
                          ],
                          "additionalProperties": false
                        },
                        "phone": {
                          "anyOf": [
                            {
                              "anyOf": [
                                {
                                  "type": "string"
                                },
                                {
                                  "type": "null"
                                }
                              ]
                            },
                            {
                              "type": "null"
                            }
                          ]
                        },
                        "programs": {
                          "anyOf": [
                            {
                              "type": "array",
                              "items": {
                                "type": "object",
                                "properties": {
                                  "endedAt": {
                                    "anyOf": [
                                      {
                                        "type": "string"
                                      },
                                      {
                                        "type": "null"
                                      }
                                    ]
                                  },
                                  "name": {
                                    "type": "string",
                                    "pattern": "^[^\\u0000\\p{Cs}]*$"
                                  },
                                  "startedAt": {
                                    "type": "string"
                                  },
                                  "status": {
                                    "type": "string",
                                    "enum": [
                                      "active",
                                      "completed",
                                      "paused"
                                    ]
                                  }
                                },
                                "required": [
                                  "endedAt",
                                  "name",
                                  "startedAt",
                                  "status"
                                ],
                                "additionalProperties": false
                              }
                            },
                            {
                              "type": "null"
                            }
                          ]
                        }
                      },
                      "required": [
                        "dateOfBirth",
                        "name"
                      ],
                      "additionalProperties": false
                    },
                    {
                      "type": "null"
                    }
                  ]
                },
                "shippingAddressId": {
                  "anyOf": [
                    {
                      "type": "string",
                      "pattern": "^addr_[0-7][0-9a-hjkmnp-tv-z]{25}$",
                      "examples": [
                        "addr_01j2y8m6jcc9tt24af5pw9x1bc"
                      ]
                    },
                    {
                      "type": "null"
                    }
                  ]
                },
                "prescriptions": {
                  "type": "array",
                  "items": {
                    "type": "object",
                    "properties": {
                      "externalPrescriptionId": {
                        "anyOf": [
                          {
                            "type": "string",
                            "minLength": 1,
                            "maxLength": 200,
                            "pattern": "\\S",
                            "allOf": [
                              {
                                "pattern": "^[^\\p{Cc}\\p{Cs}]*$"
                              }
                            ]
                          },
                          {
                            "type": "null"
                          }
                        ]
                      },
                      "clinical": {
                        "anyOf": [
                          {
                            "type": "object",
                            "properties": {
                              "compoundingReason": {
                                "anyOf": [
                                  {
                                    "type": "object",
                                    "properties": {
                                      "category": {
                                        "anyOf": [
                                          {
                                            "type": "string",
                                            "enum": [
                                              "alcohol_free",
                                              "drug_shortage",
                                              "commercial_product_discontinued",
                                              "modified_release",
                                              "inactive_ingredient_sensitivity",
                                              "inactive_ingredient_toxicity",
                                              "concentration_adjustment",
                                              "alternate_route",
                                              "dosage_form_unavailable",
                                              "flavor_adjustment",
                                              "tablet_burden",
                                              "patient_cannot_use_commercial_product",
                                              "no_approved_product_available",
                                              "no_rationale_required",
                                              "other_patient_specific_need"
                                            ]
                                          },
                                          {
                                            "type": "null"
                                          }
                                        ]
                                      },
                                      "context": {
                                        "anyOf": [
                                          {
                                            "type": "string"
                                          },
                                          {
                                            "type": "null"
                                          }
                                        ]
                                      }
                                    },
                                    "additionalProperties": false
                                  },
                                  {
                                    "type": "null"
                                  }
                                ]
                              },
                              "medicationReviewStatus": {
                                "anyOf": [
                                  {
                                    "type": "string",
                                    "enum": [
                                      "not_reviewed",
                                      "none",
                                      "recorded"
                                    ]
                                  },
                                  {
                                    "type": "null"
                                  }
                                ]
                              },
                              "diagnosisReviewStatus": {
                                "anyOf": [
                                  {
                                    "type": "string",
                                    "enum": [
                                      "not_reviewed",
                                      "none",
                                      "recorded"
                                    ]
                                  },
                                  {
                                    "type": "null"
                                  }
                                ]
                              },
                              "currentMedications": {
                                "anyOf": [
                                  {
                                    "type": "array",
                                    "items": {
                                      "type": "string"
                                    },
                                    "maxItems": 100
                                  },
                                  {
                                    "type": "null"
                                  }
                                ]
                              },
                              "diagnoses": {
                                "anyOf": [
                                  {
                                    "type": "array",
                                    "items": {
                                      "type": "object",
                                      "properties": {
                                        "code": {
                                          "type": "string"
                                        },
                                        "display": {
                                          "type": "string"
                                        }
                                      },
                                      "required": [
                                        "code",
                                        "display"
                                      ],
                                      "additionalProperties": false
                                    },
                                    "maxItems": 20
                                  },
                                  {
                                    "type": "null"
                                  }
                                ]
                              },
                              "observations": {
                                "anyOf": [
                                  {
                                    "type": "array",
                                    "items": {
                                      "type": "object",
                                      "properties": {
                                        "display": {
                                          "type": "string"
                                        },
                                        "unit": {
                                          "type": "string"
                                        },
                                        "value": {
                                          "anyOf": [
                                            {
                                              "type": "number",
                                              "exclusiveMinimum": 0
                                            },
                                            {
                                              "type": "string",
                                              "enum": [
                                                "Infinity",
                                                "-Infinity",
                                                "NaN"
                                              ]
                                            }
                                          ]
                                        }
                                      },
                                      "required": [
                                        "display",
                                        "unit",
                                        "value"
                                      ],
                                      "additionalProperties": false
                                    },
                                    "maxItems": 20
                                  },
                                  {
                                    "type": "null"
                                  }
                                ]
                              }
                            },
                            "additionalProperties": false
                          },
                          {
                            "type": "null"
                          }
                        ]
                      },
                      "pharmacyId": {
                        "anyOf": [
                          {
                            "type": "string",
                            "pattern": "^pharm_[0-7][0-9a-hjkmnp-tv-z]{25}$",
                            "examples": [
                              "pharm_01j2y8m6jcc9tt24af5pw9x1bc"
                            ]
                          },
                          {
                            "type": "null"
                          }
                        ]
                      },
                      "daysSupply": {
                        "type": "integer",
                        "minimum": 1,
                        "maximum": 365
                      },
                      "dispensing": {
                        "type": "object",
                        "properties": {
                          "dispenseUponAcceptance": {
                            "anyOf": [
                              {
                                "type": "boolean"
                              },
                              {
                                "type": "null"
                              }
                            ]
                          },
                          "shippingOptionId": {
                            "anyOf": [
                              {
                                "type": "string",
                                "pattern": "^shp_[0-7][0-9a-hjkmnp-tv-z]{25}$",
                                "examples": [
                                  "shp_01j2y8m6jcc9tt24af5pw9x1bc"
                                ]
                              },
                              {
                                "type": "null"
                              }
                            ]
                          },
                          "shippingAmountCents": {
                            "anyOf": [
                              {
                                "type": "integer",
                                "minimum": 0
                              },
                              {
                                "type": "null"
                              }
                            ],
                            "description": "Reviewed customer shipping rate for the selected service. Preview supplies this value. Shared group rates must not be summed per prescription."
                          },
                          "shippingDestinationType": {
                            "anyOf": [
                              {
                                "type": "string",
                                "enum": [
                                  "patient"
                                ]
                              },
                              {
                                "type": "null"
                              }
                            ]
                          },
                          "pharmacyNotes": {
                            "anyOf": [
                              {
                                "type": "string"
                              },
                              {
                                "type": "null"
                              }
                            ]
                          },
                          "requestedFillDate": {
                            "anyOf": [
                              {
                                "type": "string",
                                "pattern": "^\\d{4}-\\d{2}-\\d{2}$"
                              },
                              {
                                "type": "null"
                              }
                            ]
                          },
                          "substitutionPermitted": {
                            "anyOf": [
                              {
                                "type": "boolean"
                              },
                              {
                                "type": "null"
                              }
                            ]
                          }
                        },
                        "additionalProperties": false
                      },
                      "directions": {
                        "type": "string"
                      },
                      "medicationId": {
                        "type": "string",
                        "pattern": "^cat_[0-7][0-9a-hjkmnp-tv-z]{25}$",
                        "examples": [
                          "cat_01j2y8m6jcc9tt24af5pw9x1bc"
                        ]
                      },
                      "quantity": {
                        "anyOf": [
                          {
                            "type": "number",
                            "exclusiveMinimum": 0,
                            "maximum": 100000
                          },
                          {
                            "type": "string",
                            "enum": [
                              "Infinity",
                              "-Infinity",
                              "NaN"
                            ]
                          }
                        ]
                      },
                      "quantityUnit": {
                        "type": "string"
                      },
                      "refills": {
                        "type": "integer",
                        "minimum": 0,
                        "maximum": 99
                      },
                      "structuredSig": {
                        "anyOf": [
                          {
                            "type": "object",
                            "properties": {
                              "dose": {
                                "type": "string"
                              },
                              "doseUnit": {
                                "type": "string"
                              },
                              "duration": {
                                "anyOf": [
                                  {
                                    "type": "string"
                                  },
                                  {
                                    "type": "null"
                                  }
                                ]
                              },
                              "frequency": {
                                "type": "string"
                              },
                              "indication": {
                                "anyOf": [
                                  {
                                    "type": "string"
                                  },
                                  {
                                    "type": "null"
                                  }
                                ]
                              },
                              "maxDailyUse": {
                                "anyOf": [
                                  {
                                    "type": "string"
                                  },
                                  {
                                    "type": "null"
                                  }
                                ]
                              },
                              "prn": {
                                "anyOf": [
                                  {
                                    "type": "boolean"
                                  },
                                  {
                                    "type": "null"
                                  }
                                ]
                              },
                              "route": {
                                "type": "string"
                              },
                              "titrationSchedule": {
                                "anyOf": [
                                  {
                                    "type": "string"
                                  },
                                  {
                                    "type": "null"
                                  }
                                ]
                              }
                            },
                            "required": [
                              "dose",
                              "doseUnit",
                              "frequency",
                              "route"
                            ],
                            "additionalProperties": false
                          },
                          {
                            "type": "null"
                          }
                        ]
                      }
                    },
                    "required": [
                      "daysSupply",
                      "dispensing",
                      "directions",
                      "medicationId",
                      "quantity",
                      "quantityUnit",
                      "refills"
                    ],
                    "additionalProperties": false
                  },
                  "minItems": 1,
                  "maxItems": 20
                }
              },
              "required": [
                "prescriptions"
              ],
              "additionalProperties": false
            },
            "minItems": 1,
            "maxItems": 20
          }
        },
        "required": [
          "practiceId",
          "orders"
        ],
        "additionalProperties": false,
        "title": "CreateOrderBatchRequest"
      },
      "CreateOrderBatchResponse": {
        "title": "CreateOrderBatchResponse",
        "type": "object",
        "properties": {
          "object": {
            "type": "string",
            "enum": [
              "order_batch"
            ]
          },
          "practiceId": {
            "type": "string",
            "pattern": "^prac_[0-7][0-9a-hjkmnp-tv-z]{25}$",
            "examples": [
              "prac_01j2y8m6jcc9tt24af5pw9x1bc"
            ]
          },
          "userId": {
            "anyOf": [
              {
                "type": "string",
                "pattern": "^user_[0-7][0-9a-hjkmnp-tv-z]{25}$",
                "examples": [
                  "user_01j2y8m6jcc9tt24af5pw9x1bc"
                ]
              },
              {
                "type": "null"
              }
            ]
          },
          "livemode": {
            "type": "boolean"
          },
          "orders": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "revision": {
                  "type": "string",
                  "pattern": "^rev_[a-f0-9]{64}$",
                  "description": "Opaque revision of the complete order prescription set. Send the revision you reviewed as expectedRevision; never replace it automatically after a conflict."
                },
                "otcItems": {
                  "type": "array",
                  "items": {
                    "type": "object",
                    "properties": {
                      "catalogItemId": {
                        "type": "string",
                        "allOf": [
                          {
                            "pattern": "^cat_[0-7][0-9a-hjkmnp-tv-z]{25}$",
                            "examples": [
                              "cat_01j2y8m6jcc9tt24af5pw9x1bc"
                            ]
                          }
                        ]
                      },
                      "name": {
                        "type": "string"
                      },
                      "quantity": {
                        "type": "integer"
                      },
                      "unitPriceCents": {
                        "type": "integer"
                      },
                      "subtotalCents": {
                        "type": "integer"
                      }
                    },
                    "required": [
                      "catalogItemId",
                      "name",
                      "quantity",
                      "unitPriceCents",
                      "subtotalCents"
                    ],
                    "additionalProperties": false
                  }
                },
                "externalOrderId": {
                  "anyOf": [
                    {
                      "type": "string",
                      "minLength": 1,
                      "maxLength": 200,
                      "pattern": "\\S",
                      "allOf": [
                        {
                          "pattern": "^[^\\p{Cc}\\p{Cs}]*$"
                        }
                      ]
                    },
                    {
                      "type": "null"
                    }
                  ]
                },
                "metadata": {
                  "type": "object",
                  "additionalProperties": {
                    "anyOf": [
                      {
                        "type": "string",
                        "allOf": [
                          {
                            "pattern": "^[^\\p{Cs}]*$"
                          },
                          {
                            "maxLength": 500
                          }
                        ]
                      },
                      {
                        "type": "number"
                      },
                      {
                        "type": "boolean"
                      },
                      {
                        "type": "null"
                      }
                    ]
                  },
                  "allOf": [
                    {
                      "propertyNames": {
                        "type": "string",
                        "allOf": [
                          {
                            "pattern": "^[^\\p{Cs}]*$"
                          },
                          {
                            "minLength": 1
                          },
                          {
                            "maxLength": 40
                          }
                        ]
                      }
                    },
                    {
                      "maxProperties": 20
                    }
                  ]
                },
                "createdAt": {
                  "type": "string"
                },
                "id": {
                  "type": "string",
                  "pattern": "^ord_[0-7][0-9a-hjkmnp-tv-z]{25}$",
                  "examples": [
                    "ord_01j2y8m6jcc9tt24af5pw9x1bc"
                  ]
                },
                "livemode": {
                  "type": "boolean"
                },
                "object": {
                  "type": "string",
                  "enum": [
                    "order"
                  ]
                },
                "patientId": {
                  "type": "string",
                  "pattern": "^pat_[0-7][0-9a-hjkmnp-tv-z]{25}$",
                  "examples": [
                    "pat_01j2y8m6jcc9tt24af5pw9x1bc"
                  ]
                },
                "practiceId": {
                  "type": "string",
                  "pattern": "^prac_[0-7][0-9a-hjkmnp-tv-z]{25}$",
                  "examples": [
                    "prac_01j2y8m6jcc9tt24af5pw9x1bc"
                  ]
                },
                "prescriptions": {
                  "type": "array",
                  "items": {
                    "type": "object",
                    "properties": {
                      "pharmacyId": {
                        "type": "string",
                        "allOf": [
                          {
                            "pattern": "^pharm_[0-7][0-9a-hjkmnp-tv-z]{25}$",
                            "examples": [
                              "pharm_01j2y8m6jcc9tt24af5pw9x1bc"
                            ]
                          }
                        ]
                      },
                      "externalPrescriptionId": {
                        "anyOf": [
                          {
                            "type": "string",
                            "allOf": [
                              {
                                "minLength": 1
                              },
                              {
                                "maxLength": 200
                              },
                              {
                                "pattern": "\\S"
                              },
                              {
                                "pattern": "^[^\\p{Cc}\\p{Cs}]*$"
                              }
                            ]
                          },
                          {
                            "type": "null"
                          }
                        ]
                      },
                      "createdAt": {
                        "type": "string"
                      },
                      "directions": {
                        "type": "string"
                      },
                      "version": {
                        "type": "integer",
                        "allOf": [
                          {
                            "minimum": 1
                          }
                        ]
                      },
                      "id": {
                        "type": "string",
                        "allOf": [
                          {
                            "pattern": "^rx_[0-7][0-9a-hjkmnp-tv-z]{25}$",
                            "examples": [
                              "rx_01j2y8m6jcc9tt24af5pw9x1bc"
                            ]
                          }
                        ]
                      },
                      "medicationId": {
                        "anyOf": [
                          {
                            "type": "string",
                            "allOf": [
                              {
                                "pattern": "^cat_[0-7][0-9a-hjkmnp-tv-z]{25}$",
                                "examples": [
                                  "cat_01j2y8m6jcc9tt24af5pw9x1bc"
                                ]
                              }
                            ]
                          },
                          {
                            "type": "null"
                          }
                        ]
                      },
                      "medicationName": {
                        "type": "string"
                      },
                      "object": {
                        "type": "string",
                        "enum": [
                          "prescription"
                        ]
                      },
                      "quantity": {
                        "anyOf": [
                          {
                            "type": "number"
                          },
                          {
                            "type": "string",
                            "enum": [
                              "Infinity",
                              "-Infinity",
                              "NaN"
                            ]
                          }
                        ]
                      },
                      "quantityUnit": {
                        "type": "string"
                      },
                      "refills": {
                        "type": "integer"
                      },
                      "status": {
                        "type": "string",
                        "enum": [
                          "requires_provider_signature"
                        ]
                      }
                    },
                    "required": [
                      "pharmacyId",
                      "externalPrescriptionId",
                      "createdAt",
                      "directions",
                      "version",
                      "id",
                      "medicationId",
                      "medicationName",
                      "object",
                      "quantity",
                      "quantityUnit",
                      "refills",
                      "status"
                    ],
                    "additionalProperties": false
                  }
                },
                "userId": {
                  "anyOf": [
                    {
                      "type": "string",
                      "pattern": "^user_[0-7][0-9a-hjkmnp-tv-z]{25}$",
                      "examples": [
                        "user_01j2y8m6jcc9tt24af5pw9x1bc"
                      ]
                    },
                    {
                      "type": "null"
                    }
                  ]
                },
                "status": {
                  "type": "string",
                  "enum": [
                    "requires_provider_signature"
                  ]
                }
              },
              "required": [
                "revision",
                "otcItems",
                "externalOrderId",
                "metadata",
                "createdAt",
                "id",
                "livemode",
                "object",
                "patientId",
                "practiceId",
                "prescriptions",
                "userId",
                "status"
              ],
              "additionalProperties": false
            },
            "minItems": 1,
            "maxItems": 20
          }
        },
        "required": [
          "object",
          "practiceId",
          "userId",
          "livemode",
          "orders"
        ],
        "additionalProperties": false
      },
      "PlatformPublicApiSellingPricesReadSellingPriceResponse": {
        "title": "PlatformPublicApiSellingPricesReadSellingPriceResponse",
        "type": "object",
        "properties": {
          "amountCents": {
            "anyOf": [
              {
                "type": "integer",
                "allOf": [
                  {
                    "exclusiveMinimum": 0
                  },
                  {
                    "maximum": 2147483647
                  }
                ]
              },
              {
                "type": "null"
              }
            ]
          },
          "version": {
            "type": "integer"
          },
          "currency": {
            "type": "string",
            "enum": [
              "USD"
            ]
          },
          "affinityPriceCents": {
            "anyOf": [
              {
                "type": "integer",
                "allOf": [
                  {
                    "exclusiveMinimum": 0
                  },
                  {
                    "maximum": 2147483647
                  }
                ]
              },
              {
                "type": "null"
              }
            ]
          },
          "affinityBasis": {
            "anyOf": [
              {
                "anyOf": [
                  {
                    "type": "object",
                    "properties": {
                      "kind": {
                        "type": "string",
                        "enum": [
                          "item"
                        ]
                      },
                      "quantity": {
                        "type": "string",
                        "enum": [
                          "1"
                        ]
                      },
                      "unit": {
                        "type": "string",
                        "allOf": [
                          {
                            "minLength": 1
                          }
                        ]
                      },
                      "quantityPrices": {
                        "anyOf": [
                          {
                            "type": "array",
                            "items": {
                              "type": "object",
                              "properties": {
                                "quantity": {
                                  "type": "string",
                                  "allOf": [
                                    {
                                      "maxLength": 100
                                    },
                                    {
                                      "pattern": "^(?:0|[1-9]\\d*)(?:\\.\\d*[1-9])?$"
                                    }
                                  ]
                                },
                                "amountCents": {
                                  "type": "integer",
                                  "allOf": [
                                    {
                                      "exclusiveMinimum": 0
                                    }
                                  ]
                                }
                              },
                              "required": [
                                "quantity",
                                "amountCents"
                              ],
                              "additionalProperties": false
                            },
                            "allOf": [
                              {
                                "minItems": 1
                              }
                            ]
                          },
                          {
                            "type": "null"
                          }
                        ]
                      }
                    },
                    "required": [
                      "kind",
                      "quantity",
                      "unit"
                    ],
                    "additionalProperties": false
                  },
                  {
                    "type": "object",
                    "properties": {
                      "kind": {
                        "type": "string",
                        "enum": [
                          "package"
                        ]
                      },
                      "quantity": {
                        "type": "string",
                        "allOf": [
                          {
                            "maxLength": 100
                          },
                          {
                            "pattern": "^(?:0|[1-9]\\d*)(?:\\.\\d*[1-9])?$"
                          }
                        ]
                      },
                      "unit": {
                        "type": "string",
                        "allOf": [
                          {
                            "minLength": 1
                          }
                        ]
                      }
                    },
                    "required": [
                      "kind",
                      "quantity",
                      "unit"
                    ],
                    "additionalProperties": false
                  },
                  {
                    "type": "object",
                    "properties": {
                      "kind": {
                        "type": "string",
                        "enum": [
                          "unit"
                        ]
                      },
                      "quantity": {
                        "type": "string",
                        "enum": [
                          "1"
                        ]
                      },
                      "unit": {
                        "type": "string",
                        "allOf": [
                          {
                            "minLength": 1
                          }
                        ]
                      }
                    },
                    "required": [
                      "kind",
                      "quantity",
                      "unit"
                    ],
                    "additionalProperties": false
                  }
                ]
              },
              {
                "type": "null"
              }
            ]
          },
          "basis": {
            "anyOf": [
              {
                "type": "object",
                "properties": {
                  "kind": {
                    "type": "string",
                    "enum": [
                      "item"
                    ]
                  },
                  "quantity": {
                    "type": "string",
                    "enum": [
                      "1"
                    ]
                  },
                  "unit": {
                    "type": "string",
                    "allOf": [
                      {
                        "minLength": 1
                      }
                    ]
                  },
                  "quantityPrices": {
                    "anyOf": [
                      {
                        "type": "array",
                        "items": {
                          "type": "object",
                          "properties": {
                            "quantity": {
                              "type": "string",
                              "allOf": [
                                {
                                  "maxLength": 100
                                },
                                {
                                  "pattern": "^(?:0|[1-9]\\d*)(?:\\.\\d*[1-9])?$"
                                }
                              ]
                            },
                            "amountCents": {
                              "type": "integer",
                              "allOf": [
                                {
                                  "exclusiveMinimum": 0
                                }
                              ]
                            }
                          },
                          "required": [
                            "quantity",
                            "amountCents"
                          ],
                          "additionalProperties": false
                        },
                        "allOf": [
                          {
                            "minItems": 1
                          }
                        ]
                      },
                      {
                        "type": "null"
                      }
                    ]
                  }
                },
                "required": [
                  "kind",
                  "quantity",
                  "unit"
                ],
                "additionalProperties": false
              },
              {
                "type": "object",
                "properties": {
                  "kind": {
                    "type": "string",
                    "enum": [
                      "package"
                    ]
                  },
                  "quantity": {
                    "type": "string",
                    "allOf": [
                      {
                        "maxLength": 100
                      },
                      {
                        "pattern": "^(?:0|[1-9]\\d*)(?:\\.\\d*[1-9])?$"
                      }
                    ]
                  },
                  "unit": {
                    "type": "string",
                    "allOf": [
                      {
                        "minLength": 1
                      }
                    ]
                  }
                },
                "required": [
                  "kind",
                  "quantity",
                  "unit"
                ],
                "additionalProperties": false
              },
              {
                "type": "object",
                "properties": {
                  "kind": {
                    "type": "string",
                    "enum": [
                      "unit"
                    ]
                  },
                  "quantity": {
                    "type": "string",
                    "enum": [
                      "1"
                    ]
                  },
                  "unit": {
                    "type": "string",
                    "allOf": [
                      {
                        "minLength": 1
                      }
                    ]
                  }
                },
                "required": [
                  "kind",
                  "quantity",
                  "unit"
                ],
                "additionalProperties": false
              }
            ]
          },
          "purchaseAmountCents": {
            "type": "integer"
          },
          "requiresReview": {
            "type": "boolean"
          }
        },
        "required": [
          "amountCents",
          "version",
          "currency",
          "affinityPriceCents",
          "affinityBasis",
          "basis",
          "purchaseAmountCents",
          "requiresReview"
        ],
        "additionalProperties": false
      },
      "PlatformPublicApiSellingPricesUpdateSellingPriceRequest": {
        "type": "object",
        "properties": {
          "practiceId": {
            "anyOf": [
              {
                "type": "string",
                "pattern": "^prac_[0-7][0-9a-hjkmnp-tv-z]{25}$",
                "examples": [
                  "prac_01j2y8m6jcc9tt24af5pw9x1bc"
                ]
              },
              {
                "type": "null"
              }
            ]
          },
          "amountCents": {
            "anyOf": [
              {
                "type": "integer",
                "exclusiveMinimum": 0,
                "maximum": 2147483647
              },
              {
                "type": "null"
              }
            ]
          },
          "baseVersion": {
            "type": "integer",
            "minimum": 0
          }
        },
        "required": [
          "amountCents",
          "baseVersion"
        ],
        "additionalProperties": false,
        "title": "PlatformPublicApiSellingPricesUpdateSellingPriceRequest"
      },
      "PlatformPublicApiSellingPricesUpdateSellingPriceResponse": {
        "title": "PlatformPublicApiSellingPricesUpdateSellingPriceResponse",
        "type": "object",
        "properties": {
          "amountCents": {
            "anyOf": [
              {
                "type": "integer",
                "allOf": [
                  {
                    "exclusiveMinimum": 0
                  },
                  {
                    "maximum": 2147483647
                  }
                ]
              },
              {
                "type": "null"
              }
            ]
          },
          "version": {
            "type": "integer"
          },
          "currency": {
            "type": "string",
            "enum": [
              "USD"
            ]
          },
          "affinityPriceCents": {
            "anyOf": [
              {
                "type": "integer",
                "allOf": [
                  {
                    "exclusiveMinimum": 0
                  },
                  {
                    "maximum": 2147483647
                  }
                ]
              },
              {
                "type": "null"
              }
            ]
          },
          "affinityBasis": {
            "anyOf": [
              {
                "anyOf": [
                  {
                    "type": "object",
                    "properties": {
                      "kind": {
                        "type": "string",
                        "enum": [
                          "item"
                        ]
                      },
                      "quantity": {
                        "type": "string",
                        "enum": [
                          "1"
                        ]
                      },
                      "unit": {
                        "type": "string",
                        "allOf": [
                          {
                            "minLength": 1
                          }
                        ]
                      },
                      "quantityPrices": {
                        "anyOf": [
                          {
                            "type": "array",
                            "items": {
                              "type": "object",
                              "properties": {
                                "quantity": {
                                  "type": "string",
                                  "allOf": [
                                    {
                                      "maxLength": 100
                                    },
                                    {
                                      "pattern": "^(?:0|[1-9]\\d*)(?:\\.\\d*[1-9])?$"
                                    }
                                  ]
                                },
                                "amountCents": {
                                  "type": "integer",
                                  "allOf": [
                                    {
                                      "exclusiveMinimum": 0
                                    }
                                  ]
                                }
                              },
                              "required": [
                                "quantity",
                                "amountCents"
                              ],
                              "additionalProperties": false
                            },
                            "allOf": [
                              {
                                "minItems": 1
                              }
                            ]
                          },
                          {
                            "type": "null"
                          }
                        ]
                      }
                    },
                    "required": [
                      "kind",
                      "quantity",
                      "unit"
                    ],
                    "additionalProperties": false
                  },
                  {
                    "type": "object",
                    "properties": {
                      "kind": {
                        "type": "string",
                        "enum": [
                          "package"
                        ]
                      },
                      "quantity": {
                        "type": "string",
                        "allOf": [
                          {
                            "maxLength": 100
                          },
                          {
                            "pattern": "^(?:0|[1-9]\\d*)(?:\\.\\d*[1-9])?$"
                          }
                        ]
                      },
                      "unit": {
                        "type": "string",
                        "allOf": [
                          {
                            "minLength": 1
                          }
                        ]
                      }
                    },
                    "required": [
                      "kind",
                      "quantity",
                      "unit"
                    ],
                    "additionalProperties": false
                  },
                  {
                    "type": "object",
                    "properties": {
                      "kind": {
                        "type": "string",
                        "enum": [
                          "unit"
                        ]
                      },
                      "quantity": {
                        "type": "string",
                        "enum": [
                          "1"
                        ]
                      },
                      "unit": {
                        "type": "string",
                        "allOf": [
                          {
                            "minLength": 1
                          }
                        ]
                      }
                    },
                    "required": [
                      "kind",
                      "quantity",
                      "unit"
                    ],
                    "additionalProperties": false
                  }
                ]
              },
              {
                "type": "null"
              }
            ]
          },
          "basis": {
            "anyOf": [
              {
                "type": "object",
                "properties": {
                  "kind": {
                    "type": "string",
                    "enum": [
                      "item"
                    ]
                  },
                  "quantity": {
                    "type": "string",
                    "enum": [
                      "1"
                    ]
                  },
                  "unit": {
                    "type": "string",
                    "allOf": [
                      {
                        "minLength": 1
                      }
                    ]
                  },
                  "quantityPrices": {
                    "anyOf": [
                      {
                        "type": "array",
                        "items": {
                          "type": "object",
                          "properties": {
                            "quantity": {
                              "type": "string",
                              "allOf": [
                                {
                                  "maxLength": 100
                                },
                                {
                                  "pattern": "^(?:0|[1-9]\\d*)(?:\\.\\d*[1-9])?$"
                                }
                              ]
                            },
                            "amountCents": {
                              "type": "integer",
                              "allOf": [
                                {
                                  "exclusiveMinimum": 0
                                }
                              ]
                            }
                          },
                          "required": [
                            "quantity",
                            "amountCents"
                          ],
                          "additionalProperties": false
                        },
                        "allOf": [
                          {
                            "minItems": 1
                          }
                        ]
                      },
                      {
                        "type": "null"
                      }
                    ]
                  }
                },
                "required": [
                  "kind",
                  "quantity",
                  "unit"
                ],
                "additionalProperties": false
              },
              {
                "type": "object",
                "properties": {
                  "kind": {
                    "type": "string",
                    "enum": [
                      "package"
                    ]
                  },
                  "quantity": {
                    "type": "string",
                    "allOf": [
                      {
                        "maxLength": 100
                      },
                      {
                        "pattern": "^(?:0|[1-9]\\d*)(?:\\.\\d*[1-9])?$"
                      }
                    ]
                  },
                  "unit": {
                    "type": "string",
                    "allOf": [
                      {
                        "minLength": 1
                      }
                    ]
                  }
                },
                "required": [
                  "kind",
                  "quantity",
                  "unit"
                ],
                "additionalProperties": false
              },
              {
                "type": "object",
                "properties": {
                  "kind": {
                    "type": "string",
                    "enum": [
                      "unit"
                    ]
                  },
                  "quantity": {
                    "type": "string",
                    "enum": [
                      "1"
                    ]
                  },
                  "unit": {
                    "type": "string",
                    "allOf": [
                      {
                        "minLength": 1
                      }
                    ]
                  }
                },
                "required": [
                  "kind",
                  "quantity",
                  "unit"
                ],
                "additionalProperties": false
              }
            ]
          },
          "purchaseAmountCents": {
            "type": "integer"
          },
          "requiresReview": {
            "type": "boolean"
          }
        },
        "required": [
          "amountCents",
          "version",
          "currency",
          "affinityPriceCents",
          "affinityBasis",
          "basis",
          "purchaseAmountCents",
          "requiresReview"
        ],
        "additionalProperties": false
      },
      "PlatformPublicApiSellingPricesReadPresentationPriceResponse": {
        "title": "PlatformPublicApiSellingPricesReadPresentationPriceResponse",
        "type": "object",
        "properties": {
          "amountCents": {
            "anyOf": [
              {
                "type": "integer",
                "allOf": [
                  {
                    "exclusiveMinimum": 0
                  },
                  {
                    "maximum": 2147483647
                  }
                ]
              },
              {
                "type": "null"
              }
            ]
          },
          "version": {
            "type": "integer"
          },
          "currency": {
            "type": "string",
            "enum": [
              "USD"
            ]
          },
          "affinityPriceCents": {
            "anyOf": [
              {
                "type": "integer",
                "allOf": [
                  {
                    "exclusiveMinimum": 0
                  },
                  {
                    "maximum": 2147483647
                  }
                ]
              },
              {
                "type": "null"
              }
            ]
          },
          "affinityBasis": {
            "anyOf": [
              {
                "anyOf": [
                  {
                    "type": "object",
                    "properties": {
                      "kind": {
                        "type": "string",
                        "enum": [
                          "item"
                        ]
                      },
                      "quantity": {
                        "type": "string",
                        "enum": [
                          "1"
                        ]
                      },
                      "unit": {
                        "type": "string",
                        "allOf": [
                          {
                            "minLength": 1
                          }
                        ]
                      },
                      "quantityPrices": {
                        "anyOf": [
                          {
                            "type": "array",
                            "items": {
                              "type": "object",
                              "properties": {
                                "quantity": {
                                  "type": "string",
                                  "allOf": [
                                    {
                                      "maxLength": 100
                                    },
                                    {
                                      "pattern": "^(?:0|[1-9]\\d*)(?:\\.\\d*[1-9])?$"
                                    }
                                  ]
                                },
                                "amountCents": {
                                  "type": "integer",
                                  "allOf": [
                                    {
                                      "exclusiveMinimum": 0
                                    }
                                  ]
                                }
                              },
                              "required": [
                                "quantity",
                                "amountCents"
                              ],
                              "additionalProperties": false
                            },
                            "allOf": [
                              {
                                "minItems": 1
                              }
                            ]
                          },
                          {
                            "type": "null"
                          }
                        ]
                      }
                    },
                    "required": [
                      "kind",
                      "quantity",
                      "unit"
                    ],
                    "additionalProperties": false
                  },
                  {
                    "type": "object",
                    "properties": {
                      "kind": {
                        "type": "string",
                        "enum": [
                          "package"
                        ]
                      },
                      "quantity": {
                        "type": "string",
                        "allOf": [
                          {
                            "maxLength": 100
                          },
                          {
                            "pattern": "^(?:0|[1-9]\\d*)(?:\\.\\d*[1-9])?$"
                          }
                        ]
                      },
                      "unit": {
                        "type": "string",
                        "allOf": [
                          {
                            "minLength": 1
                          }
                        ]
                      }
                    },
                    "required": [
                      "kind",
                      "quantity",
                      "unit"
                    ],
                    "additionalProperties": false
                  },
                  {
                    "type": "object",
                    "properties": {
                      "kind": {
                        "type": "string",
                        "enum": [
                          "unit"
                        ]
                      },
                      "quantity": {
                        "type": "string",
                        "enum": [
                          "1"
                        ]
                      },
                      "unit": {
                        "type": "string",
                        "allOf": [
                          {
                            "minLength": 1
                          }
                        ]
                      }
                    },
                    "required": [
                      "kind",
                      "quantity",
                      "unit"
                    ],
                    "additionalProperties": false
                  }
                ]
              },
              {
                "type": "null"
              }
            ]
          },
          "basis": {
            "anyOf": [
              {
                "anyOf": [
                  {
                    "type": "object",
                    "properties": {
                      "kind": {
                        "type": "string",
                        "enum": [
                          "item"
                        ]
                      },
                      "quantity": {
                        "type": "string",
                        "enum": [
                          "1"
                        ]
                      },
                      "unit": {
                        "type": "string",
                        "allOf": [
                          {
                            "minLength": 1
                          }
                        ]
                      },
                      "quantityPrices": {
                        "anyOf": [
                          {
                            "type": "array",
                            "items": {
                              "type": "object",
                              "properties": {
                                "quantity": {
                                  "type": "string",
                                  "allOf": [
                                    {
                                      "maxLength": 100
                                    },
                                    {
                                      "pattern": "^(?:0|[1-9]\\d*)(?:\\.\\d*[1-9])?$"
                                    }
                                  ]
                                },
                                "amountCents": {
                                  "type": "integer",
                                  "allOf": [
                                    {
                                      "exclusiveMinimum": 0
                                    }
                                  ]
                                }
                              },
                              "required": [
                                "quantity",
                                "amountCents"
                              ],
                              "additionalProperties": false
                            },
                            "allOf": [
                              {
                                "minItems": 1
                              }
                            ]
                          },
                          {
                            "type": "null"
                          }
                        ]
                      }
                    },
                    "required": [
                      "kind",
                      "quantity",
                      "unit"
                    ],
                    "additionalProperties": false
                  },
                  {
                    "type": "object",
                    "properties": {
                      "kind": {
                        "type": "string",
                        "enum": [
                          "package"
                        ]
                      },
                      "quantity": {
                        "type": "string",
                        "allOf": [
                          {
                            "maxLength": 100
                          },
                          {
                            "pattern": "^(?:0|[1-9]\\d*)(?:\\.\\d*[1-9])?$"
                          }
                        ]
                      },
                      "unit": {
                        "type": "string",
                        "allOf": [
                          {
                            "minLength": 1
                          }
                        ]
                      }
                    },
                    "required": [
                      "kind",
                      "quantity",
                      "unit"
                    ],
                    "additionalProperties": false
                  },
                  {
                    "type": "object",
                    "properties": {
                      "kind": {
                        "type": "string",
                        "enum": [
                          "unit"
                        ]
                      },
                      "quantity": {
                        "type": "string",
                        "enum": [
                          "1"
                        ]
                      },
                      "unit": {
                        "type": "string",
                        "allOf": [
                          {
                            "minLength": 1
                          }
                        ]
                      }
                    },
                    "required": [
                      "kind",
                      "quantity",
                      "unit"
                    ],
                    "additionalProperties": false
                  }
                ]
              },
              {
                "type": "null"
              }
            ]
          }
        },
        "required": [
          "amountCents",
          "version",
          "currency",
          "affinityPriceCents",
          "affinityBasis",
          "basis"
        ],
        "additionalProperties": false
      },
      "PlatformPublicApiSellingPricesUpdatePresentationPriceRequest": {
        "type": "object",
        "properties": {
          "practiceId": {
            "anyOf": [
              {
                "type": "string",
                "pattern": "^prac_[0-7][0-9a-hjkmnp-tv-z]{25}$",
                "examples": [
                  "prac_01j2y8m6jcc9tt24af5pw9x1bc"
                ]
              },
              {
                "type": "null"
              }
            ]
          },
          "amountCents": {
            "anyOf": [
              {
                "type": "integer",
                "exclusiveMinimum": 0,
                "maximum": 2147483647
              },
              {
                "type": "null"
              }
            ]
          },
          "baseVersion": {
            "type": "integer",
            "minimum": 0
          }
        },
        "required": [
          "amountCents",
          "baseVersion"
        ],
        "additionalProperties": false,
        "title": "PlatformPublicApiSellingPricesUpdatePresentationPriceRequest"
      },
      "PlatformPublicApiSellingPricesUpdatePresentationPriceResponse": {
        "title": "PlatformPublicApiSellingPricesUpdatePresentationPriceResponse",
        "type": "object",
        "properties": {
          "amountCents": {
            "anyOf": [
              {
                "type": "integer",
                "allOf": [
                  {
                    "exclusiveMinimum": 0
                  },
                  {
                    "maximum": 2147483647
                  }
                ]
              },
              {
                "type": "null"
              }
            ]
          },
          "version": {
            "type": "integer"
          },
          "currency": {
            "type": "string",
            "enum": [
              "USD"
            ]
          },
          "affinityPriceCents": {
            "anyOf": [
              {
                "type": "integer",
                "allOf": [
                  {
                    "exclusiveMinimum": 0
                  },
                  {
                    "maximum": 2147483647
                  }
                ]
              },
              {
                "type": "null"
              }
            ]
          },
          "affinityBasis": {
            "anyOf": [
              {
                "anyOf": [
                  {
                    "type": "object",
                    "properties": {
                      "kind": {
                        "type": "string",
                        "enum": [
                          "item"
                        ]
                      },
                      "quantity": {
                        "type": "string",
                        "enum": [
                          "1"
                        ]
                      },
                      "unit": {
                        "type": "string",
                        "allOf": [
                          {
                            "minLength": 1
                          }
                        ]
                      },
                      "quantityPrices": {
                        "anyOf": [
                          {
                            "type": "array",
                            "items": {
                              "type": "object",
                              "properties": {
                                "quantity": {
                                  "type": "string",
                                  "allOf": [
                                    {
                                      "maxLength": 100
                                    },
                                    {
                                      "pattern": "^(?:0|[1-9]\\d*)(?:\\.\\d*[1-9])?$"
                                    }
                                  ]
                                },
                                "amountCents": {
                                  "type": "integer",
                                  "allOf": [
                                    {
                                      "exclusiveMinimum": 0
                                    }
                                  ]
                                }
                              },
                              "required": [
                                "quantity",
                                "amountCents"
                              ],
                              "additionalProperties": false
                            },
                            "allOf": [
                              {
                                "minItems": 1
                              }
                            ]
                          },
                          {
                            "type": "null"
                          }
                        ]
                      }
                    },
                    "required": [
                      "kind",
                      "quantity",
                      "unit"
                    ],
                    "additionalProperties": false
                  },
                  {
                    "type": "object",
                    "properties": {
                      "kind": {
                        "type": "string",
                        "enum": [
                          "package"
                        ]
                      },
                      "quantity": {
                        "type": "string",
                        "allOf": [
                          {
                            "maxLength": 100
                          },
                          {
                            "pattern": "^(?:0|[1-9]\\d*)(?:\\.\\d*[1-9])?$"
                          }
                        ]
                      },
                      "unit": {
                        "type": "string",
                        "allOf": [
                          {
                            "minLength": 1
                          }
                        ]
                      }
                    },
                    "required": [
                      "kind",
                      "quantity",
                      "unit"
                    ],
                    "additionalProperties": false
                  },
                  {
                    "type": "object",
                    "properties": {
                      "kind": {
                        "type": "string",
                        "enum": [
                          "unit"
                        ]
                      },
                      "quantity": {
                        "type": "string",
                        "enum": [
                          "1"
                        ]
                      },
                      "unit": {
                        "type": "string",
                        "allOf": [
                          {
                            "minLength": 1
                          }
                        ]
                      }
                    },
                    "required": [
                      "kind",
                      "quantity",
                      "unit"
                    ],
                    "additionalProperties": false
                  }
                ]
              },
              {
                "type": "null"
              }
            ]
          },
          "basis": {
            "anyOf": [
              {
                "anyOf": [
                  {
                    "type": "object",
                    "properties": {
                      "kind": {
                        "type": "string",
                        "enum": [
                          "item"
                        ]
                      },
                      "quantity": {
                        "type": "string",
                        "enum": [
                          "1"
                        ]
                      },
                      "unit": {
                        "type": "string",
                        "allOf": [
                          {
                            "minLength": 1
                          }
                        ]
                      },
                      "quantityPrices": {
                        "anyOf": [
                          {
                            "type": "array",
                            "items": {
                              "type": "object",
                              "properties": {
                                "quantity": {
                                  "type": "string",
                                  "allOf": [
                                    {
                                      "maxLength": 100
                                    },
                                    {
                                      "pattern": "^(?:0|[1-9]\\d*)(?:\\.\\d*[1-9])?$"
                                    }
                                  ]
                                },
                                "amountCents": {
                                  "type": "integer",
                                  "allOf": [
                                    {
                                      "exclusiveMinimum": 0
                                    }
                                  ]
                                }
                              },
                              "required": [
                                "quantity",
                                "amountCents"
                              ],
                              "additionalProperties": false
                            },
                            "allOf": [
                              {
                                "minItems": 1
                              }
                            ]
                          },
                          {
                            "type": "null"
                          }
                        ]
                      }
                    },
                    "required": [
                      "kind",
                      "quantity",
                      "unit"
                    ],
                    "additionalProperties": false
                  },
                  {
                    "type": "object",
                    "properties": {
                      "kind": {
                        "type": "string",
                        "enum": [
                          "package"
                        ]
                      },
                      "quantity": {
                        "type": "string",
                        "allOf": [
                          {
                            "maxLength": 100
                          },
                          {
                            "pattern": "^(?:0|[1-9]\\d*)(?:\\.\\d*[1-9])?$"
                          }
                        ]
                      },
                      "unit": {
                        "type": "string",
                        "allOf": [
                          {
                            "minLength": 1
                          }
                        ]
                      }
                    },
                    "required": [
                      "kind",
                      "quantity",
                      "unit"
                    ],
                    "additionalProperties": false
                  },
                  {
                    "type": "object",
                    "properties": {
                      "kind": {
                        "type": "string",
                        "enum": [
                          "unit"
                        ]
                      },
                      "quantity": {
                        "type": "string",
                        "enum": [
                          "1"
                        ]
                      },
                      "unit": {
                        "type": "string",
                        "allOf": [
                          {
                            "minLength": 1
                          }
                        ]
                      }
                    },
                    "required": [
                      "kind",
                      "quantity",
                      "unit"
                    ],
                    "additionalProperties": false
                  }
                ]
              },
              {
                "type": "null"
              }
            ]
          }
        },
        "required": [
          "amountCents",
          "version",
          "currency",
          "affinityPriceCents",
          "affinityBasis",
          "basis"
        ],
        "additionalProperties": false
      },
      "ListWebhookGrantsResponse": {
        "title": "ListWebhookGrantsResponse",
        "type": "object",
        "properties": {
          "object": {
            "type": "string",
            "enum": [
              "list"
            ]
          },
          "data": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "id": {
                  "type": "string",
                  "pattern": "^acct_[0-7][0-9a-hjkmnp-tv-z]{25}$",
                  "description": "Platform account ID; use as the pagination cursor within this owner's grants.",
                  "examples": [
                    "acct_01j2y8m6jcc9tt24af5pw9x1bc"
                  ]
                },
                "object": {
                  "type": "string",
                  "enum": [
                    "webhook_grant"
                  ]
                },
                "organizationId": {
                  "type": "string",
                  "pattern": "^acct_[0-7][0-9a-hjkmnp-tv-z]{25}$",
                  "examples": [
                    "acct_01j2y8m6jcc9tt24af5pw9x1bc"
                  ]
                },
                "platformId": {
                  "type": "string",
                  "pattern": "^acct_[0-7][0-9a-hjkmnp-tv-z]{25}$",
                  "examples": [
                    "acct_01j2y8m6jcc9tt24af5pw9x1bc"
                  ]
                },
                "livemode": {
                  "type": "boolean"
                },
                "scopes": {
                  "type": "array",
                  "items": {
                    "type": "string",
                    "enum": [
                      "webhooks:read",
                      "webhooks:write"
                    ]
                  }
                },
                "createdAt": {
                  "type": "string"
                },
                "updatedAt": {
                  "type": "string"
                }
              },
              "required": [
                "id",
                "object",
                "organizationId",
                "platformId",
                "livemode",
                "scopes",
                "createdAt",
                "updatedAt"
              ],
              "additionalProperties": false
            }
          },
          "hasMore": {
            "type": "boolean"
          },
          "url": {
            "type": "string",
            "enum": [
              "/v1/webhook-grants"
            ]
          }
        },
        "required": [
          "object",
          "data",
          "hasMore",
          "url"
        ],
        "additionalProperties": false
      },
      "SaveWebhookGrantRequest": {
        "type": "object",
        "properties": {
          "scopes": {
            "type": "array",
            "items": {
              "type": "string",
              "enum": [
                "webhooks:read",
                "webhooks:write"
              ]
            },
            "minItems": 1,
            "maxItems": 2
          }
        },
        "required": [
          "scopes"
        ],
        "additionalProperties": false,
        "title": "SaveWebhookGrantRequest"
      },
      "SaveWebhookGrantResponse": {
        "title": "SaveWebhookGrantResponse",
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "pattern": "^acct_[0-7][0-9a-hjkmnp-tv-z]{25}$",
            "description": "Platform account ID; use as the pagination cursor within this owner's grants.",
            "examples": [
              "acct_01j2y8m6jcc9tt24af5pw9x1bc"
            ]
          },
          "object": {
            "type": "string",
            "enum": [
              "webhook_grant"
            ]
          },
          "organizationId": {
            "type": "string",
            "pattern": "^acct_[0-7][0-9a-hjkmnp-tv-z]{25}$",
            "examples": [
              "acct_01j2y8m6jcc9tt24af5pw9x1bc"
            ]
          },
          "platformId": {
            "type": "string",
            "pattern": "^acct_[0-7][0-9a-hjkmnp-tv-z]{25}$",
            "examples": [
              "acct_01j2y8m6jcc9tt24af5pw9x1bc"
            ]
          },
          "livemode": {
            "type": "boolean"
          },
          "scopes": {
            "type": "array",
            "items": {
              "type": "string",
              "enum": [
                "webhooks:read",
                "webhooks:write"
              ]
            }
          },
          "createdAt": {
            "type": "string"
          },
          "updatedAt": {
            "type": "string"
          }
        },
        "required": [
          "id",
          "object",
          "organizationId",
          "platformId",
          "livemode",
          "scopes",
          "createdAt",
          "updatedAt"
        ],
        "additionalProperties": false
      },
      "RevokeWebhookGrantResponse": {
        "title": "RevokeWebhookGrantResponse",
        "type": "object",
        "properties": {
          "object": {
            "type": "string",
            "enum": [
              "webhook_grant"
            ]
          },
          "organizationId": {
            "type": "string",
            "pattern": "^acct_[0-7][0-9a-hjkmnp-tv-z]{25}$",
            "examples": [
              "acct_01j2y8m6jcc9tt24af5pw9x1bc"
            ]
          },
          "platformId": {
            "type": "string",
            "pattern": "^acct_[0-7][0-9a-hjkmnp-tv-z]{25}$",
            "examples": [
              "acct_01j2y8m6jcc9tt24af5pw9x1bc"
            ]
          },
          "revoked": {
            "type": "boolean",
            "enum": [
              true
            ]
          }
        },
        "required": [
          "object",
          "organizationId",
          "platformId",
          "revoked"
        ],
        "additionalProperties": false
      }
    },
    "securitySchemes": {
      "affinityApiKey": {
        "description": "Server-side Affinity service key. Use this header when bearer authorization is unavailable.",
        "in": "header",
        "name": "x-affinity-api-key",
        "type": "apiKey"
      },
      "bearerAuth": {
        "description": "Server-side Affinity service key using the Bearer authentication scheme.",
        "scheme": "bearer",
        "type": "http"
      }
    }
  },
  "security": [
    {
      "bearerAuth": []
    },
    {
      "affinityApiKey": []
    }
  ],
  "tags": [
    {
      "name": "Locations",
      "description": "Physical practice sites and their Team access identifiers. Locations are shared between Test and Live."
    },
    {
      "name": "API Keys",
      "description": "Inspect a service key's subject, mode, and scopes."
    },
    {
      "name": "Patients",
      "description": "Patient records and allergies within a practice. Available to practice keys and authorized platform keys."
    },
    {
      "name": "Platform Pricing",
      "description": "Practice selling prices managed by the platform."
    },
    {
      "name": "Account",
      "description": "The platform organization that owns the integration."
    },
    {
      "name": "Team",
      "description": "Invite Team members and discover accepted accounts and prescriber setup."
    },
    {
      "name": "Practices",
      "description": "Provision and manage practices connected to a platform."
    },
    {
      "name": "Catalog",
      "description": "Catalog items, pharmacies, and shipping services available to a practice or platform."
    },
    {
      "name": "Orders",
      "description": "Create individual or bulk unsigned orders, edit drafts, and follow review and fulfillment."
    },
    {
      "name": "Webhooks",
      "description": "Practice and platform event subscriptions, delivery attempts, and replay."
    }
  ],
  "servers": [
    {
      "description": "Production",
      "url": "https://api.affinityrx.com"
    }
  ],
  "x-tagGroups": [
    {
      "name": "General",
      "tags": [
        "API Keys",
        "Webhooks"
      ]
    },
    {
      "name": "Practices",
      "tags": [
        "Team",
        "Locations",
        "Patients",
        "Catalog",
        "Orders"
      ]
    },
    {
      "name": "Platforms",
      "tags": [
        "Account",
        "Practices",
        "Platform Pricing"
      ]
    },
    {
      "name": "Pharmacies",
      "tags": []
    }
  ],
  "x-affinity-webhooks": {
    "apiVersion": "2026-09-28",
    "eventTypes": [
      "webhook_endpoint.test",
      "cancellation.requested",
      "cancellation.sent",
      "cancellation.confirmed",
      "cancellation.rejected",
      "cancellation.failed",
      "cancellation.too_late",
      "order.created",
      "order.updated",
      "order.review_requested",
      "order.changes_requested",
      "order.signed",
      "order.rejected",
      "order.submitted",
      "order.accepted",
      "order.processing",
      "order.shipped",
      "order.delivered",
      "order.blocked",
      "order.cancelled"
    ],
    "orderStatuses": [
      "blocked",
      "cancelled",
      "delivered",
      "draft",
      "partially_submitted",
      "requires_provider_signature",
      "processing",
      "ready",
      "rejected",
      "shipped",
      "submitted"
    ],
    "signatureHeader": "affinity-signature",
    "signatureScheme": "t=<unix-seconds>,v1=<hex-hmac-sha256>"
  }
}