> ## Documentation Index
> Fetch the complete documentation index at: https://ekacare-mintlify-efa94f7d.mintlify.site/llms.txt
> Use this file to discover all available pages before exploring further.

# Book Appointment Slot

> This API is used to book an appointment slot for a patient based on the available slots retrieved from the `get appointment slots` API.



## OpenAPI

````yaml post /dr/v1/appointment
openapi: 3.0.0
info:
  title: Ekacare API & Webhook Documentation
  contact: {}
  version: '1.0'
servers:
  - description: Production
    url: https://api.eka.care
  - description: Stage/Sandbox
    url: https://api.dev.eka.care
security: []
paths:
  /dr/v1/appointment:
    post:
      tags:
        - Appointment API
      summary: Book Appointment Slot
      description: >-
        This API is used to book an appointment slot for a patient based on the
        available slots retrieved from the `get appointment slots` API.
      operationId: BookAppointmentSlot
      parameters:
        - name: auth
          in: header
          description: ''
          required: true
          style: simple
          schema:
            type: string
            example: auth
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              description: >-
                The request body should contain either partner-specific fields
                or non-partner-specific fields for clinic and doctor
                identification.
              properties:
                partner_appointment_id:
                  type: string
                token:
                  type: integer
                  description: >-
                    A unique number given to each patient to indicate their
                    position in the queue.
                appointment_details:
                  type: object
                  properties:
                    mode:
                      type: string
                      enum:
                        - INCLINIC
                        - PHONE
                        - VIDEO
                    start_time:
                      type: integer
                      description: Start time of the appointment in epoch
                    end_time:
                      type: integer
                      description: End time of the appointment in epoch
                    custom_attributes:
                      type: object
                      description: >-
                        `Custom attributes` and `value` for each custom
                        attribute are a fixed set of enum defined by our partner
                        at the time of onboarding. `Labels` and `Tags` are
                        `special type` of custom attributes which exist by
                        default for every partner and are visible in appointment
                        queue. key-value pair within labels and tags can be
                        defined by each repective partner. Position of other
                        custom attributes in appointment queue need to
                        configured by partner.
                    video_connect:
                      type: object
                      description: >-
                        Configuration of video connect. To be used only when
                        mode is `VIDEO`
                      properties:
                        vendor:
                          type: string
                          enum:
                            - 100ms
                        url:
                          type: string
                  required:
                    - start_time
                patient_details:
                  type: object
                  properties:
                    designation:
                      type: string
                      enum:
                        - Mr.
                        - Ms.
                        - Mrs.
                        - Miss.
                        - Kumar.
                        - Shri.
                        - Smt.
                        - Dr.
                        - Master.
                        - Baby.
                        - Mohd.
                        - B/O
                      example: Mr.
                      description: Title or designation of the patient
                    first_name:
                      type: string
                      example: Test
                      description: First name of the patient
                    partner_patient_id:
                      type: string
                      example: '6742984'
                      description: Identifier for the partner’s patient.
                    middle_name:
                      type: string
                      example: ''
                      description: Middle name of the patient (if any)
                    last_name:
                      type: string
                      example: Patient
                      description: Last name of the patient
                    mobile:
                      type: string
                      example: '+919999999999'
                      description: Mobile number of the patient, including country code
                    gender:
                      type: string
                      example: M
                      description: >-
                        Gender of the patient (e.g., 'M' for male, 'F' for
                        female, 'O' for others)
                      enum:
                        - M
                        - F
                        - O
                    address:
                      type: object
                      properties:
                        city:
                          type: string
                          example: Bangalore
                        pincode:
                          type: integer
                          example: 560049
                      description: Address details of the patient
                  oneOf:
                    - title: DOB
                      properties:
                        dob:
                          type: string
                          format: date
                          example: '1987-01-06'
                          description: Date of birth of the patient (YYYY-MM-DD)
                      required:
                        - dob
                    - title: AGE
                      properties:
                        age:
                          type: integer
                          example: 24
                          description: Age in years
                      required:
                        - age
                partner_meta:
                  type: object
                  description: >-
                    This field is a set of `key-value pair` very specific to our
                    partner and not visible in appointment queue. These
                    key-value pairs are just stored at our end and echoed back
                    in appointment related apis. We dont use it for any
                    computation.
                display_meta:
                  type: object
                  description: >
                    - This field is a set of `key-value pair`.

                    - The value corresponding to a key must be string, int, or
                    float.

                    - Keys in `display_meta` must not exceed 30 characters.

                    - The value for a key must not exceed 50 characters.

                    - These key-value pairs will be shown on the appointment
                    card.

                    - For key names, it is recommended to use underscores (`_`)
                    instead of spaces. 
                      During display, underscores will be replaced with spaces, and the following 
                      letter will be capitalized automatically.
                    - Example:  
                      `"vendor_patient_id": "P41025551968206"` will be shown as 
                      `"Vendor Patient Id": "P41025551968206"`
                      
              oneOf:
                - title: PartnerIds
                  properties:
                    partner_clinic_id:
                      type: string
                      description: >-
                        Identifier for the partner’s clinic. Please ensure the
                        clinic is registered on the hub
                    partner_doctor_id:
                      type: string
                      description: >-
                        Identifier for the partner’s doctor. Please ensure the
                        doctor is registered on the hub
                    partner_patient_id:
                      type: string
                      description: >-
                        Identifier for the partner’s patient. Please ensure the
                        patient is registered beforehand using the "Add Patient"
                        API.
                  required:
                    - partner_clinic_id
                    - partner_doctor_id
                    - partner_patient_id
                - title: EkaIds
                  properties:
                    clinic_id:
                      type: string
                      description: Identifier for the clinic in Eka.
                    doctor_id:
                      type: string
                      description: Identifier for the doctor in Eka.
                    patient_id:
                      type: string
                      description: Identifier for the patient in Eka.
                  required:
                    - clinic_id
                    - doctor_id
                    - patient_id
              required:
                - appointment_details
            example:
              partner_appointment_id: '098765434567890'
              partner_clinic_id: '642783'
              partner_doctor_id: '8423994'
              partner_patient_id: '6742984'
              token: 2
              appointment_details:
                start_time: 1730189586
                end_time: 1730189586
                mode: INCLINIC
                custom_attributes:
                  label:
                    - vitals_submitted
                  tags:
                    - paid
                    - in_consult
                video_connect:
                  vendor: other
                  url: https://xyz.com
              patient_details:
                designation: Mr.
                first_name: Test
                middle_name: ''
                last_name: Patient
                mobile: '+919999999999'
                gender: M
                dob: '1987-01-06'
                address:
                  city: Bangalore
                  pincode: 560049
                partner_patient_id: '6742984'
              partner_meta:
                encounter_id: '123'
              display_meta:
                key1: value1
      responses:
        '201':
          description: OK
          headers:
            Date:
              content:
                text/plain:
                  schema:
                    type: string
                  example: Thu, 16 Apr 2020 08:47:12 GMT
            Transfer-Encoding:
              content:
                text/plain:
                  schema:
                    type: string
                  example: chunked
            Connection:
              content:
                text/plain:
                  schema:
                    type: string
                  example: keep-alive
            Server:
              content:
                text/plain:
                  schema:
                    type: string
                  example: nginx/1.10.3 (Ubuntu)
            Vary:
              content:
                text/plain:
                  schema:
                    type: string
                  example: Accept-Encoding
            Strict-Transport-Security:
              content:
                text/plain:
                  schema:
                    type: string
                  example: max-age=15768000
            Content-Encoding:
              content:
                text/plain:
                  schema:
                    type: string
                  example: gzip
          content:
            application/json:
              schema:
                type: object
                properties:
                  appointment_id:
                    type: string
              example:
                appointment_id: '{{appointment_id}}'
        '400':
          description: Bad Request
          headers:
            Date:
              content:
                text/plain:
                  schema:
                    type: string
                  example: Thu, 16 Apr 2020 08:47:12 GMT
            Transfer-Encoding:
              content:
                text/plain:
                  schema:
                    type: string
                  example: chunked
            Connection:
              content:
                text/plain:
                  schema:
                    type: string
                  example: keep-alive
            Server:
              content:
                text/plain:
                  schema:
                    type: string
                  example: nginx/1.10.3 (Ubuntu)
            Vary:
              content:
                text/plain:
                  schema:
                    type: string
                  example: Accept-Encoding
            Strict-Transport-Security:
              content:
                text/plain:
                  schema:
                    type: string
                  example: max-age=15768000
            Content-Encoding:
              content:
                text/plain:
                  schema:
                    type: string
                  example: gzip
          content:
            application/json:
              schema:
                allOf:
                  - $ref: '#/components/schemas/400BadRequest1'
                  - example:
                      data: {}
                      error:
                        code: INVALID_REQUEST_PARAMETERS
                        message: The request contains invalid parameters
              example:
                error:
                  code: INVALID_REQUEST_PARAMETERS
                  message: The request contains invalid parameters
      deprecated: false
components:
  schemas:
    400BadRequest1:
      title: 400BadRequest1
      required:
        - data
        - error
      type: object
      properties:
        data:
          type: object
        error:
          $ref: '#/components/schemas/Error'
      example:
        data: {}
        error:
          code: INVALID_REQUEST_PARAMETERS
          message: The request contains invalid parameters
    Error:
      title: Error
      required:
        - code
        - message
      type: object
      properties:
        code:
          type: string
        message:
          type: string
      example:
        code: NOT_ALLOWED
        message: You are not allowed to add resource

````