scaleway.billing.v2beta1 package

Submodules

scaleway.billing.v2beta1.api module

class scaleway.billing.v2beta1.api.BillingV2Beta1API(client: Client, *, bypass_validation: bool = False)

Bases: API

This API allows you to manage and query your Scaleway billing and consumption.

download_invoice(*, invoice_id: str, file_type: Optional[DownloadInvoiceRequestFileType] = None) ScwFile

Download an invoice. Download a specific invoice, specified by its ID. :param invoice_id: Invoice ID. :param file_type: File type. PDF by default. :return: ScwFile

Usage:

result = api.download_invoice(
    invoice_id="example",
)
export_invoices(*, organization_id: Optional[str] = None, billing_period_start_after: Optional[datetime] = None, billing_period_start_before: Optional[datetime] = None, invoice_type: Optional[InvoiceType] = None, page: Optional[int] = None, page_size: Optional[int] = None, order_by: Optional[ExportInvoicesRequestOrderBy] = None, file_type: Optional[ExportInvoicesRequestFileType] = None) ScwFile

Export invoices. Export invoices in a CSV file. :param organization_id: Organization ID. If specified, only invoices from this Organization will be returned. :param billing_period_start_after: Return only invoice with start date greater than billing_period_start. :param billing_period_start_before: Return only invoice with start date less than billing_period_start. :param invoice_type: Invoice type. It can either be periodic or purchase. :param page: Page number. :param page_size: Positive integer lower or equal to 100 to select the number of items to return. :param order_by: How invoices are ordered in the response. :param file_type: File format for exporting the invoice list. :return: ScwFile

Usage:

result = api.export_invoices()
get_invoice(*, invoice_id: str) Invoice

Get an invoice. Get a specific invoice, specified by its ID. :param invoice_id: Invoice ID. :return: Invoice

Usage:

result = api.get_invoice(
    invoice_id="example",
)
list_consumptions(*, order_by: Optional[ListConsumptionsRequestOrderBy] = None, page: Optional[int] = None, page_size: Optional[int] = None, organization_id: Optional[str] = None, project_id: Optional[str] = None, category_name: Optional[str] = None, billing_period: Optional[str] = None) ListConsumptionsResponse

Get monthly consumption. Consumption allows you to retrieve your past or current consumption cost, by project or category. :param order_by: Order consumptions list in the response by their update date. :param page: Positive integer to choose the page to return. :param page_size: Positive integer lower or equal to 100 to select the number of items to return. :param organization_id: Filter by Organization ID. One-Of (‘project_identifier’): at most one of ‘organization_id’, ‘project_id’ could be set. :param project_id: Filter by Project ID. One-Of (‘project_identifier’): at most one of ‘organization_id’, ‘project_id’ could be set. :param category_name: Filter by name of a Category as they are shown in the invoice (Compute, Network, Observability). :param 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. :return: ListConsumptionsResponse

Usage:

result = api.list_consumptions()
list_consumptions_all(*, order_by: Optional[ListConsumptionsRequestOrderBy] = None, page: Optional[int] = None, page_size: Optional[int] = None, organization_id: Optional[str] = None, project_id: Optional[str] = None, category_name: Optional[str] = None, billing_period: Optional[str] = None) List[ListConsumptionsResponseConsumption]

Get monthly consumption. Consumption allows you to retrieve your past or current consumption cost, by project or category. :param order_by: Order consumptions list in the response by their update date. :param page: Positive integer to choose the page to return. :param page_size: Positive integer lower or equal to 100 to select the number of items to return. :param organization_id: Filter by Organization ID. One-Of (‘project_identifier’): at most one of ‘organization_id’, ‘project_id’ could be set. :param project_id: Filter by Project ID. One-Of (‘project_identifier’): at most one of ‘organization_id’, ‘project_id’ could be set. :param category_name: Filter by name of a Category as they are shown in the invoice (Compute, Network, Observability). :param 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. :return: List[ListConsumptionsResponseConsumption]

Usage:

result = api.list_consumptions_all()
list_discounts(*, order_by: Optional[ListDiscountsRequestOrderBy] = None, page: Optional[int] = None, page_size: Optional[int] = None, organization_id: Optional[str] = None) ListDiscountsResponse

List discounts. List all discounts for your organization and usable categories, products, offers, references, regions and zones where the discount can be applied. :param order_by: Order discounts in the response by their description. :param page: Positive integer to choose the page to return. :param page_size: Positive integer lower or equal to 100 to select the number of items to return. :param organization_id: ID of the organization. :return: ListDiscountsResponse

Usage:

result = api.list_discounts()
list_discounts_all(*, order_by: Optional[ListDiscountsRequestOrderBy] = None, page: Optional[int] = None, page_size: Optional[int] = None, organization_id: Optional[str] = None) List[Discount]

List discounts. List all discounts for your organization and usable categories, products, offers, references, regions and zones where the discount can be applied. :param order_by: Order discounts in the response by their description. :param page: Positive integer to choose the page to return. :param page_size: Positive integer lower or equal to 100 to select the number of items to return. :param organization_id: ID of the organization. :return: List[Discount]

Usage:

result = api.list_discounts_all()
list_invoices(*, organization_id: Optional[str] = None, billing_period_start_after: Optional[datetime] = None, billing_period_start_before: Optional[datetime] = None, invoice_type: Optional[InvoiceType] = None, page: Optional[int] = None, page_size: Optional[int] = None, order_by: Optional[ListInvoicesRequestOrderBy] = None) ListInvoicesResponse

List invoices. List all your invoices, filtering by start_date and invoice_type. Each invoice has its own ID. :param organization_id: Organization ID. If specified, only invoices from this Organization will be returned. :param billing_period_start_after: Return only invoice with start date greater than billing_period_start. :param billing_period_start_before: Return only invoice with start date less than billing_period_start. :param invoice_type: Invoice type. It can either be periodic or purchase. :param page: Page number. :param page_size: Positive integer lower or equal to 100 to select the number of items to return. :param order_by: How invoices are ordered in the response. :return: ListInvoicesResponse

Usage:

result = api.list_invoices()
list_invoices_all(*, organization_id: Optional[str] = None, billing_period_start_after: Optional[datetime] = None, billing_period_start_before: Optional[datetime] = None, invoice_type: Optional[InvoiceType] = None, page: Optional[int] = None, page_size: Optional[int] = None, order_by: Optional[ListInvoicesRequestOrderBy] = None) List[Invoice]

List invoices. List all your invoices, filtering by start_date and invoice_type. Each invoice has its own ID. :param organization_id: Organization ID. If specified, only invoices from this Organization will be returned. :param billing_period_start_after: Return only invoice with start date greater than billing_period_start. :param billing_period_start_before: Return only invoice with start date less than billing_period_start. :param invoice_type: Invoice type. It can either be periodic or purchase. :param page: Page number. :param page_size: Positive integer lower or equal to 100 to select the number of items to return. :param order_by: How invoices are ordered in the response. :return: List[Invoice]

Usage:

result = api.list_invoices_all()
list_taxes(*, order_by: Optional[ListTaxesRequestOrderBy] = None, page: Optional[int] = None, page_size: Optional[int] = None, organization_id: Optional[str] = None, billing_period: Optional[str] = None) ListTaxesResponse

Get monthly consumption taxes. Consumption Tax allows you to retrieve your past or current tax charges, by project or category. :param order_by: Order consumed taxes list in the response by their update date. :param page: Page number. :param page_size: Positive integer lower or equal to 100 to select the number of items to return. :param organization_id: Filter by Organization ID. :param 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. :return: ListTaxesResponse

Usage:

result = api.list_taxes()
list_taxes_all(*, order_by: Optional[ListTaxesRequestOrderBy] = None, page: Optional[int] = None, page_size: Optional[int] = None, organization_id: Optional[str] = None, billing_period: Optional[str] = None) List[ListTaxesResponseTax]

Get monthly consumption taxes. Consumption Tax allows you to retrieve your past or current tax charges, by project or category. :param order_by: Order consumed taxes list in the response by their update date. :param page: Page number. :param page_size: Positive integer lower or equal to 100 to select the number of items to return. :param organization_id: Filter by Organization ID. :param 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. :return: List[ListTaxesResponseTax]

Usage:

result = api.list_taxes_all()

scaleway.billing.v2beta1.marshalling module

scaleway.billing.v2beta1.marshalling.unmarshal_Discount(data: Any) Discount
scaleway.billing.v2beta1.marshalling.unmarshal_DiscountCoupon(data: Any) DiscountCoupon
scaleway.billing.v2beta1.marshalling.unmarshal_DiscountFilter(data: Any) DiscountFilter
scaleway.billing.v2beta1.marshalling.unmarshal_Invoice(data: Any) Invoice
scaleway.billing.v2beta1.marshalling.unmarshal_ListConsumptionsResponse(data: Any) ListConsumptionsResponse
scaleway.billing.v2beta1.marshalling.unmarshal_ListConsumptionsResponseConsumption(data: Any) ListConsumptionsResponseConsumption
scaleway.billing.v2beta1.marshalling.unmarshal_ListDiscountsResponse(data: Any) ListDiscountsResponse
scaleway.billing.v2beta1.marshalling.unmarshal_ListInvoicesResponse(data: Any) ListInvoicesResponse
scaleway.billing.v2beta1.marshalling.unmarshal_ListTaxesResponse(data: Any) ListTaxesResponse
scaleway.billing.v2beta1.marshalling.unmarshal_ListTaxesResponseTax(data: Any) ListTaxesResponseTax

scaleway.billing.v2beta1.types module

class scaleway.billing.v2beta1.types.Discount(id: 'str', organization_id: 'str', description: 'str', value: 'float', value_used: 'float', value_remaining: 'float', mode: 'DiscountDiscountMode', filters: 'List[DiscountFilter]', creation_date: 'Optional[datetime]', start_date: 'Optional[datetime]', stop_date: 'Optional[datetime]', coupon: 'Optional[DiscountCoupon]')

Bases: object

coupon: Optional[DiscountCoupon]

The description of the coupon.

creation_date: Optional[datetime]

The creation date of the discount.

description: str

The description of the discount.

filters: List[DiscountFilter]

List of the discount scopes.

id: str

The ID of the discount.

mode: DiscountDiscountMode

The mode of the discount.

organization_id: str

The organization ID of the discount.

start_date: Optional[datetime]

The start date of the discount.

stop_date: Optional[datetime]

The stop date of the discount.

value: float

The initial value of the discount.

value_remaining: float

The remaining value of the discount.

value_used: float

The value indicating how much of the discount has been used.

class scaleway.billing.v2beta1.types.DiscountCoupon(description: 'Optional[str]')

Bases: object

description: Optional[str]

The description of the coupon.

class scaleway.billing.v2beta1.types.DiscountDiscountMode(value: str, names: Optional[Any] = None, *args: Any, **kwargs: Any)

Bases: str, Enum

An enumeration.

DISCOUNT_MODE_RATE = 'discount_mode_rate'
DISCOUNT_MODE_SPLITTABLE = 'discount_mode_splittable'
DISCOUNT_MODE_VALUE = 'discount_mode_value'
UNKNOWN_DISCOUNT_MODE = 'unknown_discount_mode'
class scaleway.billing.v2beta1.types.DiscountFilter(type_: 'DiscountFilterType', value: 'str', exclude: 'bool')

Bases: object

exclude: bool

Boolean to describe if filter is an excluding filter.

type_: DiscountFilterType

Type of the filter (category name, product name, product range, resource name, region or zone).

value: str

Value of filter.

class scaleway.billing.v2beta1.types.DiscountFilterType(value: str, names: Optional[Any] = None, *args: Any, **kwargs: Any)

Bases: str, Enum

An enumeration.

CATEGORY_NAME = 'category_name'
PRODUCT_NAME = 'product_name'
PRODUCT_RANGE = 'product_range'
REGION = 'region'
RESOURCE_NAME = 'resource_name'
UNKNOWN_TYPE = 'unknown_type'
ZONE = 'zone'
class scaleway.billing.v2beta1.types.DownloadInvoiceRequest(invoice_id: 'str', file_type: 'Optional[DownloadInvoiceRequestFileType]')

Bases: object

file_type: Optional[DownloadInvoiceRequestFileType]

File type. PDF by default.

invoice_id: str

Invoice ID.

class scaleway.billing.v2beta1.types.DownloadInvoiceRequestFileType(value: str, names: Optional[Any] = None, *args: Any, **kwargs: Any)

Bases: str, Enum

An enumeration.

PDF = 'pdf'
class scaleway.billing.v2beta1.types.ExportInvoicesRequest(organization_id: 'Optional[str]', billing_period_start_after: 'Optional[datetime]', billing_period_start_before: 'Optional[datetime]', invoice_type: 'Optional[InvoiceType]', page: 'Optional[int]', page_size: 'Optional[int]', order_by: 'Optional[ExportInvoicesRequestOrderBy]', file_type: 'Optional[ExportInvoicesRequestFileType]')

Bases: object

billing_period_start_after: Optional[datetime]

Return only invoice with start date greater than billing_period_start.

billing_period_start_before: Optional[datetime]

Return only invoice with start date less than billing_period_start.

file_type: Optional[ExportInvoicesRequestFileType]

File format for exporting the invoice list.

invoice_type: Optional[InvoiceType]

Invoice type. It can either be periodic or purchase.

order_by: Optional[ExportInvoicesRequestOrderBy]

How invoices are ordered in the response.

organization_id: Optional[str]

Organization ID. If specified, only invoices from this Organization will be returned.

page: Optional[int]

Page number.

page_size: Optional[int]

Positive integer lower or equal to 100 to select the number of items to return.

class scaleway.billing.v2beta1.types.ExportInvoicesRequestFileType(value: str, names: Optional[Any] = None, *args: Any, **kwargs: Any)

Bases: str, Enum

An enumeration.

CSV = 'csv'
class scaleway.billing.v2beta1.types.ExportInvoicesRequestOrderBy(value: str, names: Optional[Any] = None, *args: Any, **kwargs: Any)

Bases: str, Enum

An enumeration.

DUE_DATE_ASC = 'due_date_asc'
DUE_DATE_DESC = 'due_date_desc'
INVOICE_NUMBER_ASC = 'invoice_number_asc'
INVOICE_NUMBER_DESC = 'invoice_number_desc'
INVOICE_TYPE_ASC = 'invoice_type_asc'
INVOICE_TYPE_DESC = 'invoice_type_desc'
ISSUED_DATE_ASC = 'issued_date_asc'
ISSUED_DATE_DESC = 'issued_date_desc'
START_DATE_ASC = 'start_date_asc'
START_DATE_DESC = 'start_date_desc'
TOTAL_TAXED_ASC = 'total_taxed_asc'
TOTAL_TAXED_DESC = 'total_taxed_desc'
TOTAL_UNTAXED_ASC = 'total_untaxed_asc'
TOTAL_UNTAXED_DESC = 'total_untaxed_desc'
class scaleway.billing.v2beta1.types.GetInvoiceRequest(invoice_id: 'str')

Bases: object

invoice_id: str

Invoice ID.

class scaleway.billing.v2beta1.types.Invoice(id: 'str', organization_id: 'str', organization_name: 'str', start_date: 'Optional[datetime]', stop_date: 'Optional[datetime]', billing_period: 'Optional[datetime]', issued_date: 'Optional[datetime]', due_date: 'Optional[datetime]', type_: 'InvoiceType', state: 'str', number: 'int', seller_name: 'str', total_untaxed: 'Optional[Money]', total_taxed: 'Optional[Money]', total_tax: 'Optional[Money]', total_discount: 'Optional[Money]', total_undiscount: 'Optional[Money]')

Bases: object

billing_period: Optional[datetime]

The billing period of the invoice in the YYYY-MM format.

due_date: Optional[datetime]

Payment time limit, set according to the Organization’s payment conditions.

id: str

Invoice ID.

issued_date: Optional[datetime]

Date when the invoice was sent to the customer.

number: int

Invoice number.

organization_id: str
organization_name: str
seller_name: str

The name of the seller (Scaleway).

start_date: Optional[datetime]

Start date of the billing period.

state: str

The state of the Invoice.

stop_date: Optional[datetime]
total_discount: Optional[Money]

The total discount amount of the invoice.

total_tax: Optional[Money]

The total tax amount of the invoice.

total_taxed: Optional[Money]

Total amount, taxed.

total_undiscount: Optional[Money]

The total amount of the invoice before applying the discount.

total_untaxed: Optional[Money]

Total amount, untaxed.

type_: InvoiceType

Type of invoice, either periodic or purchase.

class scaleway.billing.v2beta1.types.InvoiceType(value: str, names: Optional[Any] = None, *args: Any, **kwargs: Any)

Bases: str, Enum

An enumeration.

PERIODIC = 'periodic'
PURCHASE = 'purchase'
UNKNOWN_TYPE = 'unknown_type'
class scaleway.billing.v2beta1.types.ListConsumptionsRequest(order_by: 'Optional[ListConsumptionsRequestOrderBy]', page: 'Optional[int]', page_size: 'Optional[int]', category_name: 'Optional[str]', billing_period: 'Optional[str]', organization_id: 'Optional[str]', project_id: 'Optional[str]')

Bases: object

billing_period: Optional[str]

Filter by the billing period in the YYYY-MM format. If it is empty the current billing period will be used as default.

category_name: Optional[str]

Filter by name of a Category as they are shown in the invoice (Compute, Network, Observability).

order_by: Optional[ListConsumptionsRequestOrderBy]

Order consumptions list in the response by their update date.

organization_id: Optional[str]
page: Optional[int]

Positive integer to choose the page to return.

page_size: Optional[int]

Positive integer lower or equal to 100 to select the number of items to return.

project_id: Optional[str]
class scaleway.billing.v2beta1.types.ListConsumptionsRequestOrderBy(value: str, names: Optional[Any] = None, *args: Any, **kwargs: Any)

Bases: str, Enum

An enumeration.

CATEGORY_NAME_ASC = 'category_name_asc'
CATEGORY_NAME_DESC = 'category_name_desc'
UPDATED_AT_ASC = 'updated_at_asc'
UPDATED_AT_DESC = 'updated_at_desc'
class scaleway.billing.v2beta1.types.ListConsumptionsResponse(consumptions: 'List[ListConsumptionsResponseConsumption]', total_count: 'int', total_discount_untaxed_value: 'float', updated_at: 'Optional[datetime]')

Bases: object

consumptions: List[ListConsumptionsResponseConsumption]

Detailed consumption list.

total_count: int

Total number of returned items.

total_discount_untaxed_value: float

Sum of all discounts, displayed only when no category or project ID filter is applied.

updated_at: Optional[datetime]

Last consumption update date.

class scaleway.billing.v2beta1.types.ListConsumptionsResponseConsumption(product_name: 'str', resource_name: 'str', sku: 'str', project_id: 'str', category_name: 'str', unit: 'str', billed_quantity: 'str', value: 'Optional[Money]')

Bases: object

billed_quantity: str

Consumed quantity.

category_name: str

Name of consumption category.

product_name: str

The product name. For example, “VPC Public Gateway S”, “VPC Public Gateway M” for the VPC product.

project_id: str

Project ID of the consumption.

resource_name: str

Identifies the reference based on the category.

sku: str

Unique identifier of the product.

unit: str

Unit of consumed quantity.

value: Optional[Money]

Monetary value of the consumption.

class scaleway.billing.v2beta1.types.ListDiscountsRequest(order_by: 'Optional[ListDiscountsRequestOrderBy]', page: 'Optional[int]', page_size: 'Optional[int]', organization_id: 'Optional[str]')

Bases: object

order_by: Optional[ListDiscountsRequestOrderBy]

Order discounts in the response by their description.

organization_id: Optional[str]

ID of the organization.

page: Optional[int]

Positive integer to choose the page to return.

page_size: Optional[int]

Positive integer lower or equal to 100 to select the number of items to return.

class scaleway.billing.v2beta1.types.ListDiscountsRequestOrderBy(value: str, names: Optional[Any] = None, *args: Any, **kwargs: Any)

Bases: str, Enum

An enumeration.

CREATION_DATE_ASC = 'creation_date_asc'
CREATION_DATE_DESC = 'creation_date_desc'
START_DATE_ASC = 'start_date_asc'
START_DATE_DESC = 'start_date_desc'
STOP_DATE_ASC = 'stop_date_asc'
STOP_DATE_DESC = 'stop_date_desc'
class scaleway.billing.v2beta1.types.ListDiscountsResponse(total_count: 'int', discounts: 'List[Discount]')

Bases: object

discounts: List[Discount]

Paginated returned discounts.

total_count: int

Total number of discounts.

class scaleway.billing.v2beta1.types.ListInvoicesRequest(organization_id: 'Optional[str]', billing_period_start_after: 'Optional[datetime]', billing_period_start_before: 'Optional[datetime]', invoice_type: 'Optional[InvoiceType]', page: 'Optional[int]', page_size: 'Optional[int]', order_by: 'Optional[ListInvoicesRequestOrderBy]')

Bases: object

billing_period_start_after: Optional[datetime]

Return only invoice with start date greater than billing_period_start.

billing_period_start_before: Optional[datetime]

Return only invoice with start date less than billing_period_start.

invoice_type: Optional[InvoiceType]

Invoice type. It can either be periodic or purchase.

order_by: Optional[ListInvoicesRequestOrderBy]

How invoices are ordered in the response.

organization_id: Optional[str]

Organization ID. If specified, only invoices from this Organization will be returned.

page: Optional[int]

Page number.

page_size: Optional[int]

Positive integer lower or equal to 100 to select the number of items to return.

class scaleway.billing.v2beta1.types.ListInvoicesRequestOrderBy(value: str, names: Optional[Any] = None, *args: Any, **kwargs: Any)

Bases: str, Enum

An enumeration.

DUE_DATE_ASC = 'due_date_asc'
DUE_DATE_DESC = 'due_date_desc'
INVOICE_NUMBER_ASC = 'invoice_number_asc'
INVOICE_NUMBER_DESC = 'invoice_number_desc'
INVOICE_TYPE_ASC = 'invoice_type_asc'
INVOICE_TYPE_DESC = 'invoice_type_desc'
ISSUED_DATE_ASC = 'issued_date_asc'
ISSUED_DATE_DESC = 'issued_date_desc'
START_DATE_ASC = 'start_date_asc'
START_DATE_DESC = 'start_date_desc'
TOTAL_TAXED_ASC = 'total_taxed_asc'
TOTAL_TAXED_DESC = 'total_taxed_desc'
TOTAL_UNTAXED_ASC = 'total_untaxed_asc'
TOTAL_UNTAXED_DESC = 'total_untaxed_desc'
class scaleway.billing.v2beta1.types.ListInvoicesResponse(total_count: 'int', invoices: 'List[Invoice]')

Bases: object

invoices: List[Invoice]

Paginated returned invoices.

total_count: int

Total number of invoices.

class scaleway.billing.v2beta1.types.ListTaxesRequest(order_by: 'Optional[ListTaxesRequestOrderBy]', page: 'Optional[int]', page_size: 'Optional[int]', organization_id: 'Optional[str]', billing_period: 'Optional[str]')

Bases: object

billing_period: Optional[str]

Filter by the billing period in the YYYY-MM format. If it is empty the current billing period will be used as default.

order_by: Optional[ListTaxesRequestOrderBy]

Order consumed taxes list in the response by their update date.

organization_id: Optional[str]

Filter by Organization ID.

page: Optional[int]

Page number.

page_size: Optional[int]

Positive integer lower or equal to 100 to select the number of items to return.

class scaleway.billing.v2beta1.types.ListTaxesRequestOrderBy(value: str, names: Optional[Any] = None, *args: Any, **kwargs: Any)

Bases: str, Enum

An enumeration.

CATEGORY_NAME_ASC = 'category_name_asc'
CATEGORY_NAME_DESC = 'category_name_desc'
UPDATED_AT_ASC = 'updated_at_asc'
UPDATED_AT_DESC = 'updated_at_desc'
class scaleway.billing.v2beta1.types.ListTaxesResponse(taxes: 'List[ListTaxesResponseTax]', total_count: 'int', updated_at: 'Optional[datetime]')

Bases: object

taxes: List[ListTaxesResponseTax]

Detailed consumption tax.

total_count: int

Total number of returned items.

updated_at: Optional[datetime]

Last consumption update date.

class scaleway.billing.v2beta1.types.ListTaxesResponseTax(description: 'str', currency: 'str', rate: 'Optional[float]', total_tax_value: 'Optional[float]')

Bases: object

currency: str

The three-letter currency code.

description: str

Description of the tax applied.

rate: Optional[float]

Applied tax rate (0.2 means a VAT of 20%).

total_tax_value: Optional[float]

The total tax value of the consumption.

Module contents

class scaleway.billing.v2beta1.BillingV2Beta1API(client: Client, *, bypass_validation: bool = False)

Bases: API

This API allows you to manage and query your Scaleway billing and consumption.

download_invoice(*, invoice_id: str, file_type: Optional[DownloadInvoiceRequestFileType] = None) ScwFile

Download an invoice. Download a specific invoice, specified by its ID. :param invoice_id: Invoice ID. :param file_type: File type. PDF by default. :return: ScwFile

Usage:

result = api.download_invoice(
    invoice_id="example",
)
export_invoices(*, organization_id: Optional[str] = None, billing_period_start_after: Optional[datetime] = None, billing_period_start_before: Optional[datetime] = None, invoice_type: Optional[InvoiceType] = None, page: Optional[int] = None, page_size: Optional[int] = None, order_by: Optional[ExportInvoicesRequestOrderBy] = None, file_type: Optional[ExportInvoicesRequestFileType] = None) ScwFile

Export invoices. Export invoices in a CSV file. :param organization_id: Organization ID. If specified, only invoices from this Organization will be returned. :param billing_period_start_after: Return only invoice with start date greater than billing_period_start. :param billing_period_start_before: Return only invoice with start date less than billing_period_start. :param invoice_type: Invoice type. It can either be periodic or purchase. :param page: Page number. :param page_size: Positive integer lower or equal to 100 to select the number of items to return. :param order_by: How invoices are ordered in the response. :param file_type: File format for exporting the invoice list. :return: ScwFile

Usage:

result = api.export_invoices()
get_invoice(*, invoice_id: str) Invoice

Get an invoice. Get a specific invoice, specified by its ID. :param invoice_id: Invoice ID. :return: Invoice

Usage:

result = api.get_invoice(
    invoice_id="example",
)
list_consumptions(*, order_by: Optional[ListConsumptionsRequestOrderBy] = None, page: Optional[int] = None, page_size: Optional[int] = None, organization_id: Optional[str] = None, project_id: Optional[str] = None, category_name: Optional[str] = None, billing_period: Optional[str] = None) ListConsumptionsResponse

Get monthly consumption. Consumption allows you to retrieve your past or current consumption cost, by project or category. :param order_by: Order consumptions list in the response by their update date. :param page: Positive integer to choose the page to return. :param page_size: Positive integer lower or equal to 100 to select the number of items to return. :param organization_id: Filter by Organization ID. One-Of (‘project_identifier’): at most one of ‘organization_id’, ‘project_id’ could be set. :param project_id: Filter by Project ID. One-Of (‘project_identifier’): at most one of ‘organization_id’, ‘project_id’ could be set. :param category_name: Filter by name of a Category as they are shown in the invoice (Compute, Network, Observability). :param 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. :return: ListConsumptionsResponse

Usage:

result = api.list_consumptions()
list_consumptions_all(*, order_by: Optional[ListConsumptionsRequestOrderBy] = None, page: Optional[int] = None, page_size: Optional[int] = None, organization_id: Optional[str] = None, project_id: Optional[str] = None, category_name: Optional[str] = None, billing_period: Optional[str] = None) List[ListConsumptionsResponseConsumption]

Get monthly consumption. Consumption allows you to retrieve your past or current consumption cost, by project or category. :param order_by: Order consumptions list in the response by their update date. :param page: Positive integer to choose the page to return. :param page_size: Positive integer lower or equal to 100 to select the number of items to return. :param organization_id: Filter by Organization ID. One-Of (‘project_identifier’): at most one of ‘organization_id’, ‘project_id’ could be set. :param project_id: Filter by Project ID. One-Of (‘project_identifier’): at most one of ‘organization_id’, ‘project_id’ could be set. :param category_name: Filter by name of a Category as they are shown in the invoice (Compute, Network, Observability). :param 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. :return: List[ListConsumptionsResponseConsumption]

Usage:

result = api.list_consumptions_all()
list_discounts(*, order_by: Optional[ListDiscountsRequestOrderBy] = None, page: Optional[int] = None, page_size: Optional[int] = None, organization_id: Optional[str] = None) ListDiscountsResponse

List discounts. List all discounts for your organization and usable categories, products, offers, references, regions and zones where the discount can be applied. :param order_by: Order discounts in the response by their description. :param page: Positive integer to choose the page to return. :param page_size: Positive integer lower or equal to 100 to select the number of items to return. :param organization_id: ID of the organization. :return: ListDiscountsResponse

Usage:

result = api.list_discounts()
list_discounts_all(*, order_by: Optional[ListDiscountsRequestOrderBy] = None, page: Optional[int] = None, page_size: Optional[int] = None, organization_id: Optional[str] = None) List[Discount]

List discounts. List all discounts for your organization and usable categories, products, offers, references, regions and zones where the discount can be applied. :param order_by: Order discounts in the response by their description. :param page: Positive integer to choose the page to return. :param page_size: Positive integer lower or equal to 100 to select the number of items to return. :param organization_id: ID of the organization. :return: List[Discount]

Usage:

result = api.list_discounts_all()
list_invoices(*, organization_id: Optional[str] = None, billing_period_start_after: Optional[datetime] = None, billing_period_start_before: Optional[datetime] = None, invoice_type: Optional[InvoiceType] = None, page: Optional[int] = None, page_size: Optional[int] = None, order_by: Optional[ListInvoicesRequestOrderBy] = None) ListInvoicesResponse

List invoices. List all your invoices, filtering by start_date and invoice_type. Each invoice has its own ID. :param organization_id: Organization ID. If specified, only invoices from this Organization will be returned. :param billing_period_start_after: Return only invoice with start date greater than billing_period_start. :param billing_period_start_before: Return only invoice with start date less than billing_period_start. :param invoice_type: Invoice type. It can either be periodic or purchase. :param page: Page number. :param page_size: Positive integer lower or equal to 100 to select the number of items to return. :param order_by: How invoices are ordered in the response. :return: ListInvoicesResponse

Usage:

result = api.list_invoices()
list_invoices_all(*, organization_id: Optional[str] = None, billing_period_start_after: Optional[datetime] = None, billing_period_start_before: Optional[datetime] = None, invoice_type: Optional[InvoiceType] = None, page: Optional[int] = None, page_size: Optional[int] = None, order_by: Optional[ListInvoicesRequestOrderBy] = None) List[Invoice]

List invoices. List all your invoices, filtering by start_date and invoice_type. Each invoice has its own ID. :param organization_id: Organization ID. If specified, only invoices from this Organization will be returned. :param billing_period_start_after: Return only invoice with start date greater than billing_period_start. :param billing_period_start_before: Return only invoice with start date less than billing_period_start. :param invoice_type: Invoice type. It can either be periodic or purchase. :param page: Page number. :param page_size: Positive integer lower or equal to 100 to select the number of items to return. :param order_by: How invoices are ordered in the response. :return: List[Invoice]

Usage:

result = api.list_invoices_all()
list_taxes(*, order_by: Optional[ListTaxesRequestOrderBy] = None, page: Optional[int] = None, page_size: Optional[int] = None, organization_id: Optional[str] = None, billing_period: Optional[str] = None) ListTaxesResponse

Get monthly consumption taxes. Consumption Tax allows you to retrieve your past or current tax charges, by project or category. :param order_by: Order consumed taxes list in the response by their update date. :param page: Page number. :param page_size: Positive integer lower or equal to 100 to select the number of items to return. :param organization_id: Filter by Organization ID. :param 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. :return: ListTaxesResponse

Usage:

result = api.list_taxes()
list_taxes_all(*, order_by: Optional[ListTaxesRequestOrderBy] = None, page: Optional[int] = None, page_size: Optional[int] = None, organization_id: Optional[str] = None, billing_period: Optional[str] = None) List[ListTaxesResponseTax]

Get monthly consumption taxes. Consumption Tax allows you to retrieve your past or current tax charges, by project or category. :param order_by: Order consumed taxes list in the response by their update date. :param page: Page number. :param page_size: Positive integer lower or equal to 100 to select the number of items to return. :param organization_id: Filter by Organization ID. :param 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. :return: List[ListTaxesResponseTax]

Usage:

result = api.list_taxes_all()
class scaleway.billing.v2beta1.Discount(id: 'str', organization_id: 'str', description: 'str', value: 'float', value_used: 'float', value_remaining: 'float', mode: 'DiscountDiscountMode', filters: 'List[DiscountFilter]', creation_date: 'Optional[datetime]', start_date: 'Optional[datetime]', stop_date: 'Optional[datetime]', coupon: 'Optional[DiscountCoupon]')

Bases: object

coupon: Optional[DiscountCoupon]

The description of the coupon.

creation_date: Optional[datetime]

The creation date of the discount.

description: str

The description of the discount.

filters: List[DiscountFilter]

List of the discount scopes.

id: str

The ID of the discount.

mode: DiscountDiscountMode

The mode of the discount.

organization_id: str

The organization ID of the discount.

start_date: Optional[datetime]

The start date of the discount.

stop_date: Optional[datetime]

The stop date of the discount.

value: float

The initial value of the discount.

value_remaining: float

The remaining value of the discount.

value_used: float

The value indicating how much of the discount has been used.

class scaleway.billing.v2beta1.DiscountCoupon(description: 'Optional[str]')

Bases: object

description: Optional[str]

The description of the coupon.

class scaleway.billing.v2beta1.DiscountDiscountMode(value: str, names: Optional[Any] = None, *args: Any, **kwargs: Any)

Bases: str, Enum

An enumeration.

DISCOUNT_MODE_RATE = 'discount_mode_rate'
DISCOUNT_MODE_SPLITTABLE = 'discount_mode_splittable'
DISCOUNT_MODE_VALUE = 'discount_mode_value'
UNKNOWN_DISCOUNT_MODE = 'unknown_discount_mode'
class scaleway.billing.v2beta1.DiscountFilter(type_: 'DiscountFilterType', value: 'str', exclude: 'bool')

Bases: object

exclude: bool

Boolean to describe if filter is an excluding filter.

type_: DiscountFilterType

Type of the filter (category name, product name, product range, resource name, region or zone).

value: str

Value of filter.

class scaleway.billing.v2beta1.DiscountFilterType(value: str, names: Optional[Any] = None, *args: Any, **kwargs: Any)

Bases: str, Enum

An enumeration.

CATEGORY_NAME = 'category_name'
PRODUCT_NAME = 'product_name'
PRODUCT_RANGE = 'product_range'
REGION = 'region'
RESOURCE_NAME = 'resource_name'
UNKNOWN_TYPE = 'unknown_type'
ZONE = 'zone'
class scaleway.billing.v2beta1.DownloadInvoiceRequest(invoice_id: 'str', file_type: 'Optional[DownloadInvoiceRequestFileType]')

Bases: object

file_type: Optional[DownloadInvoiceRequestFileType]

File type. PDF by default.

invoice_id: str

Invoice ID.

class scaleway.billing.v2beta1.DownloadInvoiceRequestFileType(value: str, names: Optional[Any] = None, *args: Any, **kwargs: Any)

Bases: str, Enum

An enumeration.

PDF = 'pdf'
class scaleway.billing.v2beta1.ExportInvoicesRequest(organization_id: 'Optional[str]', billing_period_start_after: 'Optional[datetime]', billing_period_start_before: 'Optional[datetime]', invoice_type: 'Optional[InvoiceType]', page: 'Optional[int]', page_size: 'Optional[int]', order_by: 'Optional[ExportInvoicesRequestOrderBy]', file_type: 'Optional[ExportInvoicesRequestFileType]')

Bases: object

billing_period_start_after: Optional[datetime]

Return only invoice with start date greater than billing_period_start.

billing_period_start_before: Optional[datetime]

Return only invoice with start date less than billing_period_start.

file_type: Optional[ExportInvoicesRequestFileType]

File format for exporting the invoice list.

invoice_type: Optional[InvoiceType]

Invoice type. It can either be periodic or purchase.

order_by: Optional[ExportInvoicesRequestOrderBy]

How invoices are ordered in the response.

organization_id: Optional[str]

Organization ID. If specified, only invoices from this Organization will be returned.

page: Optional[int]

Page number.

page_size: Optional[int]

Positive integer lower or equal to 100 to select the number of items to return.

class scaleway.billing.v2beta1.ExportInvoicesRequestFileType(value: str, names: Optional[Any] = None, *args: Any, **kwargs: Any)

Bases: str, Enum

An enumeration.

CSV = 'csv'
class scaleway.billing.v2beta1.ExportInvoicesRequestOrderBy(value: str, names: Optional[Any] = None, *args: Any, **kwargs: Any)

Bases: str, Enum

An enumeration.

DUE_DATE_ASC = 'due_date_asc'
DUE_DATE_DESC = 'due_date_desc'
INVOICE_NUMBER_ASC = 'invoice_number_asc'
INVOICE_NUMBER_DESC = 'invoice_number_desc'
INVOICE_TYPE_ASC = 'invoice_type_asc'
INVOICE_TYPE_DESC = 'invoice_type_desc'
ISSUED_DATE_ASC = 'issued_date_asc'
ISSUED_DATE_DESC = 'issued_date_desc'
START_DATE_ASC = 'start_date_asc'
START_DATE_DESC = 'start_date_desc'
TOTAL_TAXED_ASC = 'total_taxed_asc'
TOTAL_TAXED_DESC = 'total_taxed_desc'
TOTAL_UNTAXED_ASC = 'total_untaxed_asc'
TOTAL_UNTAXED_DESC = 'total_untaxed_desc'
class scaleway.billing.v2beta1.GetInvoiceRequest(invoice_id: 'str')

Bases: object

invoice_id: str

Invoice ID.

class scaleway.billing.v2beta1.Invoice(id: 'str', organization_id: 'str', organization_name: 'str', start_date: 'Optional[datetime]', stop_date: 'Optional[datetime]', billing_period: 'Optional[datetime]', issued_date: 'Optional[datetime]', due_date: 'Optional[datetime]', type_: 'InvoiceType', state: 'str', number: 'int', seller_name: 'str', total_untaxed: 'Optional[Money]', total_taxed: 'Optional[Money]', total_tax: 'Optional[Money]', total_discount: 'Optional[Money]', total_undiscount: 'Optional[Money]')

Bases: object

billing_period: Optional[datetime]

The billing period of the invoice in the YYYY-MM format.

due_date: Optional[datetime]

Payment time limit, set according to the Organization’s payment conditions.

id: str

Invoice ID.

issued_date: Optional[datetime]

Date when the invoice was sent to the customer.

number: int

Invoice number.

organization_id: str
organization_name: str
seller_name: str

The name of the seller (Scaleway).

start_date: Optional[datetime]

Start date of the billing period.

state: str

The state of the Invoice.

stop_date: Optional[datetime]
total_discount: Optional[Money]

The total discount amount of the invoice.

total_tax: Optional[Money]

The total tax amount of the invoice.

total_taxed: Optional[Money]

Total amount, taxed.

total_undiscount: Optional[Money]

The total amount of the invoice before applying the discount.

total_untaxed: Optional[Money]

Total amount, untaxed.

type_: InvoiceType

Type of invoice, either periodic or purchase.

class scaleway.billing.v2beta1.InvoiceType(value: str, names: Optional[Any] = None, *args: Any, **kwargs: Any)

Bases: str, Enum

An enumeration.

PERIODIC = 'periodic'
PURCHASE = 'purchase'
UNKNOWN_TYPE = 'unknown_type'
class scaleway.billing.v2beta1.ListConsumptionsRequest(order_by: 'Optional[ListConsumptionsRequestOrderBy]', page: 'Optional[int]', page_size: 'Optional[int]', category_name: 'Optional[str]', billing_period: 'Optional[str]', organization_id: 'Optional[str]', project_id: 'Optional[str]')

Bases: object

billing_period: Optional[str]

Filter by the billing period in the YYYY-MM format. If it is empty the current billing period will be used as default.

category_name: Optional[str]

Filter by name of a Category as they are shown in the invoice (Compute, Network, Observability).

order_by: Optional[ListConsumptionsRequestOrderBy]

Order consumptions list in the response by their update date.

organization_id: Optional[str]
page: Optional[int]

Positive integer to choose the page to return.

page_size: Optional[int]

Positive integer lower or equal to 100 to select the number of items to return.

project_id: Optional[str]
class scaleway.billing.v2beta1.ListConsumptionsRequestOrderBy(value: str, names: Optional[Any] = None, *args: Any, **kwargs: Any)

Bases: str, Enum

An enumeration.

CATEGORY_NAME_ASC = 'category_name_asc'
CATEGORY_NAME_DESC = 'category_name_desc'
UPDATED_AT_ASC = 'updated_at_asc'
UPDATED_AT_DESC = 'updated_at_desc'
class scaleway.billing.v2beta1.ListConsumptionsResponse(consumptions: 'List[ListConsumptionsResponseConsumption]', total_count: 'int', total_discount_untaxed_value: 'float', updated_at: 'Optional[datetime]')

Bases: object

consumptions: List[ListConsumptionsResponseConsumption]

Detailed consumption list.

total_count: int

Total number of returned items.

total_discount_untaxed_value: float

Sum of all discounts, displayed only when no category or project ID filter is applied.

updated_at: Optional[datetime]

Last consumption update date.

class scaleway.billing.v2beta1.ListConsumptionsResponseConsumption(product_name: 'str', resource_name: 'str', sku: 'str', project_id: 'str', category_name: 'str', unit: 'str', billed_quantity: 'str', value: 'Optional[Money]')

Bases: object

billed_quantity: str

Consumed quantity.

category_name: str

Name of consumption category.

product_name: str

The product name. For example, “VPC Public Gateway S”, “VPC Public Gateway M” for the VPC product.

project_id: str

Project ID of the consumption.

resource_name: str

Identifies the reference based on the category.

sku: str

Unique identifier of the product.

unit: str

Unit of consumed quantity.

value: Optional[Money]

Monetary value of the consumption.

class scaleway.billing.v2beta1.ListDiscountsRequest(order_by: 'Optional[ListDiscountsRequestOrderBy]', page: 'Optional[int]', page_size: 'Optional[int]', organization_id: 'Optional[str]')

Bases: object

order_by: Optional[ListDiscountsRequestOrderBy]

Order discounts in the response by their description.

organization_id: Optional[str]

ID of the organization.

page: Optional[int]

Positive integer to choose the page to return.

page_size: Optional[int]

Positive integer lower or equal to 100 to select the number of items to return.

class scaleway.billing.v2beta1.ListDiscountsRequestOrderBy(value: str, names: Optional[Any] = None, *args: Any, **kwargs: Any)

Bases: str, Enum

An enumeration.

CREATION_DATE_ASC = 'creation_date_asc'
CREATION_DATE_DESC = 'creation_date_desc'
START_DATE_ASC = 'start_date_asc'
START_DATE_DESC = 'start_date_desc'
STOP_DATE_ASC = 'stop_date_asc'
STOP_DATE_DESC = 'stop_date_desc'
class scaleway.billing.v2beta1.ListDiscountsResponse(total_count: 'int', discounts: 'List[Discount]')

Bases: object

discounts: List[Discount]

Paginated returned discounts.

total_count: int

Total number of discounts.

class scaleway.billing.v2beta1.ListInvoicesRequest(organization_id: 'Optional[str]', billing_period_start_after: 'Optional[datetime]', billing_period_start_before: 'Optional[datetime]', invoice_type: 'Optional[InvoiceType]', page: 'Optional[int]', page_size: 'Optional[int]', order_by: 'Optional[ListInvoicesRequestOrderBy]')

Bases: object

billing_period_start_after: Optional[datetime]

Return only invoice with start date greater than billing_period_start.

billing_period_start_before: Optional[datetime]

Return only invoice with start date less than billing_period_start.

invoice_type: Optional[InvoiceType]

Invoice type. It can either be periodic or purchase.

order_by: Optional[ListInvoicesRequestOrderBy]

How invoices are ordered in the response.

organization_id: Optional[str]

Organization ID. If specified, only invoices from this Organization will be returned.

page: Optional[int]

Page number.

page_size: Optional[int]

Positive integer lower or equal to 100 to select the number of items to return.

class scaleway.billing.v2beta1.ListInvoicesRequestOrderBy(value: str, names: Optional[Any] = None, *args: Any, **kwargs: Any)

Bases: str, Enum

An enumeration.

DUE_DATE_ASC = 'due_date_asc'
DUE_DATE_DESC = 'due_date_desc'
INVOICE_NUMBER_ASC = 'invoice_number_asc'
INVOICE_NUMBER_DESC = 'invoice_number_desc'
INVOICE_TYPE_ASC = 'invoice_type_asc'
INVOICE_TYPE_DESC = 'invoice_type_desc'
ISSUED_DATE_ASC = 'issued_date_asc'
ISSUED_DATE_DESC = 'issued_date_desc'
START_DATE_ASC = 'start_date_asc'
START_DATE_DESC = 'start_date_desc'
TOTAL_TAXED_ASC = 'total_taxed_asc'
TOTAL_TAXED_DESC = 'total_taxed_desc'
TOTAL_UNTAXED_ASC = 'total_untaxed_asc'
TOTAL_UNTAXED_DESC = 'total_untaxed_desc'
class scaleway.billing.v2beta1.ListInvoicesResponse(total_count: 'int', invoices: 'List[Invoice]')

Bases: object

invoices: List[Invoice]

Paginated returned invoices.

total_count: int

Total number of invoices.

class scaleway.billing.v2beta1.ListTaxesRequest(order_by: 'Optional[ListTaxesRequestOrderBy]', page: 'Optional[int]', page_size: 'Optional[int]', organization_id: 'Optional[str]', billing_period: 'Optional[str]')

Bases: object

billing_period: Optional[str]

Filter by the billing period in the YYYY-MM format. If it is empty the current billing period will be used as default.

order_by: Optional[ListTaxesRequestOrderBy]

Order consumed taxes list in the response by their update date.

organization_id: Optional[str]

Filter by Organization ID.

page: Optional[int]

Page number.

page_size: Optional[int]

Positive integer lower or equal to 100 to select the number of items to return.

class scaleway.billing.v2beta1.ListTaxesRequestOrderBy(value: str, names: Optional[Any] = None, *args: Any, **kwargs: Any)

Bases: str, Enum

An enumeration.

CATEGORY_NAME_ASC = 'category_name_asc'
CATEGORY_NAME_DESC = 'category_name_desc'
UPDATED_AT_ASC = 'updated_at_asc'
UPDATED_AT_DESC = 'updated_at_desc'
class scaleway.billing.v2beta1.ListTaxesResponse(taxes: 'List[ListTaxesResponseTax]', total_count: 'int', updated_at: 'Optional[datetime]')

Bases: object

taxes: List[ListTaxesResponseTax]

Detailed consumption tax.

total_count: int

Total number of returned items.

updated_at: Optional[datetime]

Last consumption update date.

class scaleway.billing.v2beta1.ListTaxesResponseTax(description: 'str', currency: 'str', rate: 'Optional[float]', total_tax_value: 'Optional[float]')

Bases: object

currency: str

The three-letter currency code.

description: str

Description of the tax applied.

rate: Optional[float]

Applied tax rate (0.2 means a VAT of 20%).

total_tax_value: Optional[float]

The total tax value of the consumption.