> ## 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.

# Update plan

> Updates the name, the description and the product of a plan. When the plan charges of the body differ from those of the active plan version, it also creates a plan version with them, which becomes the active plan version of the plan. The plan instances of the plan keep their plan instance versions until `POST /v1/plan-instances/update-to-latest-plan-version` moves them.

Requires the role `plans:write`.



## OpenAPI

````yaml /api-reference/openapi.yaml put /v1/plans/{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/{id}:
    put:
      tags:
        - Plans
      summary: Update plan
      description: >-
        Updates the name, the description and the product of a plan. When the
        plan charges of the body differ from those of the active plan version,
        it also creates a plan version with them, which becomes the active plan
        version of the plan. The plan instances of the plan keep their plan
        instance versions until `POST
        /v1/plan-instances/update-to-latest-plan-version` moves them.


        Requires the role `plans:write`.
      parameters:
        - schema:
            type: string
            format: uuid
          in: path
          name: id
          required: true
          description: The unique identifier of the plan in our system.
      requestBody:
        content:
          application/json:
            schema:
              type: object
              properties:
                name:
                  type: string
                  minLength: 1
                  description: The name of the plan.
                  example: Plano Essencial
                description:
                  description: >-
                    The description of the plan, or null for none. Leave it out
                    for none.
                  type:
                    - 'null'
                    - string
                  example: Assinatura mensal com entrega diária de pães.
                productId:
                  type: string
                  format: uuid
                  description: >-
                    The unique identifier of the product that the plan belongs
                    to.
                planCharges:
                  type: array
                  minItems: 1
                  maxItems: 100
                  items:
                    type: object
                    discriminator:
                      propertyName: category
                    oneOf:
                      - type: object
                        description: >-
                          A fixed charge: bills a flat amount once per period of
                          its billingFrequency, at the boundary its
                          billingTiming picks.
                        properties:
                          category:
                            description: 'Discriminator: fixed charge.'
                            enum:
                              - fixed
                          name:
                            type: string
                            minLength: 1
                            description: >-
                              Display name of the charge as it appears on
                              invoices. Required when isCustomNameEnabled is
                              true. When isCustomNameEnabled is false, the name
                              follows the name of the resource of the charge,
                              else of its license, else of its catalog item.
                            examples:
                              - Mensalidade
                          isCustomNameEnabled:
                            type: boolean
                            description: >-
                              Whether name is customized for this charge. When
                              false, the name follows the name of the resource
                              of the charge, else of its license, else of its
                              catalog item.
                          itemId:
                            type: string
                            format: uuid
                            description: >-
                              The unique identifier of the catalog item this
                              charge bills.
                          pricingModel:
                            type: string
                            description: >-
                              Fixed and minimum_commitment charges always use
                              fixed pricing.
                            enum:
                              - fixed
                          pricing:
                            type: object
                            description: >-
                              Fixed pricing: a flat amount billed once per
                              period of the charge's billingFrequency. The only
                              pricing available for fixed and minimum_commitment
                              charges.
                            properties:
                              model:
                                description: 'Discriminator: fixed pricing.'
                                enum:
                                  - fixed
                              amount:
                                type: integer
                                minimum: 0
                                description: >-
                                  The flat amount billed per period, in cents.
                                  For minimum_commitment charges, the minimum
                                  the charges sharing its frequency are topped
                                  up to.
                              quantity:
                                type: integer
                                minimum: 1
                                description: >-
                                  Optional, fixed charges only: the quantity
                                  billed. When set, amount is the amount of one
                                  unit and each period of the charge's
                                  billingFrequency bills quantity x amount.
                            required:
                              - model
                              - amount
                            additionalProperties: false
                          billingFrequency:
                            type: object
                            description: >-
                              Optional. The period this charge covers: unit
                              month or week, repeated count times. A write
                              accepts six frequencies: week x 1, week x 2, month
                              x 1 (the default), month x 3, month x 6 and month
                              x 12; any other count is rejected. Fixed and
                              minimum-commitment charges bill at their period
                              boundary; usage-based charges measure their
                              resource over the whole period and license-based
                              charges bill the last count reported before it
                              closes, both priced at the close. Custom charges
                              read their input resources and licenses the same
                              way, and their calculator prices them at the
                              close. Prorated license charges and usage charges
                              on a prorated resource accept only a count of one,
                              month x 1 or week x 1. Defaults to month x 1 when
                              omitted.
                            properties:
                              unit:
                                type: string
                                enum:
                                  - month
                                  - week
                                description: >-
                                  Grid family of the period. All charges on a
                                  plan must share one family.
                              count:
                                type: integer
                                minimum: 1
                                description: How many units the period spans.
                            required:
                              - unit
                              - count
                            additionalProperties: false
                          billingTiming:
                            type: string
                            enum:
                              - in_advance
                              - in_arrears
                            description: >-
                              Optional. When the charge's flat fee is billed
                              relative to the period it covers (see
                              billingFrequency): in_arrears (the default) bills
                              the period at the close of the cycle that ends it;
                              in_advance bills it at the boundary that opens it
                              (the contract's activation invoice for the periods
                              its first cycle opens, otherwise the close of the
                              cycle just before the period). Only the timing
                              shifts, never the amount. Valid only on fixed
                              charges. Defaults to in_arrears when omitted.
                        required:
                          - category
                          - itemId
                          - isCustomNameEnabled
                          - pricingModel
                          - pricing
                        additionalProperties: false
                        allOf:
                          - if:
                              properties:
                                isCustomNameEnabled:
                                  enum:
                                    - true
                            then:
                              required:
                                - name
                      - type: object
                        description: >-
                          A minimum commitment charge: at the close of each
                          period of its billingFrequency, tops the plan's
                          charges sharing that frequency up to the configured
                          amount when their total on that calculation stays
                          below it. A plan can have at most one minimum per
                          billing frequency.
                        properties:
                          category:
                            description: 'Discriminator: minimum commitment charge.'
                            enum:
                              - minimum_commitment
                          name:
                            type: string
                            minLength: 1
                            description: >-
                              Display name of the charge as it appears on
                              invoices. Required when isCustomNameEnabled is
                              true. When isCustomNameEnabled is false, the name
                              follows the name of the resource of the charge,
                              else of its license, else of its catalog item.
                            examples:
                              - Mensalidade
                          isCustomNameEnabled:
                            type: boolean
                            description: >-
                              Whether name is customized for this charge. When
                              false, the name follows the name of the resource
                              of the charge, else of its license, else of its
                              catalog item.
                          itemId:
                            type: string
                            format: uuid
                            description: >-
                              The unique identifier of the catalog item this
                              charge bills.
                          pricingModel:
                            type: string
                            description: >-
                              Fixed and minimum_commitment charges always use
                              fixed pricing.
                            enum:
                              - fixed
                          pricing:
                            type: object
                            description: >-
                              Fixed pricing: a flat amount billed once per
                              period of the charge's billingFrequency. The only
                              pricing available for fixed and minimum_commitment
                              charges.
                            properties:
                              model:
                                description: 'Discriminator: fixed pricing.'
                                enum:
                                  - fixed
                              amount:
                                type: integer
                                minimum: 0
                                description: >-
                                  The flat amount billed per period, in cents.
                                  For minimum_commitment charges, the minimum
                                  the charges sharing its frequency are topped
                                  up to.
                              quantity:
                                type: integer
                                minimum: 1
                                description: >-
                                  Optional, fixed charges only: the quantity
                                  billed. When set, amount is the amount of one
                                  unit and each period of the charge's
                                  billingFrequency bills quantity x amount.
                            required:
                              - model
                              - amount
                            additionalProperties: false
                          billingFrequency:
                            type: object
                            description: >-
                              Optional. The period this charge covers: unit
                              month or week, repeated count times. A write
                              accepts six frequencies: week x 1, week x 2, month
                              x 1 (the default), month x 3, month x 6 and month
                              x 12; any other count is rejected. Fixed and
                              minimum-commitment charges bill at their period
                              boundary; usage-based charges measure their
                              resource over the whole period and license-based
                              charges bill the last count reported before it
                              closes, both priced at the close. Custom charges
                              read their input resources and licenses the same
                              way, and their calculator prices them at the
                              close. Prorated license charges and usage charges
                              on a prorated resource accept only a count of one,
                              month x 1 or week x 1. Defaults to month x 1 when
                              omitted.
                            properties:
                              unit:
                                type: string
                                enum:
                                  - month
                                  - week
                                description: >-
                                  Grid family of the period. All charges on a
                                  plan must share one family.
                              count:
                                type: integer
                                minimum: 1
                                description: How many units the period spans.
                            required:
                              - unit
                              - count
                            additionalProperties: false
                        required:
                          - category
                          - itemId
                          - isCustomNameEnabled
                          - pricingModel
                          - pricing
                        additionalProperties: false
                        allOf:
                          - if:
                              properties:
                                isCustomNameEnabled:
                                  enum:
                                    - true
                            then:
                              required:
                                - name
                      - type: object
                        description: >-
                          A usage-based charge: prices the consumption of a
                          metered resource according to pricingModel.
                        properties:
                          category:
                            description: 'Discriminator: usage-based charge.'
                            enum:
                              - usage_based
                          name:
                            type: string
                            minLength: 1
                            description: >-
                              Display name of the charge as it appears on
                              invoices. Required when isCustomNameEnabled is
                              true. When isCustomNameEnabled is false, the name
                              follows the name of the resource of the charge,
                              else of its license, else of its catalog item.
                            examples:
                              - Mensalidade
                          isCustomNameEnabled:
                            type: boolean
                            description: >-
                              Whether name is customized for this charge. When
                              false, the name follows the name of the resource
                              of the charge, else of its license, else of its
                              catalog item.
                          resourceId:
                            type: string
                            format: uuid
                            description: >-
                              The unique identifier of the metered resource
                              whose usage the charge prices.
                          pricingModel:
                            type: string
                            enum:
                              - per_unit
                              - per_package
                              - percentage
                              - tiered_per_unit
                              - tiered_percentage
                              - tiered_fixed
                              - advanced
                            description: >-
                              How the charge is priced: per_unit (price per unit
                              with optional included quantity), per_package
                              (price per started package of units), percentage
                              (a percentage of a monetary base amount),
                              tiered_per_unit / tiered_percentage / tiered_fixed
                              (tier ladder where every tier uses that pricing
                              type), or advanced (tier ladder mixing tier
                              pricing types). per_unit, per_package and
                              tiered_per_unit require a Unit-type resource;
                              percentage and tiered_percentage require a
                              Currency-type resource; tiered_fixed and advanced
                              accept either. Always matches pricing.model.
                          pricing:
                            type: object
                            description: >-
                              Pricing configuration of a usage-based charge,
                              keyed by model. Must match the charge's
                              pricingModel.
                            discriminator:
                              propertyName: model
                            oneOf:
                              - type: object
                                description: >-
                                  Per-unit pricing: every billable unit costs
                                  unitPrice, after deducting the included
                                  quantity. Not valid for charges on
                                  Currency-type resources.
                                properties:
                                  model:
                                    description: 'Discriminator: per-unit pricing.'
                                    enum:
                                      - per_unit
                                  includedQuantity:
                                    type: integer
                                    minimum: 0
                                    description: >-
                                      Optional number of units included at no
                                      charge before billing starts.
                                  unitPrice:
                                    type: string
                                    pattern: ^\d+(\.\d{1,6})?$
                                    description: >-
                                      Price per unit, as a decimal currency-unit
                                      string (up to 6 decimal places).
                                    examples:
                                      - '0.25'
                                  fixedAmount:
                                    type: integer
                                    minimum: 0
                                    description: >-
                                      Optional flat amount billed once per
                                      period of the charge's billingFrequency,
                                      on top of the priced quantity, in cents.
                                      Rendered as a fixed-price sub-line item
                                      when greater than zero.
                                  minimumAmount:
                                    type: integer
                                    minimum: 0
                                    description: >-
                                      Optional floor for the charge, in cents.
                                      When the priced quantity plus fixedAmount
                                      stays below it, a minimum-amount sub-line
                                      item tops the charge up to this value.
                                required:
                                  - model
                                  - unitPrice
                                additionalProperties: false
                              - type: object
                                description: >-
                                  Per-package pricing: billable units are
                                  charged per started package of packageSize
                                  units, after deducting the included quantity.
                                  Not valid for charges on Currency-type
                                  resources.
                                properties:
                                  model:
                                    description: 'Discriminator: per-package pricing.'
                                    enum:
                                      - per_package
                                  includedQuantity:
                                    type: integer
                                    minimum: 0
                                    description: >-
                                      Optional number of units included at no
                                      charge before billing starts.
                                  packageSize:
                                    type: integer
                                    minimum: 1
                                    description: Number of resource units per package.
                                  packagePrice:
                                    type: string
                                    pattern: ^\d+(\.\d{1,6})?$
                                    description: >-
                                      Price per package, as a decimal
                                      currency-unit string (up to 6 decimal
                                      places).
                                    examples:
                                      - '50.00'
                                  fixedAmount:
                                    type: integer
                                    minimum: 0
                                    description: >-
                                      Optional flat amount billed once per
                                      period of the charge's billingFrequency,
                                      on top of the priced quantity, in cents.
                                      Rendered as a fixed-price sub-line item
                                      when greater than zero.
                                  minimumAmount:
                                    type: integer
                                    minimum: 0
                                    description: >-
                                      Optional floor for the charge, in cents.
                                      When the priced quantity plus fixedAmount
                                      stays below it, a minimum-amount sub-line
                                      item tops the charge up to this value.
                                required:
                                  - model
                                  - packageSize
                                  - packagePrice
                                additionalProperties: false
                              - type: object
                                description: >-
                                  Percentage pricing: a percentage taken over
                                  the monetary base amount consumed. Only valid
                                  for charges on Currency-type resources.
                                properties:
                                  model:
                                    description: 'Discriminator: percentage pricing.'
                                    enum:
                                      - percentage
                                  percentage:
                                    type: string
                                    pattern: ^(100(\.0{1,6})?|\d{1,2}(\.\d{1,6})?)$
                                    description: >-
                                      Percentage applied to the base amount, as
                                      a decimal string from 0 to 100 (up to 6
                                      decimal places).
                                    examples:
                                      - '2.5'
                                  fixedAmount:
                                    type: integer
                                    minimum: 0
                                    description: >-
                                      Optional flat amount billed once per
                                      period of the charge's billingFrequency,
                                      on top of the priced quantity, in cents.
                                      Rendered as a fixed-price sub-line item
                                      when greater than zero.
                                  minimumAmount:
                                    type: integer
                                    minimum: 0
                                    description: >-
                                      Optional floor for the charge, in cents.
                                      When the priced quantity plus fixedAmount
                                      stays below it, a minimum-amount sub-line
                                      item tops the charge up to this value.
                                required:
                                  - model
                                  - percentage
                                additionalProperties: false
                              - type: object
                                description: >-
                                  Tiered per-unit pricing: units are priced by
                                  the tier ladder defined in the charge's tiers,
                                  every tier priced per unit. Not valid for
                                  charges on Currency-type resources.
                                properties:
                                  model:
                                    description: 'Discriminator: tiered per-unit pricing.'
                                    enum:
                                      - tiered_per_unit
                                  tierMode:
                                    enum:
                                      - progressive
                                      - volume
                                    description: >-
                                      How the ladder applies: progressive prices
                                      each tier's band separately (graduated);
                                      volume prices all usage at the single tier
                                      containing the total.
                                  fixedAmount:
                                    type: integer
                                    minimum: 0
                                    description: >-
                                      Optional flat amount billed once per
                                      period of the charge's billingFrequency,
                                      on top of the priced quantity, in cents.
                                      Rendered as a fixed-price sub-line item
                                      when greater than zero.
                                  minimumAmount:
                                    type: integer
                                    minimum: 0
                                    description: >-
                                      Optional floor for the charge, in cents.
                                      When the priced quantity plus fixedAmount
                                      stays below it, a minimum-amount sub-line
                                      item tops the charge up to this value.
                                required:
                                  - model
                                  - tierMode
                                additionalProperties: false
                              - type: object
                                description: >-
                                  Tiered percentage pricing: the monetary base
                                  amount is priced by the tier ladder defined in
                                  the charge's tiers, every tier priced as a
                                  percentage. Only valid for charges on
                                  Currency-type resources.
                                properties:
                                  model:
                                    description: 'Discriminator: tiered percentage pricing.'
                                    enum:
                                      - tiered_percentage
                                  tierMode:
                                    enum:
                                      - progressive
                                      - volume
                                    description: >-
                                      How the ladder applies: progressive prices
                                      each tier's band separately (graduated);
                                      volume prices all usage at the single tier
                                      containing the total.
                                  fixedAmount:
                                    type: integer
                                    minimum: 0
                                    description: >-
                                      Optional flat amount billed once per
                                      period of the charge's billingFrequency,
                                      on top of the priced quantity, in cents.
                                      Rendered as a fixed-price sub-line item
                                      when greater than zero.
                                  minimumAmount:
                                    type: integer
                                    minimum: 0
                                    description: >-
                                      Optional floor for the charge, in cents.
                                      When the priced quantity plus fixedAmount
                                      stays below it, a minimum-amount sub-line
                                      item tops the charge up to this value.
                                required:
                                  - model
                                  - tierMode
                                additionalProperties: false
                              - type: object
                                description: >-
                                  Tiered fixed pricing: the tier containing the
                                  total usage bills its flat amount. Always
                                  volume mode. Usage beyond the last tier can be
                                  billed through unitOverage or
                                  percentageOverage (mutually exclusive);
                                  configuring one requires a bounded final tier.
                                properties:
                                  model:
                                    description: 'Discriminator: tiered fixed pricing.'
                                    enum:
                                      - tiered_fixed
                                  tierMode:
                                    enum:
                                      - progressive
                                      - volume
                                    description: >-
                                      Must be volume for tiered fixed pricing:
                                      the single tier containing the total usage
                                      bills its flat amount.
                                  unitOverage:
                                    type: object
                                    description: >-
                                      Optional overage price for units beyond
                                      the last tier, for charges on Unit-type
                                      resources. Mutually exclusive with
                                      percentageOverage.
                                    properties:
                                      excessUnitPrice:
                                        type: string
                                        pattern: ^\d+(\.\d{1,6})?$
                                        description: >-
                                          Price per unit beyond the last tier, as
                                          a decimal currency-unit string (up to 6
                                          decimal places).
                                        examples:
                                          - '0.30'
                                    required:
                                      - excessUnitPrice
                                    additionalProperties: false
                                  percentageOverage:
                                    type: object
                                    description: >-
                                      Optional overage percentage for the base
                                      amount beyond the last tier, for charges
                                      on Currency-type resources. Mutually
                                      exclusive with unitOverage.
                                    properties:
                                      excessPercentage:
                                        type: string
                                        pattern: ^(100(\.0{1,6})?|\d{1,2}(\.\d{1,6})?)$
                                        description: >-
                                          Percentage applied to the base amount
                                          beyond the last tier, as a decimal
                                          string from 0 to 100 (up to 6 decimal
                                          places).
                                        examples:
                                          - '1.5'
                                    required:
                                      - excessPercentage
                                    additionalProperties: false
                                  fixedAmount:
                                    type: integer
                                    minimum: 0
                                    description: >-
                                      Optional flat amount billed once per
                                      period of the charge's billingFrequency,
                                      on top of the priced quantity, in cents.
                                      Rendered as a fixed-price sub-line item
                                      when greater than zero.
                                  minimumAmount:
                                    type: integer
                                    minimum: 0
                                    description: >-
                                      Optional floor for the charge, in cents.
                                      When the priced quantity plus fixedAmount
                                      stays below it, a minimum-amount sub-line
                                      item tops the charge up to this value.
                                required:
                                  - model
                                  - tierMode
                                not:
                                  required:
                                    - unitOverage
                                    - percentageOverage
                                additionalProperties: false
                              - type: object
                                description: >-
                                  Advanced pricing: a tier ladder mixing tier
                                  pricing types (per unit, percentage, per
                                  package, flat). On a Unit-type resource the
                                  tiers can be per_unit, per_package or flat; on
                                  a Currency-type resource, percentage or flat.
                                  Also used for charges priced before single
                                  pricing models existed.
                                properties:
                                  model:
                                    description: >-
                                      Discriminator: advanced (mixed-tier)
                                      pricing.
                                    enum:
                                      - advanced
                                  tierMode:
                                    enum:
                                      - progressive
                                      - volume
                                    description: >-
                                      How the ladder applies: progressive prices
                                      each tier's band separately (graduated);
                                      volume prices all usage at the single tier
                                      containing the total.
                                  fixedAmount:
                                    type: integer
                                    minimum: 0
                                    description: >-
                                      Optional flat amount billed once per
                                      period of the charge's billingFrequency,
                                      on top of the priced quantity, in cents.
                                      Rendered as a fixed-price sub-line item
                                      when greater than zero.
                                  minimumAmount:
                                    type: integer
                                    minimum: 0
                                    description: >-
                                      Optional floor for the charge, in cents.
                                      When the priced quantity plus fixedAmount
                                      stays below it, a minimum-amount sub-line
                                      item tops the charge up to this value.
                                required:
                                  - model
                                  - tierMode
                                additionalProperties: false
                          tiers:
                            type: array
                            items:
                              type: object
                              description: >-
                                A price tier: a band of quantity, from one
                                number to another, with its own price. The tiers
                                of a plan charge form a contiguous ladder over
                                its quantity.
                              properties:
                                from:
                                  type: integer
                                  minimum: 0
                                  description: >-
                                    Lower bound of the tier band (inclusive), in
                                    resource units — or cents of the monetary
                                    base amount for percentage-priced tiers. The
                                    first tier starts at 0 or 1; each subsequent
                                    tier starts at the previous tier's to + 1.
                                to:
                                  type: integer
                                  minimum: 0
                                  nullable: true
                                  description: >-
                                    Upper bound of the tier band (inclusive), in
                                    the same unit as from. Null makes the final
                                    tier unbounded; a finite final bound is only
                                    allowed on tiered_fixed charges with an
                                    overage price configured.
                                pricing:
                                  type: object
                                  description: >-
                                    How usage falling in this tier is priced,
                                    keyed by type: per_unit (price per unit),
                                    percentage (percentage of the base amount),
                                    per_package (price per started package), or
                                    flat (fixed amount for the band).
                                  discriminator:
                                    propertyName: type
                                  oneOf:
                                    - type: object
                                      description: >-
                                        Per-unit tier pricing: every unit in the
                                        tier band costs unitPrice. Not valid for
                                        charges on Currency-type resources.
                                      properties:
                                        type:
                                          description: 'Discriminator: per-unit tier pricing.'
                                          enum:
                                            - per_unit
                                        unitPrice:
                                          type: string
                                          pattern: ^\d+(\.\d{1,6})?$
                                          description: >-
                                            Price per unit within the tier, as a
                                            decimal currency-unit string (up to 6
                                            decimal places).
                                          examples:
                                            - '0.20'
                                        fixedPrice:
                                          type: string
                                          pattern: ^\d+(\.\d{1,6})?$
                                          nullable: true
                                          description: >-
                                            Optional flat fee billed on top when the
                                            tier applies, as a decimal currency-unit
                                            string. Only valid on pricingModel
                                            tiered_per_unit. Null when the tier has
                                            no flat fee.
                                          examples:
                                            - '10.00'
                                      required:
                                        - type
                                        - unitPrice
                                        - fixedPrice
                                      additionalProperties: false
                                    - type: object
                                      description: >-
                                        Percentage tier pricing: the base amount
                                        in the tier band is billed at a
                                        percentage. Only valid for charges on
                                        Currency-type resources.
                                      properties:
                                        type:
                                          description: 'Discriminator: percentage tier pricing.'
                                          enum:
                                            - percentage
                                        percentage:
                                          type: string
                                          pattern: ^(100(\.0{1,6})?|\d{1,2}(\.\d{1,6})?)$
                                          description: >-
                                            Percentage applied to the base amount
                                            within the tier, as a decimal string
                                            from 0 to 100 (up to 6 decimal places).
                                          examples:
                                            - '1.5'
                                      required:
                                        - type
                                        - percentage
                                      additionalProperties: false
                                    - type: object
                                      description: >-
                                        Per-package tier pricing: units in the
                                        tier band are charged per started
                                        package of packageSize units. Not valid
                                        for charges on Currency-type resources.
                                      properties:
                                        type:
                                          description: 'Discriminator: per-package tier pricing.'
                                          enum:
                                            - per_package
                                        packageSize:
                                          type: integer
                                          minimum: 1
                                          description: Number of resource units per package.
                                        packagePrice:
                                          type: string
                                          pattern: ^\d+(\.\d{1,6})?$
                                          description: >-
                                            Price per package, as a decimal
                                            currency-unit string (up to 6 decimal
                                            places).
                                          examples:
                                            - '45.00'
                                      required:
                                        - type
                                        - packageSize
                                        - packagePrice
                                      additionalProperties: false
                                    - type: object
                                      description: >-
                                        Flat tier pricing: usage falling in the
                                        tier band is billed a flat amount,
                                        regardless of the exact quantity.
                                      properties:
                                        type:
                                          description: 'Discriminator: flat tier pricing.'
                                          enum:
                                            - flat
                                        amount:
                                          type: string
                                          pattern: ^\d+(\.\d{1,6})?$
                                          description: >-
                                            The flat amount billed for the tier, as
                                            a decimal currency-unit string (up to 6
                                            decimal places).
                                          examples:
                                            - '199.90'
                                      required:
                                        - type
                                        - amount
                                      additionalProperties: false
                              required:
                                - from
                                - to
                                - pricing
                              additionalProperties: false
                            description: >-
                              The tier ladder of the charge, ordered from the
                              lowest band to the highest. Required non-empty for
                              tier-based pricing models (tiered_per_unit,
                              tiered_percentage, tiered_fixed, advanced); must
                              be empty otherwise.
                          billingFrequency:
                            type: object
                            description: >-
                              Optional. The period this charge covers: unit
                              month or week, repeated count times. A write
                              accepts six frequencies: week x 1, week x 2, month
                              x 1 (the default), month x 3, month x 6 and month
                              x 12; any other count is rejected. Fixed and
                              minimum-commitment charges bill at their period
                              boundary; usage-based charges measure their
                              resource over the whole period and license-based
                              charges bill the last count reported before it
                              closes, both priced at the close. Custom charges
                              read their input resources and licenses the same
                              way, and their calculator prices them at the
                              close. Prorated license charges and usage charges
                              on a prorated resource accept only a count of one,
                              month x 1 or week x 1. Defaults to month x 1 when
                              omitted.
                            properties:
                              unit:
                                type: string
                                enum:
                                  - month
                                  - week
                                description: >-
                                  Grid family of the period. All charges on a
                                  plan must share one family.
                              count:
                                type: integer
                                minimum: 1
                                description: How many units the period spans.
                            required:
                              - unit
                              - count
                            additionalProperties: false
                          currencyUnitCode:
                            type: string
                            description: >-
                              Code of the currency unit the charge's usage is
                              denominated in, for tenants using the credits
                              module. Defaults to BRL when omitted.
                            examples:
                              - BRL
                        required:
                          - category
                          - resourceId
                          - isCustomNameEnabled
                          - pricingModel
                          - pricing
                          - tiers
                        additionalProperties: false
                        allOf:
                          - if:
                              properties:
                                isCustomNameEnabled:
                                  enum:
                                    - true
                            then:
                              required:
                                - name
                      - type: object
                        description: >-
                          A license-based charge: bills the license balance once
                          per period of its billingFrequency, at the close of
                          the period. By default it bills in full the last
                          balance reported before the close; when billingModel
                          is proration, it prorates each change of the balance
                          over the days held.
                        properties:
                          category:
                            description: 'Discriminator: license-based charge.'
                            enum:
                              - license_based
                          name:
                            type: string
                            minLength: 1
                            description: >-
                              Display name of the charge as it appears on
                              invoices. Required when isCustomNameEnabled is
                              true. When isCustomNameEnabled is false, the name
                              follows the name of the resource of the charge,
                              else of its license, else of its catalog item.
                            examples:
                              - Mensalidade
                          isCustomNameEnabled:
                            type: boolean
                            description: >-
                              Whether name is customized for this charge. When
                              false, the name follows the name of the resource
                              of the charge, else of its license, else of its
                              catalog item.
                          licenseId:
                            type: string
                            format: uuid
                            description: >-
                              The unique identifier of the license whose
                              reported count the charge bills. The charge bills
                              as the license's own catalog item.
                          pricingModel:
                            type: string
                            enum:
                              - per_unit
                              - per_package
                              - tiered_per_unit
                              - tiered_fixed
                            description: >-
                              How the license count is priced: per_unit (price
                              per license with optional included quantity),
                              per_package (price per started package of
                              licenses), or tiered_per_unit / tiered_fixed (tier
                              ladder over the count). Percentage models do not
                              apply: a license count carries no monetary base.
                              Always matches pricing.model.
                          pricing:
                            type: object
                            description: >-
                              Pricing configuration of a usage-based charge,
                              keyed by model. Must match the charge's
                              pricingModel.
                            discriminator:
                              propertyName: model
                            oneOf:
                              - type: object
                                description: >-
                                  Per-unit pricing: every billable unit costs
                                  unitPrice, after deducting the included
                                  quantity. Not valid for charges on
                                  Currency-type resources.
                                properties:
                                  model:
                                    description: 'Discriminator: per-unit pricing.'
                                    enum:
                                      - per_unit
                                  includedQuantity:
                                    type: integer
                                    minimum: 0
                                    description: >-
                                      Optional number of units included at no
                                      charge before billing starts.
                                  unitPrice:
                                    type: string
                                    pattern: ^\d+(\.\d{1,6})?$
                                    description: >-
                                      Price per unit, as a decimal currency-unit
                                      string (up to 6 decimal places).
                                    examples:
                                      - '0.25'
                                  fixedAmount:
                                    type: integer
                                    minimum: 0
                                    description: >-
                                      Optional flat amount billed once per
                                      period of the charge's billingFrequency,
                                      on top of the priced quantity, in cents.
                                      Rendered as a fixed-price sub-line item
                                      when greater than zero.
                                  minimumAmount:
                                    type: integer
                                    minimum: 0
                                    description: >-
                                      Optional floor for the charge, in cents.
                                      When the priced quantity plus fixedAmount
                                      stays below it, a minimum-amount sub-line
                                      item tops the charge up to this value.
                                required:
                                  - model
                                  - unitPrice
                                additionalProperties: false
                              - type: object
                                description: >-
                                  Per-package pricing: billable units are
                                  charged per started package of packageSize
                                  units, after deducting the included quantity.
                                  Not valid for charges on Currency-type
                                  resources.
                                properties:
                                  model:
                                    description: 'Discriminator: per-package pricing.'
                                    enum:
                                      - per_package
                                  includedQuantity:
                                    type: integer
                                    minimum: 0
                                    description: >-
                                      Optional number of units included at no
                                      charge before billing starts.
                                  packageSize:
                                    type: integer
                                    minimum: 1
                                    description: Number of resource units per package.
                                  packagePrice:
                                    type: string
                                    pattern: ^\d+(\.\d{1,6})?$
                                    description: >-
                                      Price per package, as a decimal
                                      currency-unit string (up to 6 decimal
                                      places).
                                    examples:
                                      - '50.00'
                                  fixedAmount:
                                    type: integer
                                    minimum: 0
                                    description: >-
                                      Optional flat amount billed once per
                                      period of the charge's billingFrequency,
                                      on top of the priced quantity, in cents.
                                      Rendered as a fixed-price sub-line item
                                      when greater than zero.
                                  minimumAmount:
                                    type: integer
                                    minimum: 0
                                    description: >-
                                      Optional floor for the charge, in cents.
                                      When the priced quantity plus fixedAmount
                                      stays below it, a minimum-amount sub-line
                                      item tops the charge up to this value.
                                required:
                                  - model
                                  - packageSize
                                  - packagePrice
                                additionalProperties: false
                              - type: object
                                description: >-
                                  Percentage pricing: a percentage taken over
                                  the monetary base amount consumed. Only valid
                                  for charges on Currency-type resources.
                                properties:
                                  model:
                                    description: 'Discriminator: percentage pricing.'
                                    enum:
                                      - percentage
                                  percentage:
                                    type: string
                                    pattern: ^(100(\.0{1,6})?|\d{1,2}(\.\d{1,6})?)$
                                    description: >-
                                      Percentage applied to the base amount, as
                                      a decimal string from 0 to 100 (up to 6
                                      decimal places).
                                    examples:
                                      - '2.5'
                                  fixedAmount:
                                    type: integer
                                    minimum: 0
                                    description: >-
                                      Optional flat amount billed once per
                                      period of the charge's billingFrequency,
                                      on top of the priced quantity, in cents.
                                      Rendered as a fixed-price sub-line item
                                      when greater than zero.
                                  minimumAmount:
                                    type: integer
                                    minimum: 0
                                    description: >-
                                      Optional floor for the charge, in cents.
                                      When the priced quantity plus fixedAmount
                                      stays below it, a minimum-amount sub-line
                                      item tops the charge up to this value.
                                required:
                                  - model
                                  - percentage
                                additionalProperties: false
                              - type: object
                                description: >-
                                  Tiered per-unit pricing: units are priced by
                                  the tier ladder defined in the charge's tiers,
                                  every tier priced per unit. Not valid for
                                  charges on Currency-type resources.
                                properties:
                                  model:
                                    description: 'Discriminator: tiered per-unit pricing.'
                                    enum:
                                      - tiered_per_unit
                                  tierMode:
                                    enum:
                                      - progressive
                                      - volume
                                    description: >-
                                      How the ladder applies: progressive prices
                                      each tier's band separately (graduated);
                                      volume prices all usage at the single tier
                                      containing the total.
                                  fixedAmount:
                                    type: integer
                                    minimum: 0
                                    description: >-
                                      Optional flat amount billed once per
                                      period of the charge's billingFrequency,
                                      on top of the priced quantity, in cents.
                                      Rendered as a fixed-price sub-line item
                                      when greater than zero.
                                  minimumAmount:
                                    type: integer
                                    minimum: 0
                                    description: >-
                                      Optional floor for the charge, in cents.
                                      When the priced quantity plus fixedAmount
                                      stays below it, a minimum-amount sub-line
                                      item tops the charge up to this value.
                                required:
                                  - model
                                  - tierMode
                                additionalProperties: false
                              - type: object
                                description: >-
                                  Tiered percentage pricing: the monetary base
                                  amount is priced by the tier ladder defined in
                                  the charge's tiers, every tier priced as a
                                  percentage. Only valid for charges on
                                  Currency-type resources.
                                properties:
                                  model:
                                    description: 'Discriminator: tiered percentage pricing.'
                                    enum:
                                      - tiered_percentage
                                  tierMode:
                                    enum:
                                      - progressive
                                      - volume
                                    description: >-
                                      How the ladder applies: progressive prices
                                      each tier's band separately (graduated);
                                      volume prices all usage at the single tier
                                      containing the total.
                                  fixedAmount:
                                    type: integer
                                    minimum: 0
                                    description: >-
                                      Optional flat amount billed once per
                                      period of the charge's billingFrequency,
                                      on top of the priced quantity, in cents.
                                      Rendered as a fixed-price sub-line item
                                      when greater than zero.
                                  minimumAmount:
                                    type: integer
                                    minimum: 0
                                    description: >-
                                      Optional floor for the charge, in cents.
                                      When the priced quantity plus fixedAmount
                                      stays below it, a minimum-amount sub-line
                                      item tops the charge up to this value.
                                required:
                                  - model
                                  - tierMode
                                additionalProperties: false
                              - type: object
                                description: >-
                                  Tiered fixed pricing: the tier containing the
                                  total usage bills its flat amount. Always
                                  volume mode. Usage beyond the last tier can be
                                  billed through unitOverage or
                                  percentageOverage (mutually exclusive);
                                  configuring one requires a bounded final tier.
                                properties:
                                  model:
                                    description: 'Discriminator: tiered fixed pricing.'
                                    enum:
                                      - tiered_fixed
                                  tierMode:
                                    enum:
                                      - progressive
                                      - volume
                                    description: >-
                                      Must be volume for tiered fixed pricing:
                                      the single tier containing the total usage
                                      bills its flat amount.
                                  unitOverage:
                                    type: object
                                    description: >-
                                      Optional overage price for units beyond
                                      the last tier, for charges on Unit-type
                                      resources. Mutually exclusive with
                                      percentageOverage.
                                    properties:
                                      excessUnitPrice:
                                        type: string
                                        pattern: ^\d+(\.\d{1,6})?$
                                        description: >-
                                          Price per unit beyond the last tier, as
                                          a decimal currency-unit string (up to 6
                                          decimal places).
                                        examples:
                                          - '0.30'
                                    required:
                                      - excessUnitPrice
                                    additionalProperties: false
                                  percentageOverage:
                                    type: object
                                    description: >-
                                      Optional overage percentage for the base
                                      amount beyond the last tier, for charges
                                      on Currency-type resources. Mutually
                                      exclusive with unitOverage.
                                    properties:
                                      excessPercentage:
                                        type: string
                                        pattern: ^(100(\.0{1,6})?|\d{1,2}(\.\d{1,6})?)$
                                        description: >-
                                          Percentage applied to the base amount
                                          beyond the last tier, as a decimal
                                          string from 0 to 100 (up to 6 decimal
                                          places).
                                        examples:
                                          - '1.5'
                                    required:
                                      - excessPercentage
                                    additionalProperties: false
                                  fixedAmount:
                                    type: integer
                                    minimum: 0
                                    description: >-
                                      Optional flat amount billed once per
                                      period of the charge's billingFrequency,
                                      on top of the priced quantity, in cents.
                                      Rendered as a fixed-price sub-line item
                                      when greater than zero.
                                  minimumAmount:
                                    type: integer
                                    minimum: 0
                                    description: >-
                                      Optional floor for the charge, in cents.
                                      When the priced quantity plus fixedAmount
                                      stays below it, a minimum-amount sub-line
                                      item tops the charge up to this value.
                                required:
                                  - model
                                  - tierMode
                                not:
                                  required:
                                    - unitOverage
                                    - percentageOverage
                                additionalProperties: false
                              - type: object
                                description: >-
                                  Advanced pricing: a tier ladder mixing tier
                                  pricing types (per unit, percentage, per
                                  package, flat). On a Unit-type resource the
                                  tiers can be per_unit, per_package or flat; on
                                  a Currency-type resource, percentage or flat.
                                  Also used for charges priced before single
                                  pricing models existed.
                                properties:
                                  model:
                                    description: >-
                                      Discriminator: advanced (mixed-tier)
                                      pricing.
                                    enum:
                                      - advanced
                                  tierMode:
                                    enum:
                                      - progressive
                                      - volume
                                    description: >-
                                      How the ladder applies: progressive prices
                                      each tier's band separately (graduated);
                                      volume prices all usage at the single tier
                                      containing the total.
                                  fixedAmount:
                                    type: integer
                                    minimum: 0
                                    description: >-
                                      Optional flat amount billed once per
                                      period of the charge's billingFrequency,
                                      on top of the priced quantity, in cents.
                                      Rendered as a fixed-price sub-line item
                                      when greater than zero.
                                  minimumAmount:
                                    type: integer
                                    minimum: 0
                                    description: >-
                                      Optional floor for the charge, in cents.
                                      When the priced quantity plus fixedAmount
                                      stays below it, a minimum-amount sub-line
                                      item tops the charge up to this value.
                                required:
                                  - model
                                  - tierMode
                                additionalProperties: false
                          billingModel:
                            type: string
                            enum:
                              - in_full
                              - proration
                            description: >-
                              Optional. How the license balance bills over the
                              charge's period: in_full (the default) bills the
                              last balance reported before the period closes,
                              for the whole period; proration bills the opening
                              balance at full price plus one prorated delta per
                              change during the cycle. Proration requires
                              per_unit pricing, or tiered_per_unit in
                              progressive mode: only tier unit prices prorate,
                              and tier flat prices bill in full for the bands
                              that the closing balance reaches.
                          tiers:
                            type: array
                            items:
                              type: object
                              description: >-
                                A price tier: a band of quantity, from one
                                number to another, with its own price. The tiers
                                of a plan charge form a contiguous ladder over
                                its quantity.
                              properties:
                                from:
                                  type: integer
                                  minimum: 0
                                  description: >-
                                    Lower bound of the tier band (inclusive), in
                                    resource units — or cents of the monetary
                                    base amount for percentage-priced tiers. The
                                    first tier starts at 0 or 1; each subsequent
                                    tier starts at the previous tier's to + 1.
                                to:
                                  type: integer
                                  minimum: 0
                                  nullable: true
                                  description: >-
                                    Upper bound of the tier band (inclusive), in
                                    the same unit as from. Null makes the final
                                    tier unbounded; a finite final bound is only
                                    allowed on tiered_fixed charges with an
                                    overage price configured.
                                pricing:
                                  type: object
                                  description: >-
                                    How usage falling in this tier is priced,
                                    keyed by type: per_unit (price per unit),
                                    percentage (percentage of the base amount),
                                    per_package (price per started package), or
                                    flat (fixed amount for the band).
                                  discriminator:
                                    propertyName: type
                                  oneOf:
                                    - type: object
                                      description: >-
                                        Per-unit tier pricing: every unit in the
                                        tier band costs unitPrice. Not valid for
                                        charges on Currency-type resources.
                                      properties:
                                        type:
                                          description: 'Discriminator: per-unit tier pricing.'
                                          enum:
                                            - per_unit
                                        unitPrice:
                                          type: string
                                          pattern: ^\d+(\.\d{1,6})?$
                                          description: >-
                                            Price per unit within the tier, as a
                                            decimal currency-unit string (up to 6
                                            decimal places).
                                          examples:
                                            - '0.20'
                                        fixedPrice:
                                          type: string
                                          pattern: ^\d+(\.\d{1,6})?$
                                          nullable: true
                                          description: >-
                                            Optional flat fee billed on top when the
                                            tier applies, as a decimal currency-unit
                                            string. Only valid on pricingModel
                                            tiered_per_unit. Null when the tier has
                                            no flat fee.
                                          examples:
                                            - '10.00'
                                      required:
                                        - type
                                        - unitPrice
                                        - fixedPrice
                                      additionalProperties: false
                                    - type: object
                                      description: >-
                                        Percentage tier pricing: the base amount
                                        in the tier band is billed at a
                                        percentage. Only valid for charges on
                                        Currency-type resources.
                                      properties:
                                        type:
                                          description: 'Discriminator: percentage tier pricing.'
                                          enum:
                                            - percentage
                                        percentage:
                                          type: string
                                          pattern: ^(100(\.0{1,6})?|\d{1,2}(\.\d{1,6})?)$
                                          description: >-
                                            Percentage applied to the base amount
                                            within the tier, as a decimal string
                                            from 0 to 100 (up to 6 decimal places).
                                          examples:
                                            - '1.5'
                                      required:
                                        - type
                                        - percentage
                                      additionalProperties: false
                                    - type: object
                                      description: >-
                                        Per-package tier pricing: units in the
                                        tier band are charged per started
                                        package of packageSize units. Not valid
                                        for charges on Currency-type resources.
                                      properties:
                                        type:
                                          description: 'Discriminator: per-package tier pricing.'
                                          enum:
                                            - per_package
                                        packageSize:
                                          type: integer
                                          minimum: 1
                                          description: Number of resource units per package.
                                        packagePrice:
                                          type: string
                                          pattern: ^\d+(\.\d{1,6})?$
                                          description: >-
                                            Price per package, as a decimal
                                            currency-unit string (up to 6 decimal
                                            places).
                                          examples:
                                            - '45.00'
                                      required:
                                        - type
                                        - packageSize
                                        - packagePrice
                                      additionalProperties: false
                                    - type: object
                                      description: >-
                                        Flat tier pricing: usage falling in the
                                        tier band is billed a flat amount,
                                        regardless of the exact quantity.
                                      properties:
                                        type:
                                          description: 'Discriminator: flat tier pricing.'
                                          enum:
                                            - flat
                                        amount:
                                          type: string
                                          pattern: ^\d+(\.\d{1,6})?$
                                          description: >-
                                            The flat amount billed for the tier, as
                                            a decimal currency-unit string (up to 6
                                            decimal places).
                                          examples:
                                            - '199.90'
                                      required:
                                        - type
                                        - amount
                                      additionalProperties: false
                              required:
                                - from
                                - to
                                - pricing
                              additionalProperties: false
                            description: >-
                              The tier ladder of the charge, ordered from the
                              lowest band to the highest. Required non-empty for
                              tier-based pricing models (tiered_per_unit,
                              tiered_fixed); must be empty otherwise.
                          billingFrequency:
                            type: object
                            description: >-
                              Optional. The period this charge covers: unit
                              month or week, repeated count times. A write
                              accepts six frequencies: week x 1, week x 2, month
                              x 1 (the default), month x 3, month x 6 and month
                              x 12; any other count is rejected. Fixed and
                              minimum-commitment charges bill at their period
                              boundary; usage-based charges measure their
                              resource over the whole period and license-based
                              charges bill the last count reported before it
                              closes, both priced at the close. Custom charges
                              read their input resources and licenses the same
                              way, and their calculator prices them at the
                              close. Prorated license charges and usage charges
                              on a prorated resource accept only a count of one,
                              month x 1 or week x 1. Defaults to month x 1 when
                              omitted.
                            properties:
                              unit:
                                type: string
                                enum:
                                  - month
                                  - week
                                description: >-
                                  Grid family of the period. All charges on a
                                  plan must share one family.
                              count:
                                type: integer
                                minimum: 1
                                description: How many units the period spans.
                            required:
                              - unit
                              - count
                            additionalProperties: false
                        required:
                          - category
                          - licenseId
                          - isCustomNameEnabled
                          - pricingModel
                          - pricing
                          - tiers
                        additionalProperties: false
                        allOf:
                          - if:
                              properties:
                                isCustomNameEnabled:
                                  enum:
                                    - true
                            then:
                              required:
                                - name
                      - type: object
                        description: >-
                          A custom charge: bills the amount the tenant's
                          Aira-authored calculator computes from the inputs the
                          charge chooses among its custom charge definition's
                          inputs and from the charge's parameter values. Bills
                          in arrears in the tenant's default currency.
                        properties:
                          category:
                            description: 'Discriminator: custom charge.'
                            enum:
                              - custom
                          name:
                            type: string
                            minLength: 1
                            description: >-
                              Display name of the charge as it appears on
                              invoices. Required when isCustomNameEnabled is
                              true. When isCustomNameEnabled is false, the name
                              follows the name of the resource of the charge,
                              else of its license, else of its catalog item.
                            examples:
                              - Mensalidade
                          isCustomNameEnabled:
                            type: boolean
                            description: >-
                              Whether name is customized for this charge. When
                              false, the name follows the name of the resource
                              of the charge, else of its license, else of its
                              catalog item.
                          itemId:
                            type: string
                            format: uuid
                            description: >-
                              The unique identifier of the catalog item this
                              charge bills.
                          customChargeDefinitionId:
                            type: string
                            format: uuid
                            description: >-
                              The unique identifier of the custom charge
                              definition the charge follows. Must belong to the
                              tenant.
                          chosenResourceIds:
                            type: array
                            items:
                              type: string
                              format: uuid
                            uniqueItems: true
                            description: >-
                              The unique identifiers of the metered resources
                              that the charge chooses as its inputs, from the
                              definition's inputResourceIds. Together with
                              chosenLicenseIds, the charge chooses exactly the
                              definition's chosenInputCount inputs. Omitting it
                              chooses no resource.
                          chosenLicenseIds:
                            type: array
                            items:
                              type: string
                              format: uuid
                            uniqueItems: true
                            description: >-
                              The unique identifiers of the licenses that the
                              charge chooses as its inputs, from the
                              definition's inputLicenseIds. Together with
                              chosenResourceIds, the charge chooses exactly the
                              definition's chosenInputCount inputs. Omitting it
                              chooses no license.
                          pricingModel:
                            type: string
                            description: >-
                              Custom charges always use custom pricing: the
                              amount is computed by the tenant's calculator from
                              the charge's parameter values.
                            enum:
                              - custom
                          pricing:
                            type: object
                            description: >-
                              Custom pricing: schema-defined commercial
                              parameters priced by the tenant's Aira-authored
                              calculator. The only pricing available for custom
                              charges.
                            properties:
                              model:
                                description: 'Discriminator: custom pricing.'
                                enum:
                                  - custom
                              parameters:
                                type: object
                                additionalProperties: true
                                description: >-
                                  The charge's commercial parameter values,
                                  keyed by the field keys of the referenced
                                  custom charge definition's parameter schema.
                                  Validated against that parameter schema when
                                  the charge is saved.
                            required:
                              - model
                              - parameters
                            additionalProperties: false
                          billingFrequency:
                            type: object
                            description: >-
                              Optional. The period this charge covers: unit
                              month or week, repeated count times. A write
                              accepts six frequencies: week x 1, week x 2, month
                              x 1 (the default), month x 3, month x 6 and month
                              x 12; any other count is rejected. Fixed and
                              minimum-commitment charges bill at their period
                              boundary; usage-based charges measure their
                              resource over the whole period and license-based
                              charges bill the last count reported before it
                              closes, both priced at the close. Custom charges
                              read their input resources and licenses the same
                              way, and their calculator prices them at the
                              close. Prorated license charges and usage charges
                              on a prorated resource accept only a count of one,
                              month x 1 or week x 1. Defaults to month x 1 when
                              omitted.
                            properties:
                              unit:
                                type: string
                                enum:
                                  - month
                                  - week
                                description: >-
                                  Grid family of the period. All charges on a
                                  plan must share one family.
                              count:
                                type: integer
                                minimum: 1
                                description: How many units the period spans.
                            required:
                              - unit
                              - count
                            additionalProperties: false
                        required:
                          - category
                          - itemId
                          - customChargeDefinitionId
                          - isCustomNameEnabled
                          - pricingModel
                          - pricing
                        additionalProperties: false
                        allOf:
                          - if:
                              properties:
                                isCustomNameEnabled:
                                  enum:
                                    - true
                            then:
                              required:
                                - name
                  description: >-
                    The plan charges of the plan, each at the position of its
                    index in the list. When they differ from those of the active
                    plan version, they become a new plan version.
              required:
                - name
                - productId
                - planCharges
              additionalProperties: false
        required: true
        description: >-
          The new name, description and product of the plan, and its plan
          charges.
      responses:
        '200':
          description: >-
            A plan, a reusable set of charges of the catalog, with its product
            and its active plan version. A contract bills a plan through a plan
            instance.
          content:
            application/json:
              schema:
                type: object
                properties:
                  id:
                    type: string
                    format: uuid
                    description: The unique identifier of the plan in our system.
                  name:
                    type: string
                    minLength: 1
                    description: The name of the plan.
                    example: Plano Essencial
                  description:
                    description: The description of the plan, or null when it has none.
                    type:
                      - 'null'
                      - string
                    example: Assinatura mensal com entrega diária de pães.
                  product:
                    type: object
                    description: The product that the plan belongs to.
                    properties:
                      id:
                        type: string
                        format: uuid
                        description: The unique identifier of the product in our system.
                      name:
                        description: The name of the product.
                        type: string
                        minLength: 1
                        example: Platform subscription
                    required:
                      - id
                      - name
                    additionalProperties: false
                  activePlanVersion:
                    type: object
                    description: >-
                      The active plan version of the plan, whose plan charges a
                      new plan instance of the plan bills.
                    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
                required:
                  - id
                  - name
                  - description
                  - product
                  - activePlanVersion
                additionalProperties: false
        '400':
          description: >-
            The request cannot succeed as sent.


            - `json_schema_validation_error`: a path parameter or the body
            breaks the schema of the endpoint.

            - `product_not_found`: no product of the tenant has the `productId`.

            - `invalid_plan_charges`: a plan charge breaks a rule of plan
            charges, such as tiers that leave a gap, an item, a resource or a
            license that the tenant does not have, two minimum commitments with
            the same billing frequency, or billing frequencies in both months
            and weeks.

            - `billing_frequency_not_yet_supported`: a license-based charge with
            the billing model `proration`, or a usage-based charge on a resource
            with the billing model `proration`, has a billing frequency of more
            than one month or one week.

            - `currency_unit_not_found`: no currency unit of the tenant has the
            `currencyUnitCode` of a usage-based charge.
          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
                      - product_not_found
                      - invalid_plan_charges
                      - billing_frequency_not_yet_supported
                      - currency_unit_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:
                json_schema_validation_error:
                  value:
                    message: '''name'' is required'
                    code: json_schema_validation_error
                product_not_found:
                  value:
                    message: default product not found
                    code: product_not_found
                invalid_plan_charges:
                  value:
                    message: 'plan charge "{itemName}": {reason}'
                    code: invalid_plan_charges
                billing_frequency_not_yet_supported:
                  value:
                    message: >-
                      a license-based charge with the billing model `proration`,
                      or a usage-based charge on a resource with the billing
                      model `proration`, has a billing frequency of more than
                      one month or one week
                    code: billing_frequency_not_yet_supported
                currency_unit_not_found:
                  value:
                    message: currency unit not found
                    code: currency_unit_not_found
        '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:write 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_not_found`: no plan 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_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_not_found:
                  value:
                    message: plan "{planId}" not found
                    code: plan_not_found
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.