# Billing

## Describe Billing

<mark style="color:green;">`GET`</mark> /v1/organizations/billing/describe?action=getorganization

\<Description of the endpoint>

**Headers**

| Name          | Value              |
| ------------- | ------------------ |
| Content-Type  | `application/json` |
| Authorization | `Bearer <token>`   |

**Body**

| Name    | Type   | Description         |
| ------- | ------ | ------------------- |
| org\_id | string | The Organization ID |

**Response**

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

```json
{
  "status": 200,
  "response": {
    "organization": {
      "resources": number,
      "name"; "string",
      "id": "string",
      "owner": "string"
    }
    "subscription": {
      "payment_exp": "string";
      "plan": "string";
      "quantity": "string";
    }
  }
}
```

{% endtab %}
{% endtabs %}

## Billing History

<mark style="color:green;">`GET`</mark> /v1/organizations/billing/history

\<Description of the endpoint>

**Headers**

| Name          | Value              |
| ------------- | ------------------ |
| Content-Type  | `application/json` |
| Authorization | `Bearer <token>`   |

**QueryString**

| Name                 | Type   | Description         |
| -------------------- | ------ | ------------------- |
| action=list\_billing | string | Name of the user    |
| org\_id              | string | The Organization ID |

**Response**

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

```json
{
  "status": 200,
  "billing_history": [
    {
      "status": "paid | unpaid",
      "id": "string",
      "organization": "string",
      "date": "string",
      "due_date": "string",
      "amount": "string"
      
    }
  ]
}
```

{% endtab %}
{% endtabs %}

## Create subscription

<mark style="color:green;">`POST`</mark> /v1/organizations/billing/update?action=getpaymentlink

\<Description of the endpoint>

**Headers**

| Name          | Value              |
| ------------- | ------------------ |
| Content-Type  | `application/json` |
| Authorization | `Bearer <token>`   |

**Query String**

| Name     | Type   | Description                         |
| -------- | ------ | ----------------------------------- |
| org\_id  | string | The ID of the Organization          |
| quantity | number | Number of Instances for subscribing |

**Response**

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

```json
{
  "status": 200,
  "response": "string" (the payment Link)
}
```

{% endtab %}
{% endtabs %}

## Change payment method

<mark style="color:green;">`POST`</mark> /v1/organizations/billing/update?action=getupdatecardlink

\<Description of the endpoint>

**Headers**

| Name          | Value              |
| ------------- | ------------------ |
| Content-Type  | `application/json` |
| Authorization | `Bearer <token>`   |

**Payload**

| Name    | Type   | Description         |
| ------- | ------ | ------------------- |
| org\_id | string | The Organization ID |

**Response**

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

```json
{
  "status": 200,
  "response": "string" (the Link for the Update Payment operation)
}
```

{% endtab %}
{% endtabs %}

## Update Subscription

<mark style="color:green;">`POST`</mark> /v1/organizations/billing/update?action=updatesubscription

\<Description of the endpoint>

**Headers**

| Name          | Value              |
| ------------- | ------------------ |
| Content-Type  | `application/json` |
| Authorization | `Bearer <token>`   |

**Payload**

| Name     | Type   | Description                                  |
| -------- | ------ | -------------------------------------------- |
| org\_id  | string | The ID of the Organization                   |
| quantity | number | The number of instances for the Subscription |

**Response**

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

```json
{
  "status": 200
}
```

{% endtab %}
{% endtabs %}

## Cancel Subscription

<mark style="color:green;">`POST`</mark> /v1/organizations/billing/update?action=cancelsubscription

\<Description of the endpoint>

**Headers**

| Name          | Value              |
| ------------- | ------------------ |
| Content-Type  | `application/json` |
| Authorization | `Bearer <token>`   |

**Body**

| Name     | Type   | Description                |
| -------- | ------ | -------------------------- |
| `org_id` | string | The ID of the Organization |

**Response**

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

```json
{
  "status": 200,
}
```

{% endtab %}
{% endtabs %}


---

# Agent Instructions: 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:

```
GET https://docs.cloudplans.io/api-reference/billing.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
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.
