---
title: "Update fee model"
method: PUT
path: "/v1/fee/models/{model_id}"
tags: ["Fee models"]
---

# Update fee model

`PUT /v1/fee/models/{model_id}`

## Request

- Base URL: `https://sandbox.pismolabs.io/rates`
- URL: `https://sandbox.pismolabs.io/rates/v1/fee/models/{model_id}`
- Auth: HTTP bearer

Update a fee model

## Path parameters

- `model_id` string, required

## Request body

- FeeModel
  - `model_description` string, required: Model description.
  - `fees` Fee[], required
    - `description` string, required: Fee description.
    - `id` string, required: Fee ID - a reference from transaction postings. The Pismo transaction team uses fee ID fields to make accounting entries. Talk to your Pismo representative about getting fee IDs for your operations.
    - `type` string, required: Fee type, represents the fee classification, and is linked with the `id` field.
    - `precedence` integer: Calculation order. All fees with the same precedence number are calculated in the same iteration. The next iteration uses the previous output as its calculation basis.
    - `deduct_from_transaction_value` boolean: Should fee be deducted from transaction value flag. Default=`false`.
    - `calculation_basis` string: * `PRINCIPAL_AMOUNT` - Taxes are applied to original transaction amount only. This is the default. * `CONTRACT_AMOUNT` - Taxes are applied to original transaction amount plus fees.
    - `calculation` union, required
      - FeeCalculationFixed
        - `calculation_method` 'FIXED', required: Calculation method - `FIXED`
        - `value` number, required: Fixed fee amount as decimal field.
      - FeeCalculationGreater
        - `calculation_method` 'GREATER', required: Calculation method - `GREATER`. Whichever value is greater - `fixed` or `percentage` is applied.
        - `fixed` number, required: Fixed fee amount as decimal field.
        - `percentage` number, required: Percentage amount as decimal field.
      - FeeCalculationPercentage
        - `calculation_method` 'PERCENTAGE', required: Calculation method - `PERCENTAGE`.
        - `value` number, required: Percentage amount as decimal field.
      - FeeCalculationDailyPercentage
        - `calculation_method` 'DAILY_PERCENTAGE', required: Calculation method - `DAILY_PERCENTAGE`. Applied to credit card cash advances and other loan-type products.
        - `value` number, required: Percentage amount as decimal field.
      - FeeCalculationCompoundInterest
        - `calculation_method` 'COMPOUND_INTEREST', required: Calculation method - `COMPOUND_INTEREST`. Applied to loan-type products.
        - `value` number, required: Percentage amount as decimal field.
        - `days_range` integer, required: Calculation's range of days. For example: 10% interest and `days_range` = 20 for $100 purchase; considering 10 days between purchase and cycle close, is applied 0.5% per day (10/20). In the first day, the value will be 0.5 (100 x 0.5%), in the second day the value will be 0.55 (100.05 x 0.5%), and so on.
      - FeeCalculationAccumulator: Fee calculation for ACCUMULATOR model.
        - `calculation_method` 'ACCUMULATOR', required: Calculation method - `ACCUMULATOR`.
        - `index` 'AMOUNT' | 'QUANTITY', required: Field used to index the calculation. `AMOUNT` - Fee is based on transaction totals. `QUANTITY` - Fee is based on number of transactions.
        - `identifier` string, required: Accumulator configuration ID. Client-assigned and passed to the <a href="https://developers.pismo.io/pismo-docs/reference/post-v1-accumulator-config" target="_blank">Create accumulator configuration</a> endpoint.
        - `rules` union[], required: Ranges and strategies
          - union
            - RuleRange
              - …
            - RuleGreater
              - …
      - FeeCalculationDynamicByAmount: Fee calculation for `DYNAMIC_BY_AMOUNT` model.
        - `calculation_method` 'DYNAMIC_BY_AMOUNT', required: Calculation method - `DYNAMIC_BY_AMOUNT`.
        - `rules` union[], required: Ranges and strategies
          - union
            - RuleRange
              - …
            - RuleGreater
              - …
      - FeeCalculationPriceTable
        - `calculation_method` 'PRICE_TABLE', required: Calculation method - `PRICE_TABLE`.
        - `index` 'INSTALLMENT': Define range type when interest rate is dynamic.
        - `fixed` number: Fixed fee amount as decimal field.
        - `percentage` number: Percentage amount as decimal field.
        - `fixed_iof_rate` number, required: Percentage amount as decimal field. IOF = Brazilian tax.
        - `daily_iof_rate` number, required: Percentage amount as decimal field. IOF = Brazilian tax.
        - `interest_rate` InterestRate, required
          - `type` 'FIXED' | 'DYNAMIC', required: Fee type: `FIXED` - Field `value` is required and will be used as interest rate. Field `grace_period` is optional. `DYNAMIC` - Field `rules` is required and the value used as interest rate will be selected according to the installment ranges configured.
          - `value` number: Percentage amount as decimal field. Value used as interest rate. **REQUIRED** for `FIXED` type.
          - `grace_period` object: Optional grace period before interest begins. Only applicable when interest rate `type` is `FIXED`. **Only processed for the `EQUAL_INSTALLMENTS` calculation method.** Silently ignored for all other methods (e.g., `PRICE_TABLE`, `DAILY_PERCENTAGE`).
            - `type` 'FIXED', required
            - `value` number, required: Number of periods to skip before interest begins.
          - `rules` InterestRateRule[]: Installment ranges responsible to configure the value used as interest rate. **REQUIRED** for `DYNAMIC` type.
            - `minimum` number, required: First installment the rule is applied to. For example, if you enter "4", rule application begins on the 4th installment. Must be 1 or higher.
            - `maximum` number, required: Last installment the rule is applied to. For example, if you enter "10", rule application ends after the 10th installment.
            - `calculation` RuleCalculation, required
              - …
            - `progression` Progression: Rate progression configuration.
              - …
      - FeeCalculationEqualInstallments
        - `calculation_method` 'EQUAL_INSTALLMENTS', required: Calculation method - `EQUAL_INSTALLMENTS`.
        - `fees` object[], required: List of additional fees.
          - `calculation` 'FIXED' | 'PERCENTAGE' | 'DAILY_PERCENTAGE' | 'IOF', required
          - `id` string, required
          - `precedence` integer, required
          - `value` number, required
          - `calculation_basis` 'PRINCIPAL_AMOUNT' | 'CONTRACT_AMOUNT', required
          - `fixed_iof_rate` number
          - `daily_iof_rate` number
        - `interest_rate` InterestRateWithGracePeriod, required
          - `type` 'FIXED' | 'DYNAMIC', required: Fee type: `FIXED` - Field `value` is required and will be used as interest rate. `DYNAMIC` - Field `rules` is required and the value used as interest rate will be selected according to the installment ranges configured.
          - `value` number: Percentage amount as decimal field. Value used as interest rate. **REQUIRED** for `FIXED` type.
          - `grace_period` object: Optional grace period before interest begins. **Only processed for the `EQUAL_INSTALLMENTS` calculation method.** Silently ignored for all other methods.
            - `type` 'FIXED', required
            - `value` number, required: Number of periods to skip before interest begins.
          - `rules` InterestRateRule[]: Installment ranges responsible to configure the value used as interest rate. **REQUIRED** for `DYNAMIC` type.
            - `minimum` number, required: First installment the rule is applied to. For example, if you enter "4", rule application begins on the 4th installment. Must be 1 or higher.
            - `maximum` number, required: Last installment the rule is applied to. For example, if you enter "10", rule application ends after the 10th installment.
            - `calculation` RuleCalculation, required
              - …
            - `progression` Progression: Rate progression configuration.
              - …
        - `precedence` integer, required: Calculation order. All fees with the same precedence number are calculated in the same iteration. The next iteration uses the previous output as its calculation basis.
        - `day_count_method` 'MONTH_30_YEAR_360' | 'MONTH_ACTUAL_YEAR_365'
      - FeeCalculationAging
        - `calculation_method` 'AGING', required: Calculation method - `AGING`.
        - `index` 'DAY': Define range type when rate is dynamic.
        - `rate` Rate, required
          - `type` 'FIXED' | 'DYNAMIC', required: Fee type: `FIXED` - Field `value` is **REQUIRED** and used as rate. `DYNAMIC` - Field `rules` is **REQUIRED** and the value used as rate is selected according to the day ranges configured.
          - `value` number: Percentage amount as decimal field. Value is used as rate. **REQUIRED** for `FIXED` type.
          - `rules` union[]: Ranges responsible to configure the value used as rate. **REQUIRED** for `DYNAMIC` type.
            - union
              - …
      - FeeCalculationIof
        - `calculation_method` 'IOF', required: Calculation method - `IOF`.
        - `value` number, required: Percentage amount as decimal and used as base to calculate the fee amount.
      - FeeCalculationConstantRepayment
        - `calculation_method` 'CONSTANT_REPAYMENT', required: Calculation method - `CONSTANT_REPAYMENT`
        - `day_count_method` 'MONTH_30_YEAR_360' | 'MONTH_ACTUAL_YEAR_365', required: Day count convention used to calculate interest
        - `payment_postponement_rules` object: Rules for payment postponement.
          - `basis` 'PRINCIPAL' | 'INTEREST': Postponement basis.
          - `cycles` string: Number of cycles to postpone.
        - `interest_rate` InterestRate, required
          - `type` 'FIXED' | 'DYNAMIC', required: Fee type: `FIXED` - Field `value` is required and will be used as interest rate. Field `grace_period` is optional. `DYNAMIC` - Field `rules` is required and the value used as interest rate will be selected according to the installment ranges configured.
          - `value` number: Percentage amount as decimal field. Value used as interest rate. **REQUIRED** for `FIXED` type.
          - `grace_period` object: Optional grace period before interest begins. Only applicable when interest rate `type` is `FIXED`. **Only processed for the `EQUAL_INSTALLMENTS` calculation method.** Silently ignored for all other methods (e.g., `PRICE_TABLE`, `DAILY_PERCENTAGE`).
            - `type` 'FIXED', required
            - `value` number, required: Number of periods to skip before interest begins.
          - `rules` InterestRateRule[]: Installment ranges responsible to configure the value used as interest rate. **REQUIRED** for `DYNAMIC` type.
            - `minimum` number, required: First installment the rule is applied to. For example, if you enter "4", rule application begins on the 4th installment. Must be 1 or higher.
            - `maximum` number, required: Last installment the rule is applied to. For example, if you enter "10", rule application ends after the 10th installment.
            - `calculation` RuleCalculation, required
              - …
            - `progression` Progression: Rate progression configuration.
              - …
        - `fees` object[]: List of additional fees.
          - `calculation` 'FIXED' | 'PERCENTAGE' | 'DAILY_PERCENTAGE', required
          - `id` string, required
          - `precedence` integer, required
          - `value` number, required
          - `calculation_basis` 'PRINCIPAL_AMOUNT' | 'CONTRACT_AMOUNT', required
      - FeeCalculationBuiltIn: Fee calculation for `BUILT_IN` model. A `BUILT_IN` fee is always applied before any other fee. The percentage defined in `value` is applied to the principal amount and the resulting fee amount is incorporated into the principal, so all subsequent fees are calculated over the principal plus the `BUILT_IN` fee. A `BUILT_IN` fee can only be added if its `precedence` is lower than the `precedence` of every other fee in the same fee model that shares at least one `processing_code` with it. If any of those fees has an equal or lower `precedence`, the API returns `400 Bad Request` with an invalid payload error listing the violated `field` and `violation`.
        - `calculation_method` 'BUILT_IN', required: Calculation method - `BUILT_IN`. Always applied before any other fee, and its amount is incorporated into the principal.
        - `value` number, required: Percentage amount as decimal field, applied to the principal amount.
    - `filters` Filters, required
      - `processing_codes` string[], required: Processing codes to apply the fee to. Processing codes identify an operation, such as purchases or debits. Each financial operation within the platform has its processing code. Some you can configure, while others are fixed in the card network flow. Talk to your Pismo representative to get, or create, processing codes. For more information, see <a href="https://developers.pismo.io/pismo-docs/docs/processing-codes-and-transaction-types" target="_blank">Processing codes and transaction types</a>.
      - `operation_types` string[]: Operation types to apply the fee to. If not specified, fees will be applied to all types.
      - `amount_range` object: Optional amount range filter. When specified, the fee is applied only to operations whose amount falls within the given range. When the object is sent, only `minimum` is required; `maximum` remains optional. When two fees share at least one `processing_code`, their `amount_range` intervals must not overlap — a fee with no `maximum` is treated as unbounded above.
        - `minimum` number, double, required: Minimum amount (inclusive) for the fee to be applied. BigDecimal value. Required when `amount_range` is provided.
        - `maximum` number, double: Maximum amount (inclusive) for the fee to be applied. BigDecimal value. Optional — when present, must be greater than or equal to `minimum`.
      - `merchant_category` object: Optional merchant category filter. When specified, the fee is applied only to operations whose Merchant Category Code (MCC) matches the given include/exclude criteria. MCC is treated as an opaque string — no ISO 8583 validation is performed. Omitting the object, or leaving both lists empty, bypasses the filter. Server-side validation — `include` and `exclude` each must not contain duplicate MCC values, and the two lists must not share any MCC value; violations return HTTP 400.
        - `include` string[]: When non-empty, the fee is applied only if the request MCC is in this list. A request without an MCC does not match when `include` is populated.
        - `exclude` string[]: When non-empty, the fee is NOT applied if the request MCC is in this list.
    - `additional_fees` AdditionalFee[]
      - `description` string, required: Fee description.
      - `type` string, required: Fee type, represents the fee classification, and is linked with the `id` field.
      - `id` string, required: Fee ID - a reference from transaction postings. The Pismo transaction team uses fee ID fields to make accounting entries. Talk to your Pismo representative about getting fee IDs for your operations.
      - `calculation` union, required
        - FeeCalculationFixed
          - `calculation_method` 'FIXED', required: Calculation method - `FIXED`
          - `value` number, required: Fixed fee amount as decimal field.
        - FeeCalculationGreater
          - `calculation_method` 'GREATER', required: Calculation method - `GREATER`. Whichever value is greater - `fixed` or `percentage` is applied.
          - `fixed` number, required: Fixed fee amount as decimal field.
          - `percentage` number, required: Percentage amount as decimal field.
        - FeeCalculationPercentage
          - `calculation_method` 'PERCENTAGE', required: Calculation method - `PERCENTAGE`.
          - `value` number, required: Percentage amount as decimal field.

## Response `200`

OK

## Other responses

- `400`: Bad request - the fee model payload is invalid. The response body depends on the validation that failed: * Schema validation (body that is not valid JSON, missing field, wrong type, invalid calculation structure) - list with each invalid field and the violated rule. * Business rule validation across fees (`RCAPI-VALIDATION-ERROR`) - error object with the list of invalid fields and violated rules in `errors`. * Request that cannot be bound, or invalid `model_id` on update (`RCAPI-INVALID-REQUEST-PAYLOAD`) - error object with code and message.
- `401`: InvalidToken
- `404`: Fee model not found
- `500`: Internal Server Error

---

[API](https://skmtc.dev/pismo/apis/platform-setup-rates-and-fees.md) - [All operations](https://skmtc.dev/pismo/apis/platform-setup-rates-and-fees/llms.txt) - [OpenAPI document](https://skmtc.dev/pismo/apis/platform-setup-rates-and-fees/revisions/9b015a025dd8?raw)
