openapi: 3.1.0
info:
  title: Billing API
  description: "Scaleway's Billing API provides a quick overview of your cloud consumption
    and allows you to monitor expenses. Public cloud services follow a 'pay as you
    go' model, ensuring you pay only for what you use. Some products offer plan options.
    Your monthly invoice is calculated at month-end based on exact resource usage
    and may include additional invoices for upfront payments during the month.\n\n\n<Message
    type=\"note\">\nYou may also be interested in the [Account API](https://www.scaleway.com/en/developers/api/account/project-api/)
    to manage your Projects, and the [IAM API](https://www.scaleway.com/en/developers/api/iam/)
    to manage users, permissions, and API keys in your Organization.\n</Message>\n\n\n\n\n\n##
    Concepts and pricing\n\nScaleway products offer different billing models, with
    billing cycles by the minute, hour, month, or year. For a clear estimate of product
    prices, visit our [pricing page](https://www.scaleway.com/en/pricing/?tags=available).
    You will also find a cost estimator for each product in the console when you order
    a resource.\n\n### Money type\n\nAll fields referencing money across Scaleway
    APIs are represented with a common Money definition - AKA Money type.\n\nThe gRPC
    `google.type.Money` type is used to represent amounts of money with their currency
    type.\n\nThe Money type is [defined by Google](https://developers.google.com/actions-center/verticals/things-to-do/reference/feed-spec/google-types#googletypemoney_definition)
    as such:\n\n```\n// Represents an amount of money with its currency type.\nmessage
    Money {\n  // The three-letter currency code defined in ISO 4217.\n  string currency_code
    = 1;\n\n  // The whole units of the amount.\n  // For example if `currencyCode`
    is `\"USD\"`, then 1 unit is one US dollar.\n  int64 units = 2;\n\n  // Number
    of nano (10^-9) units of the amount.\n  // The value must be between -999,999,999
    and +999,999,999 inclusive.\n  // If `units` is positive, `nanos` must be positive
    or zero.\n  // If `units` is zero, `nanos` can be positive, zero, or negative.\n
    \ // If `units` is negative, `nanos` must be negative or zero.\n  // For example
    $-1.75 is represented as `units`=-1 and `nanos`=-750,000,000.\n  int32 nanos =
    3;\n}\n```\n\n\n\n\n## Quickstart\n\n<Message type=\"requirement\">\n - You have
    an account and are logged into the [Scaleway console](https://console.scaleway.com/organization)\n
    - You have created an [API key](https://www.scaleway.com/en/docs/iam/how-to/create-api-keys/)
    and the API key has sufficient [IAM permissions](https://www.scaleway.com/en/docs/iam/reference-content/permission-sets/)
    to perform the actions described on this page\n - You have [installed `curl`](https://curl.se/download.html)\n</Message>\n\n1.
    Configure your environment variables.\n\n   <Message type=\"note\">\n   This is
    an optional step that aims at simplifying your usage of the API.\n   </Message>\n\n
    \  ```bash\n   export SCW_SECRET_KEY=\"<API secret key>\"\n   export SCW_ORGANIZATION_ID=\"<Scaleway
    Organization ID>\"\n   ```\n\n2. Run the following command to obtain your consumption
    over the current month.\n\n   ```bash\n   curl -X GET \\\n     -H \"X-Auth-Token:
    $SCW_SECRET_KEY\" \\\n     -H \"Content-Type: application/json\" \\\n     \"https://api.scaleway.com/billing/v2beta1/consumptions?organization_id=$SCW_ORGANIZATION_ID\"\n
    \  ```\n\n3. Run the following command to obtain your consumption over the current
    month for just one category of products.\n\n   Specify the target `category_name`
    as one of:\n\n   - `BareMetal`\n   - `Compute`\n   - `Containers`\n   - `Labs`\n
    \  - `Managed Databases`\n   - `Managed Services`\n   - `Network`\n   - `Object
    Storage`\n   - `Observability`\n   - `Security and Identity`\n   - `Serverless`\n
    \  - `Storage`\n   - `Subscription`\n\n   ```bash\n   curl -X GET \\\n     -H
    \"X-Auth-Token: $SCW_SECRET_KEY\" \\\n     -H \"Content-Type: application/json\"
    \\\n     \"https://api.scaleway.com/billing/v2beta1/consumptions?organization_id=$SCW_ORGANIZATION_ID&category_name=Compute\"\n
    \  ```\n\n4. Run the following command to obtain your consumption for a specific
    month.\n\n   Specify the target billing period as `YYYY-MM`, e.g., `2023-11`.\n\n
    \  ```bash\n   curl -X GET \\\n     -H \"X-Auth-Token: $SCW_SECRET_KEY\" \\\n
    \    -H \"Content-Type: application/json\" \\\n     \"https://api.scaleway.com/billing/v2beta1/consumptions?organization_id=$SCW_ORGANIZATION_ID&billing_period=2023-11\"\n
    \  ```\n\n5. Run the following command to obtain your consumption for a specific
    project only.\n\n   First, choose your target `project_id`:\n\n   ```bash\n   export
    SCW_PROJECT_ID=\"<Scaleway Project ID>\"\n   ```\n\n   Then inject it in your
    API request:\n\n   ```bash\n   curl -X GET \\\n     -H \"X-Auth-Token: $SCW_SECRET_KEY\"
    \\\n     -H \"Content-Type: application/json\" \\\n     \"https://api.scaleway.com/billing/v2beta1/consumptions?project_id=SCW_PROJECT_ID\"\n
    \  ```\n\n\n  \n\n## Technical information\n\n### IAM requirements\n\nKeep in
    mind that:\n\n- 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.\n- You only need `BillingReadOnly` permissions
    to query consumption.\n  ​\n\n## Going further\n\n​\nFor more help using Scaleway’s
    Billing API, check out the following resources:\n​\n\n- Our [main documentation](https://www.scaleway.com/en/docs/billing/)\n-
    Our [Slack Community](https://www.scaleway-community.slack.com/)\n- Our [support
    ticketing system](https://www.scaleway.com/en/docs/account/how-to/open-a-support-ticket/)."
  version: v2beta1
servers:
- url: https://api.scaleway.com
tags:
- name: Consumption
  description: Consumption reflects the amount of money spent on the products you’ve
    used. Its monetary value is calculated in real-time, providing an instant overview
    of your expenses, including any applicable taxes
- name: Invoices
  description: Manage your invoices by listing all invoices, filtering them by start_date
    and invoice_type, each uniquely identified by an ID. Retrieve specific invoices
    by their IDs, download them for detailed review, and efficiently export all invoices
    into a comprehensive CSV file, ensuring a streamlined overview of your invoices
- name: Discounts
  description: Gain simplified access to key information about discounts, including
    creation dates, and remaining, used, and total values
- name: Coupons
  description: Get a discount given a coupon code
components:
  schemas:
    scaleway.billing.v2beta1.Discount:
      type: object
      properties:
        id:
          type: string
          description: The ID of the discount.
        creation_date:
          type: string
          description: The creation date of the discount. (RFC 3339 format)
          format: date-time
          example: "2022-03-22T12:34:56.123456Z"
          nullable: true
        organization_id:
          type: string
          description: The Organization ID of the discount.
        description:
          type: string
          description: The description of the discount.
        value:
          type: number
          description: The initial value of the discount.
          format: double
        value_used:
          type: number
          description: The value indicating how much of the discount has been used.
          format: double
        value_remaining:
          type: number
          description: The remaining value of the discount.
          format: double
        mode:
          type: string
          description: The mode of the discount.
          enum:
          - unknown_discount_mode
          - discount_mode_rate
          - discount_mode_value
          - discount_mode_splittable
          x-enum-descriptions:
            values:
              unknown_discount_mode: Unknown discount mode
              discount_mode_rate: A rate discount that reduces each customer bill
                by the discount value percentage
              discount_mode_value: A value discount that reduces the amount of the
                customer bill by the discount value
              discount_mode_splittable: A fixed sum to be deducted from the user's
                bills
          default: unknown_discount_mode
        start_date:
          type: string
          description: The start date of the discount. (RFC 3339 format)
          format: date-time
          example: "2022-03-22T12:34:56.123456Z"
          nullable: true
        stop_date:
          type: string
          description: The stop date of the discount. (RFC 3339 format)
          format: date-time
          example: "2022-03-22T12:34:56.123456Z"
          nullable: true
        coupon:
          type: object
          description: The description of the coupon.
          properties:
            description:
              type: string
              description: The description of the coupon.
              nullable: true
          x-properties-order:
          - description
        filters:
          type: array
          description: List of the discount scopes.
          items:
            $ref: '#/components/schemas/scaleway.billing.v2beta1.Discount.Filter'
      x-properties-order:
      - id
      - creation_date
      - organization_id
      - description
      - value
      - value_used
      - value_remaining
      - mode
      - start_date
      - stop_date
      - coupon
      - filters
    scaleway.billing.v2beta1.Discount.Filter:
      type: object
      properties:
        type:
          type: string
          description: Type of the filter (category name, product name, product range,
            resource name, region or zone).
          enum:
          - unknown_type
          - category_name
          - product_name
          - product_range
          - resource_name
          - region
          - zone
          x-enum-descriptions:
            values:
              unknown_type: Unknown filter type
              category_name: Product category, such as Compute, Network, Observability
              product_name: Products within the Product category. For example, VPC,
                Private Networks, and Public Gateways are products in the Network
                category
              product_range: The range of a product. For example, `Production Optimized`
                or `Cost Optimized` for an `instance` product of the `compute` category
              resource_name: Identifies the reference based on category, product,
                range, size, region, and zone. It can sometimes include different
                product options, such as licenses and monthly payments
              region: Region name like "FR-PAR", "NL-AMS", "PL-WAW"
              zone: Zone name like "FR-PAR-1", "FR-PAR-2", "FR-PAR-3"
          default: unknown_type
        value:
          type: string
          description: Value of filter.
        exclude:
          type: boolean
          description: Boolean to describe if filter is an excluding filter.
      x-properties-order:
      - type
      - value
      - exclude
    scaleway.billing.v2beta1.Invoice:
      type: object
      properties:
        id:
          type: string
          description: Invoice ID. (UUID format)
          example: 6170692e-7363-616c-6577-61792e636f6d
        organization_id:
          type: string
          description: (UUID format)
          example: 6170692e-7363-616c-6577-61792e636f6d
        organization_name:
          type: string
        start_date:
          type: string
          description: Start date of the billing period. (RFC 3339 format)
          format: date-time
          example: "2022-03-22T12:34:56.123456Z"
          nullable: true
        stop_date:
          type: string
          description: (RFC 3339 format)
          format: date-time
          example: "2022-03-22T12:34:56.123456Z"
          nullable: true
        billing_period:
          type: string
          description: The billing period of the invoice in the YYYY-MM format. (RFC
            3339 format)
          format: date-time
          example: "2022-03-22T12:34:56.123456Z"
          nullable: true
        issued_date:
          type: string
          description: Date when the invoice was sent to the customer. (RFC 3339 format)
          format: date-time
          example: "2022-03-22T12:34:56.123456Z"
          nullable: true
        due_date:
          type: string
          description: Payment time limit, set according to the Organization's payment
            conditions. (RFC 3339 format)
          format: date-time
          example: "2022-03-22T12:34:56.123456Z"
          nullable: true
        total_untaxed:
          type: object
          description: Total amount, untaxed.
          properties:
            currency_code:
              type: string
            units:
              type: integer
              format: int64
            nanos:
              type: integer
              format: int32
          x-properties-order:
          - currency_code
          - units
          - nanos
        total_taxed:
          type: object
          description: Total amount, taxed.
          properties:
            currency_code:
              type: string
            units:
              type: integer
              format: int64
            nanos:
              type: integer
              format: int32
          x-properties-order:
          - currency_code
          - units
          - nanos
        total_tax:
          type: object
          description: The total tax amount of the invoice.
          properties:
            currency_code:
              type: string
            units:
              type: integer
              format: int64
            nanos:
              type: integer
              format: int32
          x-properties-order:
          - currency_code
          - units
          - nanos
        total_discount:
          type: object
          description: The total discount amount of the invoice.
          properties:
            currency_code:
              type: string
            units:
              type: integer
              format: int64
            nanos:
              type: integer
              format: int32
          x-properties-order:
          - currency_code
          - units
          - nanos
        total_undiscount:
          type: object
          description: The total amount of the invoice before applying the discount.
          properties:
            currency_code:
              type: string
            units:
              type: integer
              format: int64
            nanos:
              type: integer
              format: int32
          x-properties-order:
          - currency_code
          - units
          - nanos
        type:
          type: string
          description: Type of invoice, either periodic or purchase.
          enum:
          - unknown_type
          - periodic
          - purchase
          - credit_note
          default: unknown_type
        state:
          type: string
          description: The state of the Invoice.
        number:
          type: integer
          description: Invoice number.
          format: int32
        seller_name:
          type: string
          description: The name of the seller (Scaleway).
      x-properties-order:
      - id
      - organization_id
      - organization_name
      - start_date
      - stop_date
      - billing_period
      - issued_date
      - due_date
      - total_untaxed
      - total_taxed
      - total_tax
      - total_discount
      - total_undiscount
      - type
      - state
      - number
      - seller_name
    scaleway.billing.v2beta1.ListConsumptionsResponse:
      type: object
      properties:
        consumptions:
          type: array
          description: Detailed consumption list.
          items:
            $ref: '#/components/schemas/scaleway.billing.v2beta1.ListConsumptionsResponse.Consumption'
        total_count:
          type: integer
          description: Total number of returned items.
          format: uint64
        total_discount_untaxed_value:
          type: number
          description: Sum of all discounts, displayed only when no category or project
            ID filter is applied.
          format: double
        updated_at:
          type: string
          description: Last consumption update date. (RFC 3339 format)
          format: date-time
          example: "2022-03-22T12:34:56.123456Z"
          nullable: true
      x-properties-order:
      - consumptions
      - total_count
      - total_discount_untaxed_value
      - updated_at
    scaleway.billing.v2beta1.ListConsumptionsResponse.Consumption:
      type: object
      properties:
        value:
          type: object
          description: Monetary value of the consumption.
          properties:
            currency_code:
              type: string
            units:
              type: integer
              format: int64
            nanos:
              type: integer
              format: int32
          x-properties-order:
          - currency_code
          - units
          - nanos
        product_name:
          type: string
          description: The product name. For example, "VPC Public Gateway S", "VPC
            Public Gateway M" for the VPC product.
        resource_name:
          type: string
          description: Identifies the reference based on the category.
        sku:
          type: string
          description: Unique identifier of the product.
        project_id:
          type: string
          description: Project ID of the consumption.
        category_name:
          type: string
          description: Name of consumption category.
        unit:
          type: string
          description: Unit of consumed quantity.
        billed_quantity:
          type: string
          description: Consumed quantity.
        consumer_id:
          type: string
          description: Organization ID of the consumer for this consumption.
        project_name:
          type: string
          description: Project name of the consumpiton.
        organization_name:
          type: string
          description: Organization name of the consumer for this consumption.
      x-properties-order:
      - value
      - product_name
      - resource_name
      - sku
      - project_id
      - category_name
      - unit
      - billed_quantity
      - consumer_id
      - project_name
      - organization_name
    scaleway.billing.v2beta1.ListDiscountsResponse:
      type: object
      properties:
        total_count:
          type: integer
          description: Total number of discounts.
          format: uint64
        discounts:
          type: array
          description: Paginated returned discounts.
          items:
            $ref: '#/components/schemas/scaleway.billing.v2beta1.Discount'
      x-properties-order:
      - total_count
      - discounts
    scaleway.billing.v2beta1.ListInvoicesResponse:
      type: object
      properties:
        total_count:
          type: integer
          description: Total number of invoices.
          format: uint64
        invoices:
          type: array
          description: Paginated returned invoices.
          items:
            $ref: '#/components/schemas/scaleway.billing.v2beta1.Invoice'
      x-properties-order:
      - total_count
      - invoices
    scaleway.billing.v2beta1.ListTaxesResponse:
      type: object
      properties:
        taxes:
          type: array
          description: Detailed consumption tax.
          items:
            $ref: '#/components/schemas/scaleway.billing.v2beta1.ListTaxesResponse.Tax'
        total_count:
          type: integer
          description: Total number of returned items.
          format: uint64
        updated_at:
          type: string
          description: Last consumption update date. (RFC 3339 format)
          format: date-time
          example: "2022-03-22T12:34:56.123456Z"
          nullable: true
      x-properties-order:
      - taxes
      - total_count
      - updated_at
    scaleway.billing.v2beta1.ListTaxesResponse.Tax:
      type: object
      properties:
        description:
          type: string
          description: Description of the tax applied.
        currency:
          type: string
          description: The three-letter currency code.
        rate:
          type: object
          description: Applied tax rate (0.2 means a VAT of 20%).
          properties:
            value:
              type: number
              format: double
          x-properties-order:
          - value
        total_tax_value:
          type: object
          description: The total tax value of the consumption.
          properties:
            value:
              type: number
              format: double
          x-properties-order:
          - value
      x-properties-order:
      - description
      - currency
      - rate
      - total_tax_value
    scaleway.std.File:
      type: object
      properties:
        name:
          type: string
        content_type:
          type: string
        content:
          type: string
      x-properties-order:
      - name
      - content_type
      - content
  securitySchemes:
    scaleway:
      in: header
      name: X-Auth-Token
      type: apiKey
paths:
  /billing/v2beta1/consumptions:
    get:
      tags:
      - Consumption
      operationId: ListConsumptions
      summary: Get monthly consumption
      description: Consumption allows you to retrieve your past or current consumption
        cost, by project or category.
      parameters:
      - in: query
        name: order_by
        description: Order consumptions list in the response by their update date.
        schema:
          type: string
          enum:
          - updated_at_desc
          - updated_at_asc
          - category_name_desc
          - category_name_asc
          x-enum-descriptions:
            values:
              updated_at_desc: Order consumptions by update date (descending chronological
                order)
              updated_at_asc: Order consumptions by update date (ascending chronological
                order)
              category_name_desc: Order consumptions by category name (descending
                alphabetical order)
              category_name_asc: Order consumptions by category name (ascending alphabetical
                order)
          default: updated_at_desc
      - in: query
        name: page
        description: Positive integer to choose the page to return.
        schema:
          type: integer
          format: int32
      - in: query
        name: page_size
        description: Positive integer lower or equal to 100 to select the number of
          items to return.
        schema:
          type: integer
          format: uint32
      - in: query
        name: category_name
        description: Filter by name of a Category as they are shown in the invoice
          (Compute, Network, Observability).
        schema:
          type: string
      - in: query
        name: billing_period
        description: Filter by the billing period in the YYYY-MM format. If it is
          empty the current billing period will be used as default.
        schema:
          type: string
      responses:
        "200":
          description: ""
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/scaleway.billing.v2beta1.ListConsumptionsResponse'
      security:
      - scaleway: []
      x-codeSamples:
      - lang: cURL
        source: |-
          curl -X GET \
            -H "X-Auth-Token: $SCW_SECRET_KEY" \
            "https://api.scaleway.com/billing/v2beta1/consumptions"
      - lang: HTTPie
        source: |-
          http GET "https://api.scaleway.com/billing/v2beta1/consumptions" \
            X-Auth-Token:$SCW_SECRET_KEY
  /billing/v2beta1/discounts:
    get:
      tags:
      - Discounts
      operationId: ListDiscounts
      summary: List discounts
      description: |-
        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.
      parameters:
      - in: query
        name: order_by
        description: Order discounts in the response by their description.
        schema:
          type: string
          enum:
          - creation_date_desc
          - creation_date_asc
          - start_date_desc
          - start_date_asc
          - stop_date_desc
          - stop_date_asc
          x-enum-descriptions:
            values:
              creation_date_desc: Order discounts by creation date (descending chronological
                order)
              creation_date_asc: Order discounts by creation date (ascending chronological
                order)
              start_date_desc: Order discounts by start date (descending chronological
                order)
              start_date_asc: Order discounts by start date (ascending chronological
                order)
              stop_date_desc: Order discounts by stop date (descending chronological
                order)
              stop_date_asc: Order discounts by stop date (ascending chronological
                order)
          default: creation_date_desc
      - in: query
        name: page
        description: Positive integer to choose the page to return.
        schema:
          type: integer
          format: int32
      - in: query
        name: page_size
        description: Positive integer lower or equal to 100 to select the number of
          items to return.
        schema:
          type: integer
          format: uint32
      - in: query
        name: organization_id
        description: ID of the organization. (UUID format)
        schema:
          type: string
          example: 6170692e-7363-616c-6577-61792e636f6d
      responses:
        "200":
          description: ""
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/scaleway.billing.v2beta1.ListDiscountsResponse'
      security:
      - scaleway: []
      x-codeSamples:
      - lang: cURL
        source: |-
          curl -X GET \
            -H "X-Auth-Token: $SCW_SECRET_KEY" \
            "https://api.scaleway.com/billing/v2beta1/discounts"
      - lang: HTTPie
        source: |-
          http GET "https://api.scaleway.com/billing/v2beta1/discounts" \
            X-Auth-Token:$SCW_SECRET_KEY
  /billing/v2beta1/export-invoices:
    get:
      tags:
      - Invoices
      operationId: ExportInvoices
      summary: Export invoices
      description: Export invoices in a CSV file.
      parameters:
      - in: query
        name: organization_id
        description: Organization ID. If specified, only invoices from this Organization
          will be returned. (UUID format)
        schema:
          type: string
          example: 6170692e-7363-616c-6577-61792e636f6d
      - in: query
        name: billing_period_start_after
        description: Return only invoice with start date greater than billing_period_start.
          (RFC 3339 format)
        schema:
          type: string
          format: date-time
          example: "2022-03-22T12:34:56.123456Z"
      - in: query
        name: billing_period_start_before
        description: Return only invoice with start date less than billing_period_start.
          (RFC 3339 format)
        schema:
          type: string
          format: date-time
          example: "2022-03-22T12:34:56.123456Z"
      - in: query
        name: invoice_type
        description: Invoice type. It can either be `periodic`, `purchase` or `credit_note`.
        schema:
          type: string
          enum:
          - unknown_type
          - periodic
          - purchase
          - credit_note
          default: unknown_type
      - in: query
        name: page
        description: Page number.
        schema:
          type: integer
          format: int32
      - in: query
        name: page_size
        description: Positive integer lower or equal to 100 to select the number of
          items to return.
        schema:
          type: integer
          format: uint32
      - in: query
        name: order_by
        description: How invoices are ordered in the response.
        schema:
          type: string
          enum:
          - 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
          default: invoice_number_desc
      - in: query
        name: file_type
        description: File format for exporting the invoice list.
        schema:
          type: string
          enum:
          - csv
          default: csv
      responses:
        "200":
          description: ""
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/scaleway.std.File'
      security:
      - scaleway: []
      x-codeSamples:
      - lang: cURL
        source: |-
          curl -X GET \
            -H "X-Auth-Token: $SCW_SECRET_KEY" \
            "https://api.scaleway.com/billing/v2beta1/export-invoices"
      - lang: HTTPie
        source: |-
          http GET "https://api.scaleway.com/billing/v2beta1/export-invoices" \
            X-Auth-Token:$SCW_SECRET_KEY
  /billing/v2beta1/invoices:
    get:
      tags:
      - Invoices
      operationId: ListInvoices
      summary: List invoices
      description: List all your invoices, filtering by `start_date` and `invoice_type`.
        Each invoice has its own ID.
      parameters:
      - in: query
        name: organization_id
        description: Organization ID. If specified, only invoices from this Organization
          will be returned. (UUID format)
        schema:
          type: string
          example: 6170692e-7363-616c-6577-61792e636f6d
      - in: query
        name: billing_period_start_after
        description: Return only invoice with start date greater than billing_period_start.
          (RFC 3339 format)
        schema:
          type: string
          format: date-time
          example: "2022-03-22T12:34:56.123456Z"
      - in: query
        name: billing_period_start_before
        description: Return only invoice with start date less than billing_period_start.
          (RFC 3339 format)
        schema:
          type: string
          format: date-time
          example: "2022-03-22T12:34:56.123456Z"
      - in: query
        name: invoice_type
        description: Invoice type. It can either be `periodic`, `purchase` or `credit_note`.
        schema:
          type: string
          enum:
          - unknown_type
          - periodic
          - purchase
          - credit_note
          default: unknown_type
      - in: query
        name: page
        description: Page number.
        schema:
          type: integer
          format: int32
      - in: query
        name: page_size
        description: Positive integer lower or equal to 100 to select the number of
          items to return.
        schema:
          type: integer
          format: uint32
      - in: query
        name: order_by
        description: How invoices are ordered in the response.
        schema:
          type: string
          enum:
          - 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
          default: invoice_number_desc
      responses:
        "200":
          description: ""
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/scaleway.billing.v2beta1.ListInvoicesResponse'
      security:
      - scaleway: []
      x-codeSamples:
      - lang: cURL
        source: |-
          curl -X GET \
            -H "X-Auth-Token: $SCW_SECRET_KEY" \
            "https://api.scaleway.com/billing/v2beta1/invoices"
      - lang: HTTPie
        source: |-
          http GET "https://api.scaleway.com/billing/v2beta1/invoices" \
            X-Auth-Token:$SCW_SECRET_KEY
  /billing/v2beta1/invoices/{invoice_id}:
    get:
      tags:
      - Invoices
      operationId: GetInvoice
      summary: Get an invoice
      description: Get a specific invoice, specified by its ID.
      parameters:
      - in: path
        name: invoice_id
        description: Invoice ID. (UUID format)
        required: true
        schema:
          type: string
          example: 6170692e-7363-616c-6577-61792e636f6d
      responses:
        "200":
          description: ""
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/scaleway.billing.v2beta1.Invoice'
      security:
      - scaleway: []
      x-codeSamples:
      - lang: cURL
        source: |-
          curl -X GET \
            -H "X-Auth-Token: $SCW_SECRET_KEY" \
            "https://api.scaleway.com/billing/v2beta1/invoices/{invoice_id}"
      - lang: HTTPie
        source: |-
          http GET "https://api.scaleway.com/billing/v2beta1/invoices/{invoice_id}" \
            X-Auth-Token:$SCW_SECRET_KEY
  /billing/v2beta1/invoices/{invoice_id}/download:
    get:
      tags:
      - Invoices
      operationId: DownloadInvoice
      summary: Download an invoice
      description: Download a specific invoice, specified by its ID.
      parameters:
      - in: path
        name: invoice_id
        description: Invoice ID. (UUID format)
        required: true
        schema:
          type: string
          example: 6170692e-7363-616c-6577-61792e636f6d
      - in: query
        name: file_type
        description: File type. PDF by default.
        schema:
          type: string
          enum:
          - pdf
          default: pdf
      responses:
        "200":
          description: ""
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/scaleway.std.File'
      security:
      - scaleway: []
      x-codeSamples:
      - lang: cURL
        source: |-
          curl -X GET \
            -H "X-Auth-Token: $SCW_SECRET_KEY" \
            "https://api.scaleway.com/billing/v2beta1/invoices/{invoice_id}/download"
      - lang: HTTPie
        source: |-
          http GET "https://api.scaleway.com/billing/v2beta1/invoices/{invoice_id}/download" \
            X-Auth-Token:$SCW_SECRET_KEY
  /billing/v2beta1/redeem-coupon:
    post:
      tags:
      - Coupons
      operationId: RedeemCoupon
      summary: Redeem coupon
      description: Redeem a coupon given the related code.
      parameters:
      - in: query
        name: organization_id
        description: The Organization ID of the discount. (UUID format)
        required: true
        schema:
          type: string
          example: 6170692e-7363-616c-6577-61792e636f6d
      - in: query
        name: code
        description: The code of the coupon to redeem.
        required: true
        schema:
          type: string
      responses:
        "200":
          description: ""
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/scaleway.billing.v2beta1.Discount'
      security:
      - scaleway: []
      x-codeSamples:
      - lang: cURL
        source: |-
          curl -X POST \
            -H "X-Auth-Token: $SCW_SECRET_KEY" \
            "https://api.scaleway.com/billing/v2beta1/redeem-coupon?code=string&organization_id=6170692e-7363-616c-6577-61792e636f6d"
      - lang: HTTPie
        source: |-
          http POST "https://api.scaleway.com/billing/v2beta1/redeem-coupon" \
            X-Auth-Token:$SCW_SECRET_KEY \
            code==string \
            organization_id==6170692e-7363-616c-6577-61792e636f6d
  /billing/v2beta1/taxes:
    get:
      tags:
      - Consumption
      operationId: ListTaxes
      summary: Get monthly consumption taxes
      description: Consumption Tax allows you to retrieve your past or current tax
        charges, by project or category.
      parameters:
      - in: query
        name: order_by
        description: Order consumed taxes list in the response by their update date.
        schema:
          type: string
          enum:
          - updated_at_desc
          - updated_at_asc
          - category_name_desc
          - category_name_asc
          x-enum-descriptions:
            values:
              updated_at_desc: Order consumptions by update date (descending chronological
                order)
              updated_at_asc: Order consumptions by update date (ascending chronological
                order)
              category_name_desc: Order consumptions by category name (descending
                alphabetical order)
              category_name_asc: Order consumptions by category name (ascending alphabetical
                order)
          default: updated_at_desc
      - in: query
        name: page
        description: Page number.
        schema:
          type: integer
          format: int32
      - in: query
        name: page_size
        description: Positive integer lower or equal to 100 to select the number of
          items to return.
        schema:
          type: integer
          format: uint32
      - in: query
        name: organization_id
        description: Filter by Organization ID. (UUID format)
        required: true
        schema:
          type: string
          example: 6170692e-7363-616c-6577-61792e636f6d
      - in: query
        name: billing_period
        description: Filter by the billing period in the YYYY-MM format. If it is
          empty the current billing period will be used as default.
        schema:
          type: string
      responses:
        "200":
          description: ""
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/scaleway.billing.v2beta1.ListTaxesResponse'
      security:
      - scaleway: []
      x-codeSamples:
      - lang: cURL
        source: |-
          curl -X GET \
            -H "X-Auth-Token: $SCW_SECRET_KEY" \
            "https://api.scaleway.com/billing/v2beta1/taxes?organization_id=6170692e-7363-616c-6577-61792e636f6d"
      - lang: HTTPie
        source: |-
          http GET "https://api.scaleway.com/billing/v2beta1/taxes" \
            X-Auth-Token:$SCW_SECRET_KEY \
            organization_id==6170692e-7363-616c-6577-61792e636f6d
