openapi: 3.2.0 info: title: Reference Patient Payments API version: 1.0.0 servers: - url: https://pre-api.joincandidhealth.com description: Production - url: https://pre-api-staging.joincandidhealth.com description: Staging - url: https://sandbox-pre-api.joincandidhealth.com description: CandidSandbox - url: https://staging-pre-api.joincandidhealth.com description: CandidStaging - url: http://localhost:4000 description: Local - url: https://api.joincandidhealth.com description: Production - url: https://api-staging.joincandidhealth.com description: Staging - url: https://sandbox-api.joincandidhealth.com description: CandidSandbox - url: https://staging-api.joincandidhealth.com description: CandidStaging - url: http://localhost:5050 description: Local tags: - name: Patient Payments paths: /api/patient-payments/v4: get: operationId: getMulti summary: Get patient payments description: 'Returns all patient payments satisfying the search criteria AND whose organization_id matches the current organization_id of the authenticated user.' tags: - Patient Payments parameters: - name: limit in: query description: Defaults to 100. The value must be greater than 0 and less than 1000. required: false schema: type: integer - name: patient_external_id in: query required: false schema: $ref: '#/components/schemas/type_commons_PatientExternalId' - name: claim_id in: query required: false schema: $ref: '#/components/schemas/type_commons_ClaimId' - name: service_line_id in: query required: false schema: $ref: '#/components/schemas/type_commons_ServiceLineId' - name: billing_provider_id in: query required: false schema: $ref: '#/components/schemas/type_commons_ProviderId' - name: unattributed in: query description: returns payments with unattributed allocations if set to true required: false schema: type: boolean - name: invoice_id in: query required: false schema: $ref: '#/components/schemas/type_commons_InvoiceId' - name: sources in: query required: false schema: $ref: '#/components/schemas/type_financials_PatientTransactionSource' - name: source_internal_id in: query required: false schema: type: string - name: sort in: query description: Defaults to payment_timestamp required: false schema: $ref: '#/components/schemas/type_patient-payments_v4_PatientPaymentSortField' - name: sort_direction in: query description: Sort direction. Defaults to descending order if not provided. required: false schema: $ref: '#/components/schemas/type_commons_SortDirection' - name: page_token in: query required: false schema: $ref: '#/components/schemas/type_commons_PageToken' - name: Authorization in: header description: OAuth authentication required: true schema: type: string responses: '200': description: Response with status 200 content: application/json: schema: $ref: '#/components/schemas/type_patient-payments_v4_PatientPaymentsPage' '403': description: Error response with status 403 content: application/json: schema: type: object properties: errorName: type: string enum: - UnauthorizedError content: $ref: '#/components/schemas/type_commons_UnauthorizedErrorMessage' required: - errorName - content '422': description: Error response with status 422 content: application/json: schema: type: object properties: errorName: type: string enum: - UnprocessableEntityError content: $ref: '#/components/schemas/type_commons_UnprocessableEntityErrorMessage' required: - errorName - content post: operationId: create summary: Create patient payment description: 'Creates a new patient payment record and returns the newly created PatientPayment object. The allocations can describe whether the payment is being applied toward a specific service line, claim, or billing provider.' tags: - Patient Payments parameters: - name: Authorization in: header description: OAuth authentication required: true schema: type: string responses: '200': description: Response with status 200 content: application/json: schema: $ref: '#/components/schemas/type_patient-payments_v4_PatientPayment' '403': description: Error response with status 403 content: application/json: schema: type: object properties: errorName: type: string enum: - UnauthorizedError content: $ref: '#/components/schemas/type_commons_UnauthorizedErrorMessage' required: - errorName - content '404': description: Error response with status 404 content: application/json: schema: type: object properties: errorName: type: string enum: - EntityNotFoundError content: $ref: '#/components/schemas/type_commons_EntityNotFoundErrorMessage' required: - errorName - content '422': description: Error response with status 422 content: application/json: schema: type: object properties: errorName: type: string enum: - UnprocessableEntityError content: $ref: '#/components/schemas/type_commons_UnprocessableEntityErrorMessage' required: - errorName - content requestBody: content: application/json: schema: type: object properties: amount_cents: type: integer payment_timestamp: type: string format: date-time payment_note: type: string patient_external_id: $ref: '#/components/schemas/type_commons_PatientExternalId' allocations: type: array items: $ref: '#/components/schemas/type_financials_AllocationCreate' invoice: $ref: '#/components/schemas/type_commons_InvoiceId' payment_method_detail: $ref: '#/components/schemas/type_patient-payments_v4_PaymentMethodDetailCreate' payment_source: $ref: '#/components/schemas/type_financials_PatientPaymentCreateSource' source_internal_id: type: string allocation_restrictions: type: array items: $ref: '#/components/schemas/type_financials_AllocationRestrictionCreate' description: 'Optional restrictions constraining which claims this payment''s credit can be auto-allocated to (e.g. billing provider NPI). Restriction (type, value) pairs must be unique. When omitted, the payment is unrestricted.' required: - amount_cents - patient_external_id - allocations /api/patient-payments/v4/{patient_payment_id}: get: operationId: get summary: Get patient payment description: Retrieves a previously created patient payment by its `patient_payment_id`. tags: - Patient Payments parameters: - name: patient_payment_id in: path required: true schema: $ref: '#/components/schemas/type_patient-payments_v4_PatientPaymentId' - name: Authorization in: header description: OAuth authentication required: true schema: type: string responses: '200': description: Response with status 200 content: application/json: schema: $ref: '#/components/schemas/type_patient-payments_v4_PatientPayment' '403': description: Error response with status 403 content: application/json: schema: type: object properties: errorName: type: string enum: - UnauthorizedError content: $ref: '#/components/schemas/type_commons_UnauthorizedErrorMessage' required: - errorName - content '404': description: Error response with status 404 content: application/json: schema: type: object properties: errorName: type: string enum: - EntityNotFoundError content: $ref: '#/components/schemas/type_commons_EntityNotFoundErrorMessage' required: - errorName - content patch: operationId: update summary: Update description: Updates the patient payment record matching the provided patient_payment_id. tags: - Patient Payments parameters: - name: patient_payment_id in: path required: true schema: $ref: '#/components/schemas/type_patient-payments_v4_PatientPaymentId' - name: Authorization in: header description: OAuth authentication required: true schema: type: string responses: '200': description: Response with status 200 content: application/json: schema: $ref: '#/components/schemas/type_patient-payments_v4_PatientPayment' '403': description: Error response with status 403 content: application/json: schema: type: object properties: errorName: type: string enum: - UnauthorizedError content: $ref: '#/components/schemas/type_commons_UnauthorizedErrorMessage' required: - errorName - content '404': description: Error response with status 404 content: application/json: schema: type: object properties: errorName: type: string enum: - EntityNotFoundError content: $ref: '#/components/schemas/type_commons_EntityNotFoundErrorMessage' required: - errorName - content '422': description: Error response with status 422 content: application/json: schema: type: object properties: errorName: type: string enum: - UnprocessableEntityError content: $ref: '#/components/schemas/type_commons_UnprocessableEntityErrorMessage' required: - errorName - content requestBody: content: application/json: schema: type: object properties: payment_timestamp: type: string format: date-time payment_note: $ref: '#/components/schemas/type_financials_NoteUpdate' invoice: $ref: '#/components/schemas/type_financials_InvoiceUpdate' delete: operationId: delete summary: Delete patient payment description: Deletes the patient payment record matching the provided patient_payment_id. tags: - Patient Payments parameters: - name: patient_payment_id in: path required: true schema: $ref: '#/components/schemas/type_patient-payments_v4_PatientPaymentId' - name: Authorization in: header description: OAuth authentication required: true schema: type: string responses: '200': description: Successful response '403': description: Error response with status 403 content: application/json: schema: type: object properties: errorName: type: string enum: - UnauthorizedError content: $ref: '#/components/schemas/type_commons_UnauthorizedErrorMessage' required: - errorName - content '404': description: Error response with status 404 content: application/json: schema: type: object properties: errorName: type: string enum: - EntityNotFoundError content: $ref: '#/components/schemas/type_commons_EntityNotFoundErrorMessage' required: - errorName - content '422': description: Error response with status 422 content: application/json: schema: type: object properties: errorName: type: string enum: - UnprocessableEntityError content: $ref: '#/components/schemas/type_commons_UnprocessableEntityErrorMessage' required: - errorName - content components: schemas: type_patient-payments_v4_PaymentMethodCreate: oneOf: - type: object properties: type: type: string enum: - cash description: 'Discriminator value: cash' required: - type - type: object properties: type: type: string enum: - check description: 'Discriminator value: check' check_number: type: string required: - type - check_number - type: object properties: type: type: string enum: - card description: 'Discriminator value: card' authorization_number: type: string required: - type - type: object properties: type: type: string enum: - money_order description: 'Discriminator value: money_order' money_order_serial_number: type: string required: - type - money_order_serial_number discriminator: propertyName: type title: PaymentMethodCreate type_commons_EncounterExternalId: type: string title: EncounterExternalId type_financials_PatientPaymentCreateSource: type: string enum: - MANUAL_ENTRY - PHREESIA - SHERPA_HEALTH description: Allowed payment sources when creating a patient payment via the API. title: PatientPaymentCreateSource type_commons_AllocationId: type: string format: uuid title: AllocationId type_patient-payments_v4_PaymentMethodDetailCreate: type: object properties: payment_method: $ref: '#/components/schemas/type_patient-payments_v4_PaymentMethodCreate' collected_at_address: $ref: '#/components/schemas/type_commons_StreetAddressShortZip' organization_service_facility_id: $ref: '#/components/schemas/type_organization-service-facilities_v2_OrganizationServiceFacilityId' provider_info: $ref: '#/components/schemas/type_patient-payments_v4_PaymentMethodProviderInfo' required: - payment_method title: PaymentMethodDetailCreate type_commons_Date: type: string description: ISO 8601 date; formatted YYYY-MM-DD (i.e. 2012-02-01) title: Date type_commons_InvoiceId: type: string format: uuid title: InvoiceId type_patient-payments_v4_PatientPaymentSortField: type: string enum: - payment_source - amount_cents - payment_timestamp - payment_note title: PatientPaymentSortField type_financials_AllocationRestrictionType: type: string enum: - billing_provider_npi - service_facility_id description: The dimension along which a payment's auto-allocation can be restricted. title: AllocationRestrictionType type_financials_Allocation: type: object properties: allocation_id: $ref: '#/components/schemas/type_commons_AllocationId' amount_cents: type: integer target: $ref: '#/components/schemas/type_financials_AllocationTarget' earmark: $ref: '#/components/schemas/type_financials_BalanceEarmark' description: The active earmark created by this allocation, if any. Only present when this allocation created an earmark for future auto-allocation and the earmark has not been deleted. allocated_on: type: string format: date-time required: - amount_cents - target title: Allocation type_patient-payments_v4_PaymentMethod: oneOf: - type: object properties: type: type: string enum: - cash description: 'Discriminator value: cash' required: - type - type: object properties: type: type: string enum: - check description: 'Discriminator value: check' check_number: type: string required: - type - check_number - type: object properties: type: type: string enum: - card description: 'Discriminator value: card' authorization_number: type: string required: - type - type: object properties: type: type: string enum: - money_order description: 'Discriminator value: money_order' money_order_serial_number: type: string required: - type - money_order_serial_number discriminator: propertyName: type title: PaymentMethod type_commons_State: type: string enum: - AA - AE - AP - AL - AK - AS - AZ - AR - CA - CO - CT - DC - DE - FL - FM - GA - GU - HI - ID - IL - IN - IA - KS - KY - LA - ME - MD - MA - MH - MI - MN - MP - MS - MO - MT - NE - NV - NH - NJ - NM - NY - NC - ND - OH - OK - OR - PA - PR - PW - RI - SC - SD - TN - TX - UT - VI - VT - VA - WA - WV - WI - WY title: State type_commons_StreetAddressShortZip: type: object properties: address1: type: string address2: type: string city: type: string state: $ref: '#/components/schemas/type_commons_State' zip_code: type: string description: 5-digit zip code zip_plus_four_code: type: string description: 4-digit zip add-on code https://en.wikipedia.org/wiki/ZIP_Code#ZIP+4 required: - address1 - city - state - zip_code title: StreetAddressShortZip type_commons_PatientExternalId: type: string title: PatientExternalId type_financials_BalanceEarmark: type: object properties: id: type: string format: uuid target: $ref: '#/components/schemas/type_financials_AllocationEarmarkType' description: The target for this earmark (date of service or external encounter ID) amount_earmarked_cents: type: integer description: The amount earmarked in cents for future allocation created_by_allocation_id: $ref: '#/components/schemas/type_commons_AllocationId' description: The ID of the allocation that created this earmark required: - id - target description: 'Represents an active balance earmarking record that holds allocated funds for future auto-allocation. Earmarks are created when funds are allocated but should be held for a specific encounter or date of service. Only active (non-deleted) earmarks are returned.' title: BalanceEarmark type_commons_ProviderId: type: string format: uuid title: ProviderId type_patient-payments_v4_PatientPayment: type: object properties: patient_payment_id: $ref: '#/components/schemas/type_patient-payments_v4_PatientPaymentId' organization_id: $ref: '#/components/schemas/type_commons_OrganizationId' source_internal_id: type: string payment_source: $ref: '#/components/schemas/type_financials_PatientTransactionSource' amount_cents: type: integer patient_external_id: $ref: '#/components/schemas/type_commons_PatientExternalId' payment_timestamp: type: string format: date-time payment_note: type: string allocations: type: array items: $ref: '#/components/schemas/type_financials_Allocation' invoice: $ref: '#/components/schemas/type_commons_InvoiceId' payment_method_detail: $ref: '#/components/schemas/type_patient-payments_v4_PaymentMethodDetail' required: - patient_payment_id - organization_id - payment_source - amount_cents - patient_external_id - allocations title: PatientPayment type_commons_SortDirection: type: string enum: - asc - desc title: SortDirection type_commons_EncounterId: type: string format: uuid title: EncounterId type_financials_AllocationCreate: type: object properties: amount_cents: type: integer target: $ref: '#/components/schemas/type_financials_AllocationTargetCreate' earmark: $ref: '#/components/schemas/type_financials_AllocationEarmarkType' description: 'If enabled for your organization, optional earmarking configuration for patient prepayments. When provided on unattributed allocations, holds the payment for future auto-allocation to matching encounters.' required: - amount_cents - target description: 'Allocations are portions of payments that are applied to specific resources, known as targets. Each allocation has and amount, defined in cents, and a target.' title: AllocationCreate type_commons_Npi: type: string title: Npi type_patient-payments_v4_PatientPaymentId: type: string format: uuid title: PatientPaymentId type_financials_AllocationTargetCreate: oneOf: - type: object properties: type: type: string enum: - service_line_by_id description: 'Discriminator value: service_line_by_id' value: $ref: '#/components/schemas/type_commons_ServiceLineId' required: - type - value - type: object properties: type: type: string enum: - claim_by_id description: 'Discriminator value: claim_by_id' value: $ref: '#/components/schemas/type_commons_ClaimId' required: - type - value - type: object properties: type: type: string enum: - claim_by_encounter_external_id description: 'Discriminator value: claim_by_encounter_external_id' value: $ref: '#/components/schemas/type_commons_EncounterExternalId' required: - type - value - type: object properties: type: type: string enum: - billing_provider_by_id description: 'Discriminator value: billing_provider_by_id' value: $ref: '#/components/schemas/type_commons_ProviderId' required: - type - value - type: object properties: type: type: string enum: - appointment_by_id_and_patient_external_id description: 'Discriminator value: appointment_by_id_and_patient_external_id' appointment_id: $ref: '#/components/schemas/type_commons_AppointmentId' patient_external_id: $ref: '#/components/schemas/type_commons_PatientExternalId' required: - type - appointment_id - patient_external_id - type: object properties: type: type: string enum: - unattributed description: 'Discriminator value: unattributed' required: - type discriminator: propertyName: type description: 'Allocation targets describe whether the portion of a payment is being applied toward a specific service line, claim, billing provider, or is unallocated.' title: AllocationTargetCreate type_financials_PatientTransactionSource: type: string enum: - MANUAL_ENTRY - CHARGEBEE - SQUARE - STRIPE - ELATION - CEDAR - HEALTHIE - REALLOCATION - PHREESIA - INSTAMED - SHERPA_HEALTH title: PatientTransactionSource type_organization-service-facilities_v2_OrganizationServiceFacilityId: type: string format: uuid title: OrganizationServiceFacilityId type_commons_ServiceLineId: type: string format: uuid title: ServiceLineId type_commons_PageToken: type: string title: PageToken type_patient-payments_v4_PaymentMethodDetail: type: object properties: payment_method: $ref: '#/components/schemas/type_patient-payments_v4_PaymentMethod' collected_at_address: $ref: '#/components/schemas/type_commons_StreetAddressShortZip' provider_info: $ref: '#/components/schemas/type_patient-payments_v4_PaymentMethodProviderInfo' required: - payment_method title: PaymentMethodDetail type_financials_InvoiceUpdate: oneOf: - type: object properties: type: type: string enum: - set description: 'Discriminator value: set' value: $ref: '#/components/schemas/type_commons_InvoiceId' required: - type - value - type: object properties: type: type: string enum: - remove description: 'Discriminator value: remove' required: - type discriminator: propertyName: type title: InvoiceUpdate type_financials_AllocationEarmarkType: oneOf: - type: object properties: type: type: string enum: - date_of_service description: 'Discriminator value: date_of_service' value: $ref: '#/components/schemas/type_commons_Date' required: - type - value description: Earmark for auto-allocation to an encounter with this specific date of service - type: object properties: type: type: string enum: - external_encounter_id description: 'Discriminator value: external_encounter_id' value: $ref: '#/components/schemas/type_commons_EncounterExternalId' required: - type - value description: Earmark for auto-allocation to an encounter with this specific external ID (more specific than date of service) discriminator: propertyName: type description: 'If enabled for your organization, defines how a patient prepayment allocation should be earmarked for future auto-allocation. Earmarks hold the allocation until a matching encounter is created, then attempt to allocate to that encounter. Only applicable for unattributed allocations.' title: AllocationEarmarkType type_financials_AllocationTarget: oneOf: - type: object properties: type: type: string enum: - service_line description: 'Discriminator value: service_line' service_line_id: $ref: '#/components/schemas/type_commons_ServiceLineId' claim_id: $ref: '#/components/schemas/type_commons_ClaimId' encounter_id: $ref: '#/components/schemas/type_commons_EncounterId' required: - type - service_line_id - claim_id - encounter_id - type: object properties: type: type: string enum: - claim description: 'Discriminator value: claim' claim_id: $ref: '#/components/schemas/type_commons_ClaimId' encounter_id: $ref: '#/components/schemas/type_commons_EncounterId' required: - type - claim_id - encounter_id - type: object properties: type: type: string enum: - billing_provider_id description: 'Discriminator value: billing_provider_id' billing_provider_id: $ref: '#/components/schemas/type_commons_ProviderId' required: - type - billing_provider_id - type: object properties: type: type: string enum: - appointment description: 'Discriminator value: appointment' appointment_id: $ref: '#/components/schemas/type_commons_AppointmentId' patient_external_id: $ref: '#/components/schemas/type_commons_PatientExternalId' required: - type - appointment_id - patient_external_id - type: object properties: type: type: string enum: - unattributed description: 'Discriminator value: unattributed' required: - type discriminator: propertyName: type description: 'Allocation targets describe whether the portion of a payment is being applied toward a specific service line, claim, billing provider, or is unallocated.' title: AllocationTarget type_patient-payments_v4_PaymentMethodProviderInfo: type: object properties: npi: $ref: '#/components/schemas/type_commons_Npi' first_name: type: string last_name: type: string title: PaymentMethodProviderInfo type_commons_OrganizationId: type: string format: uuid title: OrganizationId type_commons_EntityNotFoundErrorMessage: type: object properties: id: type: string required: - id title: EntityNotFoundErrorMessage type_commons_UnprocessableEntityErrorMessage: type: object properties: message: type: string title: UnprocessableEntityErrorMessage type_patient-payments_v4_PatientPaymentsPage: type: object properties: prev_page_token: $ref: '#/components/schemas/type_commons_PageToken' next_page_token: $ref: '#/components/schemas/type_commons_PageToken' items: type: array items: $ref: '#/components/schemas/type_patient-payments_v4_PatientPayment' required: - items title: PatientPaymentsPage type_financials_NoteUpdate: oneOf: - type: object properties: type: type: string enum: - set description: 'Discriminator value: set' value: type: string required: - type - value - type: object properties: type: type: string enum: - remove description: 'Discriminator value: remove' required: - type discriminator: propertyName: type title: NoteUpdate type_commons_AppointmentId: type: string title: AppointmentId type_financials_AllocationRestrictionCreate: type: object properties: restriction_type: $ref: '#/components/schemas/type_financials_AllocationRestrictionType' restriction_value: type: string description: For billing_provider_npi, the NPI. For service_facility_id, the organization service facility ID. required: - restriction_type - restriction_value description: 'Constrains which claims a payment''s credit can be auto-allocated to. Restrictions of the same restriction_type are OR''d together (any value may match); different restriction_types are AND''d (every type present must match). A payment with no restrictions can be allocated to any claim.' title: AllocationRestrictionCreate type_commons_UnauthorizedErrorMessage: type: object properties: message: type: string title: UnauthorizedErrorMessage type_commons_ClaimId: type: string format: uuid title: ClaimId securitySchemes: OAuthScheme: type: http scheme: bearer description: OAuth 2.0 authentication