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

# Mark dispute as lost

> Marks the payment dispute as lost.

> [!NOTE]
>
> API v2 is in beta. Endpoints return the `X-Lago-Endpoint-Status: beta` header.

> [!WARNING]
>
> This endpoint changes billing or financial records. Check the target environment, the resource identifier and the expected effect before you call it. Review the change before you run it in production.


## OpenAPI

````yaml https://swagger.getlago.com/openapi-v2.yaml POST /invoices/{lago_id}/lose_dispute
openapi: 3.1.0
info:
  title: Lago API v2 documentation
  description: >-
    Lago API v2. Documents native v2 endpoints for the product catalog, billing,
    customers, organizations, billing entities, billable metrics, events,
    features, privileges, entitlements, wallets, alerts, logs and webhook
    endpoints. Paginated lists use cursor pagination. Some lists, such as rates
    and phases, return the complete list without pagination. Native v2 endpoints
    use opt-in relationship expansions and structured error responses. Only the
    documented actions and expansions are supported. Some other /api/v2 paths
    still fall back to v1 controllers and are not described here.
  version: 2.0.0-beta
  license:
    name: AGPLv3
    url: https://github.com/getlago/lago-openapi/blob/main/LICENSE
  contact:
    email: tech@getlago.com
servers:
  - url: https://api.getlago.com/api/v2
    description: US Lago cluster
  - url: https://api.eu.getlago.com/api/v2
    description: EU Lago cluster
security:
  - bearerAuth: []
tags:
  - name: taxes
    description: Tax rates
  - name: product_categories
    description: product categories operations
  - name: products
    description: products operations
  - name: product_filters
    description: product filters operations
  - name: rate_cards
    description: rate cards operations
  - name: rate_card_rates
    description: rate card rates operations
  - name: catalog_plans
    description: catalog plans operations
  - name: plan_applied_rate_cards
    description: plan applied rate cards operations
  - name: plan_rate_phases
    description: plan rate phases operations
  - name: contract_applied_rate_cards
    description: contract applied rate cards operations
  - name: contract_rate_phases
    description: contract rate phases operations
  - name: contracts
    description: contracts operations
  - name: invoices
    description: invoices operations
  - name: fees
    description: fees operations
  - name: payments
    description: payments operations
  - name: payment_requests
    description: payment requests operations
  - name: payment_receipts
    description: payment receipts operations
  - name: credit_notes
    description: credit notes operations
  - name: customers
    description: customers operations
  - name: organizations
    description: Organization operations
  - name: billing_entities
    description: billing entities operations
  - name: billable_metrics
    description: billable metrics operations
  - name: events
    description: Event operations
  - name: activity_logs
    description: activity logs operations
  - name: api_logs
    description: api logs operations
  - name: security_logs
    description: security logs operations
  - name: webhook_endpoints
    description: webhook endpoints operations
  - name: features
    description: features operations
  - name: feature_privileges
    description: feature privileges operations
  - name: plan_wallets
    description: plan wallets operations
  - name: contract_wallets
    description: contract wallets operations
  - name: contract_wallet_transactions
    description: contract wallet transactions operations
  - name: plan_wallet_alerts
    description: plan wallet alerts operations
  - name: contract_wallet_alerts
    description: contract wallet alerts operations
  - name: contract_alerts
    description: contract alerts operations
  - name: plan_entitlements
    description: plan entitlements operations
  - name: contract_entitlements
    description: contract entitlements operations
externalDocs:
  description: Lago documentation
  url: https://getlago.com/docs
paths:
  /invoices/{lago_id}/lose_dispute:
    parameters:
      - name: lago_id
        in: path
        required: true
        description: Unique identifier created by Lago.
        schema:
          type: string
          description: Unique identifier created by Lago.
          example: 1a901a90-1a90-1a90-1a90-1a901a901a90
          format: uuid
    post:
      tags:
        - invoices
      summary: Mark an invoice dispute as lost
      description: >-
        Marks the payment dispute as lost.

        Requires the product catalog to be enabled and invoice write permission
        on the API key.
      operationId: loseDisputeInvoice
      responses:
        '200':
          description: Successful response
          headers:
            X-Lago-Endpoint-Status:
              $ref: '#/components/headers/EndpointStatus'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Invoice'
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '403':
          $ref: '#/components/responses/Forbidden'
        '404':
          $ref: '#/components/responses/NotFound'
        '422':
          $ref: '#/components/responses/UnprocessableEntity'
components:
  headers:
    EndpointStatus:
      description: Indicates that the endpoint is in beta.
      schema:
        type: string
        enum:
          - beta
        example: beta
  schemas:
    Invoice:
      type: object
      description: invoice response.
      required:
        - invoice
      properties:
        invoice:
          $ref: '#/components/schemas/InvoiceObject'
    InvoiceObject:
      type: object
      description: Invoice.
      required:
        - lago_id
        - number
        - invoice_type
        - status
        - payment_status
        - billing_entity_code
        - lago_customer_id
        - external_customer_id
        - currency
        - issuing_date
        - payment_due_date
        - payment_overdue
        - purchase_order_number
        - fees_amount_cents
        - sub_total_excluding_taxes_amount_cents
        - taxes_amount_cents
        - sub_total_including_taxes_amount_cents
        - credit_notes_amount_cents
        - total_amount_cents
        - total_offsetted_credit_note_amount_cents
        - total_paid_amount_cents
        - total_due_amount_cents
        - pdf_url
        - xml_url
        - payment_dispute_lost_at
        - voided_at
        - created_at
        - updated_at
      properties:
        lago_id:
          type: string
          description: Unique identifier created by Lago.
          example: 1a901a90-1a90-1a90-1a90-1a901a901a90
          format: uuid
        number:
          type: string
          description: Number.
          example: example
        invoice_type:
          type: string
          description: >-
            Type of invoice. Advance fees are named advance_fees rather than the
            v1 advance_charges value.
          example: contract
          enum:
            - contract
            - advance_fees
            - subscription
            - add_on
            - credit
            - one_off
            - progressive_billing
            - credit_purchase
        status:
          type: string
          description: Invoice lifecycle status.
          example: generating
          enum:
            - generating
            - draft
            - open
            - finalized
            - voided
            - failed
            - closed
            - pending
            - deleted
        payment_status:
          type: string
          description: Payment status.
          example: pending
          enum:
            - pending
            - succeeded
            - failed
        billing_entity_code:
          type: string
          description: Code of the invoice billing entity.
          example: main
        lago_customer_id:
          type:
            - string
            - 'null'
          description: Customer identifier.
          example: 1a901a90-1a90-1a90-1a90-1a901a901a90
          format: uuid
        external_customer_id:
          type: string
          description: External customer identifier.
          example: customer_123
        currency:
          type:
            - string
            - 'null'
          description: Currency as an ISO 4217 code.
          example: USD
        issuing_date:
          type:
            - string
            - 'null'
          description: Issuing date.
          example: null
          format: date
        payment_due_date:
          type:
            - string
            - 'null'
          description: Payment due date.
          example: null
          format: date
        payment_overdue:
          type:
            - boolean
            - 'null'
          description: Payment overdue.
          example: false
        purchase_order_number:
          type:
            - string
            - 'null'
          description: Purchase order number.
          example: example
        fees_amount_cents:
          type: integer
          description: Fees amount cents.
          example: 100
        sub_total_excluding_taxes_amount_cents:
          type: integer
          description: Sub total excluding taxes amount cents.
          example: 100
        taxes_amount_cents:
          type: integer
          description: Taxes amount cents.
          example: 100
        sub_total_including_taxes_amount_cents:
          type: integer
          description: Sub total including taxes amount cents.
          example: 100
        credit_notes_amount_cents:
          type: integer
          description: Credit notes amount cents.
          example: 100
        total_amount_cents:
          type: integer
          description: Total amount cents.
          example: 100
        total_offsetted_credit_note_amount_cents:
          type: integer
          description: Total applied credit note offsets, in cents.
          example: 0
        total_paid_amount_cents:
          type: integer
          description: Total paid amount cents.
          example: 100
        total_due_amount_cents:
          type: integer
          description: Amount still due, in cents.
          example: 1000
        pdf_url:
          type:
            - string
            - 'null'
          description: Document download URL, or null while the document is unavailable.
          example: https://documents.example/invoice.pdf
          format: uri
        xml_url:
          type:
            - string
            - 'null'
          description: Document download URL, or null while the document is unavailable.
          example: https://documents.example/invoice.pdf
          format: uri
        payment_dispute_lost_at:
          type:
            - string
            - 'null'
          description: Payment dispute lost at.
          example: null
          format: date-time
        voided_at:
          type:
            - string
            - 'null'
          description: Voided at.
          example: null
          format: date-time
        created_at:
          type: string
          format: date-time
          description: UTC creation timestamp, with microsecond precision.
          example: '2022-04-29T08:59:51.123456Z'
        updated_at:
          type: string
          description: UTC timestamp of the last update, with microsecond precision.
          example: '2022-04-29T08:59:51.123456Z'
          format: date-time
        fees:
          type: array
          description: >-
            Present only with expands[]=fees. At most 1000 fees may be expanded;
            use GET /fees for larger invoices.
          items:
            $ref: '#/components/schemas/FeeObject'
        applied_taxes:
          type: array
          description: Present only with expands[]=applied_taxes.
          items:
            $ref: '#/components/schemas/InvoiceAppliedTaxObject'
        customer:
          $ref: '#/components/schemas/CustomerObject'
          description: Present only with expands[]=customer.
        contracts:
          type: array
          description: >-
            Present only with expands[]=contracts. Contracts are derived from
            fee provenance.
          items:
            $ref: '#/components/schemas/ContractObject'
        applied_invoice_custom_sections:
          type: array
          description: Present only with expands[]=applied_invoice_custom_sections.
          items:
            $ref: '#/components/schemas/AppliedInvoiceCustomSectionObject'
        error_details:
          type: array
          description: Present only with expands[]=error_details.
          items:
            $ref: '#/components/schemas/ErrorDetailObject'
    ApiError:
      type: object
      required:
        - code
        - details
      properties:
        code:
          type: string
          pattern: ^[a-z][a-z0-9_]*$
          description: >-
            Code identifying the failure. The HTTP status is carried by the
            response, not the body.
          example: validation_errors
        details:
          type: array
          description: >-
            Details of the failure. The array is empty when no field details are
            available.
          items:
            type: object
            required:
              - code
              - field
              - meta
            properties:
              code:
                type: string
                pattern: ^[a-z][a-z0-9_]*$
                description: >-
                  Code identifying the field error or the reason a request
                  parameter was rejected.
                example: value_is_mandatory
              field:
                type: string
                description: >-
                  Request field or parameter. Nested fields use dots and
                  zero-based array indexes. A resource-level failure uses base.
                example: name
              meta:
                type: object
                description: >-
                  Information about the failure, such as the missing resource,
                  allowed values or bounds. The object is empty when no metadata
                  is available.
                additionalProperties: true
                example: {}
                properties:
                  min:
                    type: integer
                    description: Inclusive minimum value.
                    example: 0
                  max:
                    type: integer
                    description: Inclusive maximum value.
                    example: 100
                  min_length:
                    type: integer
                    description: Minimum string length, in characters.
                    example: 1
                  max_length:
                    type: integer
                    description: Maximum string length, in characters.
                    example: 255
                  max_items:
                    type: integer
                    description: Maximum number of items.
                    example: 100
                  allowed_values:
                    type: array
                    description: Values accepted for the field.
                    items:
                      type: string
                      description: Allowed value.
                      example: draft
                  invalid_values:
                    type: array
                    description: Values rejected by request validation.
                    items:
                      type: string
                      description: Rejected value.
                      example: unknown
                  value:
                    type: string
                    description: Query parameter value received.
                    example: unknown
                  resource:
                    type: string
                    description: Resource that could not be found.
                    example: customer
                  provider_name:
                    type: string
                    description: Name of the provider that failed.
                    example: stripe
                  provider_code:
                    type: string
                    description: Code of the provider connection.
                    example: stripe_eu
                  provider_error_code:
                    type: string
                    description: Error code returned by the provider.
                    example: resource_missing
    FeeObject:
      type: object
      description: Fee.
      required:
        - lago_id
        - lago_invoice_id
        - fee_type
        - lago_customer_id
        - external_customer_id
        - lago_contract_id
        - external_contract_id
        - lago_product_id
        - product_code
        - lago_product_category_id
        - product_category_code
        - lago_product_filter_id
        - product_filter_code
        - lago_rate_card_id
        - rate_card_code
        - lago_rate_id
        - rate_code
        - lago_rate_override_id
        - lago_true_up_parent_fee_id
        - lago_true_up_fee_id
        - event_transaction_id
        - display_on_invoice
        - product_invoice_display_name
        - product_category_invoice_display_name
        - product_filter_invoice_display_name
        - filters
        - billing_timing
        - grouped_by
        - currency
        - units
        - total_aggregated_units
        - events_count
        - unit_amount_cents
        - precise_unit_amount_cents
        - amount_cents
        - sub_total_excluding_taxes_amount_cents
        - taxes_amount_cents
        - total_amount_cents
        - amount_details
        - pricing_unit_details
        - payment_status
        - from_datetime
        - to_datetime
        - succeeded_at
        - failed_at
        - refunded_at
        - created_at
        - updated_at
        - deleted_at
        - lago_wallet_id
        - wallet_code
        - lago_wallet_transaction_id
      properties:
        lago_id:
          type: string
          description: Unique identifier created by Lago.
          example: 1a901a90-1a90-1a90-1a90-1a901a901a90
          format: uuid
        lago_invoice_id:
          type:
            - string
            - 'null'
          description: Identifier of the related invoice.
          example: 1a901a90-1a90-1a90-1a90-1a901a901a90
          format: uuid
        fee_type:
          type: string
          description: >-
            Product fee or wallet credit purchase fee. The fees endpoints return
            product fees; invoice fee expansions can also include credit
            purchases.
          example: product
          enum:
            - product
            - credit_purchase
        lago_customer_id:
          type:
            - string
            - 'null'
          description: Identifier of the related customer.
          example: 1a901a90-1a90-1a90-1a90-1a901a901a90
          format: uuid
        external_customer_id:
          type:
            - string
            - 'null'
          description: External customer id.
          example: example
        lago_contract_id:
          type:
            - string
            - 'null'
          description: Identifier of the related contract.
          example: 1a901a90-1a90-1a90-1a90-1a901a901a90
          format: uuid
        external_contract_id:
          type:
            - string
            - 'null'
          description: External contract id.
          example: example
        lago_product_id:
          type:
            - string
            - 'null'
          description: Identifier of the related product.
          example: 1a901a90-1a90-1a90-1a90-1a901a901a90
          format: uuid
        product_code:
          type:
            - string
            - 'null'
          description: Product code.
          example: example
        lago_product_category_id:
          type:
            - string
            - 'null'
          description: Identifier of the related product category.
          example: 1a901a90-1a90-1a90-1a90-1a901a901a90
          format: uuid
        product_category_code:
          type:
            - string
            - 'null'
          description: Product category code.
          example: example
        lago_product_filter_id:
          type:
            - string
            - 'null'
          description: Identifier of the related product filter.
          example: 1a901a90-1a90-1a90-1a90-1a901a901a90
          format: uuid
        product_filter_code:
          type:
            - string
            - 'null'
          description: Product filter code.
          example: example
        lago_rate_card_id:
          type:
            - string
            - 'null'
          description: Identifier of the related rate card.
          example: 1a901a90-1a90-1a90-1a90-1a901a901a90
          format: uuid
        rate_card_code:
          type:
            - string
            - 'null'
          description: Rate card code.
          example: example
        lago_rate_id:
          type:
            - string
            - 'null'
          description: Identifier of the related rate.
          example: 1a901a90-1a90-1a90-1a90-1a901a901a90
          format: uuid
        rate_code:
          type:
            - string
            - 'null'
          description: Rate code.
          example: example
        lago_rate_override_id:
          type:
            - string
            - 'null'
          description: Identifier of the related rate override.
          example: 1a901a90-1a90-1a90-1a90-1a901a901a90
          format: uuid
        lago_true_up_parent_fee_id:
          type:
            - string
            - 'null'
          description: Identifier of the related true up parent fee.
          example: 1a901a90-1a90-1a90-1a90-1a901a901a90
          format: uuid
        lago_true_up_fee_id:
          type:
            - string
            - 'null'
          description: Identifier of the related true up fee.
          example: 1a901a90-1a90-1a90-1a90-1a901a901a90
          format: uuid
        event_transaction_id:
          type:
            - string
            - 'null'
          description: Transaction identifier of the advance-billing event.
          example: event_123
        display_on_invoice:
          type:
            - boolean
            - 'null'
          description: Whether the rate card displays this fee on invoices.
          example: true
        product_invoice_display_name:
          type:
            - string
            - 'null'
          description: Product invoice display name.
          example: example
        product_category_invoice_display_name:
          type:
            - string
            - 'null'
          description: Product category invoice display name.
          example: example
        product_filter_invoice_display_name:
          type:
            - string
            - 'null'
          description: Product filter invoice display name.
          example: example
        filters:
          type:
            - object
            - 'null'
          description: >-
            Product filter matches saved with the fee. Older fees can fall back
            to current filter values.
          additionalProperties:
            type: array
            description: Values selected for this key.
            items:
              type:
                - string
                - 'null'
              description: Selected filter value.
              example: eu
        billing_timing:
          type: string
          description: When the fee is billed.
          example: advance
          enum:
            - advance
            - arrears
        grouped_by:
          type: object
          description: Grouped by.
          additionalProperties: true
        currency:
          type: string
          description: Currency as an ISO 4217 code.
          example: USD
        units:
          type: string
          description: Quantity. Sent as a decimal string.
          example: '1.5'
          pattern: ^-?[0-9]+(\.[0-9]+)?$
        total_aggregated_units:
          type:
            - string
            - 'null'
          description: Total aggregated units. Sent as a decimal string.
          example: '1.5'
          pattern: ^-?[0-9]+(\.[0-9]+)?$
        events_count:
          type:
            - integer
            - 'null'
          description: Events count.
          example: 1
        unit_amount_cents:
          type: integer
          description: Unit amount cents.
          example: 100
        precise_unit_amount_cents:
          type: string
          description: Precise unit amount in cents. Sent as a decimal string.
          example: '1.5'
          pattern: ^-?[0-9]+(\.[0-9]+)?$
        amount_cents:
          type: integer
          description: Amount cents.
          example: 100
        sub_total_excluding_taxes_amount_cents:
          type: integer
          description: Fee amount after discounts and before tax, in cents.
          example: 1000
        taxes_amount_cents:
          type: integer
          description: Taxes amount cents.
          example: 100
        total_amount_cents:
          type: integer
          description: Fee amount including tax, in cents.
          example: 1200
        amount_details:
          type: object
          description: Amount details.
          additionalProperties: true
        pricing_unit_details:
          anyOf:
            - $ref: '#/components/schemas/FeePricingUnitDetailsObject'
            - type: 'null'
          description: Pricing unit amounts, or null when no pricing unit is used.
        payment_status:
          type: string
          description: Payment status of the fee.
          example: pending
          enum:
            - pending
            - succeeded
            - failed
            - refunded
        from_datetime:
          type:
            - string
            - 'null'
          description: Start of the billed period, when available.
          example: null
          format: date-time
        to_datetime:
          type:
            - string
            - 'null'
          description: End of the billed period, when available.
          example: null
          format: date-time
        succeeded_at:
          type:
            - string
            - 'null'
          description: Succeeded at.
          example: null
          format: date-time
        failed_at:
          type:
            - string
            - 'null'
          description: Failed at.
          example: null
          format: date-time
        refunded_at:
          type:
            - string
            - 'null'
          description: Refunded at.
          example: null
          format: date-time
        created_at:
          type: string
          format: date-time
          description: UTC creation timestamp, with microsecond precision.
          example: '2022-04-29T08:59:51.123456Z'
        updated_at:
          type: string
          description: UTC timestamp of the last update, with microsecond precision.
          example: '2022-04-29T08:59:51.123456Z'
          format: date-time
        deleted_at:
          type:
            - string
            - 'null'
          description: >-
            UTC deletion timestamp, with microsecond precision. Null until
            deletion.
          example: null
          format: date-time
        applied_taxes:
          type: array
          description: Present only with expands[]=applied_taxes.
          items:
            $ref: '#/components/schemas/FeeAppliedTaxObject'
        invoice:
          anyOf:
            - $ref: '#/components/schemas/InvoiceObject'
            - type: 'null'
          description: Present only with expands[]=invoice.
        product:
          anyOf:
            - $ref: '#/components/schemas/ProductObject'
            - type: 'null'
          description: Present only with expands[]=product.
        product_filter:
          anyOf:
            - $ref: '#/components/schemas/ProductFilterObject'
            - type: 'null'
          description: Present only with expands[]=product_filter.
        rate_card:
          anyOf:
            - $ref: '#/components/schemas/RateCardObject'
            - type: 'null'
          description: Present only with expands[]=rate_card.
        rate:
          anyOf:
            - $ref: '#/components/schemas/RateCardRateObject'
            - type: 'null'
          description: Present only with expands[]=rate.
        contract:
          anyOf:
            - $ref: '#/components/schemas/ContractObject'
            - type: 'null'
          description: Present only with expands[]=contract.
        customer:
          anyOf:
            - $ref: '#/components/schemas/CustomerObject'
            - type: 'null'
          description: Present only with expands[]=customer.
        lago_wallet_id:
          type:
            - string
            - 'null'
          description: >-
            Identifier of the wallet funded by a credit purchase, or null for a
            product fee.
          example: 1a901a90-1a90-1a90-1a90-1a901a901a90
          format: uuid
        wallet_code:
          type:
            - string
            - 'null'
          description: >-
            Code of the wallet funded by a credit purchase, or null for a
            product fee.
          example: prepaid
        lago_wallet_transaction_id:
          type:
            - string
            - 'null'
          description: >-
            Identifier of the credit purchase wallet transaction, or null for a
            product fee.
          example: 1a901a90-1a90-1a90-1a90-1a901a901a90
          format: uuid
    InvoiceAppliedTaxObject:
      type: object
      description: Invoice Applied Tax.
      required:
        - lago_id
        - lago_invoice_id
        - lago_tax_id
        - tax_name
        - tax_code
        - tax_rate
        - tax_description
        - amount_cents
        - fees_amount_cents
        - created_at
        - updated_at
      properties:
        lago_id:
          type: string
          description: Unique identifier created by Lago.
          example: 1a901a90-1a90-1a90-1a90-1a901a901a90
          format: uuid
        lago_invoice_id:
          type: string
          description: Identifier of the taxed record.
          example: 1a901a90-1a90-1a90-1a90-1a901a901a90
          format: uuid
        lago_tax_id:
          type:
            - string
            - 'null'
          description: >-
            Tax identifier. Null when the tax was removed or supplied by a
            provider.
          example: 1a901a90-1a90-1a90-1a90-1a901a901a90
          format: uuid
        tax_name:
          type: string
          description: Tax name.
          example: example
        tax_code:
          type: string
          description: Tax code.
          example: example
        tax_rate:
          type: number
          description: Tax rate.
          example: 20
        tax_description:
          type:
            - string
            - 'null'
          description: Tax description.
          example: example
        amount_cents:
          type: integer
          description: Amount cents.
          example: 100
        fees_amount_cents:
          type: integer
          description: Fees amount cents.
          example: 100
        created_at:
          type: string
          format: date-time
          description: UTC creation timestamp, with microsecond precision.
          example: '2022-04-29T08:59:51.123456Z'
        updated_at:
          type: string
          description: UTC timestamp of the last update, with microsecond precision.
          example: '2022-04-29T08:59:51.123456Z'
          format: date-time
    CustomerObject:
      type: object
      description: Customer.
      required:
        - lago_id
        - billing_entity_code
        - external_id
        - account_type
        - name
        - firstname
        - lastname
        - customer_type
        - sequential_id
        - slug
        - country
        - address_line1
        - address_line2
        - state
        - zipcode
        - email
        - city
        - url
        - phone
        - logo_url
        - legal_name
        - legal_number
        - currency
        - tax_identification_number
        - timezone
        - applicable_timezone
        - external_salesforce_id
        - finalize_zero_amount_invoice
        - skip_invoice_custom_sections
        - invoice_grace_period
        - periodic_invoice_issuing_date_anchor
        - periodic_invoice_issuing_date_adjustment
        - payment_provider
        - payment_provider_code
        - provider_customer_id
        - provider_payment_methods
        - document_locale
        - created_at
        - updated_at
        - deleted_at
      properties:
        lago_id:
          type: string
          description: Unique identifier created by Lago.
          example: 1a901a90-1a90-1a90-1a90-1a901a901a90
          format: uuid
        billing_entity_code:
          type: string
          description: Code of the customer billing entity.
          example: main
        external_id:
          type: string
          description: Unique customer identifier in your application.
          example: customer_123
        account_type:
          type: string
          description: Account type.
          example: customer
          enum:
            - customer
            - partner
        name:
          type:
            - string
            - 'null'
          description: Name.
          example: example
        firstname:
          type:
            - string
            - 'null'
          description: Firstname.
          example: example
        lastname:
          type:
            - string
            - 'null'
          description: Lastname.
          example: example
        customer_type:
          type:
            - string
            - 'null'
          description: Type of customer.
          example: company
          enum:
            - company
            - individual
            - null
        sequential_id:
          type:
            - integer
            - 'null'
          description: Sequential id.
          example: 100
        slug:
          type:
            - string
            - 'null'
          description: Slug.
          example: example
        country:
          type:
            - string
            - 'null'
          description: Country.
          example: example
        address_line1:
          type:
            - string
            - 'null'
          description: Address line1.
          example: example
        address_line2:
          type:
            - string
            - 'null'
          description: Address line2.
          example: example
        state:
          type:
            - string
            - 'null'
          description: State.
          example: example
        zipcode:
          type:
            - string
            - 'null'
          description: Zipcode.
          example: example
        email:
          type:
            - string
            - 'null'
          description: Email.
          example: billing@acme.example
        city:
          type:
            - string
            - 'null'
          description: City.
          example: example
        url:
          type:
            - string
            - 'null'
          description: Url.
          example: example
        phone:
          type:
            - string
            - 'null'
          description: Phone.
          example: example
        logo_url:
          type:
            - string
            - 'null'
          description: Logo url.
          example: example
        legal_name:
          type:
            - string
            - 'null'
          description: Legal name.
          example: example
        legal_number:
          type:
            - string
            - 'null'
          description: Legal number.
          example: example
        currency:
          type:
            - string
            - 'null'
          description: Currency as an ISO 4217 code.
          example: USD
        tax_identification_number:
          type:
            - string
            - 'null'
          description: Tax identification number.
          example: example
        timezone:
          type:
            - string
            - 'null'
          description: Timezone.
          example: example
        applicable_timezone:
          type: string
          description: Timezone used for customer billing.
          example: Europe/Paris
        external_salesforce_id:
          type:
            - string
            - 'null'
          description: External salesforce id.
          example: example
        finalize_zero_amount_invoice:
          type: string
          description: Whether invoices with a zero amount are finalized.
          example: inherit
          enum:
            - inherit
            - skip
            - finalize
        skip_invoice_custom_sections:
          type: boolean
          description: Skip invoice custom sections.
          example: false
        invoice_grace_period:
          type:
            - integer
            - 'null'
          description: Invoice grace period.
          example: 1
        periodic_invoice_issuing_date_anchor:
          type:
            - string
            - 'null'
          description: Anchor used to determine the issuing date of periodic invoices.
          example: current_period_end
        periodic_invoice_issuing_date_adjustment:
          type:
            - string
            - 'null'
          description: Adjustment applied to the periodic invoice issuing date.
          example: keep_anchor
        payment_provider:
          type:
            - string
            - 'null'
          description: Payment provider.
          example: example
        payment_provider_code:
          type:
            - string
            - 'null'
          description: Payment provider code.
          example: example
        provider_customer_id:
          type:
            - string
            - 'null'
          description: Customer identifier in the payment provider.
          example: cus_example
        provider_payment_methods:
          type:
            - array
            - 'null'
          description: Payment methods allowed by the provider.
          items:
            type: string
            description: Payment method type.
            example: card
        document_locale:
          type:
            - string
            - 'null'
          description: Document locale.
          example: example
        created_at:
          type: string
          format: date-time
          description: UTC creation timestamp, with microsecond precision.
          example: '2022-04-29T08:59:51.123456Z'
        updated_at:
          type: string
          description: UTC timestamp of the last update, with microsecond precision.
          example: '2022-04-29T08:59:51.123456Z'
          format: date-time
        deleted_at:
          type:
            - string
            - 'null'
          description: >-
            UTC deletion timestamp, with microsecond precision. Null until
            deletion.
          example: null
          format: date-time
        x402_agent_address:
          type:
            - string
            - 'null'
          description: Agent address. Present only when x402 payments are enabled.
          example: '0x0000000000000000000000000000000000000000'
    ContractObject:
      type: object
      description: Contract.
      required:
        - lago_id
        - external_id
        - code
        - lago_customer_id
        - external_customer_id
        - name
        - plan_code
        - status
        - consolidate_invoice
        - purchase_order_number
        - billing_anchor_date
        - effective_billing_anchor_date
        - skip_invoice_custom_sections
        - started_at
        - ended_at
        - terminated_at
        - canceled_at
        - created_at
        - updated_at
      properties:
        lago_id:
          type: string
          description: Unique identifier created by Lago.
          example: 1a901a90-1a90-1a90-1a90-1a901a901a90
          format: uuid
        external_id:
          type: string
          description: External id.
          example: example
        code:
          type:
            - string
            - 'null'
          description: >-
            Immutable contract code. Null for existing contracts created without
            a code.
          example: initial
        lago_customer_id:
          type: string
          description: Customer identifier created by Lago.
          example: 1a901a90-1a90-1a90-1a90-1a901a901a90
          format: uuid
        external_customer_id:
          type: string
          description: External customer identifier.
          example: customer_123
        name:
          type:
            - string
            - 'null'
          description: Name.
          example: example
        plan_code:
          type:
            - string
            - 'null'
          description: >-
            Optional plan code. Plan-less contracts use directly attached rate
            cards.
          example: standard
        status:
          type: string
          description: Lifecycle status. A draft never bills until it is published.
          example: pending
          enum:
            - draft
            - pending
            - active
            - terminated
            - canceled
        consolidate_invoice:
          type: boolean
          description: Consolidate invoice.
          example: false
        purchase_order_number:
          type:
            - string
            - 'null'
          description: Purchase order number.
          example: example
        billing_anchor_date:
          type:
            - string
            - 'null'
          description: Optional billing anchor.
          example: null
          format: date
        effective_billing_anchor_date:
          type:
            - string
            - 'null'
          description: Resolved billing anchor.
          example: null
          format: date
        skip_invoice_custom_sections:
          type: boolean
          description: Skip invoice custom sections.
          example: false
        started_at:
          type:
            - string
            - 'null'
          description: Started at.
          example: null
          format: date-time
        ended_at:
          type:
            - string
            - 'null'
          description: Ended at.
          example: null
          format: date-time
        terminated_at:
          type:
            - string
            - 'null'
          description: Terminated at.
          example: null
          format: date-time
        canceled_at:
          type:
            - string
            - 'null'
          description: Canceled at.
          example: null
          format: date-time
        created_at:
          type: string
          format: date-time
          description: UTC creation timestamp, with microsecond precision.
          example: '2022-04-29T08:59:51.123456Z'
        updated_at:
          type: string
          description: UTC timestamp of the last update, with microsecond precision.
          example: '2022-04-29T08:59:51.123456Z'
          format: date-time
        applied_rate_cards:
          type: array
          description: Present only with expands[]=applied_rate_cards.
          items:
            $ref: '#/components/schemas/ContractAppliedRateCardObject'
        plan:
          anyOf:
            - $ref: '#/components/schemas/CatalogPlanObject'
            - type: 'null'
          description: Present only with expands[]=plan.
        customer:
          $ref: '#/components/schemas/CustomerObject'
          description: Present only with expands[]=customer.
        invoice_custom_sections:
          type: array
          description: Present only with expands[]=invoice_custom_sections.
          items:
            $ref: '#/components/schemas/InvoiceCustomSectionObject'
    AppliedInvoiceCustomSectionObject:
      type: object
      description: Applied Invoice Custom Section.
      required:
        - lago_id
        - lago_invoice_id
        - code
        - details
        - display_name
        - created_at
        - updated_at
      properties:
        lago_id:
          type: string
          description: Unique identifier created by Lago.
          example: 1a901a90-1a90-1a90-1a90-1a901a901a90
          format: uuid
        lago_invoice_id:
          type: string
          description: Invoice identifier.
          example: 1a901a90-1a90-1a90-1a90-1a901a901a90
          format: uuid
        code:
          type: string
          description: Code.
          example: example
        details:
          type:
            - string
            - 'null'
          description: Details.
          example: example
        display_name:
          type:
            - string
            - 'null'
          description: Display name.
          example: example
        created_at:
          type: string
          format: date-time
          description: UTC creation timestamp, with microsecond precision.
          example: '2022-04-29T08:59:51.123456Z'
        updated_at:
          type: string
          description: UTC timestamp of the last update, with microsecond precision.
          example: '2022-04-29T08:59:51.123456Z'
          format: date-time
    ErrorDetailObject:
      type: object
      description: Error attached to an invoice.
      required:
        - lago_id
        - error_code
        - details
        - created_at
        - updated_at
        - deleted_at
      properties:
        lago_id:
          type: string
          description: Unique identifier created by Lago.
          example: 1a901a90-1a90-1a90-1a90-1a901a901a90
          format: uuid
        error_code:
          type: string
          description: Error category.
          example: not_provided
          enum:
            - not_provided
            - tax_error
            - tax_voiding_error
            - invoice_generation_error
        details:
          type: object
          description: Details.
          additionalProperties: true
        created_at:
          type: string
          format: date-time
          description: UTC creation timestamp, with microsecond precision.
          example: '2022-04-29T08:59:51.123456Z'
        updated_at:
          type: string
          description: UTC timestamp of the last update, with microsecond precision.
          example: '2022-04-29T08:59:51.123456Z'
          format: date-time
        deleted_at:
          type:
            - string
            - 'null'
          description: >-
            UTC deletion timestamp, with microsecond precision. Null until
            deletion.
          example: null
          format: date-time
    FeePricingUnitDetailsObject:
      type: object
      description: Fee Pricing Unit Details.
      required:
        - lago_pricing_unit_id
        - pricing_unit_code
        - short_name
        - amount_cents
        - precise_amount_cents
        - unit_amount_cents
        - precise_unit_amount
        - conversion_rate
      properties:
        lago_pricing_unit_id:
          type: string
          description: Pricing unit identifier.
          example: 1a901a90-1a90-1a90-1a90-1a901a901a90
          format: uuid
        pricing_unit_code:
          type: string
          description: Pricing unit code.
          example: tokens
        short_name:
          type: string
          description: Short name.
          example: example
        amount_cents:
          type: integer
          description: Amount cents.
          example: 100
        precise_amount_cents:
          type: string
          description: Precise amount cents. Sent as a decimal string.
          example: '1.5'
          pattern: ^-?[0-9]+(\.[0-9]+)?$
        unit_amount_cents:
          type: integer
          description: Unit amount cents.
          example: 100
        precise_unit_amount:
          type: string
          description: Precise unit amount. Sent as a decimal string.
          example: '1.5'
          pattern: ^-?[0-9]+(\.[0-9]+)?$
        conversion_rate:
          type: string
          description: Conversion rate. Sent as a decimal string.
          example: '1.5'
          pattern: ^-?[0-9]+(\.[0-9]+)?$
    FeeAppliedTaxObject:
      type: object
      description: Fee Applied Tax.
      required:
        - lago_id
        - lago_fee_id
        - lago_tax_id
        - tax_name
        - tax_code
        - tax_rate
        - tax_description
        - amount_cents
        - created_at
        - updated_at
      properties:
        lago_id:
          type: string
          description: Unique identifier created by Lago.
          example: 1a901a90-1a90-1a90-1a90-1a901a901a90
          format: uuid
        lago_fee_id:
          type: string
          description: Identifier of the taxed record.
          example: 1a901a90-1a90-1a90-1a90-1a901a901a90
          format: uuid
        lago_tax_id:
          type:
            - string
            - 'null'
          description: >-
            Tax identifier. Null when the tax was removed or supplied by a
            provider.
          example: 1a901a90-1a90-1a90-1a90-1a901a901a90
          format: uuid
        tax_name:
          type: string
          description: Tax name.
          example: example
        tax_code:
          type: string
          description: Tax code.
          example: example
        tax_rate:
          type: number
          description: Tax rate.
          example: 20
        tax_description:
          type:
            - string
            - 'null'
          description: Tax description.
          example: example
        amount_cents:
          type: integer
          description: Amount cents.
          example: 100
        created_at:
          type: string
          format: date-time
          description: UTC creation timestamp, with microsecond precision.
          example: '2022-04-29T08:59:51.123456Z'
        updated_at:
          type: string
          description: UTC timestamp of the last update, with microsecond precision.
          example: '2022-04-29T08:59:51.123456Z'
          format: date-time
    ProductObject:
      type: object
      description: Product.
      required:
        - lago_id
        - name
        - code
        - description
        - invoice_display_name
        - created_at
        - updated_at
        - deleted_at
        - product_category_code
        - billable_metric_code
        - product_type
      properties:
        lago_id:
          type: string
          description: Unique identifier created by Lago.
          example: 1a901a90-1a90-1a90-1a90-1a901a901a90
          format: uuid
        name:
          type: string
          description: Name.
          example: example
        code:
          type: string
          description: Code.
          example: example
        description:
          type:
            - string
            - 'null'
          description: Description.
          example: Example
        invoice_display_name:
          type:
            - string
            - 'null'
          description: Invoice display name.
          example: example
        created_at:
          type: string
          format: date-time
          description: UTC creation timestamp, with microsecond precision.
          example: '2022-04-29T08:59:51.123456Z'
        updated_at:
          type: string
          description: UTC timestamp of the last update, with microsecond precision.
          example: '2022-04-29T08:59:51.123456Z'
          format: date-time
        deleted_at:
          type:
            - string
            - 'null'
          description: >-
            UTC deletion timestamp, with microsecond precision. Null until
            deletion.
          example: null
          format: date-time
        product_category_code:
          type:
            - string
            - 'null'
          description: Code of the category, or null for an uncategorized product.
          example: compute
        billable_metric_code:
          type:
            - string
            - 'null'
          description: >-
            Code of the billable metric. Required for metered products and
            absent for fixed products.
          example: api_requests
        product_type:
          type: string
          description: >-
            Type of product. Metered products require a billable metric; fixed
            products must not reference one.
          example: metered
          enum:
            - metered
            - fixed
        product_category:
          anyOf:
            - $ref: '#/components/schemas/ProductCategoryObject'
            - type: 'null'
          description: Present only with expands[]=product_category on retrieval.
        billable_metric:
          anyOf:
            - $ref: '#/components/schemas/BillableMetricObject'
            - type: 'null'
          description: Present only with expands[]=billable_metric on retrieval.
    ProductFilterObject:
      type: object
      description: Product Filter.
      required:
        - lago_id
        - name
        - code
        - description
        - invoice_display_name
        - created_at
        - updated_at
        - deleted_at
        - product_code
        - product_category_code
        - values
      properties:
        lago_id:
          type: string
          description: Unique identifier created by Lago.
          example: 1a901a90-1a90-1a90-1a90-1a901a901a90
          format: uuid
        name:
          type: string
          description: Name.
          example: example
        code:
          type: string
          description: Code.
          example: example
        description:
          type:
            - string
            - 'null'
          description: Description.
          example: example
        invoice_display_name:
          type:
            - string
            - 'null'
          description: Invoice display name.
          example: example
        created_at:
          type: string
          format: date-time
          description: UTC creation timestamp, with microsecond precision.
          example: '2022-04-29T08:59:51.123456Z'
        updated_at:
          type: string
          description: UTC timestamp of the last update, with microsecond precision.
          example: '2022-04-29T08:59:51.123456Z'
          format: date-time
        deleted_at:
          type:
            - string
            - 'null'
          description: >-
            UTC deletion timestamp, with microsecond precision. Null until
            deletion.
          example: null
          format: date-time
        product_code:
          type: string
          description: Code of the parent product.
          example: api_requests
        product_category_code:
          type:
            - string
            - 'null'
          description: Code of the product category.
          example: compute
        values:
          type: array
          description: >-
            Filter key and value matches. An empty list is returned after
            deletion.
          items:
            $ref: '#/components/schemas/ProductFilterValueObject'
    RateCardObject:
      type: object
      description: Rate Card.
      required:
        - lago_id
        - name
        - code
        - description
        - created_at
        - updated_at
        - deleted_at
        - product_code
        - product_filter_code
        - currency
        - billing_timing
        - proration
        - display_on_invoice
        - regroup_paid_fees
        - applied_pricing_unit_code
      properties:
        lago_id:
          type: string
          description: Unique identifier created by Lago.
          example: 1a901a90-1a90-1a90-1a90-1a901a901a90
          format: uuid
        name:
          type: string
          description: Name.
          example: example
        code:
          type: string
          description: Code.
          example: example
        description:
          type:
            - string
            - 'null'
          description: Description.
          example: example
        created_at:
          type: string
          format: date-time
          description: UTC creation timestamp, with microsecond precision.
          example: '2022-04-29T08:59:51.123456Z'
        updated_at:
          type: string
          description: UTC timestamp of the last update, with microsecond precision.
          example: '2022-04-29T08:59:51.123456Z'
          format: date-time
        deleted_at:
          type:
            - string
            - 'null'
          description: >-
            UTC deletion timestamp, with microsecond precision. Null until
            deletion.
          example: null
          format: date-time
        product_code:
          type: string
          description: Code of the priced product.
          example: api_requests
        product_filter_code:
          type:
            - string
            - 'null'
          description: Code of the priced filter, or null for the product default.
          example: eu
        currency:
          type: string
          description: Currency as an ISO 4217 code.
          example: USD
        billing_timing:
          type: string
          description: When fees are billed.
          example: arrears
          enum:
            - arrears
            - advance
        proration:
          type: boolean
          description: Proration.
          example: false
        display_on_invoice:
          type: boolean
          description: Display on invoice.
          example: false
        regroup_paid_fees:
          type:
            - string
            - 'null'
          description: >-
            Whether paid advance fees are regrouped into an invoice. Null keeps
            fees standalone.
          example: invoice
          enum:
            - invoice
            - null
        applied_pricing_unit_code:
          type:
            - string
            - 'null'
          description: Applied pricing unit code.
          example: example
        active_rate:
          anyOf:
            - $ref: '#/components/schemas/RateCardRateObject'
            - type: 'null'
          description: >-
            Present only with expands[]=active_rate. Null until a rate becomes
            effective.
        rates:
          type: array
          description: >-
            Present only with expands[]=rates. Sorted by effective_from, newest
            first.
          items:
            $ref: '#/components/schemas/RateCardRateObject'
        taxes:
          type: array
          description: Present only with expands[]=taxes.
          items:
            $ref: '#/components/schemas/TaxObject'
        product:
          $ref: '#/components/schemas/ProductObject'
          description: Present only with expands[]=product.
        product_filter:
          anyOf:
            - $ref: '#/components/schemas/ProductFilterObject'
            - type: 'null'
          description: Present only with expands[]=product_filter.
    RateCardRateObject:
      type: object
      description: Rate Card Rate.
      required:
        - lago_id
        - code
        - rate_card_code
        - status
        - rate_model
        - rate_properties
        - min_amount_cents
        - billing_interval_count
        - billing_interval_unit
        - applied_pricing_unit_conversion_rate
        - effective_from
        - created_at
        - updated_at
        - deleted_at
      properties:
        lago_id:
          type: string
          description: Unique identifier created by Lago.
          example: 1a901a90-1a90-1a90-1a90-1a901a901a90
          format: uuid
        code:
          type: string
          description: Code.
          example: example
        rate_card_code:
          type:
            - string
            - 'null'
          description: Code of the parent rate card.
          example: compute_usd
        status:
          type: string
          description: Status derived from the effective-dated rate timeline.
          example: pending
          enum:
            - pending
            - active
            - terminated
        rate_model:
          type: string
          description: >-
            Pricing model. Fixed products support standard, graduated and
            volume. Volume cannot be billed in advance; dynamic requires a sum
            metric. Proration and aggregation can impose further restrictions.
          example: standard
          enum:
            - standard
            - graduated
            - package
            - percentage
            - volume
            - graduated_percentage
            - custom
            - dynamic
        rate_properties:
          $ref: '#/components/schemas/RatePropertiesObject'
        min_amount_cents:
          type: integer
          description: Minimum amount, in cents.
          example: 100
        billing_interval_count:
          type: integer
          description: Billing interval count.
          example: 1
        billing_interval_unit:
          type: string
          description: Unit of the billing interval.
          example: day
          enum:
            - day
            - week
            - month
            - year
        applied_pricing_unit_conversion_rate:
          type:
            - string
            - 'null'
          description: Applied pricing unit conversion rate. Sent as a decimal string.
          example: '1.5'
          pattern: ^-?[0-9]+(\.[0-9]+)?$
        effective_from:
          type: string
          description: Effective from.
          example: '2022-04-29T08:59:51.123456Z'
          format: date-time
        created_at:
          type: string
          format: date-time
          description: UTC creation timestamp, with microsecond precision.
          example: '2022-04-29T08:59:51.123456Z'
        updated_at:
          type: string
          description: UTC timestamp of the last update, with microsecond precision.
          example: '2022-04-29T08:59:51.123456Z'
          format: date-time
        deleted_at:
          type:
            - string
            - 'null'
          description: >-
            UTC deletion timestamp, with microsecond precision. Null until
            deletion.
          example: null
          format: date-time
    ContractAppliedRateCardObject:
      type: object
      description: Contract Applied Rate Card.
      required:
        - lago_id
        - external_contract_id
        - rate_card_code
        - product_code
        - product_filter_code
        - units
        - effective_date
        - billing_anchor_date
        - next_billing_at
        - created_at
        - updated_at
        - deleted_at
        - billing_scope
      properties:
        lago_id:
          type: string
          description: Unique identifier created by Lago.
          example: 1a901a90-1a90-1a90-1a90-1a901a901a90
          format: uuid
        external_contract_id:
          type: string
          description: External identifier of the contract.
          example: contract_123
        rate_card_code:
          type: string
          description: Code of the applied rate card.
          example: compute_usd
        product_code:
          type: string
          description: Code of the product priced by the applied rate card.
          example: api_requests
        product_filter_code:
          type:
            - string
            - 'null'
          description: >-
            Code of the product filter priced by the applied rate card, or null
            for the product default.
          example: eu
        units:
          type:
            - string
            - 'null'
          description: Quantity. Sent as a decimal string.
          example: '1.5'
          pattern: ^-?[0-9]+(\.[0-9]+)?$
        effective_date:
          type: string
          description: Effective date.
          example: '2022-04-29'
          format: date
        billing_anchor_date:
          type: string
          description: Billing anchor date.
          example: '2022-04-29'
          format: date
        next_billing_at:
          type:
            - string
            - 'null'
          description: Next billing at.
          example: null
          format: date-time
        created_at:
          type: string
          format: date-time
          description: UTC creation timestamp, with microsecond precision.
          example: '2022-04-29T08:59:51.123456Z'
        updated_at:
          type: string
          description: UTC timestamp of the last update, with microsecond precision.
          example: '2022-04-29T08:59:51.123456Z'
          format: date-time
        deleted_at:
          type:
            - string
            - 'null'
          description: >-
            UTC deletion timestamp, with microsecond precision. Null until
            deletion.
          example: null
          format: date-time
        billing_scope:
          type: string
          description: >-
            Groups priced segments within a billing cycle or bills each segment
            separately. Defaults to cycle.
          example: cycle
          enum:
            - cycle
            - segment
    CatalogPlanObject:
      type: object
      description: Catalog Plan.
      required:
        - lago_id
        - name
        - code
        - description
        - invoice_display_name
        - currency
        - created_at
        - deleted_at
      properties:
        lago_id:
          type: string
          description: Unique identifier created by Lago.
          example: 1a901a90-1a90-1a90-1a90-1a901a901a90
          format: uuid
        name:
          type: string
          description: Name.
          example: example
        code:
          type: string
          description: Code.
          example: example
        description:
          type:
            - string
            - 'null'
          description: Description.
          example: example
        invoice_display_name:
          type:
            - string
            - 'null'
          description: Invoice display name.
          example: example
        currency:
          type: string
          description: Currency as an ISO 4217 code.
          example: USD
        created_at:
          type: string
          format: date-time
          description: UTC creation timestamp, with microsecond precision.
          example: '2022-04-29T08:59:51.123456Z'
        deleted_at:
          type:
            - string
            - 'null'
          description: >-
            UTC deletion timestamp, with microsecond precision. Null until
            deletion.
          example: null
          format: date-time
        taxes:
          type: array
          description: Present only with expands[]=taxes on retrieval.
          items:
            $ref: '#/components/schemas/TaxObject'
    InvoiceCustomSectionObject:
      type: object
      description: Invoice Custom Section.
      required:
        - lago_id
        - code
        - name
        - description
        - details
        - display_name
        - created_at
        - updated_at
        - deleted_at
      properties:
        lago_id:
          type: string
          description: Unique identifier created by Lago.
          example: 1a901a90-1a90-1a90-1a90-1a901a901a90
          format: uuid
        code:
          type: string
          description: Code.
          example: example
        name:
          type: string
          description: Name.
          example: example
        description:
          type:
            - string
            - 'null'
          description: Description.
          example: example
        details:
          type:
            - string
            - 'null'
          description: Details.
          example: example
        display_name:
          type:
            - string
            - 'null'
          description: Display name.
          example: example
        created_at:
          type: string
          format: date-time
          description: UTC creation timestamp, with microsecond precision.
          example: '2022-04-29T08:59:51.123456Z'
        updated_at:
          type: string
          description: UTC timestamp of the last update, with microsecond precision.
          example: '2022-04-29T08:59:51.123456Z'
          format: date-time
        deleted_at:
          type:
            - string
            - 'null'
          description: >-
            UTC deletion timestamp, with microsecond precision. Null until
            deletion.
          example: null
          format: date-time
    ProductCategoryObject:
      type: object
      description: Product Category.
      required:
        - lago_id
        - name
        - code
        - description
        - invoice_display_name
        - created_at
        - updated_at
        - deleted_at
      properties:
        lago_id:
          type: string
          description: Unique identifier created by Lago.
          example: 1a901a90-1a90-1a90-1a90-1a901a901a90
          format: uuid
        name:
          type: string
          description: Name.
          example: example
        code:
          type: string
          description: Code.
          example: example
        description:
          type:
            - string
            - 'null'
          description: Description.
          example: example
        invoice_display_name:
          type:
            - string
            - 'null'
          description: Invoice display name.
          example: example
        created_at:
          type: string
          format: date-time
          description: UTC creation timestamp, with microsecond precision.
          example: '2022-04-29T08:59:51.123456Z'
        updated_at:
          type: string
          description: UTC timestamp of the last update, with microsecond precision.
          example: '2022-04-29T08:59:51.123456Z'
          format: date-time
        deleted_at:
          type:
            - string
            - 'null'
          description: >-
            UTC deletion timestamp, with microsecond precision. Null until
            deletion.
          example: null
          format: date-time
    BillableMetricObject:
      type: object
      description: Billable Metric.
      required:
        - lago_id
        - name
        - code
        - description
        - aggregation_type
        - weighted_interval
        - recurring
        - rounding_function
        - rounding_precision
        - field_name
        - expression
        - created_at
        - updated_at
        - deleted_at
      properties:
        lago_id:
          type: string
          description: Unique identifier created by Lago.
          example: 1a901a90-1a90-1a90-1a90-1a901a901a90
          format: uuid
        name:
          type: string
          description: Name.
          example: example
        code:
          type: string
          description: Code.
          example: example
        description:
          type:
            - string
            - 'null'
          description: Description.
          example: example
        aggregation_type:
          type: string
          description: How event values are aggregated.
          example: count_agg
          enum:
            - count_agg
            - sum_agg
            - max_agg
            - unique_count_agg
            - weighted_sum_agg
            - latest_agg
        weighted_interval:
          type:
            - string
            - 'null'
          description: Weighting interval for weighted_sum_agg.
          example: seconds
          enum:
            - seconds
            - null
        recurring:
          type: boolean
          description: Recurring.
          example: false
        rounding_function:
          type:
            - string
            - 'null'
          description: Rounding applied to the aggregated quantity.
          example: round
          enum:
            - round
            - ceil
            - floor
            - null
        rounding_precision:
          type:
            - integer
            - 'null'
          description: Rounding precision.
          example: 1
        field_name:
          type:
            - string
            - 'null'
          description: Field name.
          example: example
        expression:
          type:
            - string
            - 'null'
          description: Expression.
          example: example
        created_at:
          type: string
          format: date-time
          description: UTC creation timestamp, with microsecond precision.
          example: '2022-04-29T08:59:51.123456Z'
        updated_at:
          type: string
          description: UTC timestamp of the last update, with microsecond precision.
          example: '2022-04-29T08:59:51.123456Z'
          format: date-time
        deleted_at:
          type:
            - string
            - 'null'
          description: >-
            UTC deletion timestamp, with microsecond precision. Null until
            deletion.
          example: null
          format: date-time
    ProductFilterValueObject:
      type: object
      description: >-
        A value matched against a filter key defined by the product billable
        metric.
      required:
        - key
        - value
      properties:
        key:
          type: string
          description: Billable metric filter key.
          example: region
        value:
          type:
            - string
            - 'null'
          description: >-
            Value to match. Null or an omitted value selects all configured
            values for this key.
          example: eu
    TaxObject:
      type: object
      required:
        - lago_id
        - name
        - code
        - rate
        - description
        - created_at
        - updated_at
        - deleted_at
      properties:
        lago_id:
          type: string
          format: uuid
          description: Unique identifier of the tax, created by Lago.
          example: 1a901a90-1a90-1a90-1a90-1a901a901a90
        name:
          type: string
          description: Name of the tax.
          example: VAT
        code:
          type: string
          description: Unique code of the tax within the organization.
          example: standard_vat
        rate:
          type: number
          description: Percentage rate of the tax, returned as a JSON number.
          example: 20
        description:
          type:
            - string
            - 'null'
          description: Internal description of the tax.
          example: Standard VAT
        created_at:
          type: string
          format: date-time
          description: UTC creation timestamp, with microsecond precision.
          example: '2022-04-29T08:59:51.123456Z'
        updated_at:
          type: string
          format: date-time
          description: UTC timestamp of the last update, with microsecond precision.
          example: '2022-04-29T09:30:00.123456Z'
        deleted_at:
          type:
            - string
            - 'null'
          format: date-time
          description: >-
            UTC deletion timestamp, with microsecond precision. It is null until
            the tax is deleted.
          example: null
      example:
        lago_id: 1a901a90-1a90-1a90-1a90-1a901a901a90
        name: VAT
        code: standard_vat
        rate: 20
        description: Standard VAT
        created_at: '2022-04-29T08:59:51.123456Z'
        updated_at: '2022-04-29T09:30:00.123456Z'
        deleted_at: null
    RatePropertiesObject:
      type: object
      description: >-
        Pricing configuration for the selected rate model. Standard requires
        amount; package also requires package_size. Graduated, volume and
        graduated_percentage models use their matching ranges array. Custom
        properties remain model-specific.
      not:
        required:
          - pricing_group_keys
        properties:
          pricing_group_keys: {}
      properties:
        amount:
          type:
            - number
            - string
          description: Amount, as a number or decimal string.
          example: '1.5'
          pattern: ^-?[0-9]+(\.[0-9]+)?$
        free_units:
          type: integer
          description: Free units per billing period.
          example: 0
        package_size:
          type: integer
          description: Units in one package.
          example: 100
        rate:
          type:
            - number
            - string
          description: Amount, as a number or decimal string.
          example: '1.5'
          pattern: ^-?[0-9]+(\.[0-9]+)?$
        fixed_amount:
          type:
            - number
            - string
          description: Amount, as a number or decimal string.
          example: '1.5'
          pattern: ^-?[0-9]+(\.[0-9]+)?$
        free_units_per_events:
          type:
            - integer
            - 'null'
          description: Number of free transactions.
          example: 0
        free_units_per_total_aggregation:
          type:
            - number
            - string
            - 'null'
          description: Amount, as a number or decimal string.
          example: '1.5'
          pattern: ^-?[0-9]+(\.[0-9]+)?$
        per_transaction_min_amount:
          type:
            - number
            - string
            - 'null'
          description: Amount, as a number or decimal string.
          example: '1.5'
          pattern: ^-?[0-9]+(\.[0-9]+)?$
        per_transaction_max_amount:
          type:
            - number
            - string
            - 'null'
          description: Amount, as a number or decimal string.
          example: '1.5'
          pattern: ^-?[0-9]+(\.[0-9]+)?$
        graduated_ranges:
          type: array
          description: Ordered pricing tiers. The final tier is open-ended.
          items:
            $ref: '#/components/schemas/RateTierObject'
        volume_ranges:
          type: array
          description: Ordered pricing tiers. The final tier is open-ended.
          items:
            $ref: '#/components/schemas/RateTierObject'
        graduated_percentage_ranges:
          type: array
          description: Ordered pricing tiers. The final tier is open-ended.
          items:
            $ref: '#/components/schemas/RateTierObject'
      additionalProperties: true
    RateTierObject:
      type: object
      description: >-
        Pricing tier. Its lower bound is the preceding upper bound; from_value
        is not returned.
      required:
        - to_value
      properties:
        to_value:
          type:
            - string
            - 'null'
          description: >-
            Upper bound of this tier, sent as a decimal string. Null marks the
            final, open-ended tier.
          example: null
        flat_amount:
          type:
            - number
            - string
          description: Amount, as a number or decimal string.
          example: '1.5'
          pattern: ^-?[0-9]+(\.[0-9]+)?$
        per_unit_amount:
          type:
            - number
            - string
          description: Amount, as a number or decimal string.
          example: '1.5'
          pattern: ^-?[0-9]+(\.[0-9]+)?$
        rate:
          type:
            - number
            - string
          description: Amount, as a number or decimal string.
          example: '1.5'
          pattern: ^-?[0-9]+(\.[0-9]+)?$
  responses:
    BadRequest:
      description: Invalid request body, pagination or relationship expansion
      headers:
        X-Lago-Endpoint-Status:
          $ref: '#/components/headers/EndpointStatus'
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ApiError'
          example:
            code: invalid_expand
            details:
              - code: malformed
                field: expands
                meta:
                  allowed_values: []
    Unauthorized:
      description: Missing or invalid API key
      headers:
        X-Lago-Endpoint-Status:
          $ref: '#/components/headers/EndpointStatus'
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ApiError'
          example:
            code: unauthorized
            details: []
    Forbidden:
      description: Feature unavailable or insufficient API permissions
      headers:
        X-Lago-Endpoint-Status:
          $ref: '#/components/headers/EndpointStatus'
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ApiError'
          example:
            code: feature_unavailable
            details: []
    NotFound:
      description: Unknown resource or resource from another organization
      headers:
        X-Lago-Endpoint-Status:
          $ref: '#/components/headers/EndpointStatus'
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ApiError'
          example:
            code: resource_not_found
            details:
              - code: resource_not_found
                field: base
                meta:
                  resource: resource_name
    UnprocessableEntity:
      description: Invalid fields or filters
      headers:
        X-Lago-Endpoint-Status:
          $ref: '#/components/headers/EndpointStatus'
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ApiError'
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer

````

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