Documentation for `scw billing`
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.
This API allows you to query billing related objects.
- Budget management commands
- Budget alerts management commands
- Budget alert notification management commands
- Consumption management commands
- Discount management commands
- Invoice management commands
Budget management commands
Budget management commands.
Create a new budget.
Create a new budget.
Usage:
Code
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:
Code
Args:
| Name | Description | |
|---|---|---|
| budget-id | Required | The ID of the budget to delete |
Fetch a budget.
Fetch a budget.
Usage:
Code
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:
Code
Args:
| Name | Description | |
|---|---|---|
| organization-id | Filter by organization ID |
Update a budget.
Update a budget.
Usage:
Code
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:
Code
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:
Code
Args:
| Name | Description | |
|---|---|---|
| budget-alert-id | Required | The ID of the budget alert to delete |
Update a budget alert.
Update a budget alert.
Usage:
Code
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:
Code
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:
Code
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:
Code
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:
Code
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:
Code
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:
Code
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_idyou will list the discounts applied to your own Organization and your customers - If you indicate your
organization_idyou will list only the discounts applied to your Organization - If you indicate
the organization_idof one of your customers, you will list the discounts applied to their Organization.
Usage:
Code
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:
Code
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:
Code
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:
Code
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:
Code
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 |