> For the complete documentation index, see [llms.txt](https://docs.enclaive.cloud/enclaive-multi-cloud-platform/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.enclaive.cloud/enclaive-multi-cloud-platform/developers/api/client-api/billing/invoice.md).

# Invoice

The "Invoice" section allows clients to access their invoice history, providing details on all past invoices. Additionally, users can retrieve information about their latest invoice, facilitating easy tracking of financial transactions and ensuring transparency in billing.

## Get last invoice

<mark style="color:blue;">`GET`</mark> `{{BASE_URL}}/api/teams/{id}/last-invoice`

Get information about your last bill.

#### Path Parameters

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

#### Headers

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

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

```json
{
    "_id": "65490130ff600e06af2a9694",
    "invoiceId": "in_1O9UOhA0ZUrt0vQJoum7M20X",
    "user": "6548a41138406c14db33b606",
    "status": "paid",
    "amount": 3300,
    "invoicePdf": "https://pay.stripe.com/invoice/acct_1NOaelA0ZUrt0vQJ/test_YWNjdF8xTk9hZWxBMFpVcnQwdlFKLF9PeFBENUF5elR4cDU3bU5ycVVreUVuVVd3dm5hTmhnLDg5ODI0MDY202009yaqn40z/pdf?s=ap",
    "createdAt": "2023-11-06T15:07:28.550Z",
    "updatedAt": "2023-11-06T15:07:46.295Z"
}
```

{% endtab %}
{% endtabs %}

## Get billing history

<mark style="color:blue;">`GET`</mark> `{{BASE_URL}}/api/teams/{id}/billing-history`

Get all invoices for a specific team.

#### Path Parameters

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

#### Query Parameters

| Name | Type   | Description |
| ---- | ------ | ----------- |
| page | String | page number |

#### Headers

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

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

```json
{
    "docs": [
        {
            "_id": "65490130ff600e06af2a9694",
            "status": "paid",
            "amount": 3300,
            "invoicePdf": "https://pay.stripe.com/invoice/acct_1NOaelA0ZUrt0vQJ/test_YWNjdF8xTk9hZWxBMFpVcnQwdlFKLF9PeFBENUF5elR4cDU3bU5ycVVreUVuVVd3dm5hTmhnLDg5ODI0MDY202009yaqn40z/pdf?s=ap"
        }
    ],
    "totalDocs": 1,
    "limit": 10,
    "totalPages": 1,
    "page": 1,
    "pagingCounter": 1,
    "hasPrevPage": false,
    "hasNextPage": false,
    "prevPage": null,
    "nextPage": null
}
```

{% endtab %}
{% endtabs %}


---

# 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.enclaive.cloud/enclaive-multi-cloud-platform/developers/api/client-api/billing/invoice.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.
