> ## Documentation Index
> Fetch the complete documentation index at: https://docs.hybridbox.io/llms.txt
> Use this file to discover all available pages before exploring further.

# Facturation

> Consulter les résumés de facturation, factures, transactions et opérations de forfait.

# Facturation

Consulter les résumés de facturation, factures, transactions et opérations de forfait.

<script src="/locale-bridge.js" />

Les exemples utilisent le mode code A2A. MCP expose le même mode code via son outil `execute`.

## Fonctions

### `billing.current_plan.get`

```text theme={null}
billing.current_plan.get(account_id: str) -> BillingResult
```

Facturation: `billing.current_plan.get`.

| Propriété            | Valeur                                                      | Propriété                | Valeur         |
| -------------------- | ----------------------------------------------------------- | ------------------------ | -------------- |
| Autorisation requise | `billing.view`                                              | Authentification requise | `oui`          |
| Mode d'exécution     | `sync`                                                      | Capacité                 | `billing.view` |
| Type de ressource    | `account`                                                   | Champ d'ID de ressource  | `account_id`   |
| Route API publique   | `GET /v1/public/accounts/{account_id}/billing/current-plan` |                          |                |

<AccordionGroup>
  <Accordion title="Arguments">
    | Nom          | Type  | Requis |
    | ------------ | ----- | ------ |
    | `account_id` | `str` | oui    |
  </Accordion>

  <Accordion title="Retours">
    | Champ             | Type   | Requis |
    | ----------------- | ------ | ------ |
    | `billing_period`  | `str`  | oui    |
    | `currency`        | `str`  | oui    |
    | `plan_id`         | `str`  | oui    |
    | `plan_name`       | `str`  | oui    |
    | `price`           | `str`  | oui    |
    | `status`          | `str`  | oui    |
    | `can_cancel_plan` | `bool` | non    |
    | `can_change_plan` | `bool` | non    |
  </Accordion>

  <Accordion title="Exemple A2A">
    Requête:

    ```json theme={null}
    {
      "request_id": "example",
      "session_id": "session_123",
      "code": "billing.current_plan.get(account_id=\"3c90c3cc-0d44-4b50-8888-8dd25736052a\")"
    }
    ```

    Réponse:

    ```json theme={null}
    {
      "request_id": "example",
      "status": "completed",
      "result": {
        "last_value": true
      },
      "responses": [
        {
          "index": 0,
          "function": "billing.current_plan.get",
          "status": "completed",
          "result": true
        }
      ],
      "complexity_score": 1
    }
    ```
  </Accordion>

  <Accordion title="Exemple MCP">
    Requête:

    ```json theme={null}
    {
      "jsonrpc": "2.0",
      "id": "example",
      "method": "tools/call",
      "params": {
        "name": "hybridbox_execute",
        "arguments": {
          "code": "billing.current_plan.get(account_id=\"3c90c3cc-0d44-4b50-8888-8dd25736052a\")"
        }
      }
    }
    ```

    Réponse:

    ```json theme={null}
    {
      "jsonrpc": "2.0",
      "id": "example",
      "result": {
        "content": [
          {
            "type": "text",
            "text": "{\n  \"request_id\": \"example\",\n  \"status\": \"completed\",\n  \"result\": {\n    \"last_value\": true\n  },\n  \"responses\": [\n    {\n      \"index\": 0,\n      \"function\": \"billing.current_plan.get\",\n      \"status\": \"completed\",\n      \"result\": true\n    }\n  ],\n  \"complexity_score\": 1\n}"
          }
        ],
        "isError": false
      }
    }
    ```
  </Accordion>
</AccordionGroup>

### `billing.invoices.list`

```text theme={null}
billing.invoices.list(account_id: str, page?: int, page_size?: int) -> Page[BillingResult]
```

Facturation: `billing.invoices.list`.

| Propriété            | Valeur                                                  | Propriété                | Valeur         |
| -------------------- | ------------------------------------------------------- | ------------------------ | -------------- |
| Autorisation requise | `billing.view`                                          | Authentification requise | `oui`          |
| Mode d'exécution     | `sync`                                                  | Capacité                 | `billing.view` |
| Type de ressource    | `account`                                               | Champ d'ID de ressource  | `account_id`   |
| Route API publique   | `GET /v1/public/accounts/{account_id}/billing/invoices` |                          |                |

<AccordionGroup>
  <Accordion title="Arguments">
    | Nom          | Type  | Requis |
    | ------------ | ----- | ------ |
    | `account_id` | `str` | oui    |
    | `page`       | `int` | non    |
    | `page_size`  | `int` | non    |
  </Accordion>

  <Accordion title="Retours">
    | Champ       | Type                                                                                                     | Requis |
    | ----------- | -------------------------------------------------------------------------------------------------------- | ------ |
    | `items`     | `[{"amount": str, "currency": str, "date": str, "download_url": str \| null, "id": str, "status": str}]` | oui    |
    | `page`      | `int`                                                                                                    | oui    |
    | `page_size` | `int`                                                                                                    | oui    |
    | `total`     | `int`                                                                                                    | oui    |
  </Accordion>

  <Accordion title="Exemple A2A">
    Requête:

    ```json theme={null}
    {
      "request_id": "example",
      "session_id": "session_123",
      "code": "billing.invoices.list(account_id=\"3c90c3cc-0d44-4b50-8888-8dd25736052a\", page=123, page_size=123)"
    }
    ```

    Réponse:

    ```json theme={null}
    {
      "request_id": "example",
      "status": "completed",
      "result": {
        "last_value": "<string>"
      },
      "responses": [
        {
          "index": 0,
          "function": "billing.invoices.list",
          "status": "completed",
          "result": "<string>"
        }
      ],
      "complexity_score": 1
    }
    ```
  </Accordion>

  <Accordion title="Exemple MCP">
    Requête:

    ```json theme={null}
    {
      "jsonrpc": "2.0",
      "id": "example",
      "method": "tools/call",
      "params": {
        "name": "hybridbox_execute",
        "arguments": {
          "code": "billing.invoices.list(account_id=\"3c90c3cc-0d44-4b50-8888-8dd25736052a\", page=123, page_size=123)"
        }
      }
    }
    ```

    Réponse:

    ```json theme={null}
    {
      "jsonrpc": "2.0",
      "id": "example",
      "result": {
        "content": [
          {
            "type": "text",
            "text": "{\n  \"request_id\": \"example\",\n  \"status\": \"completed\",\n  \"result\": {\n    \"last_value\": \"<string>\"\n  },\n  \"responses\": [\n    {\n      \"index\": 0,\n      \"function\": \"billing.invoices.list\",\n      \"status\": \"completed\",\n      \"result\": \"<string>\"\n    }\n  ],\n  \"complexity_score\": 1\n}"
          }
        ],
        "isError": false
      }
    }
    ```
  </Accordion>
</AccordionGroup>

### `billing.plan.cancel`

```text theme={null}
billing.plan.cancel(account_id: str, cancel_at_period_end?: bool, cancel_immediately?: bool) -> BillingResult
```

Facturation: `billing.plan.cancel`.

| Propriété            | Valeur                                                      | Propriété                | Valeur           |
| -------------------- | ----------------------------------------------------------- | ------------------------ | ---------------- |
| Autorisation requise | `billing.manage`                                            | Authentification requise | `oui`            |
| Mode d'exécution     | `sync`                                                      | Capacité                 | `billing.manage` |
| Type de ressource    | `account`                                                   | Champ d'ID de ressource  | `account_id`     |
| Route API publique   | `POST /v1/public/accounts/{account_id}/billing/cancel-plan` |                          |                  |

<AccordionGroup>
  <Accordion title="Arguments">
    | Nom                    | Type   | Requis |
    | ---------------------- | ------ | ------ |
    | `account_id`           | `str`  | oui    |
    | `cancel_at_period_end` | `bool` | non    |
    | `cancel_immediately`   | `bool` | non    |
  </Accordion>

  <Accordion title="Retours">
    | Champ              | Type           | Requis |
    | ------------------ | -------------- | ------ |
    | `status`           | `str`          | oui    |
    | `account_status`   | `str \| null`  | non    |
    | `effective_at`     | `str \| null`  | non    |
    | `eligible`         | `bool \| null` | non    |
    | `previous_plan_id` | `str \| null`  | non    |
    | `target_plan_id`   | `str \| null`  | non    |
  </Accordion>

  <Accordion title="Exemple A2A">
    Requête:

    ```json theme={null}
    {
      "request_id": "example",
      "session_id": "session_123",
      "code": "billing.plan.cancel(account_id=\"3c90c3cc-0d44-4b50-8888-8dd25736052a\", cancel_at_period_end=true, cancel_immediately=true)"
    }
    ```

    Réponse:

    ```json theme={null}
    {
      "request_id": "example",
      "status": "completed",
      "result": {
        "last_value": "<string>"
      },
      "responses": [
        {
          "index": 0,
          "function": "billing.plan.cancel",
          "status": "completed",
          "result": "<string>"
        }
      ],
      "complexity_score": 1
    }
    ```
  </Accordion>

  <Accordion title="Exemple MCP">
    Requête:

    ```json theme={null}
    {
      "jsonrpc": "2.0",
      "id": "example",
      "method": "tools/call",
      "params": {
        "name": "hybridbox_execute",
        "arguments": {
          "code": "billing.plan.cancel(account_id=\"3c90c3cc-0d44-4b50-8888-8dd25736052a\", cancel_at_period_end=true, cancel_immediately=true)"
        }
      }
    }
    ```

    Réponse:

    ```json theme={null}
    {
      "jsonrpc": "2.0",
      "id": "example",
      "result": {
        "content": [
          {
            "type": "text",
            "text": "{\n  \"request_id\": \"example\",\n  \"status\": \"completed\",\n  \"result\": {\n    \"last_value\": \"<string>\"\n  },\n  \"responses\": [\n    {\n      \"index\": 0,\n      \"function\": \"billing.plan.cancel\",\n      \"status\": \"completed\",\n      \"result\": \"<string>\"\n    }\n  ],\n  \"complexity_score\": 1\n}"
          }
        ],
        "isError": false
      }
    }
    ```
  </Accordion>
</AccordionGroup>

### `billing.plan.change`

```text theme={null}
billing.plan.change(account_id: str, plan_id: "smtp_per_mailbox" | "smtp_per_proxy", effective_date?: str | null) -> BillingResult
```

Facturation: `billing.plan.change`.

| Propriété            | Valeur                                                      | Propriété                | Valeur           |
| -------------------- | ----------------------------------------------------------- | ------------------------ | ---------------- |
| Autorisation requise | `billing.manage`                                            | Authentification requise | `oui`            |
| Mode d'exécution     | `sync`                                                      | Capacité                 | `billing.manage` |
| Type de ressource    | `account`                                                   | Champ d'ID de ressource  | `account_id`     |
| Route API publique   | `POST /v1/public/accounts/{account_id}/billing/change-plan` |                          |                  |

<AccordionGroup>
  <Accordion title="Arguments">
    | Nom              | Type                                     | Requis |
    | ---------------- | ---------------------------------------- | ------ |
    | `account_id`     | `str`                                    | oui    |
    | `plan_id`        | `"smtp_per_mailbox" \| "smtp_per_proxy"` | oui    |
    | `effective_date` | `str \| null`                            | non    |
  </Accordion>

  <Accordion title="Retours">
    | Champ              | Type           | Requis |
    | ------------------ | -------------- | ------ |
    | `status`           | `str`          | oui    |
    | `account_status`   | `str \| null`  | non    |
    | `effective_at`     | `str \| null`  | non    |
    | `eligible`         | `bool \| null` | non    |
    | `previous_plan_id` | `str \| null`  | non    |
    | `target_plan_id`   | `str \| null`  | non    |
  </Accordion>

  <Accordion title="Exemple A2A">
    Requête:

    ```json theme={null}
    {
      "request_id": "example",
      "session_id": "session_123",
      "code": "billing.plan.change(account_id=\"3c90c3cc-0d44-4b50-8888-8dd25736052a\", plan_id=\"3c90c3cc-0d44-4b50-8888-8dd25736052a\", effective_date=\"<string>\")"
    }
    ```

    Réponse:

    ```json theme={null}
    {
      "request_id": "example",
      "status": "completed",
      "result": {
        "last_value": "<string>"
      },
      "responses": [
        {
          "index": 0,
          "function": "billing.plan.change",
          "status": "completed",
          "result": "<string>"
        }
      ],
      "complexity_score": 1
    }
    ```
  </Accordion>

  <Accordion title="Exemple MCP">
    Requête:

    ```json theme={null}
    {
      "jsonrpc": "2.0",
      "id": "example",
      "method": "tools/call",
      "params": {
        "name": "hybridbox_execute",
        "arguments": {
          "code": "billing.plan.change(account_id=\"3c90c3cc-0d44-4b50-8888-8dd25736052a\", plan_id=\"3c90c3cc-0d44-4b50-8888-8dd25736052a\", effective_date=\"<string>\")"
        }
      }
    }
    ```

    Réponse:

    ```json theme={null}
    {
      "jsonrpc": "2.0",
      "id": "example",
      "result": {
        "content": [
          {
            "type": "text",
            "text": "{\n  \"request_id\": \"example\",\n  \"status\": \"completed\",\n  \"result\": {\n    \"last_value\": \"<string>\"\n  },\n  \"responses\": [\n    {\n      \"index\": 0,\n      \"function\": \"billing.plan.change\",\n      \"status\": \"completed\",\n      \"result\": \"<string>\"\n    }\n  ],\n  \"complexity_score\": 1\n}"
          }
        ],
        "isError": false
      }
    }
    ```
  </Accordion>
</AccordionGroup>

### `billing.transactions.list`

```text theme={null}
billing.transactions.list(account_id: str, page?: int, page_size?: int) -> Page[BillingResult]
```

Facturation: `billing.transactions.list`.

| Propriété            | Valeur                                                      | Propriété                | Valeur         |
| -------------------- | ----------------------------------------------------------- | ------------------------ | -------------- |
| Autorisation requise | `billing.view`                                              | Authentification requise | `oui`          |
| Mode d'exécution     | `sync`                                                      | Capacité                 | `billing.view` |
| Type de ressource    | `account`                                                   | Champ d'ID de ressource  | `account_id`   |
| Route API publique   | `GET /v1/public/accounts/{account_id}/billing/transactions` |                          |                |

<AccordionGroup>
  <Accordion title="Arguments">
    | Nom          | Type  | Requis |
    | ------------ | ----- | ------ |
    | `account_id` | `str` | oui    |
    | `page`       | `int` | non    |
    | `page_size`  | `int` | non    |
  </Accordion>

  <Accordion title="Retours">
    | Champ       | Type                                                                                                                                                                                       | Requis |
    | ----------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------ |
    | `page`      | `int`                                                                                                                                                                                      | oui    |
    | `page_size` | `int`                                                                                                                                                                                      | oui    |
    | `total`     | `int`                                                                                                                                                                                      | oui    |
    | `items`     | `[{"amount": str, "currency": str, "direction": str, "effective_at": str, "status": str, "transaction_id": str, "type": str, "balance_after"?: str \| null, "description"?: str \| null}]` | non    |
  </Accordion>

  <Accordion title="Exemple A2A">
    Requête:

    ```json theme={null}
    {
      "request_id": "example",
      "session_id": "session_123",
      "code": "billing.transactions.list(account_id=\"3c90c3cc-0d44-4b50-8888-8dd25736052a\", page=123, page_size=123)"
    }
    ```

    Réponse:

    ```json theme={null}
    {
      "request_id": "example",
      "status": "completed",
      "result": {
        "last_value": 123
      },
      "responses": [
        {
          "index": 0,
          "function": "billing.transactions.list",
          "status": "completed",
          "result": 123
        }
      ],
      "complexity_score": 1
    }
    ```
  </Accordion>

  <Accordion title="Exemple MCP">
    Requête:

    ```json theme={null}
    {
      "jsonrpc": "2.0",
      "id": "example",
      "method": "tools/call",
      "params": {
        "name": "hybridbox_execute",
        "arguments": {
          "code": "billing.transactions.list(account_id=\"3c90c3cc-0d44-4b50-8888-8dd25736052a\", page=123, page_size=123)"
        }
      }
    }
    ```

    Réponse:

    ```json theme={null}
    {
      "jsonrpc": "2.0",
      "id": "example",
      "result": {
        "content": [
          {
            "type": "text",
            "text": "{\n  \"request_id\": \"example\",\n  \"status\": \"completed\",\n  \"result\": {\n    \"last_value\": 123\n  },\n  \"responses\": [\n    {\n      \"index\": 0,\n      \"function\": \"billing.transactions.list\",\n      \"status\": \"completed\",\n      \"result\": 123\n    }\n  ],\n  \"complexity_score\": 1\n}"
          }
        ],
        "isError": false
      }
    }
    ```
  </Accordion>
</AccordionGroup>

### `billing.wallet_balance.get`

```text theme={null}
billing.wallet_balance.get(account_id: str) -> BillingResult
```

Facturation: `billing.wallet_balance.get`.

| Propriété            | Valeur                                                        | Propriété                | Valeur         |
| -------------------- | ------------------------------------------------------------- | ------------------------ | -------------- |
| Autorisation requise | `billing.view`                                                | Authentification requise | `oui`          |
| Mode d'exécution     | `sync`                                                        | Capacité                 | `billing.view` |
| Type de ressource    | `account`                                                     | Champ d'ID de ressource  | `account_id`   |
| Route API publique   | `GET /v1/public/accounts/{account_id}/billing/wallet-balance` |                          |                |

<AccordionGroup>
  <Accordion title="Arguments">
    | Nom          | Type  | Requis |
    | ------------ | ----- | ------ |
    | `account_id` | `str` | oui    |
  </Accordion>

  <Accordion title="Retours">
    | Champ             | Type  | Requis |
    | ----------------- | ----- | ------ |
    | `accrued_charges` | `str` | oui    |
    | `balance`         | `str` | oui    |
    | `currency`        | `str` | oui    |
    | `net_balance`     | `str` | oui    |
  </Accordion>

  <Accordion title="Exemple A2A">
    Requête:

    ```json theme={null}
    {
      "request_id": "example",
      "session_id": "session_123",
      "code": "billing.wallet_balance.get(account_id=\"3c90c3cc-0d44-4b50-8888-8dd25736052a\")"
    }
    ```

    Réponse:

    ```json theme={null}
    {
      "request_id": "example",
      "status": "completed",
      "result": {
        "last_value": {
          "accrued_charges": "<string>",
          "balance": "<string>",
          "currency": "<string>",
          "net_balance": "<string>"
        }
      },
      "responses": [
        {
          "index": 0,
          "function": "billing.wallet_balance.get",
          "status": "completed",
          "result": {
            "accrued_charges": "<string>",
            "balance": "<string>",
            "currency": "<string>",
            "net_balance": "<string>"
          }
        }
      ],
      "complexity_score": 1
    }
    ```
  </Accordion>

  <Accordion title="Exemple MCP">
    Requête:

    ```json theme={null}
    {
      "jsonrpc": "2.0",
      "id": "example",
      "method": "tools/call",
      "params": {
        "name": "hybridbox_execute",
        "arguments": {
          "code": "billing.wallet_balance.get(account_id=\"3c90c3cc-0d44-4b50-8888-8dd25736052a\")"
        }
      }
    }
    ```

    Réponse:

    ```json theme={null}
    {
      "jsonrpc": "2.0",
      "id": "example",
      "result": {
        "content": [
          {
            "type": "text",
            "text": "{\n  \"request_id\": \"example\",\n  \"status\": \"completed\",\n  \"result\": {\n    \"last_value\": {\n      \"accrued_charges\": \"<string>\",\n      \"balance\": \"<string>\",\n      \"currency\": \"<string>\",\n      \"net_balance\": \"<string>\"\n    }\n  },\n  \"responses\": [\n    {\n      \"index\": 0,\n      \"function\": \"billing.wallet_balance.get\",\n      \"status\": \"completed\",\n      \"result\": {\n        \"accrued_charges\": \"<string>\",\n        \"balance\": \"<string>\",\n        \"currency\": \"<string>\",\n        \"net_balance\": \"<string>\"\n      }\n    }\n  ],\n  \"complexity_score\": 1\n}"
          }
        ],
        "isError": false
      }
    }
    ```
  </Accordion>
</AccordionGroup>
