> ## 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.

# الفوترة

> مراجعة ملخصات الفوترة والفواتير والمعاملات وعمليات الخطط.

# الفوترة

مراجعة ملخصات الفوترة والفواتير والمعاملات وعمليات الخطط.

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

تستخدم الأمثلة وضع الكود في A2A. يتيح MCP وضع الكود نفسه عبر أداة `execute`.

## الوظائف

### `billing.current_plan.get`

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

الفوترة: `billing.current_plan.get`.

| الخاصية        | القيمة                                                      | الخاصية         | القيمة         |
| -------------- | ----------------------------------------------------------- | --------------- | -------------- |
| الإذن المطلوب  | `billing.view`                                              | المصادقة مطلوبة | `نعم`          |
| وضع التنفيذ    | `sync`                                                      | الصلاحية        | `billing.view` |
| نوع المورد     | `account`                                                   | حقل معرف المورد | `account_id`   |
| مسار API العام | `GET /v1/public/accounts/{account_id}/billing/current-plan` |                 |                |

<AccordionGroup>
  <Accordion title="الوسيطات">
    | الاسم        | النوع | مطلوب |
    | ------------ | ----- | ----- |
    | `account_id` | `str` | نعم   |
  </Accordion>

  <Accordion title="القيم المرجعة">
    | الحقل             | النوع  | مطلوب |
    | ----------------- | ------ | ----- |
    | `billing_period`  | `str`  | نعم   |
    | `currency`        | `str`  | نعم   |
    | `plan_id`         | `str`  | نعم   |
    | `plan_name`       | `str`  | نعم   |
    | `price`           | `str`  | نعم   |
    | `status`          | `str`  | نعم   |
    | `can_cancel_plan` | `bool` | لا    |
    | `can_change_plan` | `bool` | لا    |
  </Accordion>

  <Accordion title="مثال A2A">
    الطلب:

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

    الاستجابة:

    ```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="مثال MCP">
    الطلب:

    ```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\")"
        }
      }
    }
    ```

    الاستجابة:

    ```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]
```

الفوترة: `billing.invoices.list`.

| الخاصية        | القيمة                                                  | الخاصية         | القيمة         |
| -------------- | ------------------------------------------------------- | --------------- | -------------- |
| الإذن المطلوب  | `billing.view`                                          | المصادقة مطلوبة | `نعم`          |
| وضع التنفيذ    | `sync`                                                  | الصلاحية        | `billing.view` |
| نوع المورد     | `account`                                               | حقل معرف المورد | `account_id`   |
| مسار API العام | `GET /v1/public/accounts/{account_id}/billing/invoices` |                 |                |

<AccordionGroup>
  <Accordion title="الوسيطات">
    | الاسم        | النوع | مطلوب |
    | ------------ | ----- | ----- |
    | `account_id` | `str` | نعم   |
    | `page`       | `int` | لا    |
    | `page_size`  | `int` | لا    |
  </Accordion>

  <Accordion title="القيم المرجعة">
    | الحقل       | النوع                                                                                                    | مطلوب |
    | ----------- | -------------------------------------------------------------------------------------------------------- | ----- |
    | `items`     | `[{"amount": str, "currency": str, "date": str, "download_url": str \| null, "id": str, "status": str}]` | نعم   |
    | `page`      | `int`                                                                                                    | نعم   |
    | `page_size` | `int`                                                                                                    | نعم   |
    | `total`     | `int`                                                                                                    | نعم   |
  </Accordion>

  <Accordion title="مثال A2A">
    الطلب:

    ```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)"
    }
    ```

    الاستجابة:

    ```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="مثال MCP">
    الطلب:

    ```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)"
        }
      }
    }
    ```

    الاستجابة:

    ```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
```

الفوترة: `billing.plan.cancel`.

| الخاصية        | القيمة                                                      | الخاصية         | القيمة           |
| -------------- | ----------------------------------------------------------- | --------------- | ---------------- |
| الإذن المطلوب  | `billing.manage`                                            | المصادقة مطلوبة | `نعم`            |
| وضع التنفيذ    | `sync`                                                      | الصلاحية        | `billing.manage` |
| نوع المورد     | `account`                                                   | حقل معرف المورد | `account_id`     |
| مسار API العام | `POST /v1/public/accounts/{account_id}/billing/cancel-plan` |                 |                  |

<AccordionGroup>
  <Accordion title="الوسيطات">
    | الاسم                  | النوع  | مطلوب |
    | ---------------------- | ------ | ----- |
    | `account_id`           | `str`  | نعم   |
    | `cancel_at_period_end` | `bool` | لا    |
    | `cancel_immediately`   | `bool` | لا    |
  </Accordion>

  <Accordion title="القيم المرجعة">
    | الحقل              | النوع          | مطلوب |
    | ------------------ | -------------- | ----- |
    | `status`           | `str`          | نعم   |
    | `account_status`   | `str \| null`  | لا    |
    | `effective_at`     | `str \| null`  | لا    |
    | `eligible`         | `bool \| null` | لا    |
    | `previous_plan_id` | `str \| null`  | لا    |
    | `target_plan_id`   | `str \| null`  | لا    |
  </Accordion>

  <Accordion title="مثال A2A">
    الطلب:

    ```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)"
    }
    ```

    الاستجابة:

    ```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="مثال MCP">
    الطلب:

    ```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)"
        }
      }
    }
    ```

    الاستجابة:

    ```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
```

الفوترة: `billing.plan.change`.

| الخاصية        | القيمة                                                      | الخاصية         | القيمة           |
| -------------- | ----------------------------------------------------------- | --------------- | ---------------- |
| الإذن المطلوب  | `billing.manage`                                            | المصادقة مطلوبة | `نعم`            |
| وضع التنفيذ    | `sync`                                                      | الصلاحية        | `billing.manage` |
| نوع المورد     | `account`                                                   | حقل معرف المورد | `account_id`     |
| مسار API العام | `POST /v1/public/accounts/{account_id}/billing/change-plan` |                 |                  |

<AccordionGroup>
  <Accordion title="الوسيطات">
    | الاسم            | النوع                                    | مطلوب |
    | ---------------- | ---------------------------------------- | ----- |
    | `account_id`     | `str`                                    | نعم   |
    | `plan_id`        | `"smtp_per_mailbox" \| "smtp_per_proxy"` | نعم   |
    | `effective_date` | `str \| null`                            | لا    |
  </Accordion>

  <Accordion title="القيم المرجعة">
    | الحقل              | النوع          | مطلوب |
    | ------------------ | -------------- | ----- |
    | `status`           | `str`          | نعم   |
    | `account_status`   | `str \| null`  | لا    |
    | `effective_at`     | `str \| null`  | لا    |
    | `eligible`         | `bool \| null` | لا    |
    | `previous_plan_id` | `str \| null`  | لا    |
    | `target_plan_id`   | `str \| null`  | لا    |
  </Accordion>

  <Accordion title="مثال A2A">
    الطلب:

    ```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>\")"
    }
    ```

    الاستجابة:

    ```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="مثال MCP">
    الطلب:

    ```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>\")"
        }
      }
    }
    ```

    الاستجابة:

    ```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]
```

الفوترة: `billing.transactions.list`.

| الخاصية        | القيمة                                                      | الخاصية         | القيمة         |
| -------------- | ----------------------------------------------------------- | --------------- | -------------- |
| الإذن المطلوب  | `billing.view`                                              | المصادقة مطلوبة | `نعم`          |
| وضع التنفيذ    | `sync`                                                      | الصلاحية        | `billing.view` |
| نوع المورد     | `account`                                                   | حقل معرف المورد | `account_id`   |
| مسار API العام | `GET /v1/public/accounts/{account_id}/billing/transactions` |                 |                |

<AccordionGroup>
  <Accordion title="الوسيطات">
    | الاسم        | النوع | مطلوب |
    | ------------ | ----- | ----- |
    | `account_id` | `str` | نعم   |
    | `page`       | `int` | لا    |
    | `page_size`  | `int` | لا    |
  </Accordion>

  <Accordion title="القيم المرجعة">
    | الحقل       | النوع                                                                                                                                                                                      | مطلوب |
    | ----------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ----- |
    | `page`      | `int`                                                                                                                                                                                      | نعم   |
    | `page_size` | `int`                                                                                                                                                                                      | نعم   |
    | `total`     | `int`                                                                                                                                                                                      | نعم   |
    | `items`     | `[{"amount": str, "currency": str, "direction": str, "effective_at": str, "status": str, "transaction_id": str, "type": str, "balance_after"?: str \| null, "description"?: str \| null}]` | لا    |
  </Accordion>

  <Accordion title="مثال A2A">
    الطلب:

    ```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)"
    }
    ```

    الاستجابة:

    ```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="مثال MCP">
    الطلب:

    ```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)"
        }
      }
    }
    ```

    الاستجابة:

    ```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
```

الفوترة: `billing.wallet_balance.get`.

| الخاصية        | القيمة                                                        | الخاصية         | القيمة         |
| -------------- | ------------------------------------------------------------- | --------------- | -------------- |
| الإذن المطلوب  | `billing.view`                                                | المصادقة مطلوبة | `نعم`          |
| وضع التنفيذ    | `sync`                                                        | الصلاحية        | `billing.view` |
| نوع المورد     | `account`                                                     | حقل معرف المورد | `account_id`   |
| مسار API العام | `GET /v1/public/accounts/{account_id}/billing/wallet-balance` |                 |                |

<AccordionGroup>
  <Accordion title="الوسيطات">
    | الاسم        | النوع | مطلوب |
    | ------------ | ----- | ----- |
    | `account_id` | `str` | نعم   |
  </Accordion>

  <Accordion title="القيم المرجعة">
    | الحقل             | النوع | مطلوب |
    | ----------------- | ----- | ----- |
    | `accrued_charges` | `str` | نعم   |
    | `balance`         | `str` | نعم   |
    | `currency`        | `str` | نعم   |
    | `net_balance`     | `str` | نعم   |
  </Accordion>

  <Accordion title="مثال A2A">
    الطلب:

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

    الاستجابة:

    ```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="مثال MCP">
    الطلب:

    ```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\")"
        }
      }
    }
    ```

    الاستجابة:

    ```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>
