{
  "openapi": "3.0.3",
  "info": {
    "title": "Pharmacy API",
    "version": "3.0",
    "contact": {
      "email": "admin@vsee.com"
    }
  },
  "servers": [
    {
      "url": "https://api.vseepreview.com/api_v3",
      "description": "Staging"
    }
  ],
  "x-readme": {
    "explorer-enabled": false,
    "proxy-enabled": false,
    "samples-languages": [
      "curl",
      "python",
      "javascript",
      "java"
    ]
  },
  "paths": {
    "/users/{id}/erx/prescriptions": {
      "get": {
        "summary": "Get user prescriptions",
        "description": "Get list of current prescriptions for a patient\n\n**Tip:** The `:id` parameter accepts dash (`-`) for the current user.",
        "tags": [
          "Pharmacy"
        ],
        "parameters": [
          {
            "name": "X-ApiToken",
            "in": "header",
            "description": "API token",
            "required": true,
            "schema": {
              "type": "string"
            },
            "example": "your_api_token"
          },
          {
            "name": "X-AccountCode",
            "in": "header",
            "description": "Account code",
            "required": true,
            "schema": {
              "type": "string"
            },
            "example": "vclinic"
          },
          {
            "name": "id",
            "in": "path",
            "description": "User ID or dash (-) for current user",
            "required": true,
            "schema": {
              "type": "string"
            },
            "example": "575"
          },
          {
            "name": "status",
            "in": "query",
            "description": "Status of prescriptions. Send `Current` by default.",
            "required": false,
            "schema": {
              "type": "string"
            },
            "example": "Current"
          }
        ],
        "responses": {
          "200": {
            "description": "Successful response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "ID": {
                            "type": "string"
                          },
                          "DrugID": {
                            "type": "string"
                          },
                          "Drug": {
                            "type": "string"
                          },
                          "Directions": {
                            "type": "string"
                          },
                          "Qty": {
                            "type": "integer"
                          },
                          "Status": {
                            "type": "string"
                          },
                          "PrescriberName": {
                            "type": "string"
                          }
                        }
                      }
                    }
                  }
                },
                "examples": {
                  "Prescriptions List": {
                    "value": {
                      "data": [
                        {
                          "ID": "101544",
                          "DrugID": "69202",
                          "NDC": "59390003613",
                          "Drug": "12 Hour Nasal 0.05% nasal spray",
                          "Directions": "1 Milliliter(s) 1 to 2 times a day",
                          "Qty": 5,
                          "Status": "Current",
                          "PrescriberName": "Dr. Rocky Charlette, N.P."
                        }
                      ]
                    }
                  }
                }
              }
            }
          }
        },
        "x-auth-type": "user-token"
      }
    },
    "/users/{id}/erx/pharmacies": {
      "get": {
        "summary": "Get user pharmacies",
        "description": "Get user's saved pharmacies\n\n**Tip:** The `:id` parameter accepts dash (`-`) for the current user.\n\nReturns an array of Pharmacy objects with location, contact info, and distance.",
        "tags": [
          "Pharmacy"
        ],
        "parameters": [
          {
            "name": "X-ApiToken",
            "in": "header",
            "description": "API token",
            "required": true,
            "schema": {
              "type": "string"
            },
            "example": "your_api_token"
          },
          {
            "name": "X-AccountCode",
            "in": "header",
            "description": "Account code",
            "required": true,
            "schema": {
              "type": "string"
            },
            "example": "vclinic"
          },
          {
            "name": "id",
            "in": "path",
            "description": "User ID or dash (-) for current user",
            "required": true,
            "schema": {
              "type": "string"
            },
            "example": "575"
          }
        ],
        "responses": {
          "200": {
            "description": "Successful response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "name": {
                            "type": "string"
                          },
                          "code": {
                            "type": "string"
                          },
                          "address": {
                            "type": "string"
                          },
                          "city": {
                            "type": "string"
                          },
                          "state": {
                            "type": "string"
                          },
                          "zip": {
                            "type": "string"
                          },
                          "phone": {
                            "type": "string"
                          },
                          "is_default": {
                            "type": "boolean"
                          }
                        }
                      }
                    }
                  }
                },
                "examples": {
                  "Pharmacies List": {
                    "value": {
                      "data": [
                        {
                          "is_default": true,
                          "name": "4700 Sunset Blvd",
                          "address": "4700 Sunset Boulevard",
                          "code": "0561539",
                          "city": "Los Angeles",
                          "state": "CA",
                          "zip": "90027",
                          "phone": "8663528725",
                          "lat": 36.800488,
                          "long": -116.71875,
                          "distance": 0.95993211712521
                        }
                      ]
                    }
                  }
                }
              }
            }
          }
        },
        "x-auth-type": "user-token"
      },
      "post": {
        "summary": "Save pharmacy",
        "description": "Save patient's currently chosen pharmacy\n\nSave the patient's currently chosen pharmacy.\n\n**Note:** Set `type` to `mdtoolbox` when saving pharmacy data from MDToolbox search results. Include the `extra` object with the unmodified data returned by the pharmacy search API (contains NCPDPID, StoreName, etc.).",
        "tags": [
          "Pharmacy"
        ],
        "parameters": [
          {
            "name": "X-ApiToken",
            "in": "header",
            "description": "API token",
            "required": true,
            "schema": {
              "type": "string"
            },
            "example": "your_api_token"
          },
          {
            "name": "X-AccountCode",
            "in": "header",
            "description": "Account code",
            "required": true,
            "schema": {
              "type": "string"
            },
            "example": "vclinic"
          },
          {
            "name": "id",
            "in": "path",
            "description": "User ID or dash (-) for current user",
            "required": true,
            "schema": {
              "type": "string"
            },
            "example": "575"
          }
        ],
        "requestBody": {
          "description": "Pharmacy details to save",
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "name": {
                    "type": "string"
                  },
                  "code": {
                    "type": "string"
                  },
                  "address": {
                    "type": "string"
                  },
                  "address_more": {
                    "type": "string"
                  },
                  "city": {
                    "type": "string"
                  },
                  "country": {
                    "type": "string"
                  },
                  "state": {
                    "type": "string"
                  },
                  "zip": {
                    "type": "string"
                  },
                  "phone": {
                    "type": "string"
                  },
                  "fax": {
                    "type": "string"
                  },
                  "lat": {
                    "type": "number"
                  },
                  "long": {
                    "type": "number"
                  },
                  "distance": {
                    "type": "number"
                  },
                  "type": {
                    "type": "string"
                  },
                  "extra": {
                    "type": "object"
                  }
                },
                "required": [
                  "name",
                  "code"
                ]
              },
              "examples": {
                "Full Request": {
                  "value": {
                    "name": "A247PC00-Anesthesia 24/7, PC",
                    "address": "1200 Freas Avenue",
                    "code": "1001103",
                    "city": "Berwick",
                    "state": "PA",
                    "zip": "18063",
                    "phone": "5707525572",
                    "fax": "6153972423",
                    "type": "mdtoolbox",
                    "extra": {
                      "NCPDPID": "1001103",
                      "StoreName": "A247PC00-Anesthesia 24/7, PC"
                    }
                  }
                },
                "Minimal Request": {
                  "value": {
                    "name": "MY PHARMACY",
                    "code": "4229919",
                    "extra": {
                      "NCPDPID": "4229919"
                    }
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Successful save",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "type": "boolean"
                    }
                  }
                },
                "examples": {
                  "Success": {
                    "value": {
                      "data": true
                    }
                  }
                }
              }
            }
          }
        },
        "x-auth-type": "user-token"
      }
    },
    "/users/{id}/erx/pharmacies/{code}": {
      "delete": {
        "summary": "Delete pharmacy",
        "description": "Delete the specified pharmacy from the user profile",
        "tags": [
          "Pharmacy"
        ],
        "parameters": [
          {
            "name": "X-ApiToken",
            "in": "header",
            "description": "API token",
            "required": true,
            "schema": {
              "type": "string"
            },
            "example": "your_api_token"
          },
          {
            "name": "X-AccountCode",
            "in": "header",
            "description": "Account code",
            "required": true,
            "schema": {
              "type": "string"
            },
            "example": "vclinic"
          },
          {
            "name": "id",
            "in": "path",
            "description": "User ID or dash (-) for current user",
            "required": true,
            "schema": {
              "type": "string"
            },
            "example": "575"
          },
          {
            "name": "code",
            "in": "path",
            "description": "Pharmacy code",
            "required": true,
            "schema": {
              "type": "string"
            },
            "example": "12834"
          }
        ],
        "responses": {
          "200": {
            "description": "Successful deletion",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "type": "boolean"
                    }
                  }
                },
                "examples": {
                  "Success": {
                    "value": {
                      "data": true
                    }
                  }
                }
              }
            }
          }
        },
        "x-auth-type": "user-token"
      }
    }
  }
}