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

# Archive plan

> Archives a plan, so that `GET /v1/plans` leaves it out unless `includeArchived` is true, and no new plan instance can bill it.

Requires the role `plans:write`.



## OpenAPI

````yaml /api-reference/openapi.yaml post /v1/plans/{id}/archive
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}/archive:
    post:
      tags:
        - Plans
      summary: Archive plan
      description: >-
        Archives a plan, so that `GET /v1/plans` leaves it out unless
        `includeArchived` is true, and no new plan instance can bill it.


        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.
      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.
                    examples:
                      - Plano Essencial
                  description:
                    description: The description of the plan, or null when it has none.
                    type:
                      - string
                      - 'null'
                    examples:
                      - 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
                        examples:
                          - Platform subscription
                    required:
                      - id
                      - name
                    additionalProperties: false
                  archivedAt:
                    description: >-
                      When the plan was archived, or null when it is not
                      archived. An archived plan cannot go on a contract.
                    type:
                      - string
                      - 'null'
                    format: date-time
                  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.
                                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
                                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
                                - name
                                - isCustomNameEnabled
                                - category
                                - 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.
                                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
                                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.
                                  required:
                                    - model
                                    - amount
                                  additionalProperties: false
                              required:
                                - id
                                - position
                                - itemId
                                - name
                                - isCustomNameEnabled
                                - category
                                - 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.
                                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
                                pricing:
                                  type: object
                                  description: >-
                                    The price of a usage-based charge, by its
                                    pricing model in 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.
                                  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:
                                          description: >-
                                            The tier mode of the price: volume,
                                            because the tier that the whole quantity
                                            reaches bills its flat amount.
                                          enum:
                                            - volume
                                        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
                                    - 'null'
                                  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
                                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
                                          - 'null'
                                        minimum: 0
                                        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
                                                  - 'null'
                                                pattern: ^\d+(\.\d{1,6})?$
                                                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
                                - name
                                - isCustomNameEnabled
                                - category
                                - 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.
                                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
                                pricing:
                                  type: object
                                  description: >-
                                    The price of a license-based charge, by its
                                    pricing model in 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.
                                  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: >-
                                        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 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:
                                          description: >-
                                            The tier mode of the price: volume,
                                            because the tier that the whole quantity
                                            reaches bills its flat amount.
                                          enum:
                                            - volume
                                        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
                                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
                                          - 'null'
                                        minimum: 0
                                        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
                                                  - 'null'
                                                pattern: ^\d+(\.\d{1,6})?$
                                                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
                                - name
                                - isCustomNameEnabled
                                - category
                                - 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 you, 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.
                                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
                                pricing:
                                  type: object
                                  description: >-
                                    The price of a custom plan charge: the
                                    parameter values that the code that Aira
                                    writes for you 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
                                - name
                                - isCustomNameEnabled
                                - category
                                - 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
                  - archivedAt
                  - activePlanVersion
                additionalProperties: false
        '400':
          description: >-
            The request cannot succeed as sent.


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

            - `plan_is_already_archived`: the plan is already archived.

            - `plan_has_active_references`: an active or draft contract has an
            active plan instance of the plan, and `details.references.contracts`
            counts those contracts and names up to three of them by their
            contract numbers.
          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
                      - plan_is_already_archived
                      - plan_has_active_references
                  details:
                    oneOf:
                      - type: object
                        additionalProperties: true
                      - type: array
                    description: >-
                      The data of the error, when it has any, such as the fields
                      that failed the validation.
                  causations:
                    type: array
                    description: >-
                      The errors that caused this one, when several did, each
                      with its own message, code and details.
                    items:
                      type: object
                      properties:
                        message:
                          type: string
                          description: A sentence for a person that says what failed.
                        code:
                          type: string
                          description: The identifier of the error.
                        details:
                          type: object
                          additionalProperties: true
                          description: The data of the error, when it has any.
                      required:
                        - message
                        - code
                      additionalProperties: false
                required:
                  - message
                  - code
                additionalProperties: false
              examples:
                json_schema_validation_error:
                  value:
                    message: '''id'' must match format "uuid"'
                    code: json_schema_validation_error
                plan_is_already_archived:
                  value:
                    message: <string>
                    code: plan_is_already_archived
                plan_has_active_references:
                  value:
                    message: <string>
                    code: plan_has_active_references
        '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: <string>
                    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 IP of the request is not among the IPs that
            your API keys accept.
          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: <string>
                    code: invalid_api_key
                deactivated_api_key:
                  value:
                    message: <string>
                    code: deactivated_api_key
                revoked_api_key:
                  value:
                    message: <string>
                    code: revoked_api_key
                expired_api_key:
                  value:
                    message: <string>
                    code: expired_api_key
                ip_not_allowed:
                  value:
                    message: <string>
                    code: ip_not_allowed
        '404':
          description: |-
            A record that the request names does not exist.

            - `plan_not_found`: no plan 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: <string>
                    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.