---
title: "Update a fee"
method: PUT
path: "/fees/{lago_id}"
tags: ["fees"]
---

# Update a fee

`PUT /fees/{lago_id}`

This endpoint is used for updating a specific fee that has been issued.

## Request body

- FeeUpdateInput
  - `fee` object, required
    - `payment_status` 'pending' | 'succeeded' | 'failed' | 'refunded', required — The payment status of the fee. Possible values are `pending`, `succeeded`, `failed` or `refunded`.

## Response `200`

Fee updated

- Fee
  - `fee` FeeObject, required
    - `lago_id` string, uuid, nullable — 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.
    - `lago_charge_id` string, uuid, nullable — Unique identifier assigned to the charge that the fee belongs to
    - `lago_charge_filter_id` string, uuid, nullable — Unique identifier assigned to the charge filter that the fee belongs to
    - `lago_fixed_charge_id` string, uuid, nullable — Unique identifier assigned to the fixed charge that the fee belongs to
    - `lago_invoice_id` string, uuid, nullable — Unique identifier assigned to the invoice that the fee belongs to
    - `lago_true_up_fee_id` string, uuid, nullable — 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.
    - `lago_true_up_parent_fee_id` string, uuid, nullable — 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.
    - `lago_subscription_id` string, uuid, nullable — Unique identifier assigned to the subscription, created by Lago. This field is specifically displayed when the fee type is charge or subscription.
    - `lago_customer_id` string, uuid, nullable — Unique identifier assigned to the customer, created by Lago. This field is specifically displayed when the fee type is charge or subscription.
    - `external_customer_id` string, nullable — Unique identifier assigned to the customer in your application. This field is specifically displayed when the fee type is charge or subscription.
    - `external_subscription_id` string, nullable — Unique identifier assigned to the subscription in your application. This field is specifically displayed when the fee type is charge or subscription.
    - `amount_cents` integer, required — The cost of this specific fee, excluding any applicable taxes.
    - `precise_amount` string — The cost of this specific fee, excluding any applicable taxes, with precision.
    - `precise_total_amount` string — The cost of this specific fee, including any applicable taxes, with precision.
    - `amount_currency` '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' | 'GHS' | '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', required
    - `taxes_amount_cents` integer, required — The cost of the tax associated with this specific fee.
    - `taxes_precise_amount` string — The cost of the tax associated with this specific fee, with precision.
    - `taxes_rate` number, required — The tax rate associated with this specific fee.
    - `units` 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.
    - `precise_unit_amount` string, required — The unit amount of the fee per unit, with precision.
    - `total_aggregated_units` string, required — The total number of units that have been aggregated for this specific fee.
    - `total_amount_cents` integer, required — The cost of this specific fee, including any applicable taxes.
    - `total_amount_currency` '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' | 'GHS' | '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', required
    - `events_count` integer, nullable — 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.
    - `pay_in_advance` 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).
    - `invoiceable` 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.
    - `from_date` string, date-time, nullable — The beginning date of the period that the fee covers. It is applicable only to `subscription`, `charge`, `fixed_charge` and `commitment` fees. This field indicates the start date of the billing period or subscription period associated with the fee.
    - `to_date` string, date-time, nullable — The ending date of the period that the fee covers. It is applicable only to `subscription`, `charge`, `fixed_charge` and `commitment` fees. This field indicates the end date of the billing period or subscription period associated with the fee.
    - `payment_status` 'pending' | 'succeeded' | 'failed' | 'refunded', 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`.
    - `created_at` string, date-time, nullable — The date and time when the fee was created. It is provided in Coordinated Universal Time (UTC) format.
    - `succeeded_at` string, date-time, nullable — The date and time when the payment for the fee was successfully processed. It is provided in Coordinated Universal Time (UTC) format.
    - `failed_at` string, date-time, nullable — The date and time when the payment for the fee failed to process. It is provided in Coordinated Universal Time (UTC) format.
    - `refunded_at` string, date-time, nullable — The date and time when the payment for the fee was refunded. It is provided in Coordinated Universal Time (UTC) format
    - `event_transaction_id` string, nullable — 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`).
    - `description` string, nullable — The description of the fee.
    - `precise_coupons_amount_cents` string — The coupon amount applied to the fee, with precision.
    - `sub_total_excluding_taxes_amount_cents` integer, required — The sub total of the fee excluding taxes, in cents.
    - `sub_total_excluding_taxes_precise_amount_cents` string, required — The sub total of the fee excluding taxes, with precision.
    - `amount_details` FeeAmountDetails
      - `plan_amount_cents` integer — The base cost of the plan, excluding any applicable taxes, that is billed on a recurring basis. This value is defined at 0 if your plan is a pay-as-you-go plan.
      - `graduated_ranges` object[] — Graduated ranges, used for a `graduated` charge model.
        - `units` string, required — Total units received in Lago.
        - `from_value` integer, required — Lower value of a tier. It is either 0 or the previous range's `to_value + 1`.
        - `to_value` integer, nullable, required — 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.
        - `flat_unit_amount` string, required — Flat unit amount within a specified tier.
        - `per_unit_amount` string, required — Amount per unit within a specified tier.
        - `per_unit_total_amount` string, required — Total amount of received units to be charged within a specified tier.
        - `total_with_flat_amount` string, required — Total amount to be charged for a specific tier, taking into account the flat_unit_amount and the per_unit_total_amount.
      - `graduated_percentage_ranges` object[] — Graduated percentage ranges, used for a `graduated_percentage` charge model.
        - `units` string, required — Total units received in Lago.
        - `from_value` integer, required — Lower value of a tier. It is either 0 or the previous range's `to_value + 1`.
        - `to_value` integer, nullable, required — 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.
        - `flat_unit_amount` string, required — Flat unit amount within a specified tier.
        - `rate` string, ^[0-9]+.?[0-9]*$, required — Percentage rate applied within a specified tier.
        - `per_unit_total_amount` string, required — Total amount of received units to be charged within a specified tier.
        - `total_with_flat_amount` string, required — Total amount to be charged for a specific tier, taking into account the flat_unit_amount and the per_unit_total_amount.
      - `free_units` string — The quantity of units that are provided free of charge for each billing period in a `package` charge model.
      - `paid_units` string — The quantity of units that are not provided free of charge for each billing period in a `package` charge model.
      - `per_package_size` integer — The quantity of units included, defined for Package or Percentage charge model.
      - `per_package_unit_amount` string — Total amount to charge for received paid_units, defined for Package or Percentage charge model.
      - `per_unit_total_amount` string — Total amount of received units to be charged for the Volume or Percentage charge model.
      - `units` string — The total units received in Lago for the Percentage charge model.
      - `free_events` integer — Total number of free events allowed for the Percentage charge model.
      - `rate` string, ^[0-9]+.?[0-9]*$ — Percentage rate applied for the Percentage charge model.
      - `paid_events` integer — Total number of paid events for the Percentage charge model.
      - `fixed_fee_unit_amount` string — Fixed fee unit price per received paid_event for the Percentage charge model.
      - `fixed_fee_total_amount` string — Total amount to charge for received paid_events for the Percentage charge model.
      - `min_max_adjustment_total_amount` string — Total adjustment amount linked to minimum and maximum spending per transaction for the Percentage charge model.
      - `per_unit_amount` string — The flat amount for a whole tier, excluding tax, for a `volume` charge model.
      - `flat_unit_amount` string — The unit price, excluding tax, for a specific tier of a `volume` charge model.
    - `self_billed` boolean — Indicates if the fee belongs to self-billed invoice. Self-billing is a process where an organization creates the invoice on behalf of the partner.
    - `item` object, required — Item attached to the fee
      - `type` 'charge' | 'fixed_charge' | 'add_on' | 'subscription' | 'credit' | 'commitment', required — The fee type. Possible values are `add-on`, `charge`, `fixed_charge`, `credit`, `subscription` or `commitment`.
      - `code` 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 `fixed_charge`, the code of the `credit` or the code of the `subscription`.
      - `name` string, required — The name of the fee item. The value depends on the type of the fee item: - If the fee item is a `charge`, it is the billable metric name. - If the fee item is a `add-on`, it is the add-on name. - If the fee item is a `credit`, it is the wallet transaction name if set, or `"credit"` if not. - If the fee item is a `fixed_charge`, it is the fixed charge add-on name. - For all the other fee items, it is the subscription plan name.
      - `description` string, nullable — The description of the fee item. The value depends on the type of the fee item: - If the fee item is a `charge`, it is the billable metric description. - If the fee item is a `add-on`, it is the add-on description. - If the fee item is a `credit`, it is always `"credit"`. - If the fee item is a `fixed_charge`, it is the fixed charge add-on description. - For all the other fee items, it is the subscription plan description.
      - `invoice_display_name` string — Specifies the name that will be displayed on an invoice. If no value is set for this field, we'll fallback to a value that depends on the type of the fee items: - If the fee item is a `charge`, we'll fallback to the `invoice_display_name` of the `charge` or the billable metric name if no `invoice_display_name` is set. - If the fee item is a `add-on`, we'll fallback to the `invoice_name` of the `add-on` or the `name` of the `add-on`. - If the fee item is a `credit`, we'll fallback to the wallet transaction name if set, or `credit` if not. - If the fee item is a `fixed_charge`, we'll fallback to the `invoice_display_name` of the `fixed_charge` or the `invoice_name` of the `fixed_charge_add_on` if no `invoice_display_name` is set. - For all the other fee items, we'll fallback to the `invoice_display_name` of the subscription plan.
      - `filter_invoice_display_name` string, nullable — 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.
      - `filters` object, nullable — Key value list of event properties
      - `lago_item_id` string, uuid, required — Unique identifier of the fee item, created by Lago. It can be the identifier of the `add-on`, the `charge`, the `credit`, the `subscription` or the `commitment`.
      - `item_type` 'AddOn' | 'BillableMetric' | 'Subscription' | 'WalletTransaction', required — The type of the fee item. Possible values are `AddOn`, `BillableMetric`, `WalletTransaction`, `Subscription`.
      - `grouped_by` object — Key value list of event properties aggregated by the charge model
    - `applied_taxes` FeeAppliedTaxObject[] — List of fee applied taxes
      - `lago_id` string, uuid, required — Unique identifier of the applied tax, created by Lago.
      - `lago_tax_id` string, uuid, nullable, required — Unique identifier of the tax, created by Lago.
      - `tax_name` string, required — Name of the tax.
      - `tax_code` string, required — Unique code used to identify the tax associated with the API request.
      - `tax_rate` number, required — The percentage rate of the tax
      - `tax_description` string, nullable, required — Internal description of the tax
      - `amount_cents` integer, required — Amount of the tax
      - `amount_currency` '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' | 'GHS' | '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', required
      - `created_at` string, date-time, 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.
    - `pricing_unit_details` PricingUnitDetailsObject
      - `lago_pricing_unit_id` string, uuid, required — Unique identifier of the pricing unit, created by Lago.
      - `pricing_unit_code` string, required — The code of the pricing unit.
      - `short_name` string, required — The short name of the pricing unit. Will be used as currency name in the UI and PDFs.
      - `amount_cents` integer, required — The amount in cents in the pricing unit.
      - `precise_amount_cents` string, required — The precise amount in cents in the pricing unit.
      - `unit_amount_cents` integer, required — The unit amount in cents in the pricing unit.
      - `precise_unit_amount` string, required — The precise unit amount in the pricing unit.
      - `conversion_rate` string, required — The conversion rate from pricing units to the plan's currency.
    - `presentation_breakdowns` object[] — Array of usage breakdowns split by presentation group keys without affecting pricing or aggregation.
      - `presentation_by` object — Key value list of event properties used for presentation grouping.
      - `units` string — The number of units consumed for a specific presentation group.

## Other responses

- `400` — Bad Request error
- `401` — Unauthorized error
- `404` — Not Found error
- `405` — Not Allowed error
- `422` — Unprocessable entity error

---

[API](https://skmtc.dev/getlago/apis/lago-api-documentation.md) · [All operations](https://skmtc.dev/getlago/apis/lago-api-documentation/llms.txt) · [OpenAPI document](https://skmtc-service-production.skmtc.workers.dev/v1/apis/getlago/lago-api-documentation/revisions/6e969ef3bb45/schema)
