{
  "openapi": "3.0.1",
  "info": {
    "title": "Paziresh24 Open Platform APIs",
    "version": "1.0.0",
    "description": "Bundled OpenAPI specs for Paziresh24 / Hamdast widget development."
  },
  "servers": [
    {
      "url": "https://apigw.paziresh24.com",
      "description": "API Gateway"
    },
    {
      "url": "https://hamdast.paziresh24.com",
      "description": "Hamdast"
    },
    {
      "url": "https://openapi.paziresh24.com",
      "description": "Open API"
    }
  ],
  "paths": {
    "/open-platform/v1/addons/appointments": {
      "post": {
        "summary": "Create or update appointments addon",
        "description": "Add or update your app addon to the doctor's appointments list page.",
        "operationId": "createOrUpdateAppointmentsAddon",
        "tags": [
          "Appointments Addon"
        ],
        "security": [
          {
            "BearerAuth": []
          }
        ],
        "responses": {
          "200": {
            "description": "Addon successfully created or updated.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AddonResponse"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden - Insufficient permissions."
          },
          "default": {
            "description": "Unexpected error occurred.",
            "content": {
              "application/json": {
                "schema": {}
              }
            }
          }
        }
      },
      "delete": {
        "summary": "Delete appointments addon",
        "description": "Remove your app addon from the doctor's appointments list page.",
        "operationId": "deleteAppointmentsAddon",
        "tags": [
          "Appointments Addon"
        ],
        "security": [
          {
            "BearerAuth": []
          }
        ],
        "responses": {
          "200": {
            "description": "Addon successfully deleted.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AddonResponse"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden - Insufficient permissions."
          },
          "404": {
            "description": "Addon not found."
          },
          "default": {
            "description": "Unexpected error occurred.",
            "content": {
              "application/json": {
                "schema": {}
              }
            }
          }
        }
      }
    },
    "/open-platform/v1/booking/slots": {
      "get": {
        "summary": "Get available time slots",
        "description": "Returns a list of available appointment time slots for a given medical center and practitioner, within a specified date range.",
        "operationId": "getSlots",
        "tags": [
          "Slots"
        ],
        "parameters": [
          {
            "name": "center_id",
            "in": "query",
            "required": true,
            "description": "The unique identifier of the medical center.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "user_center_id",
            "in": "query",
            "required": true,
            "description": "The identifier of the practitioner within the medical center.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "from",
            "in": "query",
            "required": true,
            "description": "Start of the time range (UNIX timestamp in seconds).",
            "schema": {
              "type": "integer"
            }
          },
          {
            "name": "to",
            "in": "query",
            "required": true,
            "description": "End of the time range (UNIX timestamp in seconds).",
            "schema": {
              "type": "integer"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successfully retrieved available appointment slots.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/FreeTurnsResponse"
                }
              }
            }
          },
          "default": {
            "description": "Unexpected error"
          }
        }
      }
    },
    "/open-platform/v1/booking/medical-centers": {
      "get": {
        "summary": "Retrieve All",
        "description": "Fetches a list of medical center",
        "operationId": "getCenters",
        "security": [
          {
            "BearerAuth": []
          }
        ],
        "tags": [
          "Medical Centers"
        ],
        "x-scopes": [
          "view-calendar"
        ],
        "responses": {
          "200": {
            "description": "Successful response with the list of medical centers.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/MedicalCentersResponse"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden - Insufficient permissions."
          },
          "default": {
            "description": "Unexpected error occurred.",
            "content": {
              "application/json": {
                "schema": {}
              }
            }
          }
        }
      }
    },
    "/open-platform/v1/booking/medical-centers/{id}": {
      "put": {
        "summary": "Update",
        "description": "Update medical center",
        "operationId": "putCenters",
        "security": [
          {
            "BearerAuth": []
          }
        ],
        "tags": [
          "Medical Centers"
        ],
        "x-scopes": [
          "view-calendar"
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/UpdateMedicalCenterBody"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "Successful response.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/UpdateMedicalCentersResponse"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden - Insufficient permissions."
          },
          "default": {
            "description": "Unexpected error occurred.",
            "content": {
              "application/json": {
                "schema": {}
              }
            }
          }
        }
      }
    },
    "/v1/booking/appointments": {
      "servers": [
        {
          "url": "https://openapi.paziresh24.com",
          "description": "Open API (direct)"
        }
      ],
      "get": {
        "summary": "Retrieve All",
        "description": "Fetches a list of doctor appointments based on the provided filters.",
        "operationId": "getAppointments",
        "security": [
          {
            "BearerAuth": []
          }
        ],
        "tags": [
          "Appointments"
        ],
        "x-scopes": [
          "view-calendar"
        ],
        "parameters": [
          {
            "name": "center_id",
            "in": "query",
            "description": "ID of the medical center to filter appointments.",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "date_start",
            "in": "query",
            "description": "Filter appointments from this date onward (Format: YYYY-MM-DD).",
            "required": false,
            "schema": {
              "type": "string",
              "format": "date"
            }
          },
          {
            "name": "date_end",
            "in": "query",
            "description": "Filter appointments up to this date (Format: YYYY-MM-DD).",
            "required": false,
            "schema": {
              "type": "string",
              "format": "date"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful response with the list of appointments.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AppointmentResponse"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden - Insufficient permissions."
          },
          "default": {
            "description": "Unexpected error occurred.",
            "content": {
              "application/json": {
                "schema": {}
              }
            }
          }
        }
      }
    },
    "/open-platform/v1/booking/appointments": {
      "post": {
        "summary": "Book an Appointment",
        "description": "Creates a new appointment for a patient with the specified details, including full name, mobile number, and national ID.",
        "operationId": "bookNewAppointment",
        "tags": [
          "Appointments"
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/NewAppointmentRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Appointment was successfully created.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/NewAppointmentResponse"
                }
              }
            }
          },
          "default": {
            "description": "Unexpected error"
          }
        }
      }
    },
    "/open-platform/v1/booking/appointments/{id}": {
      "get": {
        "summary": "Retrieve Single Appointment",
        "description": "Fetches the details of a specific appointment using its unique appointment ID (UUID).",
        "operationId": "getAppointmentById",
        "tags": [
          "Appointments"
        ],
        "security": [
          {
            "BearerAuth": []
          }
        ],
        "x-scopes": [
          "view-calendar"
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "description": "Unique identifier of the appointment (UUID).",
            "schema": {
              "type": "string",
              "format": "uuid"
            },
            "example": "52f172e5-cf69-11f0-a8fe-fa163e8a0bb8"
          }
        ],
        "responses": {
          "200": {
            "description": "Successful response with the appointment details.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SingleAppointmentResponse"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden - Insufficient permissions."
          },
          "404": {
            "description": "Appointment not found."
          },
          "default": {
            "description": "Unexpected error occurred.",
            "content": {
              "application/json": {
                "schema": {}
              }
            }
          }
        }
      },
      "delete": {
        "summary": "Delete",
        "description": "Delete appointments by id.",
        "operationId": "deleteAppointments",
        "security": [
          {
            "BearerAuth": []
          }
        ],
        "tags": [
          "Appointments"
        ],
        "x-scopes": [
          "view-calendar"
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful response.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/DeleteAppointmentResponse"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden - Insufficient permissions."
          },
          "default": {
            "description": "Unexpected error occurred.",
            "content": {
              "application/json": {
                "schema": {}
              }
            }
          }
        }
      }
    },
    "/open-platform/v1/booking/work-hours": {
      "get": {
        "summary": "Retrieve All",
        "description": "Fetches a list of workhours by center",
        "operationId": "getWorkhours",
        "security": [
          {
            "BearerAuth": []
          }
        ],
        "parameters": [
          {
            "name": "center_id",
            "in": "query",
            "description": "ID of the medical center to filter appointments.",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "tags": [
          "Work Hours"
        ],
        "x-scopes": [
          "view-calendar"
        ],
        "responses": {
          "200": {
            "description": "Successful response with the list of workhours.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/MedicalCentersResponse"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden - Insufficient permissions."
          },
          "default": {
            "description": "Unexpected error occurred.",
            "content": {
              "application/json": {
                "schema": {}
              }
            }
          }
        }
      },
      "post": {
        "summary": "Set",
        "description": "Set workhours for center",
        "operationId": "setWorkhours",
        "security": [
          {
            "BearerAuth": []
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/SetWorkhoursBody"
              }
            }
          },
          "required": true
        },
        "tags": [
          "Work Hours"
        ],
        "x-scopes": [
          "view-calendar"
        ],
        "responses": {
          "200": {
            "description": "Successful response.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SetWorkhoursResponse"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden - Insufficient permissions."
          },
          "default": {
            "description": "Unexpected error occurred.",
            "content": {
              "application/json": {
                "schema": {}
              }
            }
          }
        }
      }
    },
    "/open-platform/v1/booking/move/{center_id}": {
      "post": {
        "summary": "Move Appointment",
        "description": "Moves an existing appointment to a new time slot within the same medical center.",
        "operationId": "moveAppointment",
        "security": [
          {
            "BearerAuth": []
          }
        ],
        "tags": [
          "Appointments"
        ],
        "x-scopes": [
          "view-calendar"
        ],
        "parameters": [
          {
            "name": "center_id",
            "in": "path",
            "required": true,
            "description": "The unique identifier of the medical center.",
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/MoveAppointmentRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Appointment moved successfully.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/MoveAppointmentResponse"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden - Insufficient permissions."
          },
          "default": {
            "description": "Unexpected error occurred.",
            "content": {
              "application/json": {
                "schema": {}
              }
            }
          }
        }
      }
    },
    "/open-platform/v1/booking/vacations/{center_id}": {
      "get": {
        "summary": "Retrieve All",
        "description": "Fetches a list of vacations by center",
        "operationId": "getVacations",
        "security": [
          {
            "BearerAuth": []
          }
        ],
        "parameters": [
          {
            "name": "center_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "from",
            "in": "query",
            "description": "Start date",
            "required": false,
            "schema": {
              "type": "integer",
              "examples": [
                1739910600
              ]
            }
          },
          {
            "name": "to",
            "in": "query",
            "description": "End date",
            "required": false,
            "schema": {
              "type": "integer",
              "examples": [
                1742502600
              ]
            }
          }
        ],
        "tags": [
          "Vacations"
        ],
        "x-scopes": [
          "view-calendar"
        ],
        "responses": {
          "200": {
            "description": "Successful response with the list of workhours.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/VacationsResponse"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden - Insufficient permissions."
          },
          "default": {
            "description": "Unexpected error occurred.",
            "content": {
              "application/json": {
                "schema": {}
              }
            }
          }
        }
      },
      "post": {
        "summary": "Create",
        "description": "Create vacation for center",
        "operationId": "createVacation",
        "security": [
          {
            "BearerAuth": []
          }
        ],
        "parameters": [
          {
            "name": "center_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CreateVacationBody"
              }
            }
          },
          "required": true
        },
        "tags": [
          "Vacations"
        ],
        "x-scopes": [
          "view-calendar"
        ],
        "responses": {
          "200": {
            "description": "Successful response.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CreateVacationResponse"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden - Insufficient permissions."
          },
          "default": {
            "description": "Unexpected error occurred.",
            "content": {
              "application/json": {
                "schema": {}
              }
            }
          }
        }
      },
      "put": {
        "summary": "Update",
        "description": "Update vacation",
        "operationId": "updateVacation",
        "security": [
          {
            "BearerAuth": []
          }
        ],
        "parameters": [
          {
            "name": "center_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/UpdateVacationBody"
              }
            }
          },
          "required": true
        },
        "tags": [
          "Vacations"
        ],
        "x-scopes": [
          "view-calendar"
        ],
        "responses": {
          "200": {
            "description": "Successful response.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/UpdateVacationResponse"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden - Insufficient permissions."
          },
          "default": {
            "description": "Unexpected error occurred.",
            "content": {
              "application/json": {
                "schema": {}
              }
            }
          }
        }
      },
      "delete": {
        "summary": "Delete",
        "description": "Delete vacation",
        "operationId": "deleteVacation",
        "security": [
          {
            "BearerAuth": []
          }
        ],
        "parameters": [
          {
            "name": "center_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/DeleteVacationBody"
              }
            }
          },
          "required": true
        },
        "tags": [
          "Vacations"
        ],
        "x-scopes": [
          "view-calendar"
        ],
        "responses": {
          "200": {
            "description": "Successful response.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/DeleteVacationResponse"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden - Insufficient permissions."
          },
          "default": {
            "description": "Unexpected error occurred.",
            "content": {
              "application/json": {
                "schema": {}
              }
            }
          }
        }
      }
    },
    "/api/v1/apps/{app_key}/channels/": {
      "get": {
        "summary": "Retrieve All",
        "description": "Retrieve all profiles where the widget is active.",
        "operationId": "retrieveAll",
        "security": [
          {
            "ApiKeyAuth": []
          }
        ],
        "parameters": [
          {
            "name": "app_key",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful response.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RetrieveAllEnabledProfileWidgetRespnose"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden - Insufficient permissions."
          },
          "default": {
            "description": "Unexpected error occurred.",
            "content": {
              "application/json": {
                "schema": {}
              }
            }
          }
        }
      }
    },
    "/api/v1/apps/{app_key}/channels/{provider_id}/": {
      "get": {
        "summary": "Retrieve by provider ID",
        "description": "Retrieve the specified profile widget",
        "operationId": "retrieveById",
        "security": [
          {
            "ApiKeyAuth": []
          }
        ],
        "parameters": [
          {
            "name": "app_key",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "provider_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful response.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RetrieveSpecifiedEnabledProfileWidgetRespnose"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden - Insufficient permissions."
          },
          "default": {
            "description": "Unexpected error occurred.",
            "content": {
              "application/json": {
                "schema": {}
              }
            }
          }
        }
      },
      "put": {
        "summary": "Add/Update",
        "description": "Enable widget on specified profile or edit placements data",
        "operationId": "addupdate",
        "security": [
          {
            "ApiKeyAuth": []
          }
        ],
        "parameters": [
          {
            "name": "app_key",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "provider_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful response.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AddSpecifiedProfileWidgetRespnose"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden - Insufficient permissions."
          },
          "default": {
            "description": "Unexpected error occurred.",
            "content": {
              "application/json": {
                "schema": {}
              }
            }
          }
        }
      },
      "delete": {
        "summary": "Delete",
        "description": "Disable widget in specified profile",
        "operationId": "delete",
        "security": [
          {
            "ApiKeyAuth": []
          }
        ],
        "parameters": [
          {
            "name": "app_key",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "provider_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful response.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RemoveSpecifiedProfileWidgetRespnose"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden - Insufficient permissions."
          },
          "default": {
            "description": "Unexpected error occurred.",
            "content": {
              "application/json": {
                "schema": {}
              }
            }
          }
        }
      }
    },
    "/open-platform/v1/chats/{appointment_id}/messages": {
      "post": {
        "summary": "Send message to chat",
        "description": "Allows sending a message to a specific conversation/chat room.",
        "operationId": "sendMessage",
        "tags": [
          "Chats"
        ],
        "security": [
          {
            "BearerAuth": []
          }
        ],
        "parameters": [
          {
            "name": "appointment_id",
            "in": "path",
            "required": true,
            "description": "The unique identifier of the booking/conversation.",
            "schema": {
              "type": "integer"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/SendMessageBody"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Message successfully sent.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SendMessageResponse"
                }
              }
            }
          },
          "404": {
            "description": "Conversation not found.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "default": {
            "description": "Unexpected error occurred.",
            "content": {
              "application/json": {
                "schema": {}
              }
            }
          }
        }
      }
    },
    "/open-platform/v1/katibe/accounts": {
      "get": {
        "summary": "Retrieve",
        "description": "Retrieve the authenticated user's bank account details including IBAN, card number, and bank name.",
        "operationId": "getBankAccounts",
        "tags": [
          "Accounts"
        ],
        "security": [
          {
            "BearerAuth": []
          }
        ],
        "responses": {
          "200": {
            "description": "Successful response containing bank account information.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/BankAccountsResponse"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden - Insufficient permissions."
          },
          "default": {
            "description": "Unexpected error occurred.",
            "content": {
              "application/json": {
                "schema": {}
              }
            }
          }
        }
      }
    },
    "/open-platform/v1/nelson/medical-centers": {
      "get": {
        "summary": "Retrieve All",
        "description": "Fetches a list of medical center",
        "operationId": "getCenters",
        "security": [
          {
            "BearerAuth": []
          }
        ],
        "tags": [
          "Medical Centers"
        ],
        "x-scopes": [
          "view-calendar"
        ],
        "responses": {
          "200": {
            "description": "Successful response with the list of medical centers.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/MedicalCentersResponse"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden - Insufficient permissions."
          },
          "default": {
            "description": "Unexpected error occurred.",
            "content": {
              "application/json": {
                "schema": {}
              }
            }
          }
        }
      }
    },
    "/open-platform/v1/nelson/medical-centers/{id}": {
      "put": {
        "summary": "Update",
        "description": "Update medical center",
        "operationId": "putCenters",
        "security": [
          {
            "BearerAuth": []
          }
        ],
        "tags": [
          "Medical Centers"
        ],
        "x-scopes": [
          "view-calendar"
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/UpdateMedicalCenterBody"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "Successful response.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/UpdateMedicalCentersResponse"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden - Insufficient permissions."
          },
          "default": {
            "description": "Unexpected error occurred.",
            "content": {
              "application/json": {
                "schema": {}
              }
            }
          }
        }
      }
    },
    "/open-platform/v1/nelson/appointments": {
      "get": {
        "summary": "Retrieve All",
        "description": "Fetches a list of doctor appointments based on the provided filters.",
        "operationId": "getAppointments",
        "security": [
          {
            "BearerAuth": []
          }
        ],
        "tags": [
          "Appointments"
        ],
        "x-scopes": [
          "view-calendar"
        ],
        "parameters": [
          {
            "name": "center_id",
            "in": "query",
            "description": "ID of the medical center to filter appointments.",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "date",
            "in": "query",
            "description": "Filter by appointment date (Format: YYYY-MM-DD).",
            "required": true,
            "schema": {
              "type": "string",
              "format": "date"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful response with the list of appointments.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AppointmentResponse"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden - Insufficient permissions."
          },
          "default": {
            "description": "Unexpected error occurred.",
            "content": {
              "application/json": {
                "schema": {}
              }
            }
          }
        }
      }
    },
    "/open-platform/v1/nelson/appointments/{id}": {
      "delete": {
        "summary": "Delete",
        "description": "Delete appointments by id.",
        "operationId": "deleteAppointments",
        "security": [
          {
            "BearerAuth": []
          }
        ],
        "tags": [
          "Appointments"
        ],
        "x-scopes": [
          "view-calendar"
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful response.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/DeleteAppointmentResponse"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden - Insufficient permissions."
          },
          "default": {
            "description": "Unexpected error occurred.",
            "content": {
              "application/json": {
                "schema": {}
              }
            }
          }
        }
      }
    },
    "/open-platform/v1/nelson/work-hours": {
      "get": {
        "summary": "Retrieve All",
        "description": "Fetches a list of workhours by center",
        "operationId": "getWorkhours",
        "security": [
          {
            "BearerAuth": []
          }
        ],
        "parameters": [
          {
            "name": "center_id",
            "in": "query",
            "description": "ID of the medical center to filter appointments.",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "tags": [
          "Work Hours"
        ],
        "x-scopes": [
          "view-calendar"
        ],
        "responses": {
          "200": {
            "description": "Successful response with the list of workhours.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/MedicalCentersResponse"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden - Insufficient permissions."
          },
          "default": {
            "description": "Unexpected error occurred.",
            "content": {
              "application/json": {
                "schema": {}
              }
            }
          }
        }
      },
      "post": {
        "summary": "Set",
        "description": "Set workhours for center",
        "operationId": "setWorkhours",
        "security": [
          {
            "BearerAuth": []
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/SetWorkhoursBody"
              }
            }
          },
          "required": true
        },
        "tags": [
          "Work Hours"
        ],
        "x-scopes": [
          "view-calendar"
        ],
        "responses": {
          "200": {
            "description": "Successful response.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SetWorkhoursResponse"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden - Insufficient permissions."
          },
          "default": {
            "description": "Unexpected error occurred.",
            "content": {
              "application/json": {
                "schema": {}
              }
            }
          }
        }
      }
    },
    "/open-platform/v1/nelson/vacations/{center_id}": {
      "get": {
        "summary": "Retrieve All",
        "description": "Fetches a list of vacations by center",
        "operationId": "getVacations",
        "security": [
          {
            "BearerAuth": []
          }
        ],
        "parameters": [
          {
            "name": "center_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "from",
            "in": "query",
            "description": "Start date",
            "required": false,
            "schema": {
              "type": "integer",
              "examples": [
                1739910600
              ]
            }
          },
          {
            "name": "to",
            "in": "query",
            "description": "End date",
            "required": false,
            "schema": {
              "type": "integer",
              "examples": [
                1742502600
              ]
            }
          }
        ],
        "tags": [
          "Vacations"
        ],
        "x-scopes": [
          "view-calendar"
        ],
        "responses": {
          "200": {
            "description": "Successful response with the list of workhours.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/VacationsResponse"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden - Insufficient permissions."
          },
          "default": {
            "description": "Unexpected error occurred.",
            "content": {
              "application/json": {
                "schema": {}
              }
            }
          }
        }
      },
      "post": {
        "summary": "Create",
        "description": "Create vacation for center",
        "operationId": "createVacation",
        "security": [
          {
            "BearerAuth": []
          }
        ],
        "parameters": [
          {
            "name": "center_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CreateVacationBody"
              }
            }
          },
          "required": true
        },
        "tags": [
          "Vacations"
        ],
        "x-scopes": [
          "view-calendar"
        ],
        "responses": {
          "200": {
            "description": "Successful response.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CreateVacationResponse"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden - Insufficient permissions."
          },
          "default": {
            "description": "Unexpected error occurred.",
            "content": {
              "application/json": {
                "schema": {}
              }
            }
          }
        }
      },
      "put": {
        "summary": "Update",
        "description": "Update vacation",
        "operationId": "updateVacation",
        "security": [
          {
            "BearerAuth": []
          }
        ],
        "parameters": [
          {
            "name": "center_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/UpdateVacationBody"
              }
            }
          },
          "required": true
        },
        "tags": [
          "Vacations"
        ],
        "x-scopes": [
          "view-calendar"
        ],
        "responses": {
          "200": {
            "description": "Successful response.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/UpdateVacationResponse"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden - Insufficient permissions."
          },
          "default": {
            "description": "Unexpected error occurred.",
            "content": {
              "application/json": {
                "schema": {}
              }
            }
          }
        }
      },
      "delete": {
        "summary": "Delete",
        "description": "Delete vacation",
        "operationId": "deleteVacation",
        "security": [
          {
            "BearerAuth": []
          }
        ],
        "parameters": [
          {
            "name": "center_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/DeleteVacationBody"
              }
            }
          },
          "required": true
        },
        "tags": [
          "Vacations"
        ],
        "x-scopes": [
          "view-calendar"
        ],
        "responses": {
          "200": {
            "description": "Successful response.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/DeleteVacationResponse"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden - Insufficient permissions."
          },
          "default": {
            "description": "Unexpected error occurred.",
            "content": {
              "application/json": {
                "schema": {}
              }
            }
          }
        }
      }
    },
    "/v1/rx/insurance-type": {
      "get": {
        "summary": "Get patient insurance type",
        "description": "Looks up the patient's insurance type for the prescription-writing flow using their national code (`کد ملی`).\n\n**Required scope:** `provider.prescription.read`",
        "operationId": "getRxInsuranceType",
        "tags": [
          "Insurance"
        ],
        "security": [
          {
            "BearerAuth": []
          }
        ],
        "x-required-scopes": [
          "provider.prescription.read"
        ],
        "parameters": [
          {
            "name": "national_code",
            "in": "query",
            "required": true,
            "description": "Patient national code (کد ملی), 10 digits.",
            "schema": {
              "type": "string",
              "pattern": "^[0-9]{10}$",
              "minLength": 10,
              "maxLength": 10,
              "example": "0012345678"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Patient insurance status only (`status`, `insurance`). Name, birth date and other PII from upstream are stripped.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "status",
                    "insurance"
                  ],
                  "properties": {
                    "status": {
                      "type": "string",
                      "description": "Coverage status from upstream (e.g. Covered).",
                      "example": "Covered"
                    },
                    "insurance": {
                      "type": "string",
                      "description": "Primary insurance name (mapped from upstream `Insurance`).",
                      "example": "تامین اجتماعی"
                    }
                  }
                },
                "example": {
                  "status": "Covered",
                  "insurance": "تامین اجتماعی"
                }
              }
            }
          },
          "400": {
            "description": "Missing or invalid `national_code`."
          },
          "401": {
            "description": "Missing or invalid access token."
          },
          "403": {
            "description": "Missing or unapproved `provider.prescription.read` scope."
          }
        }
      }
    },
    "/v1/rx/service-types": {
      "get": {
        "summary": "List service type codes",
        "description": "Returns prescription service categories (drugs, lab, imaging, others, equipment) mapped to the numeric `type` codes each insurance provider uses.\n\nUse these codes as the `type` query param of `GET /v1/rx/services/search`. A category may map to several codes for one provider, or to none (empty array).",
        "operationId": "listRxServiceTypes",
        "tags": [
          "Search"
        ],
        "security": [],
        "responses": {
          "200": {
            "description": "Service categories with per-provider type codes.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ServiceTypesResponse"
                },
                "example": {
                  "categories": [
                    {
                      "key": "drugs",
                      "title": "دارو",
                      "providers": {
                        "tamin": [
                          79
                        ],
                        "salamat": [
                          1
                        ]
                      }
                    },
                    {
                      "key": "lab",
                      "title": "آزمایش",
                      "providers": {
                        "tamin": [
                          80
                        ],
                        "salamat": [
                          2
                        ]
                      }
                    },
                    {
                      "key": "imaging",
                      "title": "تصویربرداری",
                      "providers": {
                        "tamin": [
                          81,
                          83,
                          84,
                          85
                        ],
                        "salamat": [
                          3
                        ]
                      }
                    },
                    {
                      "key": "others",
                      "title": "سایر",
                      "providers": {
                        "tamin": [
                          82,
                          86,
                          87,
                          88,
                          89,
                          90,
                          91,
                          92,
                          93,
                          95
                        ],
                        "salamat": [
                          4,
                          5,
                          6
                        ]
                      }
                    },
                    {
                      "key": "equipment",
                      "title": "تجهیزات پزشکی",
                      "providers": {
                        "tamin": [],
                        "salamat": [
                          8
                        ]
                      }
                    }
                  ]
                }
              }
            }
          }
        }
      }
    },
    "/v1/rx/services/search": {
      "get": {
        "summary": "Search drugs and services",
        "description": "Searches the insurance catalog of prescribable items by name for a given insurance provider. Covers drugs, lab tests, imaging and other paraclinical services — selected via the `type` code from `GET /v1/rx/service-types`.\n\n**Required scope:** `provider.prescription.read`",
        "operationId": "searchRxItems",
        "tags": [
          "Search"
        ],
        "security": [
          {
            "BearerAuth": []
          }
        ],
        "x-required-scopes": [
          "provider.prescription.read"
        ],
        "parameters": [
          {
            "name": "_q",
            "in": "query",
            "required": true,
            "description": "Search term (item name), e.g. \"amoxicillin\".",
            "schema": {
              "type": "string",
              "minLength": 1
            }
          },
          {
            "name": "provider",
            "in": "query",
            "required": false,
            "description": "Insurance provider, e.g. \"tamin\", \"salamat\".",
            "schema": {
              "type": "string",
              "default": "tamin"
            }
          },
          {
            "name": "type",
            "in": "query",
            "required": false,
            "description": "Category type code from `/v1/rx/service-types` (e.g. 79 = drug on tamin).",
            "schema": {
              "type": "integer",
              "default": 79
            }
          },
          {
            "name": "_limit",
            "in": "query",
            "required": false,
            "description": "Max number of results to return.",
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 100,
              "default": 10
            }
          },
          {
            "name": "_start",
            "in": "query",
            "required": false,
            "description": "Offset for pagination.",
            "schema": {
              "type": "integer",
              "minimum": 0,
              "default": 0
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Matching catalog items.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SearchResponse"
                },
                "example": {
                  "statusCode": 200,
                  "message": "آیتم با موفقیت گرفته شد.",
                  "result": {
                    "insuranceType": "tamin",
                    "serviceList": [
                      {
                        "id": 61086,
                        "srvId": null,
                        "srvCode": null,
                        "srvName": "AMOXICILLIN 125 mg/5mL 30 mL POWDER, FOR SUSPENSION ORAL",
                        "srvBimSw": null,
                        "gSrvCode": "53053",
                        "wsSrvCode": "71653",
                        "serviceType": {
                          "id": 79,
                          "srvType": "01",
                          "srvTypeDes": "دارويي",
                          "custType": "3",
                          "status": "1"
                        },
                        "brands": []
                      }
                    ]
                  }
                }
              }
            }
          },
          "400": {
            "description": "Missing or invalid query parameters (e.g. `_q`), or missing `Authorization` header.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "401": {
            "description": "Access token is missing, invalid, or expired.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/IdentityError"
                }
              }
            }
          },
          "403": {
            "description": "Authenticated, but not authorized for the selected insurance provider.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/IdentityError"
                }
              }
            }
          }
        }
      }
    },
    "/open-platform/v1/profile/information": {
      "get": {
        "summary": "Retrieve",
        "description": "Get profile information such as expertise, biography and ...",
        "operationId": "getInformation",
        "security": [
          {
            "BearerAuth": []
          }
        ],
        "tags": [
          "Information"
        ],
        "responses": {
          "200": {
            "description": "Successful response.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RetrieveInformation"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden - Insufficient permissions."
          },
          "default": {
            "description": "Unexpected error occurred.",
            "content": {
              "application/json": {
                "schema": {}
              }
            }
          }
        }
      },
      "patch": {
        "summary": "Update",
        "description": "Update profile information such as biography and ...",
        "operationId": "patchInformation",
        "security": [
          {
            "BearerAuth": []
          }
        ],
        "tags": [
          "Information"
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/UpdateInformationBody"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "Successful response.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/UpdateInformationRespnose"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden - Insufficient permissions."
          },
          "default": {
            "description": "Unexpected error occurred.",
            "content": {
              "application/json": {
                "schema": {}
              }
            }
          }
        }
      }
    },
    "/open-platform/v1/profile/purge-cache": {
      "post": {
        "summary": "Purge Cache",
        "description": "API for developers to clear their profile cache from CDN.",
        "operationId": "invalidateProfileCache",
        "security": [
          {
            "BearerAuth": []
          }
        ],
        "tags": [
          "Utilities"
        ],
        "responses": {
          "200": {
            "description": " Cache cleared successfully",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "example": true
                    },
                    "message": {
                      "type": "string",
                      "example": "Purging request sent successfully."
                    }
                  }
                }
              }
            }
          },
          "403": {
            "description": "Forbidden - Insufficient permissions."
          },
          "default": {
            "description": "Unexpected error occurred.",
            "content": {
              "application/json": {
                "schema": {}
              }
            }
          }
        }
      }
    },
    "/v1/rasan/balance": {
      "get": {
        "summary": "Get SMS credit balance",
        "description": "Returns the provider's current SMS credit. Requires `provider.rasan.read`.\n\nIf the provider has not called `hamdast.rasan.activate()` yet, responds with `409` and code `SMS_NOT_ACTIVATED`.",
        "operationId": "getRasanBalance",
        "tags": [
          "Balance"
        ],
        "security": [
          {
            "BearerAuth": []
          }
        ],
        "x-scopes": [
          "provider.rasan.read"
        ],
        "responses": {
          "200": {
            "description": "Current SMS credit.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/BalanceResponse"
                },
                "example": {
                  "credit": 10000,
                  "unit": "IRR"
                }
              }
            }
          },
          "401": {
            "description": "Missing or invalid access token."
          },
          "403": {
            "description": "Missing or unapproved `provider.rasan.read` scope."
          },
          "409": {
            "description": "SMS not activated (`SMS_NOT_ACTIVATED`).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                },
                "example": {
                  "code": "SMS_NOT_ACTIVATED",
                  "message": "SMS panel is not activated for this provider"
                }
              }
            }
          }
        }
      }
    },
    "/v1/rasan/messages": {
      "post": {
        "summary": "Send an SMS",
        "description": "Sends an SMS on behalf of the provider. Requires `provider.rasan.write`.\n\nReturns `409` (`SMS_NOT_ACTIVATED`) if SMS is not activated, or `402` (`INSUFFICIENT_SMS_CREDIT`) if credit is too low.",
        "operationId": "sendRasanMessage",
        "tags": [
          "Messages"
        ],
        "security": [
          {
            "BearerAuth": []
          }
        ],
        "x-scopes": [
          "provider.rasan.write"
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/SendMessageRequest"
              },
              "example": {
                "receptor": "09121234567",
                "message": "Your appointment is confirmed"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Message accepted.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SendMessageResponse"
                },
                "example": {
                  "message_id": 123456,
                  "status": 1,
                  "status_text": "in queue",
                  "receptor": "09121234567"
                }
              }
            }
          },
          "400": {
            "description": "Invalid request body."
          },
          "401": {
            "description": "Missing or invalid access token."
          },
          "402": {
            "description": "Insufficient credit (`INSUFFICIENT_SMS_CREDIT`).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                },
                "example": {
                  "code": "INSUFFICIENT_SMS_CREDIT",
                  "message": "Insufficient SMS credit"
                }
              }
            }
          },
          "403": {
            "description": "Missing or unapproved `provider.rasan.write` scope."
          },
          "409": {
            "description": "SMS not activated (`SMS_NOT_ACTIVATED`)."
          }
        }
      }
    },
    "/v1/ravi/links": {
      "get": {
        "summary": "Get review links for a booking",
        "description": "Retrieves review-related links for a specific booking appointment.",
        "operationId": "getRaviLinks",
        "tags": [
          "Links"
        ],
        "security": [
          {
            "BearerAuth": []
          }
        ],
        "parameters": [
          {
            "name": "book_id",
            "in": "query",
            "required": true,
            "description": "The unique identifier of the booking appointment.",
            "schema": {
              "type": "string",
              "format": "uuid"
            },
            "example": "00000000-0000-4000-8000-000000000001"
          }
        ],
        "responses": {
          "200": {
            "description": "Successfully retrieved review links.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RaviLinksResponse"
                },
                "example": {
                  "link": "..."
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized - Missing or invalid bearer token."
          },
          "403": {
            "description": "Forbidden - Insufficient permissions."
          },
          "404": {
            "description": "Booking not found."
          },
          "default": {
            "description": "Unexpected error occurred.",
            "content": {
              "application/json": {
                "schema": {}
              }
            }
          }
        }
      }
    },
    "/open-platform/v1/rates": {
      "get": {
        "summary": "Get rates",
        "description": "Retrieves a list of rates for a doctor.",
        "operationId": "getRates",
        "tags": [
          "Reviews"
        ],
        "security": [
          {
            "BearerAuth": []
          }
        ],
        "parameters": [],
        "responses": {
          "200": {
            "description": "Successfully retrieved rates.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RatesResponse"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden - Insufficient permissions."
          },
          "default": {
            "description": "Unexpected error occurred.",
            "content": {
              "application/json": {
                "schema": {}
              }
            }
          }
        }
      }
    },
    "/open-platform/v1/reviews": {
      "get": {
        "summary": "Get reviews list",
        "description": "Retrieves a list of reviews with pagination and sorting options.",
        "operationId": "getReviews",
        "tags": [
          "Reviews"
        ],
        "security": [
          {
            "BearerAuth": []
          }
        ],
        "parameters": [
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "description": "Number of items to return per page. Default is 10.",
            "schema": {
              "type": "integer",
              "default": 10
            }
          },
          {
            "name": "offset",
            "in": "query",
            "required": false,
            "description": "Number of items to skip. Default is 0.",
            "schema": {
              "type": "integer",
              "default": 0
            }
          },
          {
            "name": "sort",
            "in": "query",
            "required": false,
            "description": "Sort order. Options: -created_at, -default_order, -count_like. Default is -created_at.",
            "schema": {
              "type": "string",
              "enum": [
                "-created_at",
                "-default_order",
                "-count_like"
              ],
              "default": "-created_at"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successfully retrieved reviews list.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ReviewsListResponse"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden - Insufficient permissions."
          },
          "default": {
            "description": "Unexpected error occurred.",
            "content": {
              "application/json": {
                "schema": {}
              }
            }
          }
        }
      }
    },
    "/open-platform/v1/reviews/{id}/replies": {
      "get": {
        "summary": "Get replies list for a review",
        "description": "Retrieves a list of replies for a specific review with pagination and sorting options.",
        "operationId": "getReviewReplies",
        "tags": [
          "Replies"
        ],
        "security": [
          {
            "BearerAuth": []
          }
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "description": "The unique identifier of the review.",
            "schema": {
              "type": "integer"
            }
          },
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "description": "Number of items to return per page. Default is 10.",
            "schema": {
              "type": "integer",
              "default": 10
            }
          },
          {
            "name": "offset",
            "in": "query",
            "required": false,
            "description": "Number of items to skip. Default is 0.",
            "schema": {
              "type": "integer",
              "default": 0
            }
          },
          {
            "name": "sort",
            "in": "query",
            "required": false,
            "description": "Sort order. Options: -created_at, -default_order, -count_like. Default is -created_at.",
            "schema": {
              "type": "string",
              "enum": [
                "-created_at",
                "-default_order",
                "-count_like"
              ],
              "default": "-created_at"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successfully retrieved replies list.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ReviewsListResponse"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden - Insufficient permissions."
          },
          "404": {
            "description": "Review not found."
          },
          "default": {
            "description": "Unexpected error occurred.",
            "content": {
              "application/json": {
                "schema": {}
              }
            }
          }
        }
      },
      "post": {
        "summary": "Create doctor reply to review",
        "description": "Allows a doctor to reply to a patient's review comment.",
        "operationId": "createReviewReply",
        "tags": [
          "Replies"
        ],
        "security": [
          {
            "BearerAuth": []
          }
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "description": "The unique identifier of the review.",
            "schema": {
              "type": "integer"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CreateReplyBody"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Reply successfully created.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CreateReplyResponse"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden - Insufficient permissions."
          },
          "404": {
            "description": "Review not found."
          },
          "default": {
            "description": "Unexpected error occurred.",
            "content": {
              "application/json": {
                "schema": {}
              }
            }
          }
        }
      }
    },
    "/open-platform/v1/reviews/{review_id}/replies/{id}": {
      "delete": {
        "summary": "Delete a reply to a review",
        "description": "Deletes a specific reply to a review.",
        "operationId": "deleteReviewReply",
        "tags": [
          "Replies"
        ],
        "security": [
          {
            "BearerAuth": []
          }
        ],
        "parameters": [
          {
            "name": "review_id",
            "in": "path",
            "required": true,
            "description": "The unique identifier of the review.",
            "schema": {
              "type": "integer"
            }
          },
          {
            "name": "id",
            "in": "path",
            "required": true,
            "description": "The unique identifier of the reply.",
            "schema": {
              "type": "integer"
            }
          }
        ],
        "responses": {
          "204": {
            "description": "Reply successfully deleted."
          },
          "403": {
            "description": "Forbidden - Insufficient permissions."
          },
          "404": {
            "description": "Review or reply not found."
          },
          "default": {
            "description": "Unexpected error occurred.",
            "content": {
              "application/json": {
                "schema": {}
              }
            }
          }
        }
      }
    },
    "/v1/search/document/field/{field_name}": {
      "patch": {
        "summary": "Update Document Field",
        "description": "Update a search document field value and enqueue it for crawling.",
        "operationId": "updateDocumentField",
        "security": [
          {
            "BearerAuth": []
          }
        ],
        "tags": [
          "Document"
        ],
        "parameters": [
          {
            "name": "field_name",
            "in": "path",
            "description": "The name of the document field to update.",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/UpdateDocumentFieldBody"
              },
              "example": {
                "fieldValue": [
                  "طراحی محصول",
                  "جستجوی عمیق",
                  "جستجوی شخصی سازی شده"
                ]
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Field updated successfully.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/UpdateDocumentFieldSuccessResponse"
                }
              }
            }
          },
          "400": {
            "description": "Invalid or missing documentId.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/UpdateDocumentFieldBadRequestResponse"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized - Invalid or missing user token.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/UnauthorizedResponse"
                }
              }
            }
          }
        }
      }
    },
    "/v1/stats/booked": {
      "get": {
        "summary": "Check booking by terminal_id",
        "description": "Queries Splunk for `event_group=view-receipt-page` with the given `terminal_id` (last 90 days).\n\nMultiple receipt views for the same appointment are collapsed to one row per `book_id`. When present, `book_date` is the appointment time from the event.\n\nIf no unique `book_id` is found, returns `booked: false` and an empty `appointments` list.",
        "operationId": "getStatsBooked",
        "tags": [
          "Booked"
        ],
        "security": [
          {
            "ApiKeyAuth": []
          }
        ],
        "parameters": [
          {
            "name": "terminal_id",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string",
              "pattern": "^[A-Za-z0-9._-]+$",
              "example": "clinic-6a72d4b2d1c9d5.59957123"
            },
            "description": "Patient app `terminal_id` cookie value."
          }
        ],
        "responses": {
          "200": {
            "description": "Booked flag and unique appointments.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/StatsBookedResponse"
                },
                "examples": {
                  "booked": {
                    "summary": "At least one appointment",
                    "value": {
                      "booked": true,
                      "appointments": [
                        {
                          "book_id": "4f746af2-93d9-11f1-9e41-005056ae075b",
                          "book_date": "سه‌شنبه ۱۴ مرداد ۱۴۰۴ ساعت ۱۰:۳۰"
                        }
                      ]
                    }
                  },
                  "not_booked": {
                    "summary": "No receipt events",
                    "value": {
                      "booked": false,
                      "appointments": []
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Missing or invalid `terminal_id`."
          },
          "401": {
            "description": "Missing or invalid `x-api-key`."
          },
          "502": {
            "description": "Splunk or auth lookup failure."
          }
        }
      }
    },
    "/v1/hamdast/apps/{app_key}/transactions": {
      "get": {
        "summary": "List transactions",
        "description": "Get the list of transactions filtered by user and status.",
        "operationId": "getTransactions",
        "tags": [
          "Transactions"
        ],
        "security": [
          {
            "ApiKeyAuth": []
          }
        ],
        "parameters": [
          {
            "name": "app_key",
            "in": "path",
            "required": true,
            "description": "Application key",
            "schema": {
              "type": "string",
              "example": "my-app"
            }
          },
          {
            "name": "user_id",
            "in": "query",
            "required": false,
            "description": "User ID",
            "schema": {
              "type": "string",
              "example": "12345"
            }
          },
          {
            "name": "status",
            "in": "query",
            "required": false,
            "description": "Transaction status",
            "schema": {
              "type": "string",
              "enum": [
                "pending",
                "canceled",
                "done"
              ],
              "example": "done"
            }
          },
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "description": "Maximum number of transactions to return",
            "schema": {
              "type": "integer",
              "example": 50
            }
          }
        ],
        "responses": {
          "200": {
            "description": "List of transactions returned successfully.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/TransactionsResponse"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden."
          },
          "default": {
            "description": "Unexpected error.",
            "content": {
              "application/json": {
                "schema": {}
              }
            }
          }
        }
      }
    },
    "/api/v1/apps/{app_key}/subscriptions": {
      "get": {
        "summary": "List subscriptions",
        "description": "Get the list of subscriptions filtered by date range and status (active/inactive).",
        "operationId": "getSubscriptions",
        "tags": [
          "Subscriptions"
        ],
        "security": [
          {
            "ApiKeyAuth": []
          }
        ],
        "parameters": [
          {
            "name": "app_key",
            "in": "path",
            "required": true,
            "description": "Application key",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "start_date",
            "in": "query",
            "required": false,
            "description": "Start date (format: YYYY-MM-DD)",
            "schema": {
              "type": "string",
              "example": "2026-02-26"
            }
          },
          {
            "name": "end_date",
            "in": "query",
            "required": false,
            "description": "End date (format: YYYY-MM-DD)",
            "schema": {
              "type": "string",
              "example": "2026-03-26"
            }
          },
          {
            "name": "status",
            "in": "query",
            "required": false,
            "description": "Subscription status",
            "schema": {
              "type": "string",
              "enum": [
                "active",
                "inactive"
              ]
            }
          }
        ],
        "responses": {
          "200": {
            "description": "List of subscriptions returned successfully.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SubscriptionsResponse"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden."
          },
          "default": {
            "description": "Unexpected error.",
            "content": {
              "application/json": {
                "schema": {}
              }
            }
          }
        }
      }
    },
    "/v1/user/information": {
      "get": {
        "summary": "Retrieve",
        "description": "Get authenticated user profile information.",
        "operationId": "getUserInformation",
        "security": [
          {
            "BearerAuth": []
          }
        ],
        "tags": [
          "Information"
        ],
        "responses": {
          "200": {
            "description": "Successful response.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RetrieveUserInformation"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden - Insufficient permissions."
          },
          "default": {
            "description": "Unexpected error occurred.",
            "content": {
              "application/json": {
                "schema": {}
              }
            }
          }
        }
      }
    },
    "/api/v1/apps/{app_key}/widgets/": {
      "get": {
        "summary": "Retrieve All",
        "description": "Retrieve all profiles where the widget is active.",
        "operationId": "retrieveAll",
        "security": [
          {
            "ApiKeyAuth": []
          }
        ],
        "parameters": [
          {
            "name": "app_key",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful response.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RetrieveAllEnabledProfileWidgetRespnose"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden - Insufficient permissions."
          },
          "default": {
            "description": "Unexpected error occurred.",
            "content": {
              "application/json": {
                "schema": {}
              }
            }
          }
        }
      }
    },
    "/api/v1/apps/{app_key}/widgets/{user_id}/": {
      "get": {
        "summary": "Retrieve by provider ID",
        "description": "Retrieve the specified profile widget",
        "operationId": "retrieveById",
        "security": [
          {
            "ApiKeyAuth": []
          }
        ],
        "parameters": [
          {
            "name": "app_key",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "user_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful response.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RetrieveSpecifiedEnabledProfileWidgetRespnose"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden - Insufficient permissions."
          },
          "default": {
            "description": "Unexpected error occurred.",
            "content": {
              "application/json": {
                "schema": {}
              }
            }
          }
        }
      },
      "put": {
        "summary": "Add/Update",
        "description": "Enable widget on specified profile or edit placements data",
        "operationId": "addupdate",
        "security": [
          {
            "ApiKeyAuth": []
          }
        ],
        "parameters": [
          {
            "name": "app_key",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "user_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful response.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AddSpecifiedProfileWidgetRespnose"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden - Insufficient permissions."
          },
          "default": {
            "description": "Unexpected error occurred.",
            "content": {
              "application/json": {
                "schema": {}
              }
            }
          }
        }
      },
      "delete": {
        "summary": "Delete",
        "description": "Disable widget in specified profile",
        "operationId": "delete",
        "security": [
          {
            "ApiKeyAuth": []
          }
        ],
        "parameters": [
          {
            "name": "app_key",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "user_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful response.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RemoveSpecifiedProfileWidgetRespnose"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden - Insufficient permissions."
          },
          "default": {
            "description": "Unexpected error occurred.",
            "content": {
              "application/json": {
                "schema": {}
              }
            }
          }
        }
      }
    }
  },
  "components": {
    "schemas": {
      "AddonResponse": {
        "type": "object",
        "properties": {
          "message": {
            "type": "string",
            "description": "Success message",
            "example": "Addon updated successfully"
          }
        }
      },
      "FreeTurn": {
        "type": "object",
        "properties": {
          "from": {
            "type": "integer",
            "description": "Start time of the appointment slot (UNIX timestamp in seconds)."
          },
          "to": {
            "type": "integer",
            "description": "End time of the appointment slot (UNIX timestamp in seconds)."
          },
          "workhour_turn_num": {
            "type": "integer",
            "description": "Slot number within the workday."
          }
        }
      },
      "FreeTurnsResponse": {
        "type": "object",
        "properties": {
          "result": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/FreeTurn"
            }
          },
          "status": {
            "type": "integer",
            "description": "Status code (0 usually indicates success)."
          },
          "message": {
            "type": "string",
            "description": "Descriptive message returned from the server."
          }
        }
      },
      "NewAppointmentRequest": {
        "type": "object",
        "required": [
          "center_id",
          "user_center_id",
          "fullname",
          "cell",
          "national_code",
          "from",
          "to"
        ],
        "properties": {
          "center_id": {
            "type": "string",
            "description": "ID of the medical center."
          },
          "user_center_id": {
            "type": "string",
            "description": "ID of the doctor or user within the center."
          },
          "fullname": {
            "type": "string",
            "description": "Patient's full name."
          },
          "cell": {
            "type": "string",
            "description": "Patient's mobile number."
          },
          "national_code": {
            "type": "string",
            "description": "Patient's national identification code."
          },
          "from": {
            "type": "integer",
            "description": "Start time of the desired appointment (UNIX timestamp in seconds)."
          },
          "to": {
            "type": "integer",
            "description": "End time of the desired appointment (UNIX timestamp in seconds)."
          }
        }
      },
      "NewAppointmentResponse": {
        "type": "object",
        "properties": {
          "message": {
            "type": "string",
            "description": "Confirmation message with date, time, and reference ID."
          },
          "time": {
            "type": "integer",
            "description": "Scheduled appointment time (UNIX timestamp)."
          },
          "refid": {
            "type": "string",
            "description": "Tracking reference ID for the appointment."
          },
          "status": {
            "type": "string",
            "description": "Response status, usually '0' for success."
          }
        }
      },
      "MedicalCentersResponse": {
        "type": "object",
        "properties": {
          "status": {
            "type": "string",
            "examples": [
              "SUCCESS"
            ]
          },
          "data": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {}
            }
          }
        }
      },
      "UpdateMedicalCenterBody": {
        "type": "object",
        "properties": {
          "address": {
            "type": "string"
          },
          "city": {
            "type": "integer"
          },
          "province": {
            "type": "integer"
          },
          "tells": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "lat": {
            "type": "integer"
          },
          "lon": {
            "type": "integer"
          }
        }
      },
      "UpdateMedicalCentersResponse": {
        "type": "object",
        "properties": {
          "status": {
            "type": "string",
            "examples": [
              "SUCCESS"
            ]
          },
          "message": {
            "type": "string",
            "examples": [
              "مرکز با موفقیت آپدیت شد"
            ]
          }
        }
      },
      "SingleAppointmentCenter": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "example": "5532"
          },
          "name": {
            "type": "string",
            "example": "ویزیت آنلاین پذیرش24"
          },
          "address": {
            "type": "string",
            "example": "مرکز ویزیت آنلاین پذیرش24"
          },
          "user_center_id": {
            "type": "string",
            "example": "9b87618a-62db-482b-8b96-ae94a92039d5"
          }
        }
      },
      "SingleAppointmentResponse": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "description": "Unique appointment identifier (UUID)",
            "example": "52f172e5-cf69-11f0-a8fe-fa163e8a0bb8"
          },
          "book_status": {
            "type": "string",
            "example": "visited"
          },
          "ref_id": {
            "type": "string",
            "example": "3491779159"
          },
          "from": {
            "type": "string",
            "example": "1764858600"
          },
          "to": {
            "type": "string",
            "example": "1764858900"
          },
          "from_date": {
            "type": "string",
            "example": "2025-12-04T18:00:00.000+03:30"
          },
          "to_date": {
            "type": "string",
            "example": "2025-12-04T18:05:00.000+03:30"
          },
          "name": {
            "type": "string",
            "example": "علی"
          },
          "family": {
            "type": "string",
            "example": "محمدی"
          },
          "display_name": {
            "type": "string",
            "example": "علی محمدی"
          },
          "cell": {
            "type": "string",
            "example": "09121234567"
          },
          "national_code": {
            "type": "string",
            "example": "0012345678"
          },
          "payment_status": {
            "type": "string",
            "example": "paid"
          },
          "center": {
            "$ref": "#/components/schemas/SingleAppointmentCenter"
          }
        }
      },
      "DeleteAppointmentResponse": {
        "type": "object",
        "properties": {
          "status": {
            "type": "string",
            "examples": [
              "SUCCESS"
            ]
          },
          "message": {
            "type": "string",
            "examples": [
              "درخواست شما با موفقیت پردازش شد"
            ]
          }
        }
      },
      "SetWorkhoursBody": {
        "type": "object",
        "properties": {
          "center_id": {
            "type": "string"
          },
          "cost": {
            "type": "integer",
            "examples": [
              0
            ]
          },
          "duration": {
            "type": "integer",
            "description": "Visit duration(minute)",
            "examples": [
              5
            ]
          },
          "workHours": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "day": {
                  "type": "integer",
                  "examples": [
                    1
                  ]
                },
                "from": {
                  "type": "string",
                  "examples": [
                    "08:00"
                  ]
                },
                "to": {
                  "type": "string",
                  "examples": [
                    "12:00"
                  ]
                }
              }
            }
          }
        }
      },
      "SetWorkhoursResponse": {
        "type": "object",
        "properties": {
          "status": {
            "type": "string",
            "examples": [
              "SUCCESS"
            ]
          },
          "message": {
            "type": "string",
            "examples": [
              "درخواست شما با موفقیت پردازش شد"
            ]
          }
        }
      },
      "VacationsResponse": {
        "type": "object",
        "properties": {
          "status": {
            "type": "string",
            "examples": [
              "SUCCESS"
            ]
          },
          "data": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "duration": {
                  "type": "integer",
                  "examples": [
                    262800
                  ]
                },
                "formatted_duration": {
                  "type": "string",
                  "examples": [
                    "3 روز"
                  ]
                },
                "formatted_from": {
                  "type": "string",
                  "examples": [
                    "پنج‌شنبه 23 اسفند-00:00"
                  ]
                },
                "formatted_to": {
                  "type": "string",
                  "examples": [
                    "یکشنبه 26 اسفند-01:00"
                  ]
                },
                "from": {
                  "type": "string",
                  "examples": [
                    "1741811400"
                  ]
                },
                "to": {
                  "type": "string",
                  "examples": [
                    "1742074200"
                  ]
                }
              }
            }
          }
        }
      },
      "CreateVacationBody": {
        "type": "object",
        "properties": {
          "from": {
            "type": "integer",
            "examples": [
              1741811400
            ]
          },
          "to": {
            "type": "integer",
            "examples": [
              1742074200
            ]
          }
        }
      },
      "CreateVacationResponse": {
        "type": "object",
        "properties": {
          "status": {
            "type": "string",
            "examples": [
              "SUCCESS"
            ]
          },
          "message": {
            "type": "string",
            "examples": [
              "درخواست شما با موفقیت پردازش شد"
            ]
          }
        }
      },
      "UpdateVacationBody": {
        "type": "object",
        "properties": {
          "from": {
            "type": "integer",
            "examples": [
              1741811400
            ]
          },
          "to": {
            "type": "integer",
            "examples": [
              1742074200
            ]
          },
          "old_from": {
            "type": "integer",
            "examples": [
              1741811400
            ]
          },
          "old_to": {
            "type": "integer",
            "examples": [
              1742074200
            ]
          }
        }
      },
      "UpdateVacationResponse": {
        "type": "object",
        "properties": {
          "status": {
            "type": "string",
            "examples": [
              "SUCCESS"
            ]
          },
          "message": {
            "type": "string",
            "examples": [
              "درخواست شما با موفقیت پردازش شد"
            ]
          }
        }
      },
      "DeleteVacationBody": {
        "type": "object",
        "properties": {
          "from": {
            "type": "integer",
            "examples": [
              1741811400
            ]
          },
          "to": {
            "type": "integer",
            "examples": [
              1742074200
            ]
          }
        }
      },
      "MoveAppointmentRequest": {
        "type": "object",
        "required": [
          "book_from",
          "book_to",
          "target_from",
          "confirmed"
        ],
        "properties": {
          "book_from": {
            "type": "integer",
            "description": "Start time of the current appointment (UNIX timestamp in seconds).",
            "example": 1782019800
          },
          "book_to": {
            "type": "integer",
            "description": "End time of the current appointment (UNIX timestamp in seconds).",
            "example": 1782059400
          },
          "target_from": {
            "type": "integer",
            "description": "Start time of the target slot to move the appointment to (UNIX timestamp in seconds).",
            "example": 1782073800
          },
          "confirmed": {
            "type": "boolean",
            "description": "Whether the move has been confirmed by the patient or doctor.",
            "example": true
          }
        }
      },
      "BookDetail": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "format": "uuid"
          },
          "internal_document_id": {
            "type": "string",
            "nullable": true
          },
          "external_document_id": {
            "type": "string",
            "nullable": true
          },
          "book_category_id": {
            "type": "string",
            "nullable": true
          },
          "patient_id": {
            "type": "string",
            "nullable": true
          },
          "patient_temp_id": {
            "type": "string",
            "format": "uuid"
          },
          "from": {
            "type": "string",
            "description": "Appointment start time (UNIX timestamp)."
          },
          "from_hour": {
            "type": "string"
          },
          "from_date": {
            "type": "string",
            "format": "date"
          },
          "to": {
            "type": "string",
            "description": "Appointment end time (UNIX timestamp)."
          },
          "center_id": {
            "type": "string"
          },
          "user_id": {
            "type": "string",
            "format": "uuid"
          },
          "doctor_shaba": {
            "type": "string"
          },
          "user_center_id": {
            "type": "string",
            "format": "uuid"
          },
          "doctor_name": {
            "type": "string"
          },
          "doctor_family": {
            "type": "string"
          },
          "doctor": {
            "type": "string"
          },
          "doctor_cell": {
            "type": "string"
          },
          "doctor_degrees_ids": {
            "type": "string"
          },
          "whatsapp": {
            "type": "string",
            "nullable": true
          },
          "setter": {
            "type": "string"
          },
          "setter_name": {
            "type": "string"
          },
          "book_type_id": {
            "type": "string"
          },
          "insert_at": {
            "type": "string",
            "description": "Insert time (UNIX timestamp)."
          },
          "insert_hour": {
            "type": "string"
          },
          "insert_date": {
            "type": "string",
            "format": "date"
          },
          "insert_with": {
            "type": "string"
          },
          "ref_id": {
            "type": "string"
          },
          "referral_id": {
            "type": "string",
            "nullable": true
          },
          "referral_status": {
            "type": "string",
            "nullable": true
          },
          "rebook": {
            "type": "string",
            "nullable": true
          },
          "last_update": {
            "type": "string",
            "description": "Last update time (UNIX timestamp)."
          },
          "services_cost": {
            "type": "string"
          },
          "discount": {
            "type": "string"
          },
          "services_cost_without_discount": {
            "type": "string"
          },
          "booking_cost": {
            "type": "string"
          },
          "paid_cost": {
            "type": "string"
          },
          "comment": {
            "type": "string"
          },
          "book_status": {
            "type": "string"
          },
          "paziresh_status": {
            "type": "string"
          },
          "payment_status": {
            "type": "string"
          },
          "payable_cost": {
            "type": "string"
          },
          "book_desk": {
            "type": "string"
          },
          "delete": {
            "type": "string"
          },
          "params": {
            "type": "object",
            "properties": {
              "online_channel": {
                "type": "string"
              }
            }
          },
          "synced_at": {
            "type": "string",
            "nullable": true
          },
          "center_name": {
            "type": "string"
          },
          "center_address": {
            "type": "string"
          },
          "center_tell": {
            "type": "string"
          },
          "display_number": {
            "type": "string"
          },
          "center_delete": {
            "type": "string"
          },
          "center_shaba": {
            "type": "string"
          },
          "in_workhour": {
            "type": "string"
          },
          "patient_temp_gender_name": {
            "type": "string"
          },
          "patient_temp_name": {
            "type": "string"
          },
          "patient_temp_family": {
            "type": "string"
          },
          "patient_temp_father_name": {
            "type": "string",
            "nullable": true
          },
          "patient_temp_full_name": {
            "type": "string"
          },
          "patient_temp_tell": {
            "type": "string",
            "nullable": true
          },
          "patient_temp_cell": {
            "type": "string"
          },
          "patient_temp_cell_country_prefix": {
            "type": "string"
          },
          "patient_temp_cell_country_prefix_code": {
            "type": "string"
          },
          "patient_temp_cell_country_prefix_name": {
            "type": "string"
          },
          "patient_temp_cell_country_prefix_latin_name": {
            "type": "string"
          },
          "patient_temp_email": {
            "type": "string",
            "nullable": true
          },
          "patient_temp_gender": {
            "type": "string"
          },
          "patient_temp_national_code": {
            "type": "string"
          },
          "patient_temp_insurance_number": {
            "type": "string",
            "nullable": true
          },
          "patient_temp_insurance_id": {
            "type": "string",
            "nullable": true
          },
          "patient_temp_insert_at": {
            "type": "string"
          },
          "patient_temp_last_update": {
            "type": "string"
          },
          "patient_temp_birthday": {
            "type": "string",
            "nullable": true
          },
          "patient_temp_nationality_type": {
            "type": "string",
            "nullable": true
          },
          "patient_full_name": {
            "type": "string"
          },
          "patient_name": {
            "type": "string"
          },
          "patient_family": {
            "type": "string"
          },
          "patient_tell": {
            "type": "string",
            "nullable": true
          },
          "patient_cell": {
            "type": "string"
          },
          "patient_cell_country_prefix": {
            "type": "string"
          },
          "patient_cell_country_prefix_code": {
            "type": "string"
          },
          "patient_cell_country_prefix_name": {
            "type": "string"
          },
          "patient_cell_country_prefix_latin_name": {
            "type": "string"
          },
          "patient_email": {
            "type": "string",
            "nullable": true
          },
          "patient_gender": {
            "type": "string"
          },
          "patient_atba_code": {
            "type": "string",
            "nullable": true
          },
          "gender_name": {
            "type": "string"
          },
          "patient_national_code": {
            "type": "string"
          },
          "patient_insurance_number": {
            "type": "string",
            "nullable": true
          },
          "patient_birthday": {
            "type": "string",
            "nullable": true
          },
          "insurance_id": {
            "type": "string",
            "nullable": true
          },
          "book_type": {
            "type": "string"
          },
          "insurance": {
            "type": "string",
            "nullable": true
          },
          "insurance_desk": {
            "type": "string",
            "nullable": true
          },
          "user_center_service_id": {
            "type": "string",
            "format": "uuid"
          },
          "ref_min_time": {
            "type": "string"
          },
          "ref_max_time": {
            "type": "string"
          },
          "payment_template_id": {
            "type": "string"
          },
          "currency_payment_template_id": {
            "type": "string",
            "nullable": true
          },
          "medical_code": {
            "type": "string"
          },
          "service_id": {
            "type": "string",
            "format": "uuid"
          },
          "doctor_expertise": {
            "type": "string"
          },
          "book_number": {
            "type": "string",
            "nullable": true
          },
          "his_payment_status": {
            "type": "string"
          },
          "doctor_share": {
            "type": "string"
          }
        }
      },
      "MoveAppointmentResponse": {
        "type": "object",
        "properties": {
          "status": {
            "type": "string"
          },
          "message": {
            "type": "string",
            "nullable": true
          },
          "result": {
            "type": "object",
            "properties": {
              "shifted_books": {
                "type": "array",
                "description": "List of appointments that were successfully moved.",
                "items": {
                  "type": "object",
                  "properties": {
                    "old_book": {
                      "description": "The appointment before the move.",
                      "$ref": "#/components/schemas/BookDetail"
                    },
                    "new_book": {
                      "description": "The appointment after the move.",
                      "$ref": "#/components/schemas/BookDetail"
                    }
                  }
                }
              },
              "not_shifted_books": {
                "type": "array",
                "description": "List of appointments that could not be moved.",
                "items": {
                  "$ref": "#/components/schemas/BookDetail"
                }
              }
            }
          }
        }
      },
      "DeleteVacationResponse": {
        "type": "object",
        "properties": {
          "status": {
            "type": "string",
            "examples": [
              "SUCCESS"
            ]
          },
          "message": {
            "type": "string",
            "examples": [
              "درخواست شما با موفقیت پردازش شد"
            ]
          }
        }
      },
      "AppointmentResponse": {
        "type": "array",
        "items": {
          "type": "object",
          "properties": {
            "id": {
              "type": "integer",
              "description": "Unique booking identifier.",
              "example": 12345678
            },
            "from": {
              "type": "integer",
              "description": "Unix timestamp (seconds) of the appointment start.",
              "example": 1741792200
            },
            "to": {
              "type": "integer",
              "description": "Unix timestamp (seconds) of the appointment end.",
              "example": 1741792500
            },
            "from_iso": {
              "type": "string",
              "format": "date-time",
              "example": "2025-03-12T18:40:00.000+03:30"
            },
            "to_iso": {
              "type": "string",
              "format": "date-time",
              "example": "2025-03-12T18:45:00.000+03:30"
            },
            "book_register": {
              "type": "integer",
              "description": "Unix timestamp (seconds) the booking was registered.",
              "example": 1741700000
            },
            "reference_code": {
              "type": "string",
              "description": "Clinic-side booking reference id.",
              "example": "1076232793"
            },
            "book_status": {
              "type": "string",
              "description": "Raw booking status from the clinic server.",
              "example": "not_came"
            },
            "paziresh_status": {
              "type": "string",
              "example": "confirmed"
            },
            "payment_status": {
              "type": "string",
              "description": "Raw payment status code from the clinic server.",
              "example": "3"
            },
            "book_type": {
              "type": "string",
              "example": "normal"
            },
            "patient": {
              "type": "object",
              "properties": {
                "gender": {
                  "type": "string",
                  "example": "male"
                },
                "name": {
                  "type": "string",
                  "example": "Amirhossein"
                },
                "family": {
                  "type": "string",
                  "example": "Beigi"
                },
                "cell": {
                  "type": "string",
                  "example": "09123456789"
                },
                "national_code": {
                  "type": "string",
                  "example": "1111111111"
                }
              }
            },
            "doctor": {
              "type": "object",
              "properties": {
                "id": {
                  "type": "integer",
                  "description": "Doctor's user_id.",
                  "example": 3476008
                },
                "name": {
                  "type": "string",
                  "example": "Amirhossein"
                },
                "family": {
                  "type": "string",
                  "example": "Beigi"
                },
                "medical_code": {
                  "type": "string",
                  "example": "12345"
                },
                "user_center_id": {
                  "type": "string",
                  "example": "9b87618a-62db-482b-8b96-ae94a92039d5"
                }
              }
            },
            "center": {
              "type": "object",
              "properties": {
                "id": {
                  "type": "string",
                  "example": "5532"
                },
                "name": {
                  "type": "string",
                  "example": "ویزیت آنلاین پذیرش24"
                },
                "address": {
                  "type": "string",
                  "example": "مرکز ویزیت آنلاین پذیرش24"
                }
              }
            },
            "book_number": {
              "type": "string",
              "example": "1234"
            },
            "payment": {
              "type": "object",
              "properties": {
                "book_status": {
                  "type": "string",
                  "description": "Human-readable payment status: paid, not - paid, paying, refunded, refund - request, or empty.",
                  "example": "paid"
                },
                "factor_status": {
                  "type": "string",
                  "description": "Human-readable factor status: not- paid, paid, expired, paying, refunded, or empty.",
                  "example": "paid"
                },
                "cost": {
                  "type": "number",
                  "example": 140000
                }
              }
            },
            "referral_tqid": {
              "type": "string",
              "example": ""
            },
            "referral_status": {
              "type": "string",
              "example": ""
            }
          }
        }
      },
      "RemoveSpecifiedProfileWidgetRespnose": {
        "type": "object",
        "properties": {
          "message": {
            "type": "string",
            "examples": [
              "Porvider Channel deleted successfully"
            ]
          }
        }
      },
      "AddSpecifiedProfileWidgetRespnose": {
        "type": "object",
        "properties": {
          "message": {
            "type": "string",
            "examples": [
              "Provider Channel updated successfully"
            ]
          }
        }
      },
      "RetrieveSpecifiedEnabledProfileWidgetRespnose": {
        "type": "object",
        "properties": {
          "provider_id": {
            "type": "string"
          }
        }
      },
      "RetrieveAllEnabledProfileWidgetRespnose": {
        "type": "array",
        "items": {
          "type": "object",
          "properties": {
            "provider_id": {
              "type": "string"
            }
          }
        }
      },
      "SendMessageBody": {
        "type": "object",
        "required": [
          "content"
        ],
        "properties": {
          "content": {
            "type": "string",
            "description": "The text content of the message.",
            "example": "متن پیام"
          },
          "attachments": {
            "type": "array",
            "description": "Attachments to send with the message.",
            "items": {
              "type": "object",
              "required": [
                "url"
              ],
              "properties": {
                "url": {
                  "type": "string",
                  "description": "Direct URL of the uploaded file."
                },
                "name": {
                  "type": "string",
                  "description": "Display name of the file."
                }
              }
            }
          }
        }
      },
      "SendMessageResponse": {
        "type": "object",
        "properties": {
          "message": {
            "type": "string",
            "description": "Success message",
            "example": "Successfully done."
          }
        }
      },
      "ErrorResponse": {
        "type": "object",
        "properties": {
          "message": {
            "type": "string",
            "description": "Error message",
            "example": "Conversation not found"
          }
        }
      },
      "BankAccount": {
        "type": "object",
        "properties": {
          "accountid": {
            "type": "string",
            "description": "Unique account identifier"
          },
          "number": {
            "type": [
              "string",
              "null"
            ],
            "description": "Account number (may be null)"
          },
          "type": {
            "type": [
              "string",
              "null"
            ],
            "description": "Type of the account (if available)"
          },
          "iban": {
            "type": "string",
            "description": "International Bank Account Number (IBAN)"
          },
          "cardid": {
            "type": "string",
            "description": "Card number linked to the account"
          },
          "name": {
            "type": "string",
            "description": "Bank name"
          },
          "ownername": {
            "type": "string",
            "description": "Full name of the account holder"
          },
          "centerid": {
            "type": [
              "string",
              "null"
            ],
            "description": "Associated center identifier (if any)"
          },
          "payment_number": {
            "type": [
              "string",
              "null"
            ],
            "description": "Associated payment number (if any)"
          }
        }
      },
      "BankAccountsResponse": {
        "type": "object",
        "properties": {
          "status": {
            "type": "boolean",
            "example": true
          },
          "message": {
            "type": "string",
            "example": "مشخصات حساب‌های بانکی"
          },
          "data": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/BankAccount"
            }
          }
        }
      },
      "nelson_MedicalCentersResponse": {
        "type": "object",
        "properties": {
          "status": {
            "type": "string",
            "examples": [
              "SUCCESS"
            ]
          },
          "data": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {}
            }
          }
        }
      },
      "nelson_UpdateMedicalCenterBody": {
        "type": "object",
        "properties": {
          "address": {
            "type": "string"
          },
          "city": {
            "type": "integer"
          },
          "province": {
            "type": "integer"
          },
          "tells": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "lat": {
            "type": "integer"
          },
          "lon": {
            "type": "integer"
          }
        }
      },
      "nelson_UpdateMedicalCentersResponse": {
        "type": "object",
        "properties": {
          "status": {
            "type": "string",
            "examples": [
              "SUCCESS"
            ]
          },
          "message": {
            "type": "string",
            "examples": [
              "مرکز با موفقیت آپدیت شد"
            ]
          }
        }
      },
      "nelson_AppointmentResponse": {
        "type": "object",
        "properties": {
          "status": {
            "type": "string",
            "examples": [
              "SUCCESS"
            ]
          },
          "data": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "id": {
                  "type": "string",
                  "description": "Unique appointment identifier.",
                  "examples": [
                    "66b0a3eb-fe64-11ef-a891-005056ad823b"
                  ]
                },
                "type": {
                  "type": "string",
                  "description": "Type of appointment booking.",
                  "examples": [
                    "book"
                  ]
                },
                "user_center_id": {
                  "type": "string",
                  "description": "ID of the medical center.",
                  "examples": [
                    "9b87618a-62db-482b-8b96-ae94a92039d5"
                  ]
                },
                "book_status": {
                  "type": "string",
                  "description": "Status of the booking (e.g., not_came, came, not_visited,visited).",
                  "examples": [
                    "not_came"
                  ]
                },
                "ref_id": {
                  "type": "string",
                  "description": "Reference ID for the booking.",
                  "examples": [
                    "1076232793"
                  ]
                },
                "from": {
                  "type": "integer",
                  "description": "Start time in Unix timestamp format.",
                  "examples": [
                    1741792200
                  ]
                },
                "to": {
                  "type": "integer",
                  "description": "End time in Unix timestamp format.",
                  "examples": [
                    1741792500
                  ]
                },
                "from_date": {
                  "type": "string",
                  "description": "Start time in human-readable format.",
                  "examples": [
                    "2025-03-12 18:40:00"
                  ]
                },
                "to_date": {
                  "type": "string",
                  "description": "End time in human-readable format.",
                  "examples": [
                    "2025-03-12 18:45:00"
                  ]
                },
                "name": {
                  "type": "string",
                  "description": "First name of the patient.",
                  "examples": [
                    "Amirhossein"
                  ]
                },
                "family": {
                  "type": "string",
                  "description": "Last name of the patient.",
                  "examples": [
                    "Beigi"
                  ]
                },
                "display_name": {
                  "type": "string",
                  "description": "Full name of the patient.",
                  "examples": [
                    "Amirhossein Beigi"
                  ]
                },
                "cell": {
                  "type": "string",
                  "description": "Patient's phone number.",
                  "examples": [
                    "09123456789"
                  ]
                },
                "national_code": {
                  "type": "string",
                  "description": "National identification number.",
                  "examples": [
                    "1111111111"
                  ]
                },
                "prescription": {
                  "type": "boolean",
                  "description": "Indicates if a prescription was issued.",
                  "examples": [
                    false
                  ]
                },
                "payment_status": {
                  "type": "string",
                  "description": "Payment status of the appointment (e.g., paid, not_paid, refunded).",
                  "examples": [
                    "paid"
                  ]
                },
                "expired": {
                  "type": "integer",
                  "description": "Indicates whether the appointment has expired (1 for expired, 0 for active).",
                  "examples": [
                    0
                  ]
                },
                "user_payment": {
                  "type": "integer",
                  "description": "Total amount paid by the user.",
                  "examples": [
                    140000
                  ]
                },
                "online_channel": {
                  "type": "string",
                  "description": "The online channel used for booking.",
                  "examples": [
                    "whatsapp"
                  ]
                },
                "delete_reason": {
                  "type": "string",
                  "nullable": true,
                  "description": "Reason for cancellation if applicable.",
                  "examples": [
                    null
                  ]
                }
              }
            }
          }
        }
      },
      "nelson_DeleteAppointmentResponse": {
        "type": "object",
        "properties": {
          "status": {
            "type": "string",
            "examples": [
              "SUCCESS"
            ]
          },
          "message": {
            "type": "string",
            "examples": [
              "درخواست شما با موفقیت پردازش شد"
            ]
          }
        }
      },
      "nelson_SetWorkhoursBody": {
        "type": "object",
        "properties": {
          "center_id": {
            "type": "string"
          },
          "cost": {
            "type": "integer",
            "examples": [
              0
            ]
          },
          "duration": {
            "type": "integer",
            "description": "Visit duration(minute)",
            "examples": [
              5
            ]
          },
          "workHours": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "day": {
                  "type": "integer",
                  "description": "Day of weeks (e.g., 1, 2, ..., 7)",
                  "examples": [
                    1
                  ]
                },
                "from": {
                  "type": "string",
                  "examples": [
                    "08:00"
                  ]
                },
                "to": {
                  "type": "string",
                  "examples": [
                    "12:00"
                  ]
                }
              }
            }
          }
        }
      },
      "nelson_SetWorkhoursResponse": {
        "type": "object",
        "properties": {
          "status": {
            "type": "string",
            "examples": [
              "SUCCESS"
            ]
          },
          "message": {
            "type": "string",
            "examples": [
              "درخواست شما با موفقیت پردازش شد"
            ]
          }
        }
      },
      "nelson_VacationsResponse": {
        "type": "object",
        "properties": {
          "status": {
            "type": "string",
            "examples": [
              "SUCCESS"
            ]
          },
          "data": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "duration": {
                  "type": "integer",
                  "examples": [
                    262800
                  ]
                },
                "formatted_duration": {
                  "type": "string",
                  "examples": [
                    "3 روز"
                  ]
                },
                "formatted_from": {
                  "type": "string",
                  "examples": [
                    "پنج‌شنبه 23 اسفند-00:00"
                  ]
                },
                "formatted_to": {
                  "type": "string",
                  "examples": [
                    "یکشنبه 26 اسفند-01:00"
                  ]
                },
                "from": {
                  "type": "string",
                  "examples": [
                    "1741811400"
                  ]
                },
                "to": {
                  "type": "string",
                  "examples": [
                    "1742074200"
                  ]
                }
              }
            }
          }
        }
      },
      "nelson_CreateVacationBody": {
        "type": "object",
        "properties": {
          "from": {
            "type": "integer",
            "examples": [
              1741811400
            ]
          },
          "to": {
            "type": "integer",
            "examples": [
              1742074200
            ]
          }
        }
      },
      "nelson_CreateVacationResponse": {
        "type": "object",
        "properties": {
          "status": {
            "type": "string",
            "examples": [
              "SUCCESS"
            ]
          },
          "message": {
            "type": "string",
            "examples": [
              "درخواست شما با موفقیت پردازش شد"
            ]
          }
        }
      },
      "nelson_UpdateVacationBody": {
        "type": "object",
        "properties": {
          "from": {
            "type": "integer",
            "examples": [
              1741811400
            ]
          },
          "to": {
            "type": "integer",
            "examples": [
              1742074200
            ]
          },
          "old_from": {
            "type": "integer",
            "examples": [
              1741811400
            ]
          },
          "old_to": {
            "type": "integer",
            "examples": [
              1742074200
            ]
          }
        }
      },
      "nelson_UpdateVacationResponse": {
        "type": "object",
        "properties": {
          "status": {
            "type": "string",
            "examples": [
              "SUCCESS"
            ]
          },
          "message": {
            "type": "string",
            "examples": [
              "درخواست شما با موفقیت پردازش شد"
            ]
          }
        }
      },
      "nelson_DeleteVacationBody": {
        "type": "object",
        "properties": {
          "from": {
            "type": "integer",
            "examples": [
              1741811400
            ]
          },
          "to": {
            "type": "integer",
            "examples": [
              1742074200
            ]
          }
        }
      },
      "nelson_DeleteVacationResponse": {
        "type": "object",
        "properties": {
          "status": {
            "type": "string",
            "examples": [
              "SUCCESS"
            ]
          },
          "message": {
            "type": "string",
            "examples": [
              "درخواست شما با موفقیت پردازش شد"
            ]
          }
        }
      },
      "prescription_ErrorResponse": {
        "type": "object",
        "properties": {
          "error": {
            "type": "string",
            "example": "querystring must have required property '_q'"
          }
        }
      },
      "IdentityError": {
        "type": "object",
        "properties": {
          "statusCode": {
            "type": "integer",
            "example": 401
          },
          "error": {
            "type": "string",
            "example": "Unauthorized"
          },
          "message": {
            "type": "string",
            "example": "token is invalid or expired"
          }
        }
      },
      "CatalogItem": {
        "type": "object",
        "description": "A prescribable catalog item. Field set is defined by the insurance provider and returned as-is.",
        "additionalProperties": true,
        "properties": {
          "id": {
            "type": "integer",
            "example": 61086
          },
          "srvName": {
            "type": "string",
            "example": "AMOXICILLIN 125 mg/5mL 30 mL POWDER, FOR SUSPENSION ORAL"
          },
          "gSrvCode": {
            "type": "string",
            "nullable": true,
            "example": "53053"
          },
          "wsSrvCode": {
            "type": "string",
            "nullable": true,
            "example": "71653"
          },
          "serviceType": {
            "type": "object",
            "properties": {
              "id": {
                "type": "integer",
                "example": 79
              },
              "srvType": {
                "type": "string",
                "example": "01"
              },
              "srvTypeDes": {
                "type": "string",
                "example": "دارويي"
              }
            }
          },
          "brands": {
            "type": "array",
            "items": {
              "type": "object"
            }
          }
        }
      },
      "SearchResponse": {
        "type": "object",
        "properties": {
          "statusCode": {
            "type": "integer",
            "example": 200
          },
          "message": {
            "type": "string",
            "example": "آیتم با موفقیت گرفته شد."
          },
          "result": {
            "type": "object",
            "properties": {
              "insuranceType": {
                "type": "string",
                "example": "tamin"
              },
              "serviceList": {
                "type": "array",
                "items": {
                  "$ref": "#/components/schemas/CatalogItem"
                }
              }
            }
          }
        }
      },
      "ServiceCategory": {
        "type": "object",
        "properties": {
          "key": {
            "type": "string",
            "description": "Stable category identifier.",
            "example": "drugs"
          },
          "title": {
            "type": "string",
            "description": "Display label.",
            "example": "دارو"
          },
          "providers": {
            "type": "object",
            "description": "Per-provider `type` codes for this category.",
            "additionalProperties": {
              "type": "array",
              "items": {
                "type": "integer"
              }
            },
            "example": {
              "tamin": [
                79
              ],
              "salamat": [
                1
              ]
            }
          }
        }
      },
      "ServiceTypesResponse": {
        "type": "object",
        "properties": {
          "categories": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/ServiceCategory"
            }
          }
        }
      },
      "UpdateInformationRespnose": {
        "type": "object",
        "properties": {
          "message": {
            "type": "string",
            "examples": [
              "اطلاعات پزشک با موفقیت ویرایش شد"
            ]
          },
          "status": {
            "type": "string",
            "examples": [
              "SUCCESS"
            ]
          }
        }
      },
      "UpdateInformationBody": {
        "type": "object",
        "properties": {
          "biography": {
            "type": "string"
          }
        }
      },
      "RetrieveInformation": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "description": "Unique identifier of the doctor"
          },
          "name": {
            "type": "string",
            "description": "First name of the doctor"
          },
          "family": {
            "type": "string",
            "description": "Family name of the doctor"
          },
          "national_code": {
            "type": "string",
            "description": "National identification code of the doctor"
          },
          "medical_code": {
            "type": "string",
            "description": "Medical code of the doctor (if available)"
          },
          "image": {
            "type": "string",
            "description": "Image file name or URL"
          },
          "secretary_phone": {
            "type": "string",
            "description": "Secretary's phone number (if available)",
            "nullable": true
          },
          "expertises": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "id": {
                  "type": "string",
                  "description": "Unique identifier for expertise"
                },
                "alias_title": {
                  "type": "string",
                  "description": "Alias title of the expertise"
                },
                "expertise": {
                  "type": "object",
                  "properties": {
                    "id": {
                      "type": "integer",
                      "description": "Unique identifier of the expertise"
                    },
                    "name": {
                      "type": "string",
                      "description": "Name of the expertise"
                    }
                  }
                },
                "degree": {
                  "type": "object",
                  "properties": {
                    "id": {
                      "type": "integer",
                      "description": "Unique identifier of the degree"
                    },
                    "name": {
                      "type": "string",
                      "description": "Name of the degree"
                    }
                  }
                }
              }
            }
          },
          "cell": {
            "type": "string",
            "description": "Cell phone number of the doctor"
          },
          "rate_info": {
            "type": "object",
            "properties": {
              "satisfaction": {
                "type": "integer",
                "description": "Satisfaction rating percentage"
              },
              "rate": {
                "type": "number",
                "format": "float",
                "description": "Average rating"
              },
              "count": {
                "type": "integer",
                "description": "Number of ratings"
              }
            },
            "nullable": true
          },
          "biography": {
            "type": "string",
            "description": "Biography of the doctor"
          },
          "slug": {
            "type": "string",
            "description": "Slug for the doctor profile"
          }
        }
      },
      "BalanceResponse": {
        "type": "object",
        "required": [
          "credit",
          "unit"
        ],
        "properties": {
          "credit": {
            "type": "number",
            "description": "Remaining credit."
          },
          "unit": {
            "type": "string",
            "description": "Credit unit (usually IRR).",
            "example": "IRR"
          }
        }
      },
      "SendMessageRequest": {
        "type": "object",
        "required": [
          "receptor",
          "message"
        ],
        "properties": {
          "receptor": {
            "type": "string",
            "description": "Recipient mobile number (e.g. 09...).",
            "minLength": 10,
            "maxLength": 16,
            "example": "09121234567"
          },
          "message": {
            "type": "string",
            "description": "SMS body.",
            "minLength": 1,
            "maxLength": 900
          }
        }
      },
      "rasan_SendMessageResponse": {
        "type": "object",
        "required": [
          "message_id",
          "status"
        ],
        "properties": {
          "message_id": {
            "type": "number",
            "description": "Message id."
          },
          "status": {
            "type": "number",
            "description": "Delivery status code."
          },
          "status_text": {
            "type": "string",
            "description": "Human-readable status."
          },
          "receptor": {
            "type": "string",
            "description": "Recipient number."
          }
        }
      },
      "rasan_ErrorResponse": {
        "type": "object",
        "properties": {
          "code": {
            "type": "string"
          },
          "message": {
            "type": "string"
          }
        }
      },
      "RaviLinksResponse": {
        "type": "object",
        "required": [
          "link"
        ],
        "properties": {
          "link": {
            "type": "string",
            "description": "Review survey form URL for the booking.",
            "example": "..."
          }
        }
      },
      "ReviewItem": {
        "type": "object",
        "properties": {
          "Id": {
            "type": "integer",
            "description": "Unique identifier of the review",
            "example": 5430410
          },
          "avg_rate_value": {
            "type": "integer",
            "description": "Average rating value",
            "example": 4
          },
          "treatment_status": {
            "type": "string",
            "nullable": true,
            "description": "Treatment status",
            "example": null
          },
          "quality_of_treatment": {
            "type": "integer",
            "description": "Quality of treatment rating",
            "example": 4
          },
          "count_like": {
            "type": "integer",
            "nullable": true,
            "description": "Number of likes",
            "example": null
          },
          "show": {
            "type": "integer",
            "description": "Visibility status (1 = visible, 0 = hidden)",
            "example": 1
          },
          "doctor_encounter": {
            "type": "integer",
            "description": "Doctor encounter rating",
            "example": 4
          },
          "visit_date": {
            "type": "string",
            "nullable": true,
            "description": "Visit date",
            "example": null
          },
          "reply_to_feedback_id": {
            "type": "integer",
            "nullable": true,
            "description": "ID of the review this is a reply to",
            "example": null
          },
          "recommend_range": {
            "type": "integer",
            "description": "Recommendation rating",
            "example": 5
          },
          "explanation_of_issue": {
            "type": "integer",
            "description": "Explanation of issue rating",
            "example": 4
          },
          "center_name": {
            "type": "string",
            "description": "Name of the medical center",
            "example": "ویزیت آنلاین پذیرش24"
          },
          "created_at": {
            "type": "string",
            "format": "date-time",
            "description": "Creation timestamp",
            "example": "2025-12-03 13:05:53+00:00"
          },
          "visit_status": {
            "type": "string",
            "description": "Visit status",
            "example": "visited"
          },
          "visit_reason": {
            "type": "string",
            "nullable": true,
            "description": "Reason for visit",
            "example": null
          },
          "user_id": {
            "type": "integer",
            "description": "User ID who wrote the review",
            "example": 3313319
          },
          "waiting_time": {
            "type": "integer",
            "description": "Waiting time in minutes",
            "example": 0
          },
          "center_id": {
            "type": "string",
            "description": "Medical center ID",
            "example": "5532"
          },
          "clinic_feedback_id": {
            "type": "integer",
            "nullable": true,
            "description": "Clinic feedback ID",
            "example": null
          },
          "doctor_slug": {
            "type": "string",
            "description": "Doctor slug (URL-friendly identifier)",
            "example": "دکتر-امیرحسین-بیگی"
          },
          "description": {
            "type": "string",
            "description": "Review description/comment",
            "example": "پزشک کارمو راه انداخت، مرسی از پذیرش۲۴"
          },
          "user_display_name": {
            "type": "string",
            "nullable": true,
            "description": "User display name",
            "example": null
          },
          "recommended": {
            "type": "boolean",
            "nullable": true,
            "description": "Whether the doctor is recommended",
            "example": null
          }
        }
      },
      "RateItem": {
        "type": "object",
        "properties": {
          "Id": {
            "type": "integer",
            "description": "Unique identifier of the rate item",
            "example": 100001
          },
          "Title": {
            "type": "string",
            "nullable": true,
            "description": "Optional title for the rate item",
            "example": null
          },
          "CreatedAt": {
            "type": "string",
            "format": "date-time",
            "nullable": true,
            "description": "Creation timestamp of the rate item",
            "example": null
          },
          "UpdatedAt": {
            "type": "string",
            "format": "date-time",
            "description": "Last update timestamp of the rate item",
            "example": "2026-01-01 10:00:00+00:00"
          },
          "doctor_encounter": {
            "type": "number",
            "format": "double",
            "description": "Average score for doctor encounter",
            "example": 4.5
          },
          "explanation_of_issue": {
            "type": "number",
            "format": "double",
            "description": "Average score for explaining the issue",
            "example": 4.7
          },
          "hide_rates": {
            "type": "boolean",
            "nullable": true,
            "description": "Whether rates are hidden",
            "example": null
          },
          "comments_count": {
            "type": "integer",
            "description": "Total number of comments",
            "example": 3
          },
          "waiting_time": {
            "type": "number",
            "format": "double",
            "description": "Average waiting time score",
            "example": 1.25
          },
          "count_rates": {
            "type": "integer",
            "description": "Number of ratings used in averages",
            "example": 5
          },
          "doctor_slug": {
            "type": "string",
            "description": "Doctor slug (URL-friendly identifier)",
            "example": "doctor-example-slug"
          },
          "waiting_time_count": {
            "type": "integer",
            "description": "Number of waiting-time ratings",
            "example": 4
          },
          "quality_of_treatment": {
            "type": "number",
            "format": "double",
            "description": "Average score for treatment quality",
            "example": 4.6
          }
        }
      },
      "RatesResponse": {
        "type": "object",
        "properties": {
          "list": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/RateItem"
            }
          },
          "pageInfo": {
            "$ref": "#/components/schemas/PageInfo"
          }
        }
      },
      "PageInfo": {
        "type": "object",
        "properties": {
          "totalRows": {
            "type": "integer",
            "description": "Total number of rows",
            "example": 1
          },
          "page": {
            "type": "integer",
            "description": "Current page number",
            "example": 1
          },
          "pageSize": {
            "type": "integer",
            "description": "Number of items per page",
            "example": 10
          },
          "isFirstPage": {
            "type": "boolean",
            "description": "Whether this is the first page",
            "example": true
          },
          "isLastPage": {
            "type": "boolean",
            "description": "Whether this is the last page",
            "example": true
          }
        }
      },
      "ReviewsListResponse": {
        "type": "object",
        "properties": {
          "list": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/ReviewItem"
            }
          },
          "pageInfo": {
            "$ref": "#/components/schemas/PageInfo"
          }
        }
      },
      "CreateReplyBody": {
        "type": "object",
        "required": [
          "description"
        ],
        "properties": {
          "description": {
            "type": "string",
            "description": "Reply text/description",
            "example": "تست"
          }
        }
      },
      "CreateReplyResponse": {
        "type": "object",
        "properties": {
          "message": {
            "type": "string",
            "description": "Success message",
            "example": "پاسخ شما با موفقیت ثبت شد"
          }
        }
      },
      "UpdateDocumentFieldBody": {
        "type": "object",
        "required": [
          "fieldValue"
        ],
        "properties": {
          "fieldValue": {
            "type": "array",
            "items": {
              "type": "string"
            },
            "description": "List of values to set for the document field."
          }
        }
      },
      "UpdateDocumentFieldSuccessResponse": {
        "type": "object",
        "required": [
          "status",
          "message",
          "data"
        ],
        "properties": {
          "status": {
            "type": "integer",
            "example": 200
          },
          "message": {
            "type": "string",
            "example": "Field data retrieved for crawling queue successfully."
          },
          "data": {
            "type": "object",
            "required": [
              "CrawlingRefrenceId",
              "fieldId",
              "internal_documentId",
              "retrievedAt"
            ],
            "properties": {
              "CrawlingRefrenceId": {
                "type": "integer",
                "example": 22436
              },
              "fieldId": {
                "type": "integer",
                "example": 5
              },
              "internal_documentId": {
                "type": "integer",
                "example": 3691
              },
              "retrievedAt": {
                "type": "string",
                "format": "date-time",
                "example": "2024-08-30T09:37:55.068+03:30"
              }
            }
          }
        }
      },
      "UpdateDocumentFieldBadRequestResponse": {
        "type": "object",
        "properties": {
          "status": {
            "type": "string",
            "example": "error"
          },
          "message": {
            "type": "string",
            "example": "Invalid or missing documentId."
          },
          "errorCode": {
            "type": "string",
            "example": "400_BAD_REQUEST"
          }
        }
      },
      "UnauthorizedResponse": {
        "type": "object",
        "properties": {
          "message": {
            "type": "string"
          }
        }
      },
      "StatsBookedResponse": {
        "type": "object",
        "required": [
          "booked",
          "appointments"
        ],
        "properties": {
          "booked": {
            "type": "boolean",
            "description": "`true` if at least one unique `book_id` was found."
          },
          "appointments": {
            "type": "array",
            "description": "Unique appointments for this terminal_id (deduped by `book_id`).",
            "items": {
              "$ref": "#/components/schemas/StatsAppointment"
            }
          }
        }
      },
      "StatsAppointment": {
        "type": "object",
        "required": [
          "book_id"
        ],
        "properties": {
          "book_id": {
            "type": "string",
            "description": "Appointment / book id."
          },
          "book_date": {
            "type": [
              "string",
              "null"
            ],
            "description": "Appointment time string from the receipt event when available; otherwise `null`.",
            "nullable": true
          }
        }
      },
      "Transaction": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "description": "Transaction ID",
            "example": "txn_abc123"
          },
          "user_id": {
            "type": "string",
            "description": "User ID",
            "example": "12345"
          },
          "status": {
            "type": "string",
            "description": "Transaction status",
            "enum": [
              "pending",
              "canceled",
              "done"
            ],
            "example": "done"
          },
          "amount": {
            "type": "integer",
            "description": "Transaction amount (in Rials)",
            "example": 50000
          },
          "receipt_id": {
            "type": "string",
            "description": "Receipt ID",
            "example": "rcpt_xyz789"
          },
          "created_at": {
            "type": "string",
            "format": "date-time",
            "description": "Transaction creation time",
            "example": "2026-06-12T10:30:00.000Z"
          }
        }
      },
      "TransactionsResponse": {
        "type": "array",
        "items": {
          "$ref": "#/components/schemas/Transaction"
        },
        "example": [
          {
            "id": "txn_abc123",
            "user_id": "12345",
            "status": "done",
            "amount": 50000,
            "receipt_id": "rcpt_xyz789",
            "created_at": "2026-06-12T10:30:00.000Z"
          }
        ]
      },
      "SubscriptionPlan": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "description": "Plan ID",
            "example": "gnd7bh43x4itx40"
          },
          "title": {
            "type": "string",
            "description": "Plan title",
            "example": "Monthly subscription"
          }
        }
      },
      "Subscription": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "description": "Subscription ID",
            "example": "126"
          },
          "user_id": {
            "type": "string",
            "description": "User ID",
            "example": "123456789"
          },
          "plan": {
            "$ref": "#/components/schemas/SubscriptionPlan"
          },
          "subscription_at": {
            "type": "string",
            "format": "date-time",
            "description": "Subscription start time",
            "example": "2026-01-14 15:23:23.824Z"
          },
          "ending_at": {
            "type": "string",
            "format": "date-time",
            "description": "Subscription end time",
            "example": "2026-11-20 05:07:13.000Z"
          }
        }
      },
      "SubscriptionsResponse": {
        "type": "array",
        "items": {
          "$ref": "#/components/schemas/Subscription"
        },
        "example": [
          {
            "id": "126",
            "user_id": "123456789",
            "plan": {
              "id": "gnd7bh43x4itx40",
              "title": "Monthly subscription"
            },
            "subscription_at": "2026-01-14 15:23:23.824Z",
            "ending_at": "2026-11-20 05:07:13.000Z"
          }
        ]
      },
      "RetrieveUserInformation": {
        "type": "object",
        "properties": {
          "users": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/UserInformation"
            }
          }
        },
        "example": {
          "users": [
            {
              "id": 1234567,
              "family": "نمونه",
              "cell": "9123456789",
              "name": "علی",
              "national_code": "1234567890",
              "gender": null,
              "country_code_id": 29,
              "email": null,
              "username": "9123456789"
            }
          ]
        }
      },
      "UserInformation": {
        "type": "object",
        "properties": {
          "id": {
            "type": "integer",
            "description": "Unique identifier of the user",
            "example": 1234567
          },
          "name": {
            "type": "string",
            "description": "First name of the user",
            "example": "علی"
          },
          "family": {
            "type": "string",
            "description": "Family name of the user",
            "example": "نمونه"
          },
          "national_code": {
            "type": "string",
            "description": "National identification code of the user",
            "example": "1234567890"
          },
          "cell": {
            "type": "string",
            "description": "Cell phone number of the user",
            "example": "9123456789"
          },
          "username": {
            "type": "string",
            "description": "Username of the user",
            "example": "9123456789"
          },
          "gender": {
            "type": [
              "string",
              "null"
            ],
            "description": "Gender of the user",
            "nullable": true,
            "example": null
          },
          "country_code_id": {
            "type": "integer",
            "description": "Country code identifier",
            "example": 29
          },
          "email": {
            "type": [
              "string",
              "null"
            ],
            "description": "Email address of the user",
            "nullable": true,
            "example": null
          }
        }
      },
      "widget_RemoveSpecifiedProfileWidgetRespnose": {
        "type": "object",
        "properties": {
          "message": {
            "type": "string",
            "examples": [
              "Provider Widget deleted successfully"
            ]
          }
        }
      },
      "widget_AddSpecifiedProfileWidgetRespnose": {
        "type": "object",
        "properties": {
          "message": {
            "type": "string",
            "examples": [
              "Provider Widget updated successfully"
            ]
          }
        }
      },
      "widget_RetrieveSpecifiedEnabledProfileWidgetRespnose": {
        "type": "object",
        "properties": {
          "user_id": {
            "type": "string"
          },
          "placements": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "placements_metadata": {
            "type": "object"
          }
        }
      },
      "widget_RetrieveAllEnabledProfileWidgetRespnose": {
        "type": "array",
        "items": {
          "type": "object",
          "properties": {
            "user_id": {
              "type": "string"
            },
            "placements": {
              "type": "array",
              "items": {
                "type": "string"
              }
            },
            "placements_metadata": {
              "type": "object"
            }
          }
        }
      }
    },
    "securitySchemes": {
      "BearerAuth": {
        "type": "http",
        "scheme": "bearer",
        "bearerFormat": "JWT",
        "description": "The token must be sent in the `Authorization` header."
      },
      "ApiKeyAuth": {
        "type": "apiKey",
        "in": "header",
        "name": "X-API-Key",
        "description": "The apikey must be sent in the `x-api-key` header."
      }
    }
  },
  "tags": [
    {
      "name": "Appointments Addon"
    },
    {
      "name": "Medical Centers"
    },
    {
      "name": "Appointments"
    },
    {
      "name": "Work Hours"
    },
    {
      "name": "Vacations"
    },
    {
      "name": "Slots"
    },
    {
      "name": "Chats"
    },
    {
      "name": "Accounts",
      "description": "Bank account information including IBAN, card numbers, and related data."
    },
    {
      "name": "Insurance",
      "description": "Patient insurance type lookup."
    },
    {
      "name": "Search",
      "description": "Insurance catalog search and service type codes."
    },
    {
      "name": "Information",
      "description": "Profile information such as expertise, biography and ..."
    },
    {
      "name": "Utilities",
      "description": "Developer tools for managing profile-related cache and other auxiliary operations."
    },
    {
      "name": "Balance",
      "description": "Provider SMS credit"
    },
    {
      "name": "Messages",
      "description": "Send SMS"
    },
    {
      "name": "Links",
      "description": "Review links for bookings."
    },
    {
      "name": "Reviews"
    },
    {
      "name": "Replies"
    },
    {
      "name": "Document",
      "description": "Search document field management."
    },
    {
      "name": "Booked",
      "description": "Receipt-page / booking funnel by terminal_id"
    },
    {
      "name": "Transactions"
    },
    {
      "name": "Subscriptions"
    }
  ],
  "x-sources": [
    "appointments-addon.json",
    "booking.json",
    "channel.json",
    "chats.json",
    "katibe.json",
    "nelson.json",
    "prescription.json",
    "profile.json",
    "rasan.json",
    "ravi.json",
    "reviews.json",
    "search.json",
    "stats.json",
    "transactions-subscriptions.json",
    "user-profile.json",
    "widget.json"
  ]
}