> ## Documentation Index
> Fetch the complete documentation index at: https://lago-ftr-wallet-improvements.mintlify.site/llms.txt
> Use this file to discover all available pages before exploring further.

# The invoice object

> Lago automatically generates invoices for each of your customers at the end of a billing period. They list and summarize the fees generated by Lago for your customers. Subscription, usage-based and recurring fees are listed as invoice items.

<RequestExample>
  ```json The fee object
  {
    "invoice": {
      "lago_id": "1a901a90-1a90-1a90-1a90-1a901a901a90",
      "sequential_id": 2,
      "number": "LAG-1234-001-002",
      "issuing_date": "2022-04-30",
      "payment_dispute_lost_at": "2022-09-14T16:35:31Z",
      "payment_due_date": "2022-04-30",
      "net_payment_term": 30,
      "invoice_type": "subscription",
      "status": "finalized",
      "payment_status": "succeeded",
      "currency": "EUR",
      "fees_amount_cents": 100,
      "coupons_amount_cents": 10,
      "credit_notes_amount_cents": 10,
      "sub_total_excluding_taxes_amount_cents": 100,
      "taxes_amount_cents": 20,
      "sub_total_including_taxes_amount_cents": 120,
      "prepaid_credit_amount_cents": 0,
      "total_amount_cents": 100,
      "version_number": 3,
      "file_url": "https://getlago.com/invoice/file",
      "customer": {
        "lago_id": "1a901a90-1a90-1a90-1a90-1a901a901a90",
        "sequential_id": 1,
        "slug": "LAG-1234-001",
        "external_id": "5eb02857-a71e-4ea2-bcf9-57d3a41bc6ba",
        "address_line1": "5230 Penfield Ave",
        "address_line2": null,
        "applicable_timezone": "America/Los_Angeles",
        "city": "Woodland Hills",
        "country": "US",
        "currency": "USD",
        "email": "dinesh@piedpiper.test",
        "legal_name": "Coleman-Blair",
        "legal_number": "49-008-2965",
        "logo_url": "http://hooli.com/logo.png",
        "name": "Gavin Belson",
        "phone": "1-171-883-3711 x245",
        "state": "CA",
        "tax_identification_number": "EU123456789",
        "timezone": "America/Los_Angeles",
        "url": "http://hooli.com",
        "zipcode": "91364",
        "net_payment_term": 30,
        "created_at": "2022-04-29T08:59:51Z",
        "updated_at": "2022-04-29T08:59:51Z",
        "billing_configuration": {
          "invoice_grace_period": 3,
          "payment_provider": "stripe",
          "payment_provider_code": "stripe-eu-1",
          "provider_customer_id": "cus_12345",
          "sync": true,
          "sync_with_provider": true,
          "document_locale": "fr",
          "provider_payment_methods": [
            "card",
            "sepa_debit"
          ]
        },
        "metadata": [
          {
            "lago_id": "1a901a90-1a90-1a90-1a90-1a901a901a90",
            "key": "Purchase Order",
            "value": "123456789",
            "display_in_invoice": true,
            "created_at": "2022-04-29T08:59:51Z"
          }
        ]
      },
      "metadata": [
        {
          "lago_id": "1a901a90-1a90-1a90-1a90-1a901a901a90",
          "key": "digital_ref_id",
          "value": "INV-0123456-98765",
          "created_at": "2022-04-29T08:59:51Z"
        }
      ],
      "applied_taxes": [
        {
          "lago_id": "1a901a90-1a90-1a90-1a90-1a901a901a90",
          "lago_tax_id": "1a901a90-1a90-1a90-1a90-1a901a901a90",
          "tax_name": "TVA",
          "tax_code": "french_standard_vat",
          "tax_rate": 20,
          "tax_description": "French standard VAT",
          "amount_cents": 2000,
          "amount_currency": "USD",
          "created_at": "2022-09-14T16:35:31Z",
          "lago_invoice_id": "1a901a90-1a90-1a90-1a90-1a901a901a90",
          "fees_amount_cents": 20000
        }
      ],
      "credits": [
        {
          "lago_id": "1a901a90-1a90-1a90-1a90-1a901a901a90",
          "amount_cents": 1200,
          "amount_currency": "EUR",
          "before_taxes": false,
          "item": {
            "lago_item_id": "1a901a90-1a90-1a90-1a90-1a901a901a90",
            "type": "coupon",
            "code": "startup_deal",
            "name": "Startup Deal"
          },
          "invoice": {
            "lago_id": "1a901a90-1a90-1a90-1a90-1a901a901a90",
            "payment_status": "succeeded"
          }
        }
      ],
      "fees": [
        {
          "lago_id": "1a901a90-1a90-1a90-1a90-1a901a901a90",
          "lago_charge_filter_id": "1a901a90-1a90-1a90-1a90-1a901a901a90",
          "lago_invoice_id": "1a901a90-1a90-1a90-1a90-1a901a901a90",
          "lago_true_up_fee_id": "1a901a90-1a90-1a90-1a90-1a901a901a90",
          "lago_true_up_parent_fee_id": "1a901a90-1a90-1a90-1a90-1a901a901a90",
          "lago_subscription_id": "1a901a90-1a90-1a90-1a90-1a901a901a90",
          "lago_customer_id": "1a901a90-1a90-1a90-1a90-1a901a901a90",
          "external_customer_id": "external_id",
          "external_subscription_id": "external_id",
          "invoice_display_name": "Setup Fee (SF1)",
          "amount_cents": 100,
          "amount_currency": "EUR",
          "taxes_amount_cents": 20,
          "taxes_rate": 20,
          "units": "0.32",
          "precise_unit_amount": "312.5",
          "total_amount_cents": 120,
          "total_amount_currency": "EUR",
          "events_count": 23,
          "pay_in_advance": true,
          "invoiceable": true,
          "from_date": "2022-04-29T08:59:51Z",
          "to_date": "2022-05-29T08:59:51Z",
          "payment_status": "pending",
          "created_at": "2022-08-24T14:58:59Z",
          "succeeded_at": "2022-08-24T14:58:59Z",
          "failed_at": "2022-08-24T14:58:59Z",
          "refunded_at": "2022-08-24T14:58:59Z",
          "event_transaction_id": "transaction_1234567890",
          "amount_details": {
            "graduated_ranges": [
              {
                "units": "10.0",
                "from_value": 0,
                "to_value": 10,
                "flat_unit_amount": "1.0",
                "per_unit_amount": "1.0",
                "per_unit_total_amount": "10.0",
                "total_with_flat_amount": "11.0"
              }
            ],
            "graduated_percentage_ranges": [
              {
                "units": "10.0",
                "from_value": 0,
                "to_value": 10,
                "flat_unit_amount": "1.0",
                "rate": "1.0",
                "per_unit_total_amount": "10.0",
                "total_with_flat_amount": "11.0"
              }
            ],
            "free_units": "10.0",
            "paid_units": "40.0",
            "per_package_size": 1000,
            "per_package_unit_amount": "0.5",
            "units": "20.0",
            "free_events": 10,
            "rate": "1.0",
            "per_unit_total_amount": "10.0",
            "paid_events": 20,
            "fixed_fee_unit_amount": "1.0",
            "fixed_fee_total_amount": "20.0",
            "min_max_adjustment_total_amount": "20.0",
            "volume_ranges": [
              {
                "per_unit_amount": "0.5",
                "flat_unit_amount": "10.0",
                "per_unit_total_amount": "10.0"
              }
            ]
          },
          "item": {
            "type": "subscription",
            "code": "startup",
            "name": "Startup",
            "invoice_display_name": "Setup Fee (SF1)",
            "filter_invoice_display_name": "AWS eu-east-1",
            "filters": {
              "additionalProp1": [
                "string"
              ],
              "additionalProp2": [
                "string"
              ],
              "additionalProp3": [
                "string"
              ]
            },
            "lago_item_id": "1a901a90-1a90-1a90-1a90-1a901a901a90",
            "item_type": "Subscription",
            "grouped_by": {
              "additionalProp1": "string",
              "additionalProp2": "string",
              "additionalProp3": "string"
            }
          },
          "applied_taxes": [
            {
              "lago_id": "1a901a90-1a90-1a90-1a90-1a901a901a90",
              "lago_tax_id": "1a901a90-1a90-1a90-1a90-1a901a901a90",
              "tax_name": "TVA",
              "tax_code": "french_standard_vat",
              "tax_rate": 20,
              "tax_description": "French standard VAT",
              "amount_cents": 2000,
              "amount_currency": "USD",
              "created_at": "2022-09-14T16:35:31Z",
              "lago_fee_id": "1a901a90-1a90-1a90-1a90-1a901a901a90"
            }
          ]
        }
      ],
      "subscriptions": [
        {
          "lago_id": "1a901a90-1a90-1a90-1a90-1a901a901a90",
          "external_id": "5eb02857-a71e-4ea2-bcf9-57d3a41bc6ba",
          "lago_customer_id": "1a901a90-1a90-1a90-1a90-1a901a901a90",
          "external_customer_id": "5eb02857-a71e-4ea2-bcf9-57d3a41bc6ba",
          "billing_time": "anniversary",
          "name": "Repository A",
          "plan_code": "premium",
          "status": "active",
          "created_at": "2022-08-08T00:00:00Z",
          "canceled_at": "2022-09-14T16:35:31Z",
          "started_at": "2022-08-08T00:00:00Z",
          "ending_at": "2022-10-08T00:00:00Z",
          "subscription_at": "2022-08-08T00:00:00Z",
          "terminated_at": "2022-09-14T16:35:31Z",
          "previous_plan_code": null,
          "next_plan_code": null,
          "downgrade_plan_date": "2022-04-30",
          "trial_ended_at": "2022-08-08T00:00:00Z"
        }
      ]
    }
  }
  ```
</RequestExample>

## Attributes

<ResponseField name="invoice" type="object">
  <Expandable title="object" defaultOpen="true">
    <ResponseField name="lago_id" type="string" required>
      Unique identifier assigned to the invoice within the Lago application.
      This ID is exclusively created by Lago and serves as a unique identifier
      for the invoice's record within the Lago system.
    </ResponseField>

    <ResponseField name="sequential_id" type="integer">
      This ID helps in uniquely identifying and organizing the invoices
      associated with a specific customer. It provides a sequential numbering
      system specific to the customer, allowing for easy tracking and management
      of invoices within the customer's context.
    </ResponseField>

    <ResponseField name="number" type="string" required>
      The unique number assigned to the invoice. This number serves as a
      distinct identifier for the invoice and helps in differentiating it from
      other invoices in the system.
    </ResponseField>

    <ResponseField name="issuing_date" type="string" required>
      The date when the invoice was issued. It is provided in the ISO 8601 date
      format.
    </ResponseField>

    <ResponseField name="payment_due_date" type="string" required>
      The payment due date for the invoice, specified in the ISO 8601 date
      format.
    </ResponseField>

    <ResponseField name="net_payment_term" type="integer" required>
      The net payment term, expressed in days, specifies the duration within
      which a customer is expected to remit payment after the invoice is
      finalized.
    </ResponseField>

    <ResponseField name="invoice_type" type="string" required>
      The type of invoice issued. Possible values are `subscription`, `one-off`
      or `credit`.
    </ResponseField>

    <ResponseField name="status" type="string" required>
      The status of the invoice. It indicates the current state of the invoice
      and can have two possible values: - `draft`: the invoice is in the draft
      state, waiting for the end of the grace period to be finalized. During
      this period, events can still be ingested and added to the invoice. -
      `finalized`: the invoice has been issued and finalized. In this state,
      events cannot be ingested or added to the invoice anymore. - `voided`: the
      invoice is considered as having zero value for reporting and is not
      payable. Importantly, this status is final, meaning the invoice’s status
      remains unalterable.
    </ResponseField>

    <ResponseField name="payment_status" type="string" required>
      The status of the payment associated with the invoice. It can have one of
      the following values: - `pending`: the payment is pending, waiting for
      payment processing in Stripe or when the invoice is emitted but users have
      not updated the payment status through the endpoint. - `succeeded`: the
      payment of the invoice has been successfully processed. - `failed`: the
      payment of the invoice has failed or encountered an error during
      processing.
    </ResponseField>

    <ResponseField name="currency" type="string" required>
      The currency of the invoice issued.
    </ResponseField>

    <ResponseField name="fees_amount_cents" type="integer" required>
      The total sum of fees amount in cents. It calculates the cumulative amount
      of all the fees associated with the invoice, providing a consolidated
      value.
    </ResponseField>

    <ResponseField name="taxes_amount_cents" type="integer" required>
      The sum of tax amount associated with the invoice, expressed in cents.
    </ResponseField>

    <ResponseField name="coupons_amount_cents" type="integer" required>
      The total sum of all coupons discounted on the invoice. It calculates the
      cumulative discount amount applied by coupons, expressed in cents.
    </ResponseField>

    <ResponseField name="credit_notes_amount_cents" type="integer" required>
      The total sum of all credit notes discounted on the invoice. It calculates
      the cumulative discount amount applied by credit notes, expressed in
      cents.
    </ResponseField>

    <ResponseField name="prepaid_credit_amount_cents" type="integer" required>
      The total sum of all prepaid credits discounted on the invoice. It
      calculates the cumulative discount amount applied by prepaid credits,
      expressed in cents.
    </ResponseField>

    <ResponseField name="sub_total_taxes_excluding_amount_cents" type="integer" required>
      Subtotal amount, excluding taxes, expressed in cents. This field depends
      on the version number. Here are the definitions based on the version: -
      Version 1: is equal to the sum of `fees_amount_cents`, minus
      `coupons_amount_cents`, and minus `prepaid_credit_amount_cents`. - Version
      2: is equal to the `fees_amount_cents`. - Version 3: is equal to the
      `fees_amount_cents`, minus `coupons_amount_cents`.
    </ResponseField>

    <ResponseField name="sub_total_taxes_including_amount_cents" type="integer" required>
      Subtotal amount, including taxes, expressed in cents. This field depends
      on the version number. Here are the definitions based on the version: -
      Version 1: is equal to the `total_amount_cents`. - Version 2: is equal to
      the sum of `fees_amount_cents` and `vat_amount_cents`. - Version 3: is
      equal to the sum `sub_total_excluding_taxes_amount_cents` and
      `taxes_amount_cents`
    </ResponseField>

    <ResponseField name="total_amount_cents" type="integer" required>
      The sum of the amount and taxes amount on the invoice, expressed in cents.
      It calculates the total financial value of the invoice, including both the
      original amount and any applicable taxes.
    </ResponseField>

    <ResponseField name="file_url" type="string">
      Contains the URL that provides direct access to the invoice PDF file. You
      can use this URL to download or view the PDF document of the invoice
    </ResponseField>

    <ResponseField name="payment_dispute_lost_at" type="string">
      The date when the payment dispute was lost. It is expressed in Coordinated
      Universal Time (UTC).
    </ResponseField>

    <ResponseField name="customers" type="object" required>
      <Expandable title="customers">
        <ResponseField name="lago_id" type="string" required>
          Unique identifier assigned to the customer within the Lago
          application. This ID is exclusively created by Lago and serves as a
          unique identifier for the customer's record within the Lago system.
        </ResponseField>

        <ResponseField name="external_id" type="string" required>
          The customer external unique identifier (provided by your own
          application).
        </ResponseField>

        <ResponseField name="address_line1" type="string">
          The first line of the billing address.
        </ResponseField>

        <ResponseField name="address_line2" type="string">
          The second line of the billing address.
        </ResponseField>

        <ResponseField name="city" type="string">
          The city of the customer's billing address.
        </ResponseField>

        <ResponseField name="country" type="string">
          Country code of the customer's billing address. Format must be ISO
          3166 (alpha-2).
        </ResponseField>

        <ResponseField name="currency" type="string">
          Currency of the customer. Format must ISO 4217.
        </ResponseField>

        <ResponseField name="email" type="string">
          The email of the customer.
        </ResponseField>

        <ResponseField name="legal_name" type="string">
          The legal company name of the customer.
        </ResponseField>

        <ResponseField name="legal_number" type="string">
          The legal company number of the customer.
        </ResponseField>

        <ResponseField name="tax_identification_number" type="string">
          The tax identification number of the customer
        </ResponseField>

        <ResponseField name="logo_url" type="string">
          The logo URL of the customer.
        </ResponseField>

        <ResponseField name="name" type="string">
          The full name of the customer.
        </ResponseField>

        <ResponseField name="phone" type="string">
          The phone number of the customer.
        </ResponseField>

        <ResponseField name="state" type="string">
          The state of the customer's billing address.
        </ResponseField>

        <ResponseField name="timezone" type="string">
          The customer's timezone, used for billing purposes in their local
          time. Overrides the organization's timezone.
        </ResponseField>

        <ResponseField name="url" type="string">
          The custom website URL of the customer.
        </ResponseField>

        <ResponseField name="zipcode" type="string">
          The zipcode of the customer's billing address.
        </ResponseField>
      </Expandable>
    </ResponseField>

    <ResponseField name="subscriptions" type="object" required>
      <Expandable title="subscriptions">
        <ResponseField name="lago_id" type="string" required>
          Unique identifier assigned to the subscription within the Lago
          application. This ID is exclusively created by Lago and serves as a
          unique identifier for the subscription’s record within the Lago system
        </ResponseField>

        <ResponseField name="external_id" type="string" required>
          The unique external identifier for the subscription in your
          application. This identifier serves as an idempotency key, ensuring
          that each subscription is unique.
        </ResponseField>

        <ResponseField name="lago_customer_id" type="string" required>
          Unique identifier assigned to the customer within the Lago
          application. This ID is exclusively created by Lago and serves as a
          unique identifier for the customer's record within the Lago system
        </ResponseField>

        <ResponseField name="external_customer_id" type="string" required>
          The customer external unique identifier (provided by your own
          application).
        </ResponseField>

        <ResponseField name="canceled_at" type="string">
          The cancellation date of the subscription. This field is not null when
          the subscription is `canceled`. This date should be provided in ISO
          8601 datetime format and expressed in Coordinated Universal Time
          (UTC).
        </ResponseField>

        <ResponseField name="created_at" type="string" required>
          The creation date of the subscription, represented in ISO 8601
          datetime format and expressed in Coordinated Universal Time (UTC).
          This date provides a timestamp indicating when the subscription was
          initially created.
        </ResponseField>

        <ResponseField name="plan_code" type="string" required>
          The unique code representing the plan to be attached to the customer.
          This code must correspond to the `code` property of one of the active
          plans.
        </ResponseField>

        <ResponseField name="started_at" type="string" required>
          The effective start date of the subscription. This field can be null
          if the subscription is `pending` or `canceled`. This date should be
          provided in ISO 8601 datetime format and expressed in Coordinated
          Universal Time (UTC).
        </ResponseField>

        <ResponseField name="name" type="string" required>
          The display name of the subscription on an invoice. This field allows
          for customization of the subscription's name for billing purposes,
          especially useful when a single customer has multiple subscriptions
          using the same plan.
        </ResponseField>

        <ResponseField name="status" type="string" required>
          The status of the subscription, which can have the following values: -
          `pending`: a previous subscription has been downgraded, and the
          current one is awaiting automatic activation at the end of the billing
          period. - `active`: the subscription is currently active and applied
          to the customer. - `terminated`: the subscription is no longer active.

          * `canceled`: the subscription has been stopped before its activation.
            This can occur when two consecutive downgrades have been applied to a
            customer or when a subscription with a pending status is terminated.
        </ResponseField>

        <ResponseField name="terminated_at" type="string" required>
          The termination date of the subscription. This field is not null when
          the subscription is `terminated`. This date should be provided in ISO
          8601 datetime format and expressed in Coordinated Universal Time (UTC)
        </ResponseField>
      </Expandable>
    </ResponseField>

    <ResponseField name="fee" type="object">
      <Expandable title="object" defaultOpen="true">
        <ResponseField name="lago_id" type="string" required>
          Unique identifier assigned to the fee within the Lago application.
          This ID is exclusively created by Lago and serves as a unique
          identifier for the fee’s record within the Lago system.
        </ResponseField>

        <ResponseField name="lago_group_id" type="string">
          Unique identifier assigned to the group that the fee belongs to
        </ResponseField>

        <ResponseField name="lago_invoice_id" type="string">
          Unique identifier assigned to the invoice that the fee belongs to
        </ResponseField>

        <ResponseField name="lago_true_up_fee_id" type="string">
          Unique identifier assigned to the true-up fee when a minimum has been
          set to the charge. This identifier helps to distinguish and manage the
          true-up fee associated with the charge, which may be applicable when a
          minimum threshold or limit is set for the charge amount.
        </ResponseField>

        <ResponseField name="lago_true_up_parent_fee_id" type="string">
          Unique identifier assigned to the parent fee on which the true-up fee
          is assigned. This identifier establishes the relationship between the
          parent fee and the associated true-up fee.
        </ResponseField>

        <ResponseField name="lago_subscription_id" type="string">
          Unique identifier assigned to the subscription, created by Lago. This
          field is specifically displayed when the fee type is charge or
          subscription.
        </ResponseField>

        <ResponseField name="lago_customer_id" type="string">
          Unique identifier assigned to the customer in your application. This
          field is specifically displayed when the fee type is charge or
          subscription.
        </ResponseField>

        ro

        <ResponseField name="external_customer_id" type="string">
          Unique identifier assigned to the customer in your application. This
          field is specifically displayed when the fee type is charge or
          subscription.
        </ResponseField>

        <ResponseField name="external_subscription_id" type="string">
          Unique identifier assigned to the subscription in your application.
          This field is specifically displayed when the fee type is charge or
          subscription.
        </ResponseField>

        <ResponseField name="invoice_display_name" type="string">
          Specifies the name that will be displayed on an invoice. If no value
          is set for this field, the name of the actual charge will be used as
          the default display name.
        </ResponseField>

        <ResponseField name="amount_cents" type="integer" required>
          The cost of this specific fee, excluding any applicable taxes.
        </ResponseField>

        <ResponseField name="amount_currency" type="string" required>
          The currency of this specific fee. It indicates the monetary unit in
          which the fee's cost is expressed.

          <Expandable title="Enum">
            \[`AED`, `AFN`, `ALL`, `AMD`, `ANG`, `AOA`, `ARS`, `AUD`, `AWG`,
            `AZN`, `BAM`, `BBD`, `BDT`, `BGN`, `BIF`, `BMD`, `BND`, `BOB`,
            `BRL`, `BSD`, `BWP`, `BYN`, `BZD`, `CAD`, `CDF`, `CHF`, `CLF`,
            `CLP`, `CNY`, `COP`, `CRC`, `CVE`, `CZK`, `DJF`, `DKK`, `DOP`,
            `DZD`, `EGP`, `ETB`, `EUR`, `FJD`, `FKP`, `GBP`, `GEL`, `GIP`,
            `GMD`, `GNF`, `GTQ`, `GYD`, `HKD`, `HNL`, `HRK`, `HTG`, `HUF`,
            `IDR`, `ILS`, `INR`, `ISK`, `JMD`, `JPY`, `KES`, `KGS`, `KHR`,
            `KMF`, `KRW`, `KYD`, `KZT`, `LAK`, `LBP`, `LKR`, `LRD`, `LSL`,
            `MAD`, `MDL`, `MGA`, `MKD`, `MMK`, `MNT`, `MOP`, `MRO`, `MUR`,
            `MVR`, `MWK`, `MXN`, `MYR`, `MZN`, `NAD`, `NGN`, `NIO`, `NOK`,
            `NPR`, `NZD`, `PAB`, `PEN`, `PGK`, `PHP`, `PKR`, `PLN`, `PYG`,
            `QAR`, `RON`, `RSD`, `RUB`, `RWF`, `SAR`, `SBD`, `SCR`, `SEK`,
            `SGD`, `SHP`, `SLL`, `SOS`, `SRD`, `STD`, `SZL`, `THB`, `TJS`,
            `TOP`, `TRY`, `TTD`, `TWD`, `TZS`, `UAH`, `UGX`, `USD`, `UYU`,
            `UZS`, `VND`, `VUV`, `WST`, `XAF`, `XCD`, `XOF`, `XPF`, `YER`,
            `ZAR`, `ZMW`]
          </Expandable>
        </ResponseField>

        <ResponseField name="taxes_amount_cents" type="integer" required>
          The cost of the tax associated with this specific fee.
        </ResponseField>

        <ResponseField name="taxes_rate" type="number" required>
          The tax rate associated with this specific fee.
        </ResponseField>

        <ResponseField name="units" type="string" required>
          The number of units used to charge the customer. This field indicates
          the quantity or count of units consumed or utilized in the context of
          the charge. It helps in determining the basis for calculating the fee
          or cost associated with the usage of the service or product provided
          to the customer.
        </ResponseField>

        <ResponseField name="precise_unit_amount" type="string" required>
          The unit amount of the fee per unit, with precision.
        </ResponseField>

        <ResponseField name="total_amount_cents" type="integer" required>
          The cost of this specific fee, including any applicable taxes.
        </ResponseField>

        <ResponseField name="total_amount_currency" type="string" required>
          The currency of this specific fee, including any applicable taxes.

          <Expandable title="Enum">
            \[`AED`, `AFN`, `ALL`, `AMD`, `ANG`, `AOA`, `ARS`, `AUD`, `AWG`,
            `AZN`, `BAM`, `BBD`, `BDT`, `BGN`, `BIF`, `BMD`, `BND`, `BOB`,
            `BRL`, `BSD`, `BWP`, `BYN`, `BZD`, `CAD`, `CDF`, `CHF`, `CLF`,
            `CLP`, `CNY`, `COP`, `CRC`, `CVE`, `CZK`, `DJF`, `DKK`, `DOP`,
            `DZD`, `EGP`, `ETB`, `EUR`, `FJD`, `FKP`, `GBP`, `GEL`, `GIP`,
            `GMD`, `GNF`, `GTQ`, `GYD`, `HKD`, `HNL`, `HRK`, `HTG`, `HUF`,
            `IDR`, `ILS`, `INR`, `ISK`, `JMD`, `JPY`, `KES`, `KGS`, `KHR`,
            `KMF`, `KRW`, `KYD`, `KZT`, `LAK`, `LBP`, `LKR`, `LRD`, `LSL`,
            `MAD`, `MDL`, `MGA`, `MKD`, `MMK`, `MNT`, `MOP`, `MRO`, `MUR`,
            `MVR`, `MWK`, `MXN`, `MYR`, `MZN`, `NAD`, `NGN`, `NIO`, `NOK`,
            `NPR`, `NZD`, `PAB`, `PEN`, `PGK`, `PHP`, `PKR`, `PLN`, `PYG`,
            `QAR`, `RON`, `RSD`, `RUB`, `RWF`, `SAR`, `SBD`, `SCR`, `SEK`,
            `SGD`, `SHP`, `SLL`, `SOS`, `SRD`, `STD`, `SZL`, `THB`, `TJS`,
            `TOP`, `TRY`, `TTD`, `TWD`, `TZS`, `UAH`, `UGX`, `USD`, `UYU`,
            `UZS`, `VND`, `VUV`, `WST`, `XAF`, `XCD`, `XOF`, `XPF`, `YER`,
            `ZAR`, `ZMW`]
          </Expandable>
        </ResponseField>

        <ResponseField name="events_count" type="integer">
          The number of events that have been sent and used to charge the
          customer. This field indicates the count or quantity of events that
          have been processed and considered in the charging process.
        </ResponseField>

        <ResponseField name="pay_in_advance" type="boolean" required>
          Flag that indicates whether the fee was paid in advance. It serves as
          a boolean value, where `true` represents that the fee was paid in
          advance (straightaway), and `false` indicates that the fee was not
          paid in arrears (at the end of the period).
        </ResponseField>

        <ResponseField name="invoiceable" type="boolean" required>
          Flag that indicates whether the fee was included on the invoice. It
          serves as a boolean value, where `true` represents that the fee was
          included on the invoice, and `false` indicates that the fee was not
          included on the invoice.
        </ResponseField>

        <ResponseField name="from_date" type="string">
          The beginning date of the period that the fee covers. It is applicable
          only to `subscription` and `charge` fees. This field indicates the
          start date of the billing period or subscription period associated
          with the fee.
        </ResponseField>

        <ResponseField name="to_date" type="string">
          The ending date of the period that the fee covers. It is applicable
          only to `subscription` and `charge` fees. This field indicates the end
          date of the billing period or subscription period associated with the
          fee.
        </ResponseField>

        <ResponseField name="payment_status" type="string" required>
          Indicates the payment status of the fee. It represents the current
          status of the payment associated with the fee. The possible values for
          this field are `pending`, `succeeded`, `failed`, and `refunded`.
        </ResponseField>

        <ResponseField name="created_at" type="string">
          The date and time when the fee was created. It is provided in
          Coordinated Universal Time (UTC) format.
        </ResponseField>

        <ResponseField name="succeeded_at" type="string">
          The date and time when the payment for the fee was successfully
          processed. It is provided in Coordinated Universal Time (UTC) format.
        </ResponseField>

        <ResponseField name="failed_at" type="string">
          The date and time when the payment for the fee failed to process. It
          is provided in Coordinated Universal Time (UTC) format.
        </ResponseField>

        <ResponseField name="refunded_at" type="string">
          The date and time when the payment for the fee was refunded. It is
          provided in Coordinated Universal Time (UTC) format
        </ResponseField>

        <ResponseField name="event_transaction_id" type="string">
          Unique identifier assigned to the transaction. This field is
          specifically displayed when the fee type is `charge` and the payment
          for the fee is made in advance (`pay_in_advance` is set to `true`).
        </ResponseField>

        <ResponseField name="amount_details" type="object" required>
          List of all unit amount details for calculating the fee.

          <Expandable>
            ### Case of a fee linked to a graduated charge model

            <ResponseField name="graduated_ranges" type="array">
              Graduated ranges, used for a `graduated` charge model.

              <Expandable>
                <ResponseField name="units" type="string">
                  Total units received in Lago.
                </ResponseField>

                <ResponseField name="from_value" type="integer">
                  Lower value of a tier. It is either 0 or the previous range's
                  `to_value` + 1
                </ResponseField>

                <ResponseField name="to_value" type="integer">
                  Highest value of a tier. - This value is higher than the
                  from\_value of the same tier. - This value is null for the last
                  tier.
                </ResponseField>

                <ResponseField name="flat_unit_amount" type="string">
                  Flat unit amount within a specified tier.
                </ResponseField>

                <ResponseField name="per_unit_amount" type="string">
                  Amount per unit within a specified tier.
                </ResponseField>

                <ResponseField name="per_unit_total_amount" type="string">
                  Total amount of received units to be charged within a
                  specified tier.
                </ResponseField>

                <ResponseField name="total_with_flat_amount" type="string">
                  Total amount to be charged for a specific tier, taking into
                  account the `flat_unit_amount` and the
                  `per_unit_total_amount`.
                </ResponseField>
              </Expandable>
            </ResponseField>

            ### Case of a fee linked to a graduated percentage charge model

            <ResponseField name="graduated_percentage_ranges" type="array">
              Graduated percentage ranges, used for a `graduated_percentage`
              charge model.

              <Expandable>
                <ResponseField name="units" type="string">
                  Total units received in Lago.
                </ResponseField>

                <ResponseField name="from_value" type="integer">
                  Lower value of a tier. It is either 0 or the previous range's
                  `to_value` + 1
                </ResponseField>

                <ResponseField name="to_value" type="integer">
                  Highest value of a tier. - This value is higher than the
                  from\_value of the same tier. - This value is null for the last
                  tier.
                </ResponseField>

                <ResponseField name="flat_unit_amount" type="string">
                  Flat unit amount within a specified tier.
                </ResponseField>

                <ResponseField name="rate" type="string">
                  Percentage rate applied within a specified tier.
                </ResponseField>

                <ResponseField name="per_unit_total_amount" type="string">
                  Total amount of received units to be charged within a
                  specified tier.
                </ResponseField>

                <ResponseField name="total_with_flat_amount" type="string">
                  Total amount to be charged for a specific tier, taking into
                  account the `flat_unit_amount` and the
                  `per_unit_total_amount`.
                </ResponseField>
              </Expandable>
            </ResponseField>

            ### Case of a fee linked to a package charge model

            <ResponseField name="free_units" type="string">
              The quantity of units that are provided free of charge for each
              billing period in a `package` charge model.
            </ResponseField>

            <ResponseField name="paid_units" type="string">
              The quantity of units that are not provided free of charge for
              each billing period in a `package` charge model.
            </ResponseField>

            <ResponseField name="per_package_size" type="integer">
              The quantity of units included, defined for `package` or
              `percentage` charge model.
            </ResponseField>

            <ResponseField name="per_package_unit_amount" type="string">
              Total amount to charge for received `paid_units``, defined for
                                          `package`or`percentage\` charge model.
            </ResponseField>

            ### Case of a fee linked to a percentage charge model

            <ResponseField name="units" type="string">
              The total units received in Lago for the `percentage` charge
              model.
            </ResponseField>

            <ResponseField name="free_events" type="integer">
              Total number of free events allowed for the `percentage` charge
              model.
            </ResponseField>

            <ResponseField name="free_units" type="string">
              The quantity of units that are provided free of charge for each
              billing period in a `package` or `percentage` charge model.
            </ResponseField>

            <ResponseField name="paid_units" type="string">
              The quantity of units that are not provided free of charge for
              each billing period in a `package` or `percentage` charge model.
            </ResponseField>

            <ResponseField name="rate" type="string">
              Percentage rate applied for the Percentage charge model.
            </ResponseField>

            <ResponseField name="per_unit_total_amount" type="string">
              Total amount of received units to be charged for the `percentage`
              charge model.
            </ResponseField>

            <ResponseField name="paid_events" type="integer">
              Total number of paid events for the `percentage` charge model.
            </ResponseField>

            <ResponseField name="fixed_fee_unit_amount" type="string">
              Fixed fee unit price per received paid\_event for the `percentage`
              charge model.
            </ResponseField>

            <ResponseField name="fixed_fee_total_amount" type="string">
              Total amount to charge for received paid\_events for the
              `percentage` charge model.
            </ResponseField>

            <ResponseField name="min_max_adjustment_total_amount" type="string">
              Total adjustment amount linked to minimum and maximum spending per
              transaction for the `percentage` charge model.
            </ResponseField>

            ### Case of a fee linked to a volume charge model

            <ResponseField name="volume_ranges" type="array">
              Volumes ranges, used for a `volume` charge model.

              <Expandable>
                <ResponseField name="flat_unit_amount" type="string">
                  The unit price, excluding tax, for a specific tier of a
                  `volume` charge model.
                </ResponseField>

                <ResponseField name="per_unit_amount" type="string">
                  The flat amount for a whole tier, excluding tax, for a
                  `volume` charge model.
                </ResponseField>

                <ResponseField name="per_unit_total_amount" type="string">
                  Total amount of received units to be charged.
                </ResponseField>
              </Expandable>
            </ResponseField>
          </Expandable>
        </ResponseField>

        <ResponseField name="item" type="object">
          <Expandable title="item">
            <ResponseField name="type" type="string" required>
              The fee type. Possible values are `add-on`, `charge`, `credit` or
              `subscription`.
            </ResponseField>

            <ResponseField name="code" type="string" required>
              The code of the fee item. It can be the code of the `add-on`, the
              code of the `charge`, the code of the `credit` or the code of the
              `subscription`.
            </ResponseField>

            <ResponseField name="name" type="string" required>
              The name of the fee item. It can be the name of the `add-on`, the
              name of the `charge`, the name of the `credit` or the name of the
              `subscription`.
            </ResponseField>

            <ResponseField name="lago_item_id" type="string" required>
              Unique identifier of the fee item, created by Lago. It can be the
              identifier of the add-on, the identifier of the `charge`, the
              identifier of the `credit` or the identifier of the
              `subscription`.
            </ResponseField>

            <ResponseField name="item_type" type="string" required>
              The type of the fee item. Possible values are `AddOn`,
              `BillableMetric`, `WalletTransaction` or `Subscription`.
            </ResponseField>

            <ResponseField name="grouped_by" type="string" required>
              Key value list of event properties aggregated by the charge model.
            </ResponseField>

            <ResponseField name="filters" type="string" required>
              Key value list of event properties.
            </ResponseField>

            <ResponseField name="filters_invoice_display_name" type="string" required>
              Specifies the name that will be displayed on an invoice. If no
              value is set for this field, the actual charge filter values will
              be used as the default display name.
            </ResponseField>
          </Expandable>
        </ResponseField>

        <ResponseField name="applied_taxes" type="object">
          <Expandable title="applied_taxes">
            <ResponseField name="lago_id" type="string" required>
              Unique identifier of the applied tax, created by Lago.
            </ResponseField>

            <ResponseField name="lago_tax_id" type="string" required>
              Unique identifier of the tax, created by Lago.
            </ResponseField>

            <ResponseField name="tax_name" type="string" required>
              Name of the tax.
            </ResponseField>

            <ResponseField name="tax_code" type="string" required>
              Unique code used to identify the tax associated with the API
              request.
            </ResponseField>

            <ResponseField name="tax_rate" type="number" required>
              The rate of the tax.
            </ResponseField>

            <ResponseField name="tax_description" type="string">
              Internal description of the tax.
            </ResponseField>

            <ResponseField name="amount_cents" type="integer" required>
              Amount of the tax.
            </ResponseField>

            <ResponseField name="amount_currency" type="string" required>
              The currency of the tax.
            </ResponseField>

            <ResponseField name="created_at" type="string" required>
              The date and time when the applied tax was created. It is
              expressed in UTC format according to the ISO 8601 datetime
              standard. This field provides the timestamp for the exact moment
              when the applied tax was initially created.
            </ResponseField>

            <ResponseField name="lago_fee_id" type="string" required>
              Unique identifier of the fee, created by Lago.
            </ResponseField>
          </Expandable>
        </ResponseField>
      </Expandable>
    </ResponseField>

    <ResponseField name="credits" type="object" required>
      <Expandable title="credits">
        <ResponseField name="lago_id" type="string" required>
          Unique identifier assigned to the credit within the Lago application.
          This ID is exclusively created by Lago and serves as a unique
          identifier for the credit’s item record within the Lago system.
        </ResponseField>

        <ResponseField name="amount_cents" type="integer" required>
          The amount of credit associated with the invoice, expressed in cents.
        </ResponseField>

        <ResponseField name="amount_currency" type="string" required>
          The currency of the credit.
        </ResponseField>

        <ResponseField name="before_vat" type="boolean" required>
          Indicates whether the credit is applied on the amount before taxes
          (coupons) or after taxes (credit notes). This flag helps determine the
          order in which credits are applied to the invoice calculation.
        </ResponseField>

        <ResponseField name="item" type="JSON" required>
          <Expandable title="item">
            <ResponseField name="lago_id" type="string" required>
              Unique identifier assigned to the credit item within the Lago
              application.
            </ResponseField>

            <ResponseField name="type" type="string" required>
              The type of credit applied. Possible values are `coupon` or
              `credit_note`.
            </ResponseField>

            <ResponseField name="code" type="string" required>
              The code of the credit applied. It can be the code of the coupon
              attached to the credit or the credit note’s number.
            </ResponseField>

            <ResponseField name="name" type="string" required>
              The name of the credit applied. It can be the name of the coupon
              attached to the credit or the initial invoice’s number linked to
              the credit note.
            </ResponseField>
          </Expandable>
        </ResponseField>
      </Expandable>
    </ResponseField>

    <ResponseField name="metadata" type="object">
      <Expandable title="metadata">
        <ResponseField name="lago_id" type="string" required>
          Unique identifier assigned to the invoice metadata within the Lago
          application.
        </ResponseField>

        <ResponseField name="created_at" type="string" required>
          The date and time when the metadata object was created. It follows the
          ISO 8601 datetime format and is expressed in Coordinated Universal
          Time (UTC).
        </ResponseField>

        <ResponseField name="key" type="string" required>
          Represents the key of the metadata’s key-value pair.
        </ResponseField>

        <ResponseField name="value" type="string" required>
          Represents the value of the metadata’s key-value pair.
        </ResponseField>
      </Expandable>
    </ResponseField>
  </Expandable>
</ResponseField>
