Fee model

The Pismo platform allows you to define dynamic fee models and apply them to your operations. A fee model is a structure that defines a collection of fees with custom calculations. You can define the method used to calculate the fee, using a fixed value or a percentage. Once defined, you can attach this model to operations within an organization (org), program, or account based on processing codes.

Create new fee model

To create a new fee model, write the model's description in the model_description body parameter. Then, define any number of applicable fees in the fees array. For each fee, you must provide the description, id, calculation , and filter parameters.

📘

At this time, processing_code is the only accepted filter to apply the fee. If the operation doesn't match the defined processing codes, the fee is ignored.

Within the calculation object, specify the calculation_method to define the fee based on either:

  • a fixed value (FIXED),
  • a percentage value (PERCENTAGE),
  • or whichever one is greater of the first two (GREATER).

For the fixed and percentage calculation methods, you must define the value field. For the greater calculation method, you must provide the fixed and percentage values. In this case, the platform calculates the percentage of the principal amount and applies whichever value is greater as the fee.

Optionally, you can also define additional fees within each fee object in the additional_fees array.

📘

You cannot have different fees associated with the same processing code.

Example

In the following example, the fee model structure defines:

  • a fee with the greater calculation method with an additional fixed value fee to be applied to processing codes 02 and 0040,
  • and a fee with the percentage calculation method to be applied to processing codes 0100 and 0020.
{
     "model_description": "Fee model applied to org",
     "fees": [
          {
               "description": "Fee wdl",
               "id": "dom_wdl",
               "calculation": {
                    "calculation_method": "GREATER",
                    "fixed": 30,
                    "percentage": 2.5
               },
               "filters": {
                    "processing_codes": [
                         "02",
                         "0040"
                    ]
               },
               "additional_fees": [
                    {
                         "description": "Foreign currency fixed surcharge",
                         "id": "a_wdl",
                         "calculation_method": "FIXED",
                         "value": 10
                    }
               ]
          }
          {
               "description": "Fee abc",
               "id": "a_abc",
               "calculation": {
                    "calculation_method": "PERCENTAGE",
                    "value": 0.5
               },
               "filters": {
                    "processing_codes": [
                         "0100",
                         "0020"
                    ]
               }
          } 
     ]
}

If the request is successful (status code 200), the response returns the newly created model_id that you will use in the subsequent fee model operations.

Attach fee model

You must attach the fee model to an org, program, or account for the fee model to take effect. Once the fee model is attached, it applies the defined fees to operations at the specified level with the specified conditions. To attach the fee model:

  • to an org, call this endpoint and provide the model_id parameter in the path.
  • to a program, call this endpoint and provide the model_id and the program_id parameters in the path.
  • to an account, call this endpoint and provide the model_id and the account_id parameters in the path.

Get fee model

To get the defined fee model:

Update fee model

To update the fee model:

  • call this endpoint,
  • provide the model_id parameter in the path,
  • update the required body parameters as needed.

Delete fee model

To delete the fee model:

If there is any fee model attached to the program or the account, the Pismo platform removes it.


Did this page help you?