> ## Documentation Index
> Fetch the complete documentation index at: https://docs.useaira.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Fetch plan version

> Fetches a plan version by id, with its plan charges.

Requires the role `plans:read`.



## OpenAPI

````yaml /api-reference/openapi.yaml get /v1/plans/version/{id}
openapi: 3.1.0
info:
  title: API Reference
  version: '1.0'
  description: Aira API Reference
  x-logo:
    url: https://static.useaira.com/images/airalogo.svg
    backgroundColor: '#FFFFFF'
    altText: Aira Logo
servers:
  - url: https://api.useaira.com
    description: API base URL
security:
  - ApiKey: []
paths:
  /v1/plans/version/{id}:
    get:
      tags:
        - Plans
      summary: Fetch plan version
      description: |-
        Fetches a plan version by id, with its plan charges.

        Requires the role `plans:read`.
      parameters:
        - schema:
            type: string
            format: uuid
          in: path
          name: id
          required: true
          description: The unique identifier of the plan version.
      responses:
        '200':
          description: 'A plan version: one saved state of the plan charges of a plan.'
          content:
            application/json:
              schema:
                type: object
                properties:
                  id:
                    type: string
                    format: uuid
                    description: The unique identifier of the plan version in our system.
                  versionNumber:
                    type: number
                    minimum: 1
                    description: >-
                      The number of the plan version in its plan, from 1, one
                      more for each new plan version.
                  isActive:
                    type: boolean
                    description: >-
                      Whether the plan version is the active plan version of its
                      plan, whose plan charges a new plan instance of the plan
                      bills. A plan has one active plan version.
                  planCharges:
                    type: array
                    items:
                      type: object
                      description: >-
                        Schema representing a plan charge, one priced line of a
                        plan: its item names what it bills, its category says
                        what it bills from, its pricing model turns a quantity
                        into money, and its billing frequency says how often it
                        bills. The fields of a charge depend on its category. An
                        amount is an integer number of cents, and a price is a
                        decimal string with up to 6 decimal places, in BRL or in
                        the credit unit of the charge.
                      discriminator:
                        propertyName: category
                      oneOf:
                        - type: object
                          description: >-
                            A fixed charge: the same amount in every charge
                            period, billed on the invoice that its billing
                            timing names.
                          properties:
                            category:
                              type: string
                              description: 'The category of the charge: fixed.'
                              enum:
                                - fixed
                            id:
                              type: string
                              format: uuid
                              description: >-
                                The unique identifier of the plan charge in our
                                system.
                            position:
                              type: integer
                              minimum: 0
                              description: >-
                                The position of the charge in the plan, from 0,
                                in the order that the billing app shows.
                            itemId:
                              type: string
                              format: uuid
                              description: >-
                                The unique identifier of the item that the
                                charge bills. The line items of the charge name
                                the same item.
                            productId:
                              type: string
                              format: uuid
                              description: >-
                                The unique identifier of the product that the
                                charge belongs to.
                            name:
                              type: string
                              minLength: 1
                              description: The name of the charge, as the invoices show it.
                              examples:
                                - Mensalidade
                            isCustomNameEnabled:
                              type: boolean
                              description: >-
                                Whether the charge has a name of its own. When
                                false, the name of the charge is the name of its
                                resource, of its license or of its item.
                            billingFrequency:
                              type: object
                              description: >-
                                How often the charge bills: each charge period
                                of the charge lasts count units, the charge
                                counts its charge periods from the contract
                                start, and it bills each charge period once.
                                Aira accepts 1 or 2 weeks and 1, 3, 6 or 12
                                months, and a prorated charge bills every week
                                or every month.
                              properties:
                                unit:
                                  type: string
                                  enum:
                                    - month
                                    - week
                                  description: >-
                                    The unit of the billing frequency: month or
                                    week. Every charge of a plan has the same
                                    unit.
                                count:
                                  type: integer
                                  minimum: 1
                                  description: >-
                                    The number of units in each charge period of
                                    the charge.
                              required:
                                - unit
                                - count
                              additionalProperties: false
                            pricingModel:
                              type: string
                              description: The pricing model of the charge, always fixed.
                              enum:
                                - fixed
                            pricing:
                              type: object
                              description: >-
                                The price of a fixed charge or of a minimum
                                commitment.
                              properties:
                                model:
                                  description: 'The pricing model of the price: fixed.'
                                  enum:
                                    - fixed
                                amount:
                                  type: integer
                                  minimum: 0
                                  description: >-
                                    The amount that the charge bills in each
                                    charge period, in cents, or the amount of
                                    one unit when the charge has a quantity. For
                                    a minimum commitment, the least that the
                                    charges of the plan with its billing
                                    frequency bill.
                                quantity:
                                  type: integer
                                  minimum: 1
                                  description: >-
                                    The number of units that a fixed charge
                                    bills in each charge period, when it has
                                    one, so that each charge period bills
                                    quantity times amount. A minimum commitment
                                    has none.
                              required:
                                - model
                                - amount
                              additionalProperties: false
                            billingTiming:
                              type: string
                              enum:
                                - in_advance
                                - in_arrears
                              description: >-
                                When the charge bills a charge period:
                                in_arrears bills it on the closing invoice of
                                its last cycle, and in_advance bills it before
                                it starts, on the activation invoice or on the
                                closing invoice of the cycle before. The billing
                                timing moves the invoice, never the amount.
                          required:
                            - id
                            - position
                            - itemId
                            - productId
                            - name
                            - isCustomNameEnabled
                            - category
                            - pricingModel
                            - pricing
                            - billingFrequency
                            - billingTiming
                          additionalProperties: false
                        - type: object
                          description: >-
                            A minimum commitment: the least that the plan bills
                            in a charge period. When the charges of the plan
                            with the same billing frequency total less, the
                            charge bills the difference. A plan has at most one
                            for each billing frequency.
                          properties:
                            category:
                              type: string
                              description: 'The category of the charge: minimum_commitment.'
                              enum:
                                - minimum_commitment
                            id:
                              type: string
                              format: uuid
                              description: >-
                                The unique identifier of the plan charge in our
                                system.
                            position:
                              type: integer
                              minimum: 0
                              description: >-
                                The position of the charge in the plan, from 0,
                                in the order that the billing app shows.
                            itemId:
                              type: string
                              format: uuid
                              description: >-
                                The unique identifier of the item that the
                                charge bills. The line items of the charge name
                                the same item.
                            productId:
                              type: string
                              format: uuid
                              description: >-
                                The unique identifier of the product that the
                                charge belongs to.
                            name:
                              type: string
                              minLength: 1
                              description: The name of the charge, as the invoices show it.
                              examples:
                                - Mensalidade
                            isCustomNameEnabled:
                              type: boolean
                              description: >-
                                Whether the charge has a name of its own. When
                                false, the name of the charge is the name of its
                                resource, of its license or of its item.
                            billingFrequency:
                              type: object
                              description: >-
                                How often the charge bills: each charge period
                                of the charge lasts count units, the charge
                                counts its charge periods from the contract
                                start, and it bills each charge period once.
                                Aira accepts 1 or 2 weeks and 1, 3, 6 or 12
                                months, and a prorated charge bills every week
                                or every month.
                              properties:
                                unit:
                                  type: string
                                  enum:
                                    - month
                                    - week
                                  description: >-
                                    The unit of the billing frequency: month or
                                    week. Every charge of a plan has the same
                                    unit.
                                count:
                                  type: integer
                                  minimum: 1
                                  description: >-
                                    The number of units in each charge period of
                                    the charge.
                              required:
                                - unit
                                - count
                              additionalProperties: false
                            pricingModel:
                              type: string
                              description: The pricing model of the charge, always fixed.
                              enum:
                                - fixed
                            pricing:
                              type: object
                              description: >-
                                The price of a fixed charge or of a minimum
                                commitment.
                              properties:
                                model:
                                  description: 'The pricing model of the price: fixed.'
                                  enum:
                                    - fixed
                                amount:
                                  type: integer
                                  minimum: 0
                                  description: >-
                                    The amount that the charge bills in each
                                    charge period, in cents, or the amount of
                                    one unit when the charge has a quantity. For
                                    a minimum commitment, the least that the
                                    charges of the plan with its billing
                                    frequency bill.
                                quantity:
                                  type: integer
                                  minimum: 1
                                  description: >-
                                    The number of units that a fixed charge
                                    bills in each charge period, when it has
                                    one, so that each charge period bills
                                    quantity times amount. A minimum commitment
                                    has none.
                              required:
                                - model
                                - amount
                              additionalProperties: false
                          required:
                            - id
                            - position
                            - itemId
                            - productId
                            - name
                            - isCustomNameEnabled
                            - category
                            - pricingModel
                            - pricing
                            - billingFrequency
                          additionalProperties: false
                        - type: object
                          description: >-
                            A usage-based charge: a charge on the usage of a
                            resource in its charge period, priced by its pricing
                            model.
                          properties:
                            category:
                              type: string
                              description: 'The category of the charge: usage_based.'
                              enum:
                                - usage_based
                            id:
                              type: string
                              format: uuid
                              description: >-
                                The unique identifier of the plan charge in our
                                system.
                            position:
                              type: integer
                              minimum: 0
                              description: >-
                                The position of the charge in the plan, from 0,
                                in the order that the billing app shows.
                            itemId:
                              type: string
                              format: uuid
                              description: >-
                                The unique identifier of the item that the
                                charge bills. The line items of the charge name
                                the same item.
                            productId:
                              type: string
                              format: uuid
                              description: >-
                                The unique identifier of the product that the
                                charge belongs to.
                            name:
                              type: string
                              minLength: 1
                              description: The name of the charge, as the invoices show it.
                              examples:
                                - Mensalidade
                            isCustomNameEnabled:
                              type: boolean
                              description: >-
                                Whether the charge has a name of its own. When
                                false, the name of the charge is the name of its
                                resource, of its license or of its item.
                            billingFrequency:
                              type: object
                              description: >-
                                How often the charge bills: each charge period
                                of the charge lasts count units, the charge
                                counts its charge periods from the contract
                                start, and it bills each charge period once.
                                Aira accepts 1 or 2 weeks and 1, 3, 6 or 12
                                months, and a prorated charge bills every week
                                or every month.
                              properties:
                                unit:
                                  type: string
                                  enum:
                                    - month
                                    - week
                                  description: >-
                                    The unit of the billing frequency: month or
                                    week. Every charge of a plan has the same
                                    unit.
                                count:
                                  type: integer
                                  minimum: 1
                                  description: >-
                                    The number of units in each charge period of
                                    the charge.
                              required:
                                - unit
                                - count
                              additionalProperties: false
                            pricingModel:
                              type: string
                              enum:
                                - per_unit
                                - per_package
                                - percentage
                                - tiered_per_unit
                                - tiered_percentage
                                - tiered_fixed
                                - advanced
                              description: >-
                                The pricing model of the charge, the same as
                                pricing.model. per_unit, per_package and
                                tiered_per_unit price a resource in units,
                                percentage and tiered_percentage price a
                                resource in money, and tiered_fixed and advanced
                                price either.
                            pricing:
                              type: object
                              description: >-
                                The price of a usage-based or license-based
                                charge, by pricing model. Its model is the
                                pricingModel of the charge.
                              discriminator:
                                propertyName: model
                              oneOf:
                                - type: object
                                  description: >-
                                    Per unit: each unit of the charge period
                                    past the included quantity costs unitPrice.
                                    A charge on a resource in money cannot have
                                    it.
                                  properties:
                                    model:
                                      description: >-
                                        The pricing model of the price:
                                        per_unit.
                                      enum:
                                        - per_unit
                                    includedQuantity:
                                      type: integer
                                      minimum: 0
                                      description: >-
                                        The number of units of each charge
                                        period that the charge does not bill,
                                        when it has one.
                                    unitPrice:
                                      type: string
                                      pattern: ^\d+(\.\d{1,6})?$
                                      description: >-
                                        The price of one unit, as a decimal
                                        string.
                                      examples:
                                        - '0.25'
                                    fixedAmount:
                                      type: integer
                                      minimum: 0
                                      description: >-
                                        An amount that the charge adds in each
                                        charge period on top of its priced
                                        quantity, in cents, when it has one.
                                    minimumAmount:
                                      type: integer
                                      minimum: 0
                                      description: >-
                                        The least that the charge bills in a
                                        charge period, in cents, when it has
                                        one: when the priced quantity plus
                                        fixedAmount comes to less, the charge
                                        bills this amount.
                                  required:
                                    - model
                                    - unitPrice
                                  additionalProperties: false
                                - type: object
                                  description: >-
                                    Per package: the units of the charge period
                                    past the included quantity bill packagePrice
                                    for each package of packageSize units that
                                    they start. A charge on a resource in money
                                    cannot have it.
                                  properties:
                                    model:
                                      description: >-
                                        The pricing model of the price:
                                        per_package.
                                      enum:
                                        - per_package
                                    includedQuantity:
                                      type: integer
                                      minimum: 0
                                      description: >-
                                        The number of units of each charge
                                        period that the charge does not bill,
                                        when it has one.
                                    packageSize:
                                      type: integer
                                      minimum: 1
                                      description: The number of units in one package.
                                    packagePrice:
                                      type: string
                                      pattern: ^\d+(\.\d{1,6})?$
                                      description: >-
                                        The price of one package, as a decimal
                                        string.
                                      examples:
                                        - '50.00'
                                    fixedAmount:
                                      type: integer
                                      minimum: 0
                                      description: >-
                                        An amount that the charge adds in each
                                        charge period on top of its priced
                                        quantity, in cents, when it has one.
                                    minimumAmount:
                                      type: integer
                                      minimum: 0
                                      description: >-
                                        The least that the charge bills in a
                                        charge period, in cents, when it has
                                        one: when the priced quantity plus
                                        fixedAmount comes to less, the charge
                                        bills this amount.
                                  required:
                                    - model
                                    - packageSize
                                    - packagePrice
                                  additionalProperties: false
                                - type: object
                                  description: >-
                                    Percentage: the charge bills a percentage of
                                    the usage of its resource in the charge
                                    period. Only a charge on a resource in money
                                    has it.
                                  properties:
                                    model:
                                      description: >-
                                        The pricing model of the price:
                                        percentage.
                                      enum:
                                        - percentage
                                    percentage:
                                      type: string
                                      pattern: ^(100(\.0{1,6})?|\d{1,2}(\.\d{1,6})?)$
                                      description: >-
                                        The percentage of the usage that the
                                        charge bills, as a decimal string from 0
                                        to 100.
                                      examples:
                                        - '2.5'
                                    fixedAmount:
                                      type: integer
                                      minimum: 0
                                      description: >-
                                        An amount that the charge adds in each
                                        charge period on top of its priced
                                        quantity, in cents, when it has one.
                                    minimumAmount:
                                      type: integer
                                      minimum: 0
                                      description: >-
                                        The least that the charge bills in a
                                        charge period, in cents, when it has
                                        one: when the priced quantity plus
                                        fixedAmount comes to less, the charge
                                        bills this amount.
                                  required:
                                    - model
                                    - percentage
                                  additionalProperties: false
                                - type: object
                                  description: >-
                                    Tiered per unit: the tiers of the charge
                                    price its units, and each tier prices them
                                    per unit. A charge on a resource in money
                                    cannot have it.
                                  properties:
                                    model:
                                      description: >-
                                        The pricing model of the price:
                                        tiered_per_unit.
                                      enum:
                                        - tiered_per_unit
                                    tierMode:
                                      enum:
                                        - progressive
                                        - volume
                                      description: >-
                                        How the tiers price the quantity:
                                        progressive splits it across the tiers,
                                        and volume prices all of it at the tier
                                        that it reaches.
                                    fixedAmount:
                                      type: integer
                                      minimum: 0
                                      description: >-
                                        An amount that the charge adds in each
                                        charge period on top of its priced
                                        quantity, in cents, when it has one.
                                    minimumAmount:
                                      type: integer
                                      minimum: 0
                                      description: >-
                                        The least that the charge bills in a
                                        charge period, in cents, when it has
                                        one: when the priced quantity plus
                                        fixedAmount comes to less, the charge
                                        bills this amount.
                                  required:
                                    - model
                                    - tierMode
                                  additionalProperties: false
                                - type: object
                                  description: >-
                                    Tiered percentage: the tiers of the charge
                                    price its usage, and each tier bills a
                                    percentage of it. Only a charge on a
                                    resource in money has it.
                                  properties:
                                    model:
                                      description: >-
                                        The pricing model of the price:
                                        tiered_percentage.
                                      enum:
                                        - tiered_percentage
                                    tierMode:
                                      enum:
                                        - progressive
                                        - volume
                                      description: >-
                                        How the tiers price the quantity:
                                        progressive splits it across the tiers,
                                        and volume prices all of it at the tier
                                        that it reaches.
                                    fixedAmount:
                                      type: integer
                                      minimum: 0
                                      description: >-
                                        An amount that the charge adds in each
                                        charge period on top of its priced
                                        quantity, in cents, when it has one.
                                    minimumAmount:
                                      type: integer
                                      minimum: 0
                                      description: >-
                                        The least that the charge bills in a
                                        charge period, in cents, when it has
                                        one: when the priced quantity plus
                                        fixedAmount comes to less, the charge
                                        bills this amount.
                                  required:
                                    - model
                                    - tierMode
                                  additionalProperties: false
                                - type: object
                                  description: >-
                                    Tiered fixed: the tier that the whole
                                    quantity reaches bills its flat amount. When
                                    the last tier has an end, unitOverage or
                                    percentageOverage prices the quantity past
                                    it, and a charge never has both.
                                  properties:
                                    model:
                                      description: >-
                                        The pricing model of the price:
                                        tiered_fixed.
                                      enum:
                                        - tiered_fixed
                                    tierMode:
                                      enum:
                                        - progressive
                                        - volume
                                      description: >-
                                        Always volume, because the tier that the
                                        whole quantity reaches bills its flat
                                        amount.
                                    unitOverage:
                                      type: object
                                      description: >-
                                        The price of the units past the last
                                        tier, for a charge on a resource in
                                        units or on a license, when the charge
                                        has one.
                                      properties:
                                        excessUnitPrice:
                                          type: string
                                          pattern: ^\d+(\.\d{1,6})?$
                                          description: >-
                                            The price of one unit past the last
                                            tier, as a decimal string.
                                          examples:
                                            - '0.30'
                                      required:
                                        - excessUnitPrice
                                      additionalProperties: false
                                    percentageOverage:
                                      type: object
                                      description: >-
                                        The percentage of the usage past the
                                        last tier that the charge bills, for a
                                        charge on a resource in money, when the
                                        charge has one.
                                      properties:
                                        excessPercentage:
                                          type: string
                                          pattern: ^(100(\.0{1,6})?|\d{1,2}(\.\d{1,6})?)$
                                          description: >-
                                            The percentage of the usage past the
                                            last tier that the charge bills, as a
                                            decimal string from 0 to 100.
                                          examples:
                                            - '1.5'
                                      required:
                                        - excessPercentage
                                      additionalProperties: false
                                    fixedAmount:
                                      type: integer
                                      minimum: 0
                                      description: >-
                                        An amount that the charge adds in each
                                        charge period on top of its priced
                                        quantity, in cents, when it has one.
                                    minimumAmount:
                                      type: integer
                                      minimum: 0
                                      description: >-
                                        The least that the charge bills in a
                                        charge period, in cents, when it has
                                        one: when the priced quantity plus
                                        fixedAmount comes to less, the charge
                                        bills this amount.
                                  required:
                                    - model
                                    - tierMode
                                  not:
                                    required:
                                      - unitOverage
                                      - percentageOverage
                                  additionalProperties: false
                                - type: object
                                  description: >-
                                    Advanced: tiers of mixed types price the
                                    quantity. The tiers of a charge on a
                                    resource in units are per_unit, per_package
                                    or flat, and those of a charge on a resource
                                    in money are percentage or flat. A charge
                                    priced before the other pricing models
                                    existed has it too.
                                  properties:
                                    model:
                                      description: >-
                                        The pricing model of the price:
                                        advanced.
                                      enum:
                                        - advanced
                                    tierMode:
                                      enum:
                                        - progressive
                                        - volume
                                      description: >-
                                        How the tiers price the quantity:
                                        progressive splits it across the tiers,
                                        and volume prices all of it at the tier
                                        that it reaches.
                                    fixedAmount:
                                      type: integer
                                      minimum: 0
                                      description: >-
                                        An amount that the charge adds in each
                                        charge period on top of its priced
                                        quantity, in cents, when it has one.
                                    minimumAmount:
                                      type: integer
                                      minimum: 0
                                      description: >-
                                        The least that the charge bills in a
                                        charge period, in cents, when it has
                                        one: when the priced quantity plus
                                        fixedAmount comes to less, the charge
                                        bills this amount.
                                  required:
                                    - model
                                    - tierMode
                                  additionalProperties: false
                            resourceId:
                              type: string
                              format: uuid
                              description: >-
                                The unique identifier of the resource whose
                                usage the charge prices.
                            currencyUnit:
                              type: object
                              description: >-
                                The currency unit that the charge is priced in,
                                or null when the charge has none. A charge with
                                no currency unit or in BRL, the default currency
                                unit, bills money. A charge in any other
                                currency unit, a credit unit, decreases the
                                balance of a credit pool in that unit and bills
                                no money.
                              properties:
                                id:
                                  type: string
                                  format: uuid
                                  description: >-
                                    The unique identifier of the currency unit
                                    in our system.
                                name:
                                  type: string
                                  description: The name of the currency unit.
                                  examples:
                                    - Real
                                code:
                                  type: string
                                  description: The short code of the currency unit.
                                  examples:
                                    - BRL
                              required:
                                - id
                                - name
                                - code
                              additionalProperties: false
                              nullable: true
                            tiers:
                              type: array
                              items:
                                type: object
                                description: >-
                                  A price tier of the charge: a band of
                                  quantity, from one number to another, with its
                                  own price. The first tier starts at 0 or 1,
                                  and each tier starts at the to of the tier
                                  before it plus 1.
                                properties:
                                  id:
                                    type: string
                                    format: uuid
                                    description: >-
                                      The unique identifier of the tier in our
                                      system.
                                  position:
                                    type: integer
                                    minimum: 0
                                    description: >-
                                      The position of the tier in the charge,
                                      from 0, from the lowest band to the
                                      highest.
                                  from:
                                    type: integer
                                    minimum: 0
                                    description: >-
                                      The first quantity of the band, which the
                                      band includes: a number of units of the
                                      resource or of the license, or of cents
                                      for a resource in money.
                                  to:
                                    type: integer
                                    minimum: 0
                                    nullable: true
                                    description: >-
                                      The last quantity of the band, which the
                                      band includes, in the unit of from, or
                                      null when the band has no end. The last
                                      tier has an end only on a charge with the
                                      pricing model tiered_fixed and an overage.
                                  pricing:
                                    type: object
                                    description: >-
                                      The price of the quantity that falls in
                                      the tier, by type: per_unit, percentage,
                                      per_package or flat.
                                    discriminator:
                                      propertyName: type
                                    oneOf:
                                      - type: object
                                        description: >-
                                          Per unit: each unit in the tier costs
                                          unitPrice. A charge on a resource in
                                          money cannot have it.
                                        properties:
                                          type:
                                            description: 'The type of the tier price: per_unit.'
                                            enum:
                                              - per_unit
                                          unitPrice:
                                            type: string
                                            pattern: ^\d+(\.\d{1,6})?$
                                            description: >-
                                              The price of one unit in the tier, as a
                                              decimal string.
                                            examples:
                                              - '0.20'
                                          fixedPrice:
                                            type: string
                                            pattern: ^\d+(\.\d{1,6})?$
                                            nullable: true
                                            description: >-
                                              An amount that the tier bills on top of
                                              its units when the tier applies, as a
                                              decimal string, or null when it has
                                              none. Only a tier of a charge with the
                                              pricing model tiered_per_unit has an
                                              amount other than zero.
                                            examples:
                                              - '10.00'
                                        required:
                                          - type
                                          - unitPrice
                                          - fixedPrice
                                        additionalProperties: false
                                      - type: object
                                        description: >-
                                          Percentage: the tier bills a percentage
                                          of the usage that falls in it. Only a
                                          charge on a resource in money has it.
                                        properties:
                                          type:
                                            description: 'The type of the tier price: percentage.'
                                            enum:
                                              - percentage
                                          percentage:
                                            type: string
                                            pattern: ^(100(\.0{1,6})?|\d{1,2}(\.\d{1,6})?)$
                                            description: >-
                                              The percentage of the usage in the tier
                                              that the tier bills, as a decimal string
                                              from 0 to 100.
                                            examples:
                                              - '1.5'
                                        required:
                                          - type
                                          - percentage
                                        additionalProperties: false
                                      - type: object
                                        description: >-
                                          Per package: the units in the tier bill
                                          packagePrice for each package of
                                          packageSize units that they start. A
                                          charge on a resource in money cannot
                                          have it.
                                        properties:
                                          type:
                                            description: 'The type of the tier price: per_package.'
                                            enum:
                                              - per_package
                                          packageSize:
                                            type: integer
                                            minimum: 1
                                            description: The number of units in one package.
                                          packagePrice:
                                            type: string
                                            pattern: ^\d+(\.\d{1,6})?$
                                            description: >-
                                              The price of one package, as a decimal
                                              string.
                                            examples:
                                              - '45.00'
                                        required:
                                          - type
                                          - packageSize
                                          - packagePrice
                                        additionalProperties: false
                                      - type: object
                                        description: >-
                                          Flat: the tier bills one amount,
                                          whatever the quantity that falls in it.
                                        properties:
                                          type:
                                            description: 'The type of the tier price: flat.'
                                            enum:
                                              - flat
                                          amount:
                                            type: string
                                            pattern: ^\d+(\.\d{1,6})?$
                                            description: >-
                                              The amount that the tier bills, as a
                                              decimal string.
                                            examples:
                                              - '199.90'
                                        required:
                                          - type
                                          - amount
                                        additionalProperties: false
                                required:
                                  - id
                                  - position
                                  - from
                                  - to
                                  - pricing
                                additionalProperties: false
                              description: >-
                                The price tiers of the charge, from the lowest
                                band to the highest, for the pricing models
                                tiered_per_unit, tiered_percentage, tiered_fixed
                                and advanced, or an empty list for the other
                                pricing models.
                          required:
                            - id
                            - position
                            - itemId
                            - productId
                            - name
                            - isCustomNameEnabled
                            - category
                            - pricingModel
                            - pricing
                            - billingFrequency
                            - resourceId
                            - currencyUnit
                            - tiers
                          additionalProperties: false
                        - type: object
                          description: >-
                            A license-based charge: a charge on the balance of a
                            license in its charge period, read by its billing
                            model and priced by its pricing model.
                          properties:
                            category:
                              type: string
                              description: 'The category of the charge: license_based.'
                              enum:
                                - license_based
                            id:
                              type: string
                              format: uuid
                              description: >-
                                The unique identifier of the plan charge in our
                                system.
                            position:
                              type: integer
                              minimum: 0
                              description: >-
                                The position of the charge in the plan, from 0,
                                in the order that the billing app shows.
                            itemId:
                              type: string
                              format: uuid
                              description: >-
                                The unique identifier of the item that the
                                charge bills. The line items of the charge name
                                the same item.
                            productId:
                              type: string
                              format: uuid
                              description: >-
                                The unique identifier of the product that the
                                charge belongs to.
                            name:
                              type: string
                              minLength: 1
                              description: The name of the charge, as the invoices show it.
                              examples:
                                - Mensalidade
                            isCustomNameEnabled:
                              type: boolean
                              description: >-
                                Whether the charge has a name of its own. When
                                false, the name of the charge is the name of its
                                resource, of its license or of its item.
                            billingFrequency:
                              type: object
                              description: >-
                                How often the charge bills: each charge period
                                of the charge lasts count units, the charge
                                counts its charge periods from the contract
                                start, and it bills each charge period once.
                                Aira accepts 1 or 2 weeks and 1, 3, 6 or 12
                                months, and a prorated charge bills every week
                                or every month.
                              properties:
                                unit:
                                  type: string
                                  enum:
                                    - month
                                    - week
                                  description: >-
                                    The unit of the billing frequency: month or
                                    week. Every charge of a plan has the same
                                    unit.
                                count:
                                  type: integer
                                  minimum: 1
                                  description: >-
                                    The number of units in each charge period of
                                    the charge.
                              required:
                                - unit
                                - count
                              additionalProperties: false
                            pricingModel:
                              type: string
                              enum:
                                - per_unit
                                - per_package
                                - tiered_per_unit
                                - tiered_fixed
                              description: >-
                                The pricing model of the charge, the same as
                                pricing.model: per_unit, per_package,
                                tiered_per_unit or tiered_fixed. No percentage
                                applies, because the balance of a license is a
                                count, not an amount of money.
                            pricing:
                              type: object
                              description: >-
                                The price of a usage-based or license-based
                                charge, by pricing model. Its model is the
                                pricingModel of the charge.
                              discriminator:
                                propertyName: model
                              oneOf:
                                - type: object
                                  description: >-
                                    Per unit: each unit of the charge period
                                    past the included quantity costs unitPrice.
                                    A charge on a resource in money cannot have
                                    it.
                                  properties:
                                    model:
                                      description: >-
                                        The pricing model of the price:
                                        per_unit.
                                      enum:
                                        - per_unit
                                    includedQuantity:
                                      type: integer
                                      minimum: 0
                                      description: >-
                                        The number of units of each charge
                                        period that the charge does not bill,
                                        when it has one.
                                    unitPrice:
                                      type: string
                                      pattern: ^\d+(\.\d{1,6})?$
                                      description: >-
                                        The price of one unit, as a decimal
                                        string.
                                      examples:
                                        - '0.25'
                                    fixedAmount:
                                      type: integer
                                      minimum: 0
                                      description: >-
                                        An amount that the charge adds in each
                                        charge period on top of its priced
                                        quantity, in cents, when it has one.
                                    minimumAmount:
                                      type: integer
                                      minimum: 0
                                      description: >-
                                        The least that the charge bills in a
                                        charge period, in cents, when it has
                                        one: when the priced quantity plus
                                        fixedAmount comes to less, the charge
                                        bills this amount.
                                  required:
                                    - model
                                    - unitPrice
                                  additionalProperties: false
                                - type: object
                                  description: >-
                                    Per package: the units of the charge period
                                    past the included quantity bill packagePrice
                                    for each package of packageSize units that
                                    they start. A charge on a resource in money
                                    cannot have it.
                                  properties:
                                    model:
                                      description: >-
                                        The pricing model of the price:
                                        per_package.
                                      enum:
                                        - per_package
                                    includedQuantity:
                                      type: integer
                                      minimum: 0
                                      description: >-
                                        The number of units of each charge
                                        period that the charge does not bill,
                                        when it has one.
                                    packageSize:
                                      type: integer
                                      minimum: 1
                                      description: The number of units in one package.
                                    packagePrice:
                                      type: string
                                      pattern: ^\d+(\.\d{1,6})?$
                                      description: >-
                                        The price of one package, as a decimal
                                        string.
                                      examples:
                                        - '50.00'
                                    fixedAmount:
                                      type: integer
                                      minimum: 0
                                      description: >-
                                        An amount that the charge adds in each
                                        charge period on top of its priced
                                        quantity, in cents, when it has one.
                                    minimumAmount:
                                      type: integer
                                      minimum: 0
                                      description: >-
                                        The least that the charge bills in a
                                        charge period, in cents, when it has
                                        one: when the priced quantity plus
                                        fixedAmount comes to less, the charge
                                        bills this amount.
                                  required:
                                    - model
                                    - packageSize
                                    - packagePrice
                                  additionalProperties: false
                                - type: object
                                  description: >-
                                    Percentage: the charge bills a percentage of
                                    the usage of its resource in the charge
                                    period. Only a charge on a resource in money
                                    has it.
                                  properties:
                                    model:
                                      description: >-
                                        The pricing model of the price:
                                        percentage.
                                      enum:
                                        - percentage
                                    percentage:
                                      type: string
                                      pattern: ^(100(\.0{1,6})?|\d{1,2}(\.\d{1,6})?)$
                                      description: >-
                                        The percentage of the usage that the
                                        charge bills, as a decimal string from 0
                                        to 100.
                                      examples:
                                        - '2.5'
                                    fixedAmount:
                                      type: integer
                                      minimum: 0
                                      description: >-
                                        An amount that the charge adds in each
                                        charge period on top of its priced
                                        quantity, in cents, when it has one.
                                    minimumAmount:
                                      type: integer
                                      minimum: 0
                                      description: >-
                                        The least that the charge bills in a
                                        charge period, in cents, when it has
                                        one: when the priced quantity plus
                                        fixedAmount comes to less, the charge
                                        bills this amount.
                                  required:
                                    - model
                                    - percentage
                                  additionalProperties: false
                                - type: object
                                  description: >-
                                    Tiered per unit: the tiers of the charge
                                    price its units, and each tier prices them
                                    per unit. A charge on a resource in money
                                    cannot have it.
                                  properties:
                                    model:
                                      description: >-
                                        The pricing model of the price:
                                        tiered_per_unit.
                                      enum:
                                        - tiered_per_unit
                                    tierMode:
                                      enum:
                                        - progressive
                                        - volume
                                      description: >-
                                        How the tiers price the quantity:
                                        progressive splits it across the tiers,
                                        and volume prices all of it at the tier
                                        that it reaches.
                                    fixedAmount:
                                      type: integer
                                      minimum: 0
                                      description: >-
                                        An amount that the charge adds in each
                                        charge period on top of its priced
                                        quantity, in cents, when it has one.
                                    minimumAmount:
                                      type: integer
                                      minimum: 0
                                      description: >-
                                        The least that the charge bills in a
                                        charge period, in cents, when it has
                                        one: when the priced quantity plus
                                        fixedAmount comes to less, the charge
                                        bills this amount.
                                  required:
                                    - model
                                    - tierMode
                                  additionalProperties: false
                                - type: object
                                  description: >-
                                    Tiered percentage: the tiers of the charge
                                    price its usage, and each tier bills a
                                    percentage of it. Only a charge on a
                                    resource in money has it.
                                  properties:
                                    model:
                                      description: >-
                                        The pricing model of the price:
                                        tiered_percentage.
                                      enum:
                                        - tiered_percentage
                                    tierMode:
                                      enum:
                                        - progressive
                                        - volume
                                      description: >-
                                        How the tiers price the quantity:
                                        progressive splits it across the tiers,
                                        and volume prices all of it at the tier
                                        that it reaches.
                                    fixedAmount:
                                      type: integer
                                      minimum: 0
                                      description: >-
                                        An amount that the charge adds in each
                                        charge period on top of its priced
                                        quantity, in cents, when it has one.
                                    minimumAmount:
                                      type: integer
                                      minimum: 0
                                      description: >-
                                        The least that the charge bills in a
                                        charge period, in cents, when it has
                                        one: when the priced quantity plus
                                        fixedAmount comes to less, the charge
                                        bills this amount.
                                  required:
                                    - model
                                    - tierMode
                                  additionalProperties: false
                                - type: object
                                  description: >-
                                    Tiered fixed: the tier that the whole
                                    quantity reaches bills its flat amount. When
                                    the last tier has an end, unitOverage or
                                    percentageOverage prices the quantity past
                                    it, and a charge never has both.
                                  properties:
                                    model:
                                      description: >-
                                        The pricing model of the price:
                                        tiered_fixed.
                                      enum:
                                        - tiered_fixed
                                    tierMode:
                                      enum:
                                        - progressive
                                        - volume
                                      description: >-
                                        Always volume, because the tier that the
                                        whole quantity reaches bills its flat
                                        amount.
                                    unitOverage:
                                      type: object
                                      description: >-
                                        The price of the units past the last
                                        tier, for a charge on a resource in
                                        units or on a license, when the charge
                                        has one.
                                      properties:
                                        excessUnitPrice:
                                          type: string
                                          pattern: ^\d+(\.\d{1,6})?$
                                          description: >-
                                            The price of one unit past the last
                                            tier, as a decimal string.
                                          examples:
                                            - '0.30'
                                      required:
                                        - excessUnitPrice
                                      additionalProperties: false
                                    percentageOverage:
                                      type: object
                                      description: >-
                                        The percentage of the usage past the
                                        last tier that the charge bills, for a
                                        charge on a resource in money, when the
                                        charge has one.
                                      properties:
                                        excessPercentage:
                                          type: string
                                          pattern: ^(100(\.0{1,6})?|\d{1,2}(\.\d{1,6})?)$
                                          description: >-
                                            The percentage of the usage past the
                                            last tier that the charge bills, as a
                                            decimal string from 0 to 100.
                                          examples:
                                            - '1.5'
                                      required:
                                        - excessPercentage
                                      additionalProperties: false
                                    fixedAmount:
                                      type: integer
                                      minimum: 0
                                      description: >-
                                        An amount that the charge adds in each
                                        charge period on top of its priced
                                        quantity, in cents, when it has one.
                                    minimumAmount:
                                      type: integer
                                      minimum: 0
                                      description: >-
                                        The least that the charge bills in a
                                        charge period, in cents, when it has
                                        one: when the priced quantity plus
                                        fixedAmount comes to less, the charge
                                        bills this amount.
                                  required:
                                    - model
                                    - tierMode
                                  not:
                                    required:
                                      - unitOverage
                                      - percentageOverage
                                  additionalProperties: false
                                - type: object
                                  description: >-
                                    Advanced: tiers of mixed types price the
                                    quantity. The tiers of a charge on a
                                    resource in units are per_unit, per_package
                                    or flat, and those of a charge on a resource
                                    in money are percentage or flat. A charge
                                    priced before the other pricing models
                                    existed has it too.
                                  properties:
                                    model:
                                      description: >-
                                        The pricing model of the price:
                                        advanced.
                                      enum:
                                        - advanced
                                    tierMode:
                                      enum:
                                        - progressive
                                        - volume
                                      description: >-
                                        How the tiers price the quantity:
                                        progressive splits it across the tiers,
                                        and volume prices all of it at the tier
                                        that it reaches.
                                    fixedAmount:
                                      type: integer
                                      minimum: 0
                                      description: >-
                                        An amount that the charge adds in each
                                        charge period on top of its priced
                                        quantity, in cents, when it has one.
                                    minimumAmount:
                                      type: integer
                                      minimum: 0
                                      description: >-
                                        The least that the charge bills in a
                                        charge period, in cents, when it has
                                        one: when the priced quantity plus
                                        fixedAmount comes to less, the charge
                                        bills this amount.
                                  required:
                                    - model
                                    - tierMode
                                  additionalProperties: false
                            licenseId:
                              type: string
                              format: uuid
                              description: >-
                                The unique identifier of the license whose
                                balance the charge bills.
                            billingModel:
                              type: string
                              enum:
                                - in_full
                                - proration
                              description: >-
                                How the charge reads the balance of its license
                                in a charge period: in_full bills the last
                                balance, and proration weighs each balance by
                                the days that it was in effect.
                            tiers:
                              type: array
                              items:
                                type: object
                                description: >-
                                  A price tier of the charge: a band of
                                  quantity, from one number to another, with its
                                  own price. The first tier starts at 0 or 1,
                                  and each tier starts at the to of the tier
                                  before it plus 1.
                                properties:
                                  id:
                                    type: string
                                    format: uuid
                                    description: >-
                                      The unique identifier of the tier in our
                                      system.
                                  position:
                                    type: integer
                                    minimum: 0
                                    description: >-
                                      The position of the tier in the charge,
                                      from 0, from the lowest band to the
                                      highest.
                                  from:
                                    type: integer
                                    minimum: 0
                                    description: >-
                                      The first quantity of the band, which the
                                      band includes: a number of units of the
                                      resource or of the license, or of cents
                                      for a resource in money.
                                  to:
                                    type: integer
                                    minimum: 0
                                    nullable: true
                                    description: >-
                                      The last quantity of the band, which the
                                      band includes, in the unit of from, or
                                      null when the band has no end. The last
                                      tier has an end only on a charge with the
                                      pricing model tiered_fixed and an overage.
                                  pricing:
                                    type: object
                                    description: >-
                                      The price of the quantity that falls in
                                      the tier, by type: per_unit, percentage,
                                      per_package or flat.
                                    discriminator:
                                      propertyName: type
                                    oneOf:
                                      - type: object
                                        description: >-
                                          Per unit: each unit in the tier costs
                                          unitPrice. A charge on a resource in
                                          money cannot have it.
                                        properties:
                                          type:
                                            description: 'The type of the tier price: per_unit.'
                                            enum:
                                              - per_unit
                                          unitPrice:
                                            type: string
                                            pattern: ^\d+(\.\d{1,6})?$
                                            description: >-
                                              The price of one unit in the tier, as a
                                              decimal string.
                                            examples:
                                              - '0.20'
                                          fixedPrice:
                                            type: string
                                            pattern: ^\d+(\.\d{1,6})?$
                                            nullable: true
                                            description: >-
                                              An amount that the tier bills on top of
                                              its units when the tier applies, as a
                                              decimal string, or null when it has
                                              none. Only a tier of a charge with the
                                              pricing model tiered_per_unit has an
                                              amount other than zero.
                                            examples:
                                              - '10.00'
                                        required:
                                          - type
                                          - unitPrice
                                          - fixedPrice
                                        additionalProperties: false
                                      - type: object
                                        description: >-
                                          Percentage: the tier bills a percentage
                                          of the usage that falls in it. Only a
                                          charge on a resource in money has it.
                                        properties:
                                          type:
                                            description: 'The type of the tier price: percentage.'
                                            enum:
                                              - percentage
                                          percentage:
                                            type: string
                                            pattern: ^(100(\.0{1,6})?|\d{1,2}(\.\d{1,6})?)$
                                            description: >-
                                              The percentage of the usage in the tier
                                              that the tier bills, as a decimal string
                                              from 0 to 100.
                                            examples:
                                              - '1.5'
                                        required:
                                          - type
                                          - percentage
                                        additionalProperties: false
                                      - type: object
                                        description: >-
                                          Per package: the units in the tier bill
                                          packagePrice for each package of
                                          packageSize units that they start. A
                                          charge on a resource in money cannot
                                          have it.
                                        properties:
                                          type:
                                            description: 'The type of the tier price: per_package.'
                                            enum:
                                              - per_package
                                          packageSize:
                                            type: integer
                                            minimum: 1
                                            description: The number of units in one package.
                                          packagePrice:
                                            type: string
                                            pattern: ^\d+(\.\d{1,6})?$
                                            description: >-
                                              The price of one package, as a decimal
                                              string.
                                            examples:
                                              - '45.00'
                                        required:
                                          - type
                                          - packageSize
                                          - packagePrice
                                        additionalProperties: false
                                      - type: object
                                        description: >-
                                          Flat: the tier bills one amount,
                                          whatever the quantity that falls in it.
                                        properties:
                                          type:
                                            description: 'The type of the tier price: flat.'
                                            enum:
                                              - flat
                                          amount:
                                            type: string
                                            pattern: ^\d+(\.\d{1,6})?$
                                            description: >-
                                              The amount that the tier bills, as a
                                              decimal string.
                                            examples:
                                              - '199.90'
                                        required:
                                          - type
                                          - amount
                                        additionalProperties: false
                                required:
                                  - id
                                  - position
                                  - from
                                  - to
                                  - pricing
                                additionalProperties: false
                              description: >-
                                The price tiers of the charge, from the lowest
                                band to the highest, for the pricing models
                                tiered_per_unit and tiered_fixed, or an empty
                                list for the other pricing models.
                          required:
                            - id
                            - position
                            - itemId
                            - productId
                            - name
                            - isCustomNameEnabled
                            - category
                            - pricingModel
                            - pricing
                            - billingFrequency
                            - licenseId
                            - billingModel
                            - tiers
                          additionalProperties: false
                        - type: object
                          description: >-
                            A custom plan charge: a charge whose price comes
                            from code that Aira writes for the tenant, from the
                            custom charge definition that the charge follows and
                            from the parameter values of the charge. It bills in
                            arrears, in money.
                          properties:
                            category:
                              type: string
                              description: 'The category of the charge: custom.'
                              enum:
                                - custom
                            id:
                              type: string
                              format: uuid
                              description: >-
                                The unique identifier of the plan charge in our
                                system.
                            position:
                              type: integer
                              minimum: 0
                              description: >-
                                The position of the charge in the plan, from 0,
                                in the order that the billing app shows.
                            itemId:
                              type: string
                              format: uuid
                              description: >-
                                The unique identifier of the item that the
                                charge bills. The line items of the charge name
                                the same item.
                            productId:
                              type: string
                              format: uuid
                              description: >-
                                The unique identifier of the product that the
                                charge belongs to.
                            name:
                              type: string
                              minLength: 1
                              description: The name of the charge, as the invoices show it.
                              examples:
                                - Mensalidade
                            isCustomNameEnabled:
                              type: boolean
                              description: >-
                                Whether the charge has a name of its own. When
                                false, the name of the charge is the name of its
                                resource, of its license or of its item.
                            billingFrequency:
                              type: object
                              description: >-
                                How often the charge bills: each charge period
                                of the charge lasts count units, the charge
                                counts its charge periods from the contract
                                start, and it bills each charge period once.
                                Aira accepts 1 or 2 weeks and 1, 3, 6 or 12
                                months, and a prorated charge bills every week
                                or every month.
                              properties:
                                unit:
                                  type: string
                                  enum:
                                    - month
                                    - week
                                  description: >-
                                    The unit of the billing frequency: month or
                                    week. Every charge of a plan has the same
                                    unit.
                                count:
                                  type: integer
                                  minimum: 1
                                  description: >-
                                    The number of units in each charge period of
                                    the charge.
                              required:
                                - unit
                                - count
                              additionalProperties: false
                            pricingModel:
                              type: string
                              description: The pricing model of the charge, always custom.
                              enum:
                                - custom
                            pricing:
                              type: object
                              description: >-
                                The price of a custom plan charge: the parameter
                                values that the code that Aira writes for the
                                tenant turns into an amount.
                              properties:
                                model:
                                  description: 'The pricing model of the price: custom.'
                                  enum:
                                    - custom
                                parameters:
                                  type: object
                                  additionalProperties: true
                                  description: >-
                                    The parameter values of the charge, by the
                                    keys of the parameter schema of its custom
                                    charge definition.
                              required:
                                - model
                                - parameters
                              additionalProperties: false
                            customChargeDefinitionId:
                              type: string
                              format: uuid
                              description: >-
                                The unique identifier of the custom charge
                                definition that the charge follows.
                            chosenResourceIds:
                              type: array
                              items:
                                type: string
                                format: uuid
                              description: >-
                                The unique identifiers of the resources that the
                                charge chose as its inputs, from the input
                                resources of its custom charge definition.
                            chosenLicenseIds:
                              type: array
                              items:
                                type: string
                                format: uuid
                              description: >-
                                The unique identifiers of the licenses that the
                                charge chose as its inputs, from the input
                                licenses of its custom charge definition.
                          required:
                            - id
                            - position
                            - itemId
                            - productId
                            - name
                            - isCustomNameEnabled
                            - category
                            - pricingModel
                            - pricing
                            - billingFrequency
                            - customChargeDefinitionId
                            - chosenResourceIds
                            - chosenLicenseIds
                          additionalProperties: false
                    description: The plan charges of the plan version.
                required:
                  - id
                  - versionNumber
                  - isActive
                  - planCharges
                additionalProperties: false
        '400':
          description: >-
            The request cannot succeed as sent.


            - `json_schema_validation_error`: a path parameter breaks the schema
            of the endpoint.
          content:
            application/json:
              schema:
                type: object
                properties:
                  message:
                    type: string
                    description: >-
                      A sentence for a person that says what failed. It can
                      change, so a system compares the code instead.
                  code:
                    type: string
                    description: >-
                      The identifier of the error, which a system compares to
                      decide what to do. It never changes.
                    enum:
                      - json_schema_validation_error
                  details:
                    oneOf:
                      - type: object
                        additionalProperties: true
                      - type: array
                    description: >-
                      The data of the error, when it has any, such as the fields
                      that failed the validation.
                  causations:
                    type: array
                    description: >-
                      The errors that caused this one, when several did, each
                      with its own message, code and details.
                    items:
                      type: object
                      properties:
                        message:
                          type: string
                          description: A sentence for a person that says what failed.
                        code:
                          type: string
                          description: The identifier of the error.
                        details:
                          type: object
                          additionalProperties: true
                          description: The data of the error, when it has any.
                      required:
                        - message
                        - code
                      additionalProperties: false
                required:
                  - message
                  - code
                additionalProperties: false
              examples:
                json_schema_validation_error:
                  value:
                    message: '''id'' must match format "uuid"'
                    code: json_schema_validation_error
        '401':
          description: >-
            The request carries no API key.


            - `no_authorization`: the request carries no API key in the
            `X-API-KEY` header.
          content:
            application/json:
              schema:
                type: object
                properties:
                  message:
                    type: string
                    description: >-
                      A sentence for a person that says what failed. It can
                      change, so a system compares the code instead.
                  code:
                    type: string
                    description: >-
                      The identifier of the error, which a system compares to
                      decide what to do. It never changes.
                    enum:
                      - no_authorization
                  details:
                    oneOf:
                      - type: object
                        additionalProperties: true
                      - type: array
                    description: >-
                      The data of the error, when it has any, such as the fields
                      that failed the validation.
                  causations:
                    type: array
                    description: >-
                      The errors that caused this one, when several did, each
                      with its own message, code and details.
                    items:
                      type: object
                      properties:
                        message:
                          type: string
                          description: A sentence for a person that says what failed.
                        code:
                          type: string
                          description: The identifier of the error.
                        details:
                          type: object
                          additionalProperties: true
                          description: The data of the error, when it has any.
                      required:
                        - message
                        - code
                      additionalProperties: false
                required:
                  - message
                  - code
                additionalProperties: false
              examples:
                no_authorization:
                  value:
                    message: No authorization provided
                    code: no_authorization
        '403':
          description: >-
            The API key cannot call the endpoint.


            - `bad_auth`: the API key does not hold the role that the endpoint
            requires.

            - `invalid_api_key`: the API key does not exist.

            - `deactivated_api_key`: the API key is deactivated.

            - `revoked_api_key`: the API key is revoked.

            - `expired_api_key`: the API key is past its expiry date.

            - `ip_not_allowed`: the tenant does not allow the IP of the request.
          content:
            application/json:
              schema:
                type: object
                properties:
                  message:
                    type: string
                    description: >-
                      A sentence for a person that says what failed. It can
                      change, so a system compares the code instead.
                  code:
                    type: string
                    description: >-
                      The identifier of the error, which a system compares to
                      decide what to do. It never changes.
                    enum:
                      - bad_auth
                      - invalid_api_key
                      - deactivated_api_key
                      - revoked_api_key
                      - expired_api_key
                      - ip_not_allowed
                  details:
                    oneOf:
                      - type: object
                        additionalProperties: true
                      - type: array
                    description: >-
                      The data of the error, when it has any, such as the fields
                      that failed the validation.
                  causations:
                    type: array
                    description: >-
                      The errors that caused this one, when several did, each
                      with its own message, code and details.
                    items:
                      type: object
                      properties:
                        message:
                          type: string
                          description: A sentence for a person that says what failed.
                        code:
                          type: string
                          description: The identifier of the error.
                        details:
                          type: object
                          additionalProperties: true
                          description: The data of the error, when it has any.
                      required:
                        - message
                        - code
                      additionalProperties: false
                required:
                  - message
                  - code
                additionalProperties: false
              examples:
                bad_auth:
                  value:
                    message: role plans:read can not be satisfied
                    code: bad_auth
                invalid_api_key:
                  value:
                    message: Invalid API key
                    code: invalid_api_key
                deactivated_api_key:
                  value:
                    message: Deactivated API key
                    code: deactivated_api_key
                revoked_api_key:
                  value:
                    message: Revoked API key
                    code: revoked_api_key
                expired_api_key:
                  value:
                    message: Expired API key
                    code: expired_api_key
                ip_not_allowed:
                  value:
                    message: IP not allowed
                    code: ip_not_allowed
        '404':
          description: >-
            A record that the request names does not exist in the tenant.


            - `plan_version_not_found`: no plan version of the tenant has the
            `id`.
          content:
            application/json:
              schema:
                type: object
                properties:
                  message:
                    type: string
                    description: >-
                      A sentence for a person that says what failed. It can
                      change, so a system compares the code instead.
                  code:
                    type: string
                    description: >-
                      The identifier of the error, which a system compares to
                      decide what to do. It never changes.
                    enum:
                      - plan_version_not_found
                  details:
                    oneOf:
                      - type: object
                        additionalProperties: true
                      - type: array
                    description: >-
                      The data of the error, when it has any, such as the fields
                      that failed the validation.
                  causations:
                    type: array
                    description: >-
                      The errors that caused this one, when several did, each
                      with its own message, code and details.
                    items:
                      type: object
                      properties:
                        message:
                          type: string
                          description: A sentence for a person that says what failed.
                        code:
                          type: string
                          description: The identifier of the error.
                        details:
                          type: object
                          additionalProperties: true
                          description: The data of the error, when it has any.
                      required:
                        - message
                        - code
                      additionalProperties: false
                required:
                  - message
                  - code
                additionalProperties: false
              examples:
                plan_version_not_found:
                  value:
                    message: plan version not found
                    code: plan_version_not_found
        '429':
          description: >-
            The tenant reached one of its limits of reads.


            - `too_many_reads_per_second`: the tenant already made 50 reads in
            this second.

            - `too_many_reads_in_flight`: the tenant already has 20 reads in
            flight.
          headers:
            Retry-After:
              schema:
                type: integer
              description: The seconds to wait before the next read.
            RateLimit-Limit:
              schema:
                type: integer
              description: >-
                The limit that the read hit: 20 for the reads in flight, 50 for
                the reads per second.
            RateLimit-Remaining:
              schema:
                type: integer
              description: The reads left under that limit, which is 0.
            RateLimit-Reset:
              schema:
                type: integer
              description: >-
                The seconds to wait before the next read, as in Retry-After. The
                limit of reads per second takes new reads in the next second,
                but the limit of reads in flight takes a new read only once one
                of the reads in flight ends.
          content:
            application/json:
              schema:
                type: object
                properties:
                  message:
                    type: string
                    description: >-
                      A sentence for a person that says what failed. It can
                      change, so a system compares the code instead.
                  code:
                    type: string
                    description: >-
                      The identifier of the error, which a system compares to
                      decide what to do. It never changes.
                    enum:
                      - too_many_reads_per_second
                      - too_many_reads_in_flight
                  details:
                    oneOf:
                      - type: object
                        additionalProperties: true
                      - type: array
                    description: >-
                      The data of the error, when it has any, such as the fields
                      that failed the validation.
                  causations:
                    type: array
                    description: >-
                      The errors that caused this one, when several did, each
                      with its own message, code and details.
                    items:
                      type: object
                      properties:
                        message:
                          type: string
                          description: A sentence for a person that says what failed.
                        code:
                          type: string
                          description: The identifier of the error.
                        details:
                          type: object
                          additionalProperties: true
                          description: The data of the error, when it has any.
                      required:
                        - message
                        - code
                      additionalProperties: false
                required:
                  - message
                  - code
                additionalProperties: false
              examples:
                too_many_reads_per_second:
                  value:
                    message: >-
                      Too many reads: a tenant can make at most 50 reads per
                      second. Retry after 1 second.
                    code: too_many_reads_per_second
                too_many_reads_in_flight:
                  value:
                    message: >-
                      Too many reads in flight: a tenant can have at most 20
                      reads in flight. Retry after 1 second.
                    code: too_many_reads_in_flight
components:
  securitySchemes:
    ApiKey:
      type: apiKey
      description: API Key Authentication.
      name: X-API-KEY
      in: header

````

This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.