NexHealth Payments API

Payments resources to view and create payments

OpenAPI Specification

nexhealth-payments-api-openapi.yml Raw ↑
openapi: 3.0.0
info:
  title: NexHealth Adjustment Types Payments API
  description: v3.0.0 and v20240412 are two names for the same API version; the Nex-Api-Version header accepts either value. Welcome to the developer hub and documentation for NexHealth API. This section of guide describes the operations, response parameters, request parameters, and parameter constraints related to User API. The term Operations refer to functions or methods. The operations are included in requests and send to the web server. Each operation performs a different action or a query on database.
  termsOfService: https://www.nexhealth.com/terms-of-service
  contact:
    name: NexHealth
    email: info@nexhealth.com
  license:
    name: NexHealth License 1.0
    url: https://www.nexhealth.com/privacy
  version: v20240412
servers:
- url: https://nexhealth.info
security:
- Authorization: []
tags:
- name: Payments
  description: Payments resources to view and create payments
paths:
  /payments:
    get:
      summary: View payments
      description: This endpoint returns the ledger payments for the specified location, narrowed down by the configured filters (at least one filter is required)
      parameters:
      - in: header
        name: Nex-Api-Version
        description: The NexHealth API version
        required: true
        schema:
          type: string
          default: v3.0.0
      - in: query
        name: subdomain
        description: Used to scope the request to the specified institution
        required: true
        schema:
          type: string
      - in: query
        name: location_id
        description: Used to scope the request to the specified location
        required: true
        schema:
          type: integer
          format: int32
      - in: query
        name: patient_id
        description: Filter by the id of the associated patient
        required: false
        example: 3
        schema:
          type: integer
          format: int32
      - in: query
        name: provider_id
        description: Filter by the id of the associated provider
        required: false
        example: 15
        schema:
          type: integer
          format: int32
      - in: query
        name: guarantor_id
        description: Filter by the id of the associated guarantor
        required: false
        example: 5
        schema:
          type: integer
          format: int32
      - in: query
        name: charge_id
        description: Filter by the id of the associated charge
        required: false
        example: 1111
        schema:
          type: integer
          format: int32
      - in: query
        name: claim_id
        description: Filter by the id of the associated claim
        required: false
        example: 2222
        schema:
          type: integer
          format: int32
      - in: query
        name: transaction_id
        description: Filter by transaction id
        required: false
        example: NHP:JXZEQ1234
        schema:
          type: string
      - in: query
        name: updated_since
        description: Filter for payments updated since a specific time (UTC)
        required: false
        example: '2024-04-12T10:30:00Z'
        schema:
          type: string
          format: date-time
      - in: query
        name: include_deleted
        description: Include deleted payments
        required: false
        example: false
        schema:
          type: boolean
          default: false
      - in: query
        name: sort
        description: "Optional comma-separated string of fields to sort on.\nInclude a leading dash for descending order.\n\nAvailable fields:\n  * updated_at\n  * -updated_at\n"
        required: false
        schema:
          type: string
      - in: query
        name: start_cursor
        description: First item of the current page. Starts empty
        required: false
        schema:
          type: string
      - in: query
        name: end_cursor
        description: Last item of the current page. Starts empty
        required: false
        schema:
          type: string
      - in: query
        name: per_page
        description: Number of results to return per page. Maximum allowed amount is 1000.
        required: false
        schema:
          type: integer
          format: int32
          default: 5
      responses:
        '200':
          description: Successful
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/API_V20240412_Entities_Ledger_Payment_Collection_Response_WithCursor'
        '400':
          description: Bad Request
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/API_Errors_BadRequest'
        '401':
          description: Unauthorized
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/API_Errors_Unauthorized'
        '403':
          description: Forbidden
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/API_Errors_Forbidden'
        '500':
          description: Internal Server Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/API_Errors_InternalServerError'
      tags:
      - Payments
      operationId: getPayments
    post:
      summary: Create payment
      description: This endpoint enqueues a write-back that records the payment in the integrated health record system
      parameters:
      - in: header
        name: Nex-Api-Version
        description: The NexHealth API version
        required: true
        schema:
          type: string
          default: v3.0.0
      - in: query
        name: subdomain
        description: Used to scope the request to the specified institution
        required: true
        schema:
          type: string
      - in: query
        name: location_id
        description: Used to scope the request to the specified location
        required: true
        schema:
          type: integer
          format: int32
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/postPayments'
        required: true
      responses:
        '202':
          description: Create payment
        '400':
          description: Bad Request
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/API_Errors_BadRequest'
        '401':
          description: Unauthorized
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/API_Errors_Unauthorized'
        '403':
          description: Forbidden
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/API_Errors_Forbidden'
        '500':
          description: Internal Server Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/API_Errors_InternalServerError'
      tags:
      - Payments
      operationId: postPayments
  /payments/{id}:
    get:
      summary: View payment
      description: This endpoint returns a single ledger payment
      parameters:
      - in: header
        name: Nex-Api-Version
        description: The NexHealth API version
        required: true
        schema:
          type: string
          default: v3.0.0
      - in: path
        name: id
        required: true
        schema:
          type: integer
          format: int64
      - in: query
        name: subdomain
        description: Used to scope the request to the specified institution
        required: true
        schema:
          type: string
      - in: query
        name: include[]
        description: Resources to be included in the response
        required: false
        explode: true
        schema:
          type: array
          items:
            type: string
            enum:
            - patient
            - provider
            - guarantor
            - claim
            - charge
            - payment_plan
            - payment_type
      responses:
        '200':
          description: Successful
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/API_V20240412_Entities_Ledger_PaymentWithIncludes_Response'
        '400':
          description: Bad Request
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/API_Errors_BadRequest'
        '401':
          description: Unauthorized
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/API_Errors_Unauthorized'
        '403':
          description: Forbidden
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/API_Errors_Forbidden'
        '500':
          description: Internal Server Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/API_Errors_InternalServerError'
      tags:
      - Payments
      operationId: getPaymentsId
components:
  schemas:
    API_V20240412_Entities_Ledger_PaymentType:
      type: object
      properties:
        id:
          type: integer
          format: int64
          example: 113
          description: Resource id
        name:
          type: string
          example: Cash
          description: The name of the payment type
        active:
          type: boolean
          example: true
          description: Whether the payment type is currently active
        updated_at:
          type: string
          format: date-time
          example: '2020-06-05T20:16:57.007Z'
          description: Payment Type update date in UTC
    API_Errors_InternalServerError:
      type: object
      properties:
        code:
          type: boolean
          description: Indicates the success or failure of the request.
        description:
          type: string
          description: Additional context about the request to help with debugging.
        data:
          type: object
        error:
          type: array
          items:
            type: string
          description: Any errors that occured during the execution of the request.
      description: API_Errors_InternalServerError model
    API_Errors_Forbidden:
      type: object
      properties:
        code:
          type: boolean
          description: Indicates the success or failure of the request.
        description:
          type: string
          description: Additional context about the request to help with debugging.
        data:
          type: object
        error:
          type: array
          items:
            type: string
          description: Any errors that occured during the execution of the request.
      description: API_Errors_Forbidden model
    API_V2_Entities_PaymentPlan:
      type: object
      properties:
        id:
          type: integer
          format: int64
          example: 113
          description: Resource id
        patient_id:
          type: integer
          format: int32
          example: 115
          description: The ID of patient this plan is for
        guarantor_id:
          type: integer
          format: int32
          example: 115
          description: The ID of the person paying for the plan
        first_payment_due_date:
          type: string
          format: date
          example: '2020-06-05'
          description: The date the first payment is due (this doesn’t include down payments)
        created_date:
          type: string
          format: date
          example: '2020-06-05'
          description: The date the payment plan was created
        active:
          type: boolean
          description: Indicates whether the payment plan has been closed, cleared, or deleted from the system
    API_V20240412_Entities_Ledger_Payment:
      type: object
      properties:
        id:
          type: integer
          format: int64
          example: 113
          description: Resource id
        foreign_id:
          type: string
          example: 1234-5678
          description: Unique identifier of this resource from the integrated system
        location_id:
          type: integer
          format: int32
          example: 10
          description: The ID of the location that this item is for
          nullable: true
        patient_id:
          type: integer
          format: int32
          example: 3
          description: The ID of the patient that this item is for
          nullable: true
        guarantor_id:
          type: integer
          format: int32
          example: 5
          description: The ID of the guarantor that this item is for
          nullable: true
        provider_id:
          type: integer
          format: int32
          example: 15
          description: The ID of the provider that this item is for
          nullable: true
        updated_at:
          type: string
          format: date-time
          example: '2024-09-05T20:31:17.007Z'
          description: Last updated time for item in UTC
        description:
          type: string
          example: This is a description
          description: A description of the item
          nullable: true
        deleted_at:
          type: string
          format: date-time
          example: '2024-09-15T11:21:26.003Z'
          description: Deleted time for item in UTC
          nullable: true
        payment_amount:
          $ref: '#/components/schemas/API_V2_Entities_Price'
        paid_at:
          type: string
          format: date
          example: '2024-10-01'
          description: The UTC date payment was made
          nullable: true
        transaction_id:
          type: string
          example: NHP:JXZEQ1234
          description: The ID of the transaction for this payment
          nullable: true
        charge_id:
          type: integer
          format: int64
          example: 1111
          description: The ID of the charge for this payment
          nullable: true
        claim_id:
          type: integer
          format: int64
          example: 2222
          description: The ID of the insurance claim for this payment
          nullable: true
        payment_plan_id:
          type: integer
          format: int64
          example: 3
          description: The ID of the payment plan associated with this payment
          nullable: true
        insurance_plan_id:
          type: integer
          format: int64
          example: 4
          description: The ID of the insurance plan associated with this payment
          nullable: true
        payment_type_id:
          type: integer
          format: int64
          example: 5
          description: The ID of the payment type for this payment
          nullable: true
    API_V20240412_Entities_Ledger_PaymentWithIncludes_Response:
      type: object
      properties:
        code:
          type: boolean
          example: false
          description: Indicates the success or failure of the request
        description:
          type: string
          example: Description
          description: Additional context on the request to help with debugging.
        error:
          type: array
          items:
            type: string
          example:
          - Error message
          description: Any errors that occur during the execution of the request.
        data:
          $ref: '#/components/schemas/API_V20240412_Entities_Ledger_PaymentWithIncludes'
        count:
          type: integer
          format: int32
          example: 2
          description: Number of total objects, in case of collection.
      description: API_V20240412_Entities_Ledger_PaymentWithIncludes_Response model
    API_Errors_Unauthorized:
      type: object
      properties:
        code:
          type: boolean
          description: Indicates the success or failure of the request.
        description:
          type: string
          description: Additional context about the request to help with debugging.
        data:
          type: object
        error:
          type: array
          items:
            type: string
          description: Any errors that occured during the execution of the request.
      description: API_Errors_Unauthorized model
    postPayments:
      type: object
      properties:
        payment:
          type: object
          description: Payment details
          properties:
            patient_id:
              type: integer
              format: int32
              description: NexHealth Patient ID
              example: 1
            amount:
              type: number
              format: double
              description: Payment amount in decimal dollars.  Negative amounts represent payments which reduce the patient's balance
              example: -138
            currency:
              type: string
              description: Currency
              default: USD
            payment_type_id:
              type: integer
              format: int32
              description: ID of the payment type
              example: 10
            transaction_id:
              type: string
              description: The transaction ID of the payment with a prefix identifying the API originator this ID will be used to identify the payment created in the EHR. Max length is 50 characters.
              example: API:123456
            paid_at:
              type: string
              format: date-time
              description: Payment datetime
              example: '2024-05-20T21:00:00+00:00'
            charge_splits:
              type: object
              description: Charge splits hash with NexHealth charge IDs and corresponding amounts in decimal dollars
              example:
                charge_id_1: -37
                charge_id_2: -100
            provider_splits:
              type: object
              description: Provider splits hash with NexHealth provider IDs and corresponding amounts in decimal dollars
              example:
                provider_id_1: -0.5
                provider_id_2: -0.5
            notes:
              type: string
              description: 'Notes that will be saved into the EHR. note: some EHRs may truncate overlong notes'
              example: Prepayment for xrays
          required:
          - patient_id
          - amount
          - transaction_id
      required:
      - payment
      description: Create payment
    API_V20240412_Entities_Ledger_PaymentWithIncludes:
      type: object
      properties:
        id:
          type: integer
          format: int64
          example: 113
          description: Resource id
        foreign_id:
          type: string
          example: 1234-5678
          description: Unique identifier of this resource from the integrated system
        location_id:
          type: integer
          format: int32
          example: 10
          description: The ID of the location that this item is for
          nullable: true
        patient_id:
          type: integer
          format: int32
          example: 3
          description: The ID of the patient that this item is for
          nullable: true
        guarantor_id:
          type: integer
          format: int32
          example: 5
          description: The ID of the guarantor that this item is for
          nullable: true
        provider_id:
          type: integer
          format: int32
          example: 15
          description: The ID of the provider that this item is for
          nullable: true
        updated_at:
          type: string
          format: date-time
          example: '2024-09-05T20:31:17.007Z'
          description: Last updated time for item in UTC
        description:
          type: string
          example: This is a description
          description: A description of the item
          nullable: true
        deleted_at:
          type: string
          format: date-time
          example: '2024-09-15T11:21:26.003Z'
          description: Deleted time for item in UTC
          nullable: true
        payment_amount:
          $ref: '#/components/schemas/API_V2_Entities_Price'
        paid_at:
          type: string
          format: date
          example: '2024-10-01'
          description: The UTC date payment was made
          nullable: true
        transaction_id:
          type: string
          example: NHP:JXZEQ1234
          description: The ID of the transaction for this payment
          nullable: true
        charge_id:
          type: integer
          format: int64
          example: 1111
          description: The ID of the charge for this payment
          nullable: true
        claim_id:
          type: integer
          format: int64
          example: 2222
          description: The ID of the insurance claim for this payment
          nullable: true
        payment_plan_id:
          type: integer
          format: int64
          example: 3
          description: The ID of the payment plan associated with this payment
          nullable: true
        insurance_plan_id:
          type: integer
          format: int64
          example: 4
          description: The ID of the insurance plan associated with this payment
          nullable: true
        patient:
          $ref: '#/components/schemas/API_V2_Entities_PatientBasic'
        provider:
          $ref: '#/components/schemas/API_V2_Entities_Provider'
        guarantor:
          $ref: '#/components/schemas/API_V2_Entities_PatientBasic'
        claim:
          $ref: '#/components/schemas/API_V2_Entities_Ledger_Insurance_ClaimBasic'
        charge:
          $ref: '#/components/schemas/API_V2_Entities_Patient_Ledger_Charge'
        payment_plan:
          $ref: '#/components/schemas/API_V2_Entities_PaymentPlan'
        payment_type:
          $ref: '#/components/schemas/API_V20240412_Entities_Ledger_PaymentType'
        payment_type_id:
          type: integer
          format: int64
          example: 5
          description: The ID of the payment type for this payment
          nullable: true
    API_V2_Entities_PatientBasic:
      type: object
      properties:
        id:
          type: integer
          format: int32
          example: 415
          description: User id
        email:
          type: string
          example: Amy.Ramos@nexhealth.com
          description: User email
          nullable: true
        first_name:
          type: string
          example: John
          description: First name
        middle_name:
          type: string
          example: Anthony
          description: Middle name
          nullable: true
        last_name:
          type: string
          example: Smith
          description: Last name
        name:
          type: string
          example: John Smith
          description: Full name
        created_at:
          type: string
          format: date-time
          example: '2020-06-05T20:16:57.007Z'
          description: User creation date in UTC
        updated_at:
          type: string
          format: date-time
          example: '2020-06-05T20:16:57.007Z'
          description: User last updation date in UTC
        institution_id:
          type: integer
          format: int32
          example: 105
          description: The institution this user belongs to
        foreign_id:
          type: string
          example: '100437'
          description: Foreign Id is a unique identifier from the integrated system
          nullable: true
        foreign_id_type:
          type: string
          example: --DataSource-
          description: Foreign Id type is a unique string identifier for the integrated system
        bio:
          type: object
          example:
            city: New York
            state: NY
            gender: Female
            zip_code: '20814'
            new_patient: false
            non_patient: true
            phone_number: '5163042196'
            date_of_birth: '1964-05-03'
            address_line_1: ''
            address_line_2: ''
            street_address: ''
            cell_phone_number: ''
            home_phone_number: ''
            work_phone_number: ''
          description: Patient biographical data, fields shown in our example response represent all possible data we retrieve but depending on system and what is actually saved in the health records system you cannot assume any field will consistently be returned
        inactive:
          type: boolean
          example: false
          description: Is the user inactivated?
        last_sync_time:
          type: string
          format: date-time
          example: '2024-04-12T10:30:00Z'
          description: The most recent time the resource's data changed meaningfully at the source
          nullable: true
        guarantor_id:
          type: integer
          format: int32
          example: 472
          description: User id of this patient's responsible party
          nullable: true
        billing_type:
          type: string
          example: Standard Billing - finance charges
          description: Used by practices in some integrated systems to categorize and filter patients when creating reports, requesting payments, and performing other related office tasks. Some integrated systems call this an account type rather than a billing type
          nullable: true
        chart_id:
          type: string
          example: '017407'
          description: User-facing ID for referencing patient data, used in some integrated systems. Depending on the system, the chart ID supplements or replaces the foreign_id as the ID visible to EHR users
          nullable: true
        preferred_language:
          type: string
          example: es
          description: Patient's preferred language as an ISO 639-1 code, if specified in the integrated system
          nullable: true
        preferred_locale:
          type: string
          example: es
          description: The patient's preferred language setting used for displaying NexHealth forms and communications
          nullable: true
        location_ids:
          type: array
          items:
            type: integer
            format: int32
          example:
          - 101
          - 102
          - 103
          description: Array of location ids associated with the user
    API_Errors_BadRequest:
      type: object
      properties:
        code:
          type: boolean
          description: Indicates the success or failure of the request.
        description:
          type: string
          description: Additional context about the request to help with debugging.
        data:
          type: object
        error:
          type: array
          items:
            type: string
          description: Any errors that occured during the execution of the request.
      description: API_Errors_BadRequest model
    API_V2_Entities_Patient_Ledger_Charge:
      type: object
      properties:
        id:
          type: integer
          format: int64
          example: 113
          description: Resource id
        foreign_id:
          type: string
          example: 1234-5678
          description: Unique identifier of this resource from the integrated system
        location_id:
          type: integer
          format: int32
          example: 10
          description: The ID of the location that this item is for
          nullable: true
        patient_id:
          type: integer
          format: int32
          example: 3
          description: The ID of the patient that this item is for
          nullable: true
        guarantor_id:
          type: integer
          format: int32
          example: 5
          description: The ID of the guarantor that this item is for
          nullable: true
        provider_id:
          type: integer
          format: int32
          example: 15
          description: The ID of the provider that this item is for
          nullable: true
        updated_at:
          type: string
          format: date-time
          example: '2024-09-05T20:31:17.007Z'
          description: Last updated time for item in UTC
        description:
          type: string
          example: This is a description
          description: A description of the item
          nullable: true
        deleted_at:
          type: string
          format: date-time
          example: '2024-09-15T11:21:26.003Z'
          description: Deleted time for item in UTC
          nullable: true
        fee:
          $ref: '#/components/schemas/API_V2_Entities_Price'
        charged_at:
          type: string
          format: date
          example: '2024-10-05'
          description: The UTC date charge was made
        procedure_id:
          type: string
          example: NHP:JXZEQ1234
          description: The ID of the procedure associated with this charge
        claim_ids:
          type: array
          items:
            type: integer
            format: int64
          example:
          - 2222
          - 3333
          description: Insurance claim IDs associated with this charge
        payment_estimate_total:
          $ref: '#/components/schemas/API_V2_Entities_Price'
        write_off_estimate_total:
          $ref: '#/components/schemas/API_V2_Entities_Price'
        write_off_total:
          $ref: '#/components/schemas/API_V2_Entities_Price'
    API_V2_Entities_Provider:
      type: object
      properties:
        id:
          type: integer
          format: int32
          example: 415
          description: User id
        email:
          type: string
          example: Amy.Ramos@nexhealth.com
          description: User email
          nullable: true
        first_name:
          type: string
          example: John
          description: First name
        middle_name:
          type: string
          example: Anthony
          description: Middle name
          nullable: true
        last_name:
          type: string
          example: Smith
          description: Last name
        name:
          type: string
          example: John Smith
          description: Full name
        created_at:
          type: string
          format: date-time
          example: '2020-06-05T20:16:57.007Z'
          description: User creation date in UTC
        updated_at:
          type: string
          format: date-time
          example: '2020-06-05T20:16:57.007Z'
          description: User last updation date in UTC
        institution_id:
          type: integer
          format: int32
          example: 105
          description: The institution this user belongs to
        foreign_id:
          type: string
          example: '100437'
          description: Foreign Id is a unique identifier from the integrated system
          nullable: true
        foreign_id_type:
          type: string
          example: --DataSource-
          description: Foreign Id type is a unique string identifier for the integrated system
        bio:
          type: object
          example:
            city: New York
            state: NY
            gender: Female
            zip_code: '20814'
            new_patient: false
            non_patient: true
            phone_number: '5163042196'
            date_of_birth: '1964-05-03'
            address_line_1: ''
            address_line_2: ''
            street_address: ''
            cell_phone_number: ''
            home_phone_number: ''
            work_phone_number: ''
          description: Patient biographical data, fields shown in our example response represent all possible data we retrieve but depending on system and what is actually saved in the health records system you cannot assume any field will consistently be returned
        inactive:
          type: boolean
          example: false
          description: Is the user inactivated?
        last_sync_time:
          type: string
          format: date-time
          example: '2024-04-12T10:30:00Z'
          description: The most recent time the resource's data changed meaningfully at the source
          nullable: true
        display_name:
          type: string
          example: John Smith
          description: Display name
        npi:
          type: string
          example: '1912507500'
          description: National Provider Identifier as registered in NPPES. May be null if the practice did not en

# --- truncated at 32 KB (36 KB total) ---
# Full source: https://raw.githubusercontent.com/api-evangelist/nexhealth/refs/heads/main/openapi/nexhealth-payments-api-openapi.yml