# Documentation for `scw billing`


:::note{title="The CLI documentation pages are currently under construction"}
The content is up to date. We're making improvements to the site over the next few weeks for a better experience.
:::

<!-- DO NOT EDIT: this file is automatically generated using scw-doc-gen -->
This API allows you to query billing related objects.

- [Budget management commands](#budget-management-commands)
  - [Create a new budget.](#create-a-new-budget.)
  - [Delete a budget.](#delete-a-budget.)
  - [Fetch a budget.](#fetch-a-budget.)
  - [List your budgets, filtering by `organization_id`.](#list-your-budgets,-filtering-by-`organization_id`.)
  - [Update a budget.](#update-a-budget.)
- [Budget alerts management commands](#budget-alerts-management-commands)
  - [Create a new budget alert.](#create-a-new-budget-alert.)
  - [Delete a budget alert.](#delete-a-budget-alert.)
  - [Update a budget alert.](#update-a-budget-alert.)
- [Budget alert notification management commands](#budget-alert-notification-management-commands)
  - [Create a new budget alert notification.](#create-a-new-budget-alert-notification.)
  - [Delete a budget alert notification.](#delete-a-budget-alert-notification.)
  - [Update a budget alert notification.](#update-a-budget-alert-notification.)
- [](#)
  - [List charges](#list-charges)
- [Consumption management commands](#consumption-management-commands)
  - [Get monthly consumption](#get-monthly-consumption)
  - [Get monthly consumption taxes](#get-monthly-consumption-taxes)
- [Discount management commands](#discount-management-commands)
  - [List discounts](#list-discounts)
- [Invoice management commands](#invoice-management-commands)
  - [Download an invoice](#download-an-invoice)
  - [Export invoices](#export-invoices)
  - [Get an invoice](#get-an-invoice)
  - [List invoices](#list-invoices)


## Budget management commands

Budget management commands.


### Create a new budget.

Create a new budget.

**Usage:**

```shell
scw billing budget create [arg=value ...]
```


**Args:**

| Name |   | Description |
|------|---|-------------|
| consumption-limit |  | Cost limit for the budget |
| enabled |  | Whether the budget is enabled or not |
| organization-id |  | Organization ID to use. If none is passed the default organization ID will be used |



### Delete a budget.

Delete a budget.

**Usage:**

```shell
scw billing budget delete [arg=value ...]
```


**Args:**

| Name |   | Description |
|------|---|-------------|
| budget-id | Required | The ID of the budget to delete |



### Fetch a budget.

Fetch a budget.

**Usage:**

```shell
scw billing budget get [arg=value ...]
```


**Args:**

| Name |   | Description |
|------|---|-------------|
| budget-id | Required | The ID of the budget |



### List your budgets, filtering by `organization_id`.

List your budgets, filtering by `organization_id`.

**Usage:**

```shell
scw billing budget list [arg=value ...]
```


**Args:**

| Name |   | Description |
|------|---|-------------|
| organization-id |  | Filter by organization ID |



### Update a budget.

Update a budget.

**Usage:**

```shell
scw billing budget update [arg=value ...]
```


**Args:**

| Name |   | Description |
|------|---|-------------|
| budget-id | Required | The ID of the budget to update |
| consumption-limit |  | Cost limit for the budget |
| enabled |  | Whether the budget will be enabled or not |



## Budget alerts management commands

Budget alerts management commands.


### Create a new budget alert.

Create a new budget alert.

**Usage:**

```shell
scw billing budget-alert create [arg=value ...]
```


**Args:**

| Name |   | Description |
|------|---|-------------|
| budget-id |  | The ID of the budget to create alert for |
| threshold |  | Threshold above which the alert is sent |



### Delete a budget alert.

Delete a budget alert.

**Usage:**

```shell
scw billing budget-alert delete [arg=value ...]
```


**Args:**

| Name |   | Description |
|------|---|-------------|
| budget-alert-id | Required | The ID of the budget alert to delete |



### Update a budget alert.

Update a budget alert.

**Usage:**

```shell
scw billing budget-alert update [arg=value ...]
```


**Args:**

| Name |   | Description |
|------|---|-------------|
| budget-alert-id | Required | The ID of the budget alert to update |
| threshold |  | Threshold above which the alert is sent |



## Budget alert notification management commands

Budget alert notification management commands.


### Create a new budget alert notification.

Create a new budget alert notification.

**Usage:**

```shell
scw billing budget-alert-notification create [arg=value ...]
```


**Args:**

| Name |   | Description |
|------|---|-------------|
| budget-alert-id |  | The ID of the budget alert to create notification for |
| sms-phone-numbers.{index} |  | List of phone numbers to receive sms notifications |
| email-addresses.{index} |  | List of email addresses to receive email notifications |
| webhook-urls.{index} |  | List of webhook url to receive webhook notifications |



### Delete a budget alert notification.

Delete a budget alert notification.

**Usage:**

```shell
scw billing budget-alert-notification delete [arg=value ...]
```


**Args:**

| Name |   | Description |
|------|---|-------------|
| budget-alert-notification-id | Required | The ID of the budget alert notification to delete |



### Update a budget alert notification.

Update a budget alert notification.

**Usage:**

```shell
scw billing budget-alert-notification update [arg=value ...]
```


**Args:**

| Name |   | Description |
|------|---|-------------|
| budget-alert-notification-id | Required | The ID of the budget alert notification to update |
| sms-phone-numbers.{index} |  | List of phone numbers to receive sms notifications |
| email-addresses.{index} |  | List of email addresses to receive email notifications |
| webhook-urls.{index} |  | List of webhook url to receive webhook notifications |



## 




### List charges

List charges for organizations or projects. You must specify at least `organization_ids` or `project_ids`.

**Usage:**

```shell
scw billing charge list [arg=value ...]
```


**Args:**

| Name |   | Description |
|------|---|-------------|
| order-by | One of: `start_date_asc`, `start_date_desc` | Sort order of charges in the response |
| page-token |  | Token returned by previous call to list next paginated charges, omitted for first page |
| page-size |  | Number of charges to return per page |
| start-date-after |  | Minimum start date of charges to filter for, defaults to the start of the billing period |
| end-date-before |  | Maximum end date of charges to filter for, defaults to the end of the billing period |
| invoice-ids.{index} |  | Invoice IDs to filter for, only charges from these invoices will be returned |
| project-ids.{index} |  | Project IDs to filter for, only charges for these projects will be returned |
| resource-ids.{index} |  | Resource IDs to filter for, only charges for these resources will be returned |
| resource-names.{index} |  | Resource display names to filter for, only charges for these resources will be returned |
| skus.{index} |  | SKU IDs to filter for, only charges for these SKUs will be returned |
| clamp-to-time-range |  | Clamp charges to the requested time range |
| organization-id |  | Organization ID to use. If none is passed the default organization ID will be used |



## Consumption management commands

Consumption management commands.


### Get monthly consumption

Consumption allows you to retrieve your past or current consumption cost, by project or category.

**Usage:**

```shell
scw billing consumption list [arg=value ...]
```


**Args:**

| Name |   | Description |
|------|---|-------------|
| order-by | One of: `updated_at_desc`, `updated_at_asc`, `category_name_desc`, `category_name_asc` | Order consumptions list in the response by their update date |
| project-id |  | Project ID to use. If none is passed the default project ID will be used |
| category-name |  | Filter by name of a Category as they are shown in the invoice (Compute, Network, Observability) |
| billing-period |  | Filter by the billing period in the YYYY-MM format. If it is empty the current billing period will be used as default |
| organization-id |  | Organization ID to use. If none is passed the default organization ID will be used |



### Get monthly consumption taxes

Consumption Tax allows you to retrieve your past or current tax charges, by project or category.

**Usage:**

```shell
scw billing consumption list-taxes [arg=value ...]
```


**Args:**

| Name |   | Description |
|------|---|-------------|
| order-by | One of: `updated_at_desc`, `updated_at_asc`, `category_name_desc`, `category_name_asc` | Order consumed taxes list in the response by their update date |
| billing-period |  | Filter by the billing period in the YYYY-MM format. If it is empty the current billing period will be used as default |
| organization-id |  | Organization ID to use. If none is passed the default organization ID will be used |



## Discount management commands

Discount management commands.


### List discounts

List all discounts for your Organization and usable categories, products, offers, references, regions and zones where the discount can be applied. As a reseller:
- If you do not specify an `organization_id` you will list the discounts applied to your own Organization and your customers
- If you indicate your `organization_id` you will list only the discounts applied to your Organization
- If you indicate `the organization_id` of one of your customers, you will list the discounts applied to their Organization.

**Usage:**

```shell
scw billing discount list [arg=value ...]
```


**Args:**

| Name |   | Description |
|------|---|-------------|
| order-by | One of: `creation_date_desc`, `creation_date_asc`, `start_date_desc`, `start_date_asc`, `stop_date_desc`, `stop_date_asc` | Order discounts in the response by their description |
| organization-id |  | ID of the organization |



## Invoice management commands

Invoice management commands.


### Download an invoice

Download a specific invoice, specified by its ID.

**Usage:**

```shell
scw billing invoice download <invoice-id ...> [arg=value ...]
```


**Args:**

| Name |   | Description |
|------|---|-------------|
| invoice-id | Required | Invoice ID |
| file-path | Default: `./` | Wanted file path |
| file-type | Default: `pdf` | Wanted file extension |
| force-replace | Default: `false` | Force file replacement |



### Export invoices

Export invoices in a CSV file.

**Usage:**

```shell
scw billing invoice export [arg=value ...]
```


**Args:**

| Name |   | Description |
|------|---|-------------|
| organization-id |  | Organization ID. If specified, only invoices from this Organization will be returned |
| billing-period-start-after |  | Return only invoice with start date greater than billing_period_start |
| billing-period-start-before |  | Return only invoice with start date less than billing_period_start |
| invoice-type |  | Invoice type. It can either be `periodic` or `purchase` |
| file-path | Default: `./` | Wanted file path |
| file-type | Default: `csv` | Wanted file extension |
| force-replace | Default: `false` | Force file replacement |



### Get an invoice

Get a specific invoice, specified by its ID.

**Usage:**

```shell
scw billing invoice get <invoice-id ...> [arg=value ...]
```


**Args:**

| Name |   | Description |
|------|---|-------------|
| invoice-id | Required | Invoice ID |



### List invoices

List all your invoices, filtering by `start_date` and `invoice_type`. Each invoice has its own ID.

**Usage:**

```shell
scw billing invoice list [arg=value ...]
```


**Args:**

| Name |   | Description |
|------|---|-------------|
| billing-period-start-after |  | Return only invoice with start date greater than billing_period_start |
| billing-period-start-before |  | Return only invoice with start date less than billing_period_start |
| invoice-type | One of: `unknown_type`, `periodic`, `purchase` | Invoice type. It can either be `periodic` or `purchase` |
| order-by | One of: `invoice_number_desc`, `invoice_number_asc`, `start_date_desc`, `start_date_asc`, `issued_date_desc`, `issued_date_asc`, `due_date_desc`, `due_date_asc`, `total_untaxed_desc`, `total_untaxed_asc`, `total_taxed_desc`, `total_taxed_asc`, `invoice_type_desc`, `invoice_type_asc` | How invoices are ordered in the response |
| organization-id |  | Organization ID. If specified, only invoices from this Organization will be returned |



