> For the complete documentation index, see [llms.txt](https://docs.welkinhealth.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.welkinhealth.com/api-reference/invoices.md).

# Invoices

Requests that relate to viewing invoice information. Access to the requests is controlled by the invoice reading permission (Billing & Invoices section in Security Policies in the Designer).

## Get invoices

> Request for all invoices on an instance.

```json
{"openapi":"3.0.3","info":{"title":"Welkin Health API","version":"1.0.0"},"tags":[{"name":"Invoices","description":"Requests that relate to viewing invoice information. Access to the requests is controlled by the invoice reading permission (Billing & Invoices section in Security Policies in the Designer)."}],"servers":[{"url":"https://api.live.welkincloud.io","description":"Welkin Health production API"}],"security":[{"bearerAuth":[]}],"components":{"securitySchemes":{"bearerAuth":{"type":"http","scheme":"bearer","description":"Bearer token obtained from `POST /{tenantName}/admin/api_clients/{clientName}`. Valid for 60 minutes."}},"parameters":{"TenantName":{"name":"tenantName","in":"path","required":true,"description":"Your organization (tenant) name, e.g. `acme-health`","schema":{"type":"string"}},"InstanceName":{"name":"instanceName","in":"path","required":true,"description":"Your environment name: `live`, `sandbox`, or a custom name","schema":{"type":"string"}},"Size":{"name":"size","in":"query","required":false,"description":"Number of results per page","schema":{"type":"integer","default":20,"minimum":1,"maximum":1000}}},"schemas":{"InvoicePage":{"allOf":[{"$ref":"#/components/schemas/PaginatedResponse"},{"type":"object","properties":{"content":{"type":"array","items":{"$ref":"#/components/schemas/Invoice"}}}}]},"PaginatedResponse":{"type":"object","description":"Standard paginated response wrapper.","properties":{"content":{"type":"array","items":{"type":"object"}},"pageable":{"$ref":"#/components/schemas/PageableInfo"},"totalElements":{"type":"integer","description":"Total number of matching records"},"totalPages":{"type":"integer","description":"Total number of pages"},"last":{"type":"boolean"},"first":{"type":"boolean"},"number":{"type":"integer","description":"Current page number (zero-based)"},"size":{"type":"integer","description":"Page size"},"numberOfElements":{"type":"integer","description":"Number of elements on the current page"},"empty":{"type":"boolean"},"sort":{"$ref":"#/components/schemas/SortInfo"}}},"PageableInfo":{"type":"object","properties":{"sort":{"$ref":"#/components/schemas/SortInfo"},"pageSize":{"type":"integer"},"pageNumber":{"type":"integer"},"offset":{"type":"integer"},"unpaged":{"type":"boolean"},"paged":{"type":"boolean"}}},"SortInfo":{"type":"object","properties":{"sorted":{"type":"boolean"},"unsorted":{"type":"boolean"},"empty":{"type":"boolean"}}},"Invoice":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"customInvoiceId":{"type":"string","nullable":true},"status":{"type":"string","description":"Commonly one of: DRAFT, PENDING, VOIDED, PAID, PARTIALLY_PAID, OVERDUE, DELETED, PREAUTHORIZED."},"paymentTypeInfo":{"type":"object","additionalProperties":true,"nullable":true},"billingType":{"$ref":"#/components/schemas/BillingType"},"dueDate":{"type":"string","format":"date-time","nullable":true},"invoiceDate":{"type":"string","format":"date-time","nullable":true},"invoiceItems":{"type":"array","items":{"$ref":"#/components/schemas/InvoiceItem"}},"careMember":{"$ref":"#/components/schemas/IndexedNamed"},"patient":{"$ref":"#/components/schemas/IndexedNamed"},"amount":{"type":"integer","description":"Total in cents."},"amountPaid":{"type":"integer","description":"Amount paid in cents."},"relatedEncounters":{"type":"array","items":{"type":"string","format":"uuid"}}}},"BillingType":{"type":"string","enum":["SELF_PAY","INSURANCE"]},"InvoiceItem":{"type":"object","properties":{"id":{"type":"string"},"description":{"type":"string","nullable":true},"quantity":{"type":"integer","default":1},"unitAmount":{"type":"integer","default":1,"description":"Cost in cents."},"serviceCode":{"type":"string","nullable":true},"serviceModifiers":{"type":"array","items":{"type":"string"}}}},"IndexedNamed":{"type":"object","required":["id"],"properties":{"id":{"type":"string","format":"uuid"},"name":{"type":"string","nullable":true}}}},"responses":{"BadRequest":{"description":"Bad request — the request could not be understood or was missing required parameters."},"Unauthorized":{"description":"Unauthorized — the Bearer token is missing, expired, or invalid."},"Forbidden":{"description":"Forbidden — the API client role does not have permission for this resource. Check the role and security policy in Admin."},"NotFound":{"description":"Not found — the requested resource does not exist."},"TooManyRequests":{"description":"Too many requests — rate limit exceeded. Implement exponential backoff."},"InternalError":{"description":"Internal server error."}}},"paths":{"/{tenantName}/{instanceName}/invoice/invoices":{"get":{"summary":"Get invoices","tags":["Invoices"],"operationId":"Get_invoices","parameters":[{"$ref":"#/components/parameters/TenantName"},{"$ref":"#/components/parameters/InstanceName"},{"$ref":"#/components/parameters/Size"},{"name":"sort","in":"query","required":false,"schema":{"type":"string"},"description":"List sorting"},{"name":"page","in":"query","required":false,"schema":{"type":"integer","default":0,"minimum":0},"description":"Page number, numbering starts at 0"}],"responses":{"200":{"description":"Paginated list of invoices.\n\n**⚠️ Unverified:** no backing REST controller for this exact path could be found in the backend source — invoicing is handled by a separate invoice-service, and this repo only contains a thin outbound HTTP client. The schema is inferred from that client's response deserialization and has not been directly confirmed against a live controller.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/InvoicePage"}}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"429":{"$ref":"#/components/responses/TooManyRequests"},"500":{"$ref":"#/components/responses/InternalError"}},"description":"Request for all invoices on an instance."}}}}
```

## Get invoice By ID

> A request to get a specific invoice. \_invoice\_id\_ is the \<u>internal\</u> invoice id (\*\*not\*\* customInvoiceId, which is displayed on the UI).\
> \
> The invoice\_id can be taken from other get requests

```json
{"openapi":"3.0.3","info":{"title":"Welkin Health API","version":"1.0.0"},"tags":[{"name":"Invoices","description":"Requests that relate to viewing invoice information. Access to the requests is controlled by the invoice reading permission (Billing & Invoices section in Security Policies in the Designer)."}],"servers":[{"url":"https://api.live.welkincloud.io","description":"Welkin Health production API"}],"security":[{"bearerAuth":[]}],"components":{"securitySchemes":{"bearerAuth":{"type":"http","scheme":"bearer","description":"Bearer token obtained from `POST /{tenantName}/admin/api_clients/{clientName}`. Valid for 60 minutes."}},"parameters":{"TenantName":{"name":"tenantName","in":"path","required":true,"description":"Your organization (tenant) name, e.g. `acme-health`","schema":{"type":"string"}},"InstanceName":{"name":"instanceName","in":"path","required":true,"description":"Your environment name: `live`, `sandbox`, or a custom name","schema":{"type":"string"}},"InvoiceId":{"name":"invoiceId","in":"path","required":true,"description":"UUID of the invoice","schema":{"type":"string","format":"uuid"}}},"schemas":{"Invoice":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"customInvoiceId":{"type":"string","nullable":true},"status":{"type":"string","description":"Commonly one of: DRAFT, PENDING, VOIDED, PAID, PARTIALLY_PAID, OVERDUE, DELETED, PREAUTHORIZED."},"paymentTypeInfo":{"type":"object","additionalProperties":true,"nullable":true},"billingType":{"$ref":"#/components/schemas/BillingType"},"dueDate":{"type":"string","format":"date-time","nullable":true},"invoiceDate":{"type":"string","format":"date-time","nullable":true},"invoiceItems":{"type":"array","items":{"$ref":"#/components/schemas/InvoiceItem"}},"careMember":{"$ref":"#/components/schemas/IndexedNamed"},"patient":{"$ref":"#/components/schemas/IndexedNamed"},"amount":{"type":"integer","description":"Total in cents."},"amountPaid":{"type":"integer","description":"Amount paid in cents."},"relatedEncounters":{"type":"array","items":{"type":"string","format":"uuid"}}}},"BillingType":{"type":"string","enum":["SELF_PAY","INSURANCE"]},"InvoiceItem":{"type":"object","properties":{"id":{"type":"string"},"description":{"type":"string","nullable":true},"quantity":{"type":"integer","default":1},"unitAmount":{"type":"integer","default":1,"description":"Cost in cents."},"serviceCode":{"type":"string","nullable":true},"serviceModifiers":{"type":"array","items":{"type":"string"}}}},"IndexedNamed":{"type":"object","required":["id"],"properties":{"id":{"type":"string","format":"uuid"},"name":{"type":"string","nullable":true}}}},"responses":{"BadRequest":{"description":"Bad request — the request could not be understood or was missing required parameters."},"Unauthorized":{"description":"Unauthorized — the Bearer token is missing, expired, or invalid."},"Forbidden":{"description":"Forbidden — the API client role does not have permission for this resource. Check the role and security policy in Admin."},"NotFound":{"description":"Not found — the requested resource does not exist."},"TooManyRequests":{"description":"Too many requests — rate limit exceeded. Implement exponential backoff."},"InternalError":{"description":"Internal server error."}}},"paths":{"/{tenantName}/{instanceName}/invoice/invoices/{invoiceId}":{"get":{"summary":"Get invoice By ID","tags":["Invoices"],"operationId":"Get_invoice_By_ID","parameters":[{"$ref":"#/components/parameters/TenantName"},{"$ref":"#/components/parameters/InstanceName"},{"$ref":"#/components/parameters/InvoiceId"}],"responses":{"200":{"description":"Invoice.\n\nSchema confirmed against the backend's outbound client to the invoice-service (`InvoiceServiceApiClientImpl`).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Invoice"}}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"429":{"$ref":"#/components/responses/TooManyRequests"},"500":{"$ref":"#/components/responses/InternalError"}},"description":"A request to get a specific invoice. _invoice_id_ is the <u>internal</u> invoice id (**not** customInvoiceId, which is displayed on the UI).\n\nThe invoice_id can be taken from other get requests"}}}}
```

## Get Invoices By Patient ID

> Request to get all invoices for the patient.

```json
{"openapi":"3.0.3","info":{"title":"Welkin Health API","version":"1.0.0"},"tags":[{"name":"Invoices","description":"Requests that relate to viewing invoice information. Access to the requests is controlled by the invoice reading permission (Billing & Invoices section in Security Policies in the Designer)."}],"servers":[{"url":"https://api.live.welkincloud.io","description":"Welkin Health production API"}],"security":[{"bearerAuth":[]}],"components":{"securitySchemes":{"bearerAuth":{"type":"http","scheme":"bearer","description":"Bearer token obtained from `POST /{tenantName}/admin/api_clients/{clientName}`. Valid for 60 minutes."}},"parameters":{"TenantName":{"name":"tenantName","in":"path","required":true,"description":"Your organization (tenant) name, e.g. `acme-health`","schema":{"type":"string"}},"InstanceName":{"name":"instanceName","in":"path","required":true,"description":"Your environment name: `live`, `sandbox`, or a custom name","schema":{"type":"string"}},"PatientId":{"name":"patientId","in":"path","required":true,"description":"UUID of the patient record","schema":{"type":"string","format":"uuid"}}},"schemas":{"InvoicePage":{"allOf":[{"$ref":"#/components/schemas/PaginatedResponse"},{"type":"object","properties":{"content":{"type":"array","items":{"$ref":"#/components/schemas/Invoice"}}}}]},"PaginatedResponse":{"type":"object","description":"Standard paginated response wrapper.","properties":{"content":{"type":"array","items":{"type":"object"}},"pageable":{"$ref":"#/components/schemas/PageableInfo"},"totalElements":{"type":"integer","description":"Total number of matching records"},"totalPages":{"type":"integer","description":"Total number of pages"},"last":{"type":"boolean"},"first":{"type":"boolean"},"number":{"type":"integer","description":"Current page number (zero-based)"},"size":{"type":"integer","description":"Page size"},"numberOfElements":{"type":"integer","description":"Number of elements on the current page"},"empty":{"type":"boolean"},"sort":{"$ref":"#/components/schemas/SortInfo"}}},"PageableInfo":{"type":"object","properties":{"sort":{"$ref":"#/components/schemas/SortInfo"},"pageSize":{"type":"integer"},"pageNumber":{"type":"integer"},"offset":{"type":"integer"},"unpaged":{"type":"boolean"},"paged":{"type":"boolean"}}},"SortInfo":{"type":"object","properties":{"sorted":{"type":"boolean"},"unsorted":{"type":"boolean"},"empty":{"type":"boolean"}}},"Invoice":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"customInvoiceId":{"type":"string","nullable":true},"status":{"type":"string","description":"Commonly one of: DRAFT, PENDING, VOIDED, PAID, PARTIALLY_PAID, OVERDUE, DELETED, PREAUTHORIZED."},"paymentTypeInfo":{"type":"object","additionalProperties":true,"nullable":true},"billingType":{"$ref":"#/components/schemas/BillingType"},"dueDate":{"type":"string","format":"date-time","nullable":true},"invoiceDate":{"type":"string","format":"date-time","nullable":true},"invoiceItems":{"type":"array","items":{"$ref":"#/components/schemas/InvoiceItem"}},"careMember":{"$ref":"#/components/schemas/IndexedNamed"},"patient":{"$ref":"#/components/schemas/IndexedNamed"},"amount":{"type":"integer","description":"Total in cents."},"amountPaid":{"type":"integer","description":"Amount paid in cents."},"relatedEncounters":{"type":"array","items":{"type":"string","format":"uuid"}}}},"BillingType":{"type":"string","enum":["SELF_PAY","INSURANCE"]},"InvoiceItem":{"type":"object","properties":{"id":{"type":"string"},"description":{"type":"string","nullable":true},"quantity":{"type":"integer","default":1},"unitAmount":{"type":"integer","default":1,"description":"Cost in cents."},"serviceCode":{"type":"string","nullable":true},"serviceModifiers":{"type":"array","items":{"type":"string"}}}},"IndexedNamed":{"type":"object","required":["id"],"properties":{"id":{"type":"string","format":"uuid"},"name":{"type":"string","nullable":true}}}},"responses":{"BadRequest":{"description":"Bad request — the request could not be understood or was missing required parameters."},"Unauthorized":{"description":"Unauthorized — the Bearer token is missing, expired, or invalid."},"Forbidden":{"description":"Forbidden — the API client role does not have permission for this resource. Check the role and security policy in Admin."},"NotFound":{"description":"Not found — the requested resource does not exist."},"TooManyRequests":{"description":"Too many requests — rate limit exceeded. Implement exponential backoff."},"InternalError":{"description":"Internal server error."}}},"paths":{"/{tenantName}/{instanceName}/invoice/patients/{patientId}/invoices":{"get":{"summary":"Get Invoices By Patient ID","tags":["Invoices"],"operationId":"Get_Invoices_By_Patient_ID","parameters":[{"$ref":"#/components/parameters/TenantName"},{"$ref":"#/components/parameters/InstanceName"},{"$ref":"#/components/parameters/PatientId"}],"responses":{"200":{"description":"Paginated list of invoices for this patient.\n\n**⚠️ Unverified:** no backing REST controller for this exact path could be found in the backend source — invoicing is handled by a separate invoice-service, and this repo only contains a thin outbound HTTP client. The schema is inferred from that client's response deserialization and has not been directly confirmed against a live controller.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/InvoicePage"}}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"429":{"$ref":"#/components/responses/TooManyRequests"},"500":{"$ref":"#/components/responses/InternalError"}},"description":"Request to get all invoices for the patient."}}}}
```

## Get Invoices By Encounter ID

> Request to get all invoices for a specific encounter

```json
{"openapi":"3.0.3","info":{"title":"Welkin Health API","version":"1.0.0"},"tags":[{"name":"Invoices","description":"Requests that relate to viewing invoice information. Access to the requests is controlled by the invoice reading permission (Billing & Invoices section in Security Policies in the Designer)."}],"servers":[{"url":"https://api.live.welkincloud.io","description":"Welkin Health production API"}],"security":[{"bearerAuth":[]}],"components":{"securitySchemes":{"bearerAuth":{"type":"http","scheme":"bearer","description":"Bearer token obtained from `POST /{tenantName}/admin/api_clients/{clientName}`. Valid for 60 minutes."}},"parameters":{"TenantName":{"name":"tenantName","in":"path","required":true,"description":"Your organization (tenant) name, e.g. `acme-health`","schema":{"type":"string"}},"InstanceName":{"name":"instanceName","in":"path","required":true,"description":"Your environment name: `live`, `sandbox`, or a custom name","schema":{"type":"string"}},"PatientId":{"name":"patientId","in":"path","required":true,"description":"UUID of the patient record","schema":{"type":"string","format":"uuid"}},"EncounterId":{"name":"encounterId","in":"path","required":true,"description":"UUID of the encounter","schema":{"type":"string","format":"uuid"}}},"schemas":{"InvoicePage":{"allOf":[{"$ref":"#/components/schemas/PaginatedResponse"},{"type":"object","properties":{"content":{"type":"array","items":{"$ref":"#/components/schemas/Invoice"}}}}]},"PaginatedResponse":{"type":"object","description":"Standard paginated response wrapper.","properties":{"content":{"type":"array","items":{"type":"object"}},"pageable":{"$ref":"#/components/schemas/PageableInfo"},"totalElements":{"type":"integer","description":"Total number of matching records"},"totalPages":{"type":"integer","description":"Total number of pages"},"last":{"type":"boolean"},"first":{"type":"boolean"},"number":{"type":"integer","description":"Current page number (zero-based)"},"size":{"type":"integer","description":"Page size"},"numberOfElements":{"type":"integer","description":"Number of elements on the current page"},"empty":{"type":"boolean"},"sort":{"$ref":"#/components/schemas/SortInfo"}}},"PageableInfo":{"type":"object","properties":{"sort":{"$ref":"#/components/schemas/SortInfo"},"pageSize":{"type":"integer"},"pageNumber":{"type":"integer"},"offset":{"type":"integer"},"unpaged":{"type":"boolean"},"paged":{"type":"boolean"}}},"SortInfo":{"type":"object","properties":{"sorted":{"type":"boolean"},"unsorted":{"type":"boolean"},"empty":{"type":"boolean"}}},"Invoice":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"customInvoiceId":{"type":"string","nullable":true},"status":{"type":"string","description":"Commonly one of: DRAFT, PENDING, VOIDED, PAID, PARTIALLY_PAID, OVERDUE, DELETED, PREAUTHORIZED."},"paymentTypeInfo":{"type":"object","additionalProperties":true,"nullable":true},"billingType":{"$ref":"#/components/schemas/BillingType"},"dueDate":{"type":"string","format":"date-time","nullable":true},"invoiceDate":{"type":"string","format":"date-time","nullable":true},"invoiceItems":{"type":"array","items":{"$ref":"#/components/schemas/InvoiceItem"}},"careMember":{"$ref":"#/components/schemas/IndexedNamed"},"patient":{"$ref":"#/components/schemas/IndexedNamed"},"amount":{"type":"integer","description":"Total in cents."},"amountPaid":{"type":"integer","description":"Amount paid in cents."},"relatedEncounters":{"type":"array","items":{"type":"string","format":"uuid"}}}},"BillingType":{"type":"string","enum":["SELF_PAY","INSURANCE"]},"InvoiceItem":{"type":"object","properties":{"id":{"type":"string"},"description":{"type":"string","nullable":true},"quantity":{"type":"integer","default":1},"unitAmount":{"type":"integer","default":1,"description":"Cost in cents."},"serviceCode":{"type":"string","nullable":true},"serviceModifiers":{"type":"array","items":{"type":"string"}}}},"IndexedNamed":{"type":"object","required":["id"],"properties":{"id":{"type":"string","format":"uuid"},"name":{"type":"string","nullable":true}}}},"responses":{"BadRequest":{"description":"Bad request — the request could not be understood or was missing required parameters."},"Unauthorized":{"description":"Unauthorized — the Bearer token is missing, expired, or invalid."},"Forbidden":{"description":"Forbidden — the API client role does not have permission for this resource. Check the role and security policy in Admin."},"NotFound":{"description":"Not found — the requested resource does not exist."},"TooManyRequests":{"description":"Too many requests — rate limit exceeded. Implement exponential backoff."},"InternalError":{"description":"Internal server error."}}},"paths":{"/{tenantName}/{instanceName}/invoice/patients/{patientId}/encounters/{encounterId}/invoices":{"get":{"summary":"Get Invoices By Encounter ID","tags":["Invoices"],"operationId":"Get_Invoices_By_Encounter_ID","parameters":[{"$ref":"#/components/parameters/TenantName"},{"$ref":"#/components/parameters/InstanceName"},{"$ref":"#/components/parameters/PatientId"},{"$ref":"#/components/parameters/EncounterId"}],"responses":{"200":{"description":"Paginated list of invoices for this encounter.\n\nSchema confirmed against the backend's outbound client to the invoice-service (`InvoiceServiceApiClientImpl`).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/InvoicePage"}}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"429":{"$ref":"#/components/responses/TooManyRequests"},"500":{"$ref":"#/components/responses/InternalError"}},"description":"Request to get all invoices for a specific encounter"}}}}
```


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://docs.welkinhealth.com/api-reference/invoices.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
