> For the complete documentation index, see [llms.txt](https://icure.gitbook.io/icure/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://icure.gitbook.io/icure/icure-data-stack/rest-api-calls/invoice.md).

# Invoice

## Gets all invoices for author at date

<mark style="color:green;">`POST`</mark> `https://demo.icure.cloud/rest/v2/invoice/byauthor/{userId}/append/{type}/{sentMediumType}`

#### Path Parameters

| Name                                             | Type   | Description |
| ------------------------------------------------ | ------ | ----------- |
| userId<mark style="color:red;">\*</mark>         | String |             |
| type<mark style="color:red;">\*</mark>           | String |             |
| sentMediumType<mark style="color:red;">\*</mark> | String |             |

#### Query Parameters

| Name                                          | Type    | Description |
| --------------------------------------------- | ------- | ----------- |
| secretFKeys<mark style="color:red;">\*</mark> | String  |             |
| insuranceId                                   | String  |             |
| invoiceId                                     | String  |             |
| gracePeriod                                   | Integer |             |

#### Request Body

| Name                                   | Type | Description |
| -------------------------------------- | ---- | ----------- |
| body<mark style="color:red;">\*</mark> | List |             |

{% tabs %}
{% tab title="200 " %}

{% endtab %}
{% endtabs %}

## Creates an invoice

<mark style="color:green;">`POST`</mark> `https://demo.icure.cloud/rest/v2/invoice`

#### Request Body

| Name                                   | Type    | Description |
| -------------------------------------- | ------- | ----------- |
| body<mark style="color:red;">\*</mark> | Invoice |             |

{% tabs %}
{% tab title="200 " %}

{% endtab %}
{% endtabs %}

## Create a batch of invoices

<mark style="color:green;">`POST`</mark> `https://demo.icure.cloud/rest/v2/invoice/batch`

Returns the created invoices.

#### Request Body

| Name                                   | Type | Description |
| -------------------------------------- | ---- | ----------- |
| body<mark style="color:red;">\*</mark> | List |             |

{% tabs %}
{% tab title="200 " %}

{% endtab %}
{% endtabs %}

## Deletes an invoice

<mark style="color:red;">`DELETE`</mark> `https://demo.icure.cloud/rest/v2/invoice/{invoiceId}`

#### Path Parameters

| Name                                        | Type   | Description |
| ------------------------------------------- | ------ | ----------- |
| invoiceId<mark style="color:red;">\*</mark> | String |             |

{% tabs %}
{% tab title="200 " %}

{% endtab %}
{% endtabs %}

## Filter invoices for the current user (HcParty)

<mark style="color:green;">`POST`</mark> `https://demo.icure.cloud/rest/v2/invoice/filter`

Returns a list of invoices along with next start keys and Document ID. If the nextStartKey is Null it means that this is the last page.

#### Request Body

| Name                                   | Type               | Description |
| -------------------------------------- | ------------------ | ----------- |
| body<mark style="color:red;">\*</mark> | FilterChainInvoice |             |

{% tabs %}
{% tab title="200 " %}

{% endtab %}
{% endtabs %}

## Gets all invoices for author at date

<mark style="color:blue;">`GET`</mark> `https://demo.icure.cloud/rest/v2/invoice/byauthor/{hcPartyId}`

#### Path Parameters

| Name                                        | Type   | Description |
| ------------------------------------------- | ------ | ----------- |
| hcPartyId<mark style="color:red;">\*</mark> | String |             |

#### Query Parameters

| Name            | Type    | Description                                                                                                                                |
| --------------- | ------- | ------------------------------------------------------------------------------------------------------------------------------------------ |
| fromDate        | Long    |                                                                                                                                            |
| toDate          | Long    |                                                                                                                                            |
| startKey        | String  | The start key for pagination: a JSON representation of an array containing all the necessary components to form the Complex Key's startKey |
| startDocumentId | String  | A patient document ID                                                                                                                      |
| limit           | Integer | Number of rows                                                                                                                             |

{% tabs %}
{% tab title="200 " %}

{% endtab %}
{% endtabs %}

## Gets an invoice

<mark style="color:blue;">`GET`</mark> `https://demo.icure.cloud/rest/v2/invoice/{invoiceId}`

#### Path Parameters

| Name                                        | Type   | Description |
| ------------------------------------------- | ------ | ----------- |
| invoiceId<mark style="color:red;">\*</mark> | String |             |

{% tabs %}
{% tab title="200 " %}

{% endtab %}
{% endtabs %}

## Gets an invoice

<mark style="color:green;">`POST`</mark> `https://demo.icure.cloud/rest/v2/invoice/byIds`

#### Request Body

| Name                                   | Type      | Description |
| -------------------------------------- | --------- | ----------- |
| body<mark style="color:red;">\*</mark> | ListOfIds |             |

{% tabs %}
{% tab title="200 " %}

{% endtab %}
{% endtabs %}

## Get the list of all used tarifications frequencies in invoices

<mark style="color:blue;">`GET`</mark> `https://demo.icure.cloud/rest/v2/invoice/codes/{minOccurences}`

#### Path Parameters

| Name                                            | Type | Description |
| ----------------------------------------------- | ---- | ----------- |
| minOccurences<mark style="color:red;">\*</mark> | Long |             |

{% tabs %}
{% tab title="200 " %}

{% endtab %}
{% endtabs %}

## Gets all invoices per status

<mark style="color:green;">`POST`</mark> `https://demo.icure.cloud/rest/v2/invoice/allHcpsByStatus/{status}`

#### Path Parameters

| Name                                     | Type   | Description |
| ---------------------------------------- | ------ | ----------- |
| status<mark style="color:red;">\*</mark> | String |             |

#### Query Parameters

| Name | Type | Description |
| ---- | ---- | ----------- |
| from | Long |             |
| to   | Long |             |

#### Request Body

| Name                                   | Type      | Description |
| -------------------------------------- | --------- | ----------- |
| body<mark style="color:red;">\*</mark> | ListOfIds |             |

{% tabs %}
{% tab title="200 " %}

{% endtab %}
{% endtabs %}

## Gets all invoices for author at date

<mark style="color:green;">`POST`</mark> `https://demo.icure.cloud/rest/v2/invoice/byContacts`

#### Request Body

| Name                                   | Type      | Description |
| -------------------------------------- | --------- | ----------- |
| body<mark style="color:red;">\*</mark> | ListOfIds |             |

{% tabs %}
{% tab title="200 " %}

{% endtab %}
{% endtabs %}

## List invoices found By Healthcare Party and secret foreign patient keys.

<mark style="color:blue;">`GET`</mark> `https://demo.icure.cloud/rest/v2/invoice/byHcPartySecretForeignKeys`

Keys have to delimited by coma

#### Query Parameters

| Name                                          | Type   | Description |
| --------------------------------------------- | ------ | ----------- |
| hcPartyId<mark style="color:red;">\*</mark>   | String |             |
| secretFKeys<mark style="color:red;">\*</mark> | String |             |

{% tabs %}
{% tab title="200 " %}

{% endtab %}
{% endtabs %}

## List invoices by groupId

<mark style="color:blue;">`GET`</mark> `https://demo.icure.cloud/rest/v2/invoice/byHcPartyGroupId/{hcPartyId}/{groupId}`

Keys have to delimited by coma

#### Path Parameters

| Name                                        | Type   | Description |
| ------------------------------------------- | ------ | ----------- |
| hcPartyId<mark style="color:red;">\*</mark> | String |             |
| groupId<mark style="color:red;">\*</mark>   | String |             |

{% tabs %}
{% tab title="200 " %}

{% endtab %}
{% endtabs %}

## List invoices by type, sent or unsent

<mark style="color:blue;">`GET`</mark> `https://demo.icure.cloud/rest/v2/invoice/byHcParty/{hcPartyId}/mediumType/{sentMediumType}/invoiceType/{invoiceType}/sent/{sent}`

Keys have to delimited by coma

#### Path Parameters

| Name                                             | Type    | Description |
| ------------------------------------------------ | ------- | ----------- |
| hcPartyId<mark style="color:red;">\*</mark>      | String  |             |
| sentMediumType<mark style="color:red;">\*</mark> | String  |             |
| invoiceType<mark style="color:red;">\*</mark>    | String  |             |
| sent<mark style="color:red;">\*</mark>           | Boolean |             |

#### Query Parameters

| Name | Type | Description |
| ---- | ---- | ----------- |
| from | Long |             |
| to   | Long |             |

{% tabs %}
{% tab title="200 " %}

{% endtab %}
{% endtabs %}

## Get all invoices by author, by sending mode, by status and by date

<mark style="color:blue;">`GET`</mark> `https://demo.icure.cloud/rest/v2/invoice/byHcpartySendingModeStatusDate/{hcPartyId}`

#### Path Parameters

| Name                                        | Type   | Description |
| ------------------------------------------- | ------ | ----------- |
| hcPartyId<mark style="color:red;">\*</mark> | String |             |

#### Query Parameters

| Name        | Type   | Description |
| ----------- | ------ | ----------- |
| sendingMode | String |             |
| status      | String |             |
| from        | Long   |             |
| to          | Long   |             |

{% tabs %}
{% tab title="200 " %}

{% endtab %}
{% endtabs %}

## Gets all invoices for author at date

<mark style="color:blue;">`GET`</mark> `https://demo.icure.cloud/rest/v2/invoice/byIds/{invoiceIds}`

#### Path Parameters

| Name                                         | Type   | Description |
| -------------------------------------------- | ------ | ----------- |
| invoiceIds<mark style="color:red;">\*</mark> | String |             |

{% tabs %}
{% tab title="200 " %}

{% endtab %}
{% endtabs %}

## Gets all invoices for author at date

<mark style="color:blue;">`GET`</mark> `https://demo.icure.cloud/rest/v2/invoice/to/{recipientIds}`

#### Path Parameters

| Name                                           | Type   | Description |
| ---------------------------------------------- | ------ | ----------- |
| recipientIds<mark style="color:red;">\*</mark> | String |             |

{% tabs %}
{% tab title="200 " %}

{% endtab %}
{% endtabs %}

## Gets all invoices for author at date

<mark style="color:blue;">`GET`</mark> `https://demo.icure.cloud/rest/v2/invoice/byServiceIds/{serviceIds}`

#### Path Parameters

| Name                                         | Type   | Description |
| -------------------------------------------- | ------ | ----------- |
| serviceIds<mark style="color:red;">\*</mark> | String |             |

{% tabs %}
{% tab title="200 " %}

{% endtab %}
{% endtabs %}

## List helement stubs found By Healthcare Party and secret foreign keys.

<mark style="color:blue;">`GET`</mark> `https://demo.icure.cloud/rest/v2/invoice/byHcPartySecretForeignKeys/delegations`

Keys must be delimited by coma

#### Query Parameters

| Name                                          | Type   | Description |
| --------------------------------------------- | ------ | ----------- |
| hcPartyId<mark style="color:red;">\*</mark>   | String |             |
| secretFKeys<mark style="color:red;">\*</mark> | String |             |

{% tabs %}
{% tab title="200 " %}

{% endtab %}
{% endtabs %}

## Gets all invoices for author at date

<mark style="color:blue;">`GET`</mark> `https://demo.icure.cloud/rest/v2/invoice/toInsurances`

#### Query Parameters

| Name    | Type   | Description |
| ------- | ------ | ----------- |
| userIds | String |             |

{% tabs %}
{% tab title="200 " %}

{% endtab %}
{% endtabs %}

## Gets all invoices for author at date

<mark style="color:blue;">`GET`</mark> `https://demo.icure.cloud/rest/v2/invoice/toInsurances/unsent`

#### Query Parameters

| Name    | Type   | Description |
| ------- | ------ | ----------- |
| userIds | String |             |

{% tabs %}
{% tab title="200 " %}

{% endtab %}
{% endtabs %}

## Gets all invoices for author at date

<mark style="color:blue;">`GET`</mark> `https://demo.icure.cloud/rest/v2/invoice/toPatients`

#### Query Parameters

| Name      | Type   | Description |
| --------- | ------ | ----------- |
| hcPartyId | String |             |

{% tabs %}
{% tab title="200 " %}

{% endtab %}
{% endtabs %}

## Gets all invoices for author at date

<mark style="color:blue;">`GET`</mark> `https://demo.icure.cloud/rest/v2/invoice/toPatients/unsent`

#### Query Parameters

| Name      | Type   | Description |
| --------- | ------ | ----------- |
| hcPartyId | String |             |

{% tabs %}
{% tab title="200 " %}

{% endtab %}
{% endtabs %}

## Gets all invoices for author at date

<mark style="color:green;">`POST`</mark> `https://demo.icure.cloud/rest/v2/invoice/mergeTo/{invoiceId}`

#### Path Parameters

| Name                                        | Type   | Description |
| ------------------------------------------- | ------ | ----------- |
| invoiceId<mark style="color:red;">\*</mark> | String |             |

#### Request Body

| Name                                   | Type      | Description |
| -------------------------------------- | --------- | ----------- |
| body<mark style="color:red;">\*</mark> | ListOfIds |             |

{% tabs %}
{% tab title="200 " %}

{% endtab %}
{% endtabs %}

## Modifies an invoice

<mark style="color:orange;">`PUT`</mark> `https://demo.icure.cloud/rest/v2/invoice`

#### Request Body

| Name                                   | Type    | Description |
| -------------------------------------- | ------- | ----------- |
| body<mark style="color:red;">\*</mark> | Invoice |             |

{% tabs %}
{% tab title="200 " %}

{% endtab %}
{% endtabs %}

## Modify a batch of invoices

<mark style="color:orange;">`PUT`</mark> `https://demo.icure.cloud/rest/v2/invoice/batch`

Returns the modified invoices.

#### Request Body

| Name                                   | Type | Description |
| -------------------------------------- | ---- | ----------- |
| body<mark style="color:red;">\*</mark> | List |             |

{% tabs %}
{% tab title="200 " %}

{% endtab %}
{% endtabs %}

## Adds a delegation to a invoice

<mark style="color:orange;">`PUT`</mark> `https://demo.icure.cloud/rest/v2/invoice/{invoiceId}/delegate`

#### Path Parameters

| Name                                        | Type   | Description |
| ------------------------------------------- | ------ | ----------- |
| invoiceId<mark style="color:red;">\*</mark> | String |             |

#### Request Body

| Name                                   | Type | Description |
| -------------------------------------- | ---- | ----------- |
| body<mark style="color:red;">\*</mark> | List |             |

{% tabs %}
{% tab title="200 " %}

{% endtab %}
{% endtabs %}

## Modifies an invoice

<mark style="color:green;">`POST`</mark> `https://demo.icure.cloud/rest/v2/invoice/reassign`

#### Request Body

| Name                                   | Type    | Description |
| -------------------------------------- | ------- | ----------- |
| body<mark style="color:red;">\*</mark> | Invoice |             |

{% tabs %}
{% tab title="200 " %}

{% endtab %}
{% endtabs %}

## Remove an invoice of an user

<mark style="color:green;">`POST`</mark> `https://demo.icure.cloud/rest/v2/invoice/byauthor/{userId}/service/{serviceId}`

#### Path Parameters

| Name                                        | Type   | Description |
| ------------------------------------------- | ------ | ----------- |
| userId<mark style="color:red;">\*</mark>    | String |             |
| serviceId<mark style="color:red;">\*</mark> | String |             |

#### Query Parameters

| Name                                          | Type   | Description |
| --------------------------------------------- | ------ | ----------- |
| secretFKeys<mark style="color:red;">\*</mark> | String |             |

#### Request Body

| Name                                   | Type | Description |
| -------------------------------------- | ---- | ----------- |
| body<mark style="color:red;">\*</mark> | List |             |

{% tabs %}
{% tab title="200 " %}

{% endtab %}
{% endtabs %}

## Update delegations in healthElements.

<mark style="color:green;">`POST`</mark> `https://demo.icure.cloud/rest/v2/invoice/delegations`

Keys must be delimited by coma

#### Request Body

| Name                                   | Type | Description |
| -------------------------------------- | ---- | ----------- |
| body<mark style="color:red;">\*</mark> | List |             |

{% tabs %}
{% tab title="200 " %}

{% endtab %}
{% endtabs %}

## Gets all invoices for author at date

<mark style="color:green;">`POST`</mark> `https://demo.icure.cloud/rest/v2/invoice/validate/{invoiceId}`

#### Path Parameters

| Name                                        | Type   | Description |
| ------------------------------------------- | ------ | ----------- |
| invoiceId<mark style="color:red;">\*</mark> | String |             |

#### Query Parameters

| Name                                          | Type   | Description |
| --------------------------------------------- | ------ | ----------- |
| scheme<mark style="color:red;">\*</mark>      | String |             |
| forcedValue<mark style="color:red;">\*</mark> | String |             |

{% tabs %}
{% tab title="200 " %}

{% endtab %}
{% endtabs %}
