Billing APIv2alpha1

Download OpenAPI

Introduction

Public cloud services are based on the “pay as you go” model, which means that you only pay for what you use. Your monthly invoice is calculated at the end of each month and based on your hourly resource usage during the month.

With Scaleway’s Billing API, you can manage the billing of your Scaleway cloud services.

Pricing

Refer to our dedicated pricing page to get more information about the rates applied on each Scaleway product.

Requirements

To perform the following steps, you must first ensure that:

1. Configure your environment variables.

Note: This is an optional step that seeks to simplify your usage of the APIs.

2. Run the following command to obtain your consumption over the current month.

3. Run the following command to list your invoices.

You should get an output similar to the following one, providing details about your invoices.

Note: This is a response example, the UUIDs displayed are not real.

4. Run the following command to download an invoice based on its ID

Make sure to replace the example ID in the URL with the actual invoice ID you want to download.

  • You must have appropriate IAM permissions to manage billing. If you are the Owner of the Organization, you will automatically have these permissions. Otherwise, you will need a policy giving you the BillingManager permission set. If you were previously a Billing Administrator, you will automatically have been migrated to the BillingAdministrator group when you activated IAM, which gives you the appropriate permissions.
  • You only need BillingReadOnly permissions to query consumption.

For more help using Scaleway’s Billing API, check out the following resources:

The consumption reflects the amount of money you have spent for the products you have used. The consumption value is monetary and is not computed in real time.

Get current month's consumption

The consumption reflects the amount of money you have spent for the products you have used. The consumption value is monetary and is not computed in real time.

GET
/billing/v2alpha1/consumption
Query Parameters

organization_id
string
Filter by organization ID. (UUID format).
200 Response

consumptions
array
Detailed consumption list.

updated_at
nullable string
Last consumption update date. (RFC 3339 format).
Response Example

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

GET
/billing/v2alpha1/invoices
Query Parameters

organization_id
string
Organization ID to filter for, only invoices from this Organization will be returned. (UUID format).

started_after
string
Invoice's `start_date` is greater or equal to `started_after`. (RFC 3339 format).

started_before
string
Invoice's `start_date` precedes `started_before`. (RFC 3339 format).

invoice_type
string
Invoice type. It can either be `periodic` or `purchase`. Possible values are unknown_type, periodic and purchase. The default value is unknown_type.

page
integer
Positive integer to choose the page to return. The default value is 1.

page_size
integer
Positive integer lower or equal to 100 to select the number of items to return. The default value is 20.

order_by
string
How invoices are ordered in the response. Possible values are 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 and invoice_type_asc. The default value is invoice_number_desc.
200 Response

total_count
integer
Total number of invoices.

invoices
array
Paginated returned invoices.
Response Example
GET
/billing/v2alpha1/invoices/{invoice_id}/download
Path Parameters

invoice_id
required string
Invoice ID. (UUID format).
Query Parameters

file_type
string
Wanted file type. Possible value is pdf. The default value is pdf.
200 Response

name
string

content_type
string

content
string
Response Example