Mono Colombia

Updates a fee policy

Changes the price or the settings of one of your fee policies. Only the fields you send are replaced; the ones you leave out keep their value.

What can change

  • strategies, when sent, replaces the whole map: send every currency the policy must keep. Removing a currency is a matter of sending the map without it. The new strategies are checked against the policy's target the same way as on creation.
  • skip: true skips (pauses) the policy: Mono ignores it while resolving, so the next less specific one applies. Your base policies (target_type: tenant) can never be skipped: they are the last resort guaranteeing every fee has a price.
  • summary, transaction_description, processing_type and processing_subtype change freely, within what the fee type supports.

What can't

fee_type, target_type and target_id identify the policy and are immutable. To move a policy to another target, delete it and create a new one.

Changes apply to the fees charged from then on. Fees already charged keep the price they were calculated with. See the fee policies guide.

PATCH
/v1/core/fees/policies/{id}

Authorization

AuthorizationBearer <token>

In: header

Path Parameters

idstring

Fee policy ID

Match^[A-Za-z]{2,7}_[\w-]{22}$
Example"fpol_5tgliBmzjZ6mpQPRbQjfKj"

Request Body

application/json

Fields of the fee policy to update

TypeScript Definitions

Use the request body type in TypeScript.

processing_subtype?string

How the fee shows up in the ledger. For inline processing: upcharge adds the fee on top of the operation's amount, deduct takes it out of the amount and add_posting charges it as its own movement inside the operation's transaction. For deferred processing: new_tx charges it in a separate transaction. Each fee type supports specific values; see the fee types table in the guides.

Value in"upcharge" | "deduct" | "add_posting" | "new_tx"
Example"add_posting"
processing_type?string

When the fee is charged: inline, as part of the operation that triggers it, or deferred, in a separate charge later on. Each fee type supports specific values; see the fee types table in the guides.

Value in"inline" | "deferred"
Example"inline"
skip?boolean

Whether the policy is skipped (paused): Mono ignores it while deciding which one applies, so the next less specific one takes over. Useful to pause an override without deleting it. The base tenant policy can never be skipped.

Examplefalse
strategies?FeeStrategies

How the fee is priced, per currency: one strategy per ISO 4217 currency code (COP, USD, …). Cannot be empty.

The policy only applies to the currencies it includes; an account in a currency the policy leaves out is priced by the next less specific policy. A tenant policy must cover every currency your programs support, while the policies of the other targets may cover a subset of their target's currencies.

Properties1 <= properties
Example{ "COP": { "default_calculation": { "fixed": 0, "percentage": "0.004", "percentage_limit": 500000, "percentage_mode": "capped" }, "rules": [ { "calculation": { "fixed": 900000, "percentage": "0" }, "conditions": [ { "left": { "property": "payout.method" }, "operator": "equal", "right": { "value": "co_ach" } } ], "summary": "Applies to co_ach payouts" } ] } }
summary?string

Human-readable description of what the policy is for.

Length1 <= length <= 255
Example"Program bank transfer fee"
transaction_description?string|null

Description used on the transactions of the fees created with this policy. The fee type's own description is used when null.

Length1 <= length <= 255
Example"Bank transfer fee"

Response Body

application/json

application/json

application/json

application/json

application/json

application/json

curl -X PATCH "https://api.sandbox.cuentamono.com/v1/core/fees/policies/fpol_5tgliBmzjZ6mpQPRbQjfKj" \  -H "Content-Type: application/json" \  -d '{}'
{
  "fee_type": "bank_transfer",
  "id": "fpol_5tgliBmzjZ6mpQPRbQjfKj",
  "inserted_at": "2022-01-01T01:00:00Z",
  "processing_subtype": "add_posting",
  "processing_type": "inline",
  "skip": false,
  "strategies": {
    "COP": {
      "default_calculation": {
        "fixed": 0,
        "percentage": "0.004",
        "percentage_limit": 500000,
        "percentage_mode": "capped"
      },
      "rules": [
        {
          "calculation": {
            "fixed": 900000,
            "percentage": "0"
          },
          "conditions": [
            {
              "left": {
                "property": "payout.method"
              },
              "operator": "equal",
              "right": {
                "value": "co_ach"
              }
            }
          ],
          "summary": "Applies to co_ach payouts"
        }
      ]
    }
  },
  "summary": "Program bank transfer fee",
  "target_id": "pro_5tgliBmzjZ6mpQPRbQjfKj",
  "target_type": "program",
  "transaction_description": "Bank transfer fee",
  "updated_at": "2022-01-01T01:00:00Z"
}
{
  "code": "400 Bad Request",
  "errors": [
    {
      "error_code": "validation_error",
      "message": "Generic changeset errors",
      "path": null,
      "url": null
    }
  ],
  "id": "log_7MkWaFqvfosB8fzHhb1Eql",
  "message": "Malformed request"
}
{
  "code": "401 Unauthorized",
  "errors": [
    {
      "error_code": "missing_authorization_header",
      "message": "`Authorization` header is missing.",
      "path": null,
      "url": null
    }
  ],
  "id": "log_7MkWaFqvfosB8fzHhb1Eql",
  "message": "Authorization header is missing or invalid."
}
{
  "code": "403 Forbidden",
  "errors": [
    {
      "error_code": "not_authorized",
      "message": "Not authorized to have access to this resource.",
      "path": null,
      "url": null
    }
  ],
  "id": "log_7MkWaFqvfosB8fzHhb1Eql",
  "message": "Not authorized to have access to this resource"
}
{
  "code": "404 Not Found",
  "errors": [
    {
      "error_code": "fee_policy_not_found",
      "message": "The fee policy doesn't exist.",
      "path": null,
      "url": null
    }
  ],
  "id": "log_7MkWaFqvfosB8fzHhb1Eql",
  "message": "Resource not defined"
}
{
  "code": "422 Unprocessable Content",
  "errors": [
    {
      "error_code": "cannot_skip_tenant_policy",
      "message": "The fee policy of target tenant can't be skipped.",
      "path": "#/path/to/field",
      "url": null
    }
  ],
  "id": "log_7MkWaFqvfosB8fzHhb1Eql",
  "message": "Validation errors"
}