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: trueskips (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_typeandprocessing_subtypechange 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.
In: header
Path Parameters
Fee policy ID
^[A-Za-z]{2,7}_[\w-]{22}$"fpol_5tgliBmzjZ6mpQPRbQjfKj"Request Body
application/json
Fields of the fee policy to update
TypeScript Definitions
Use the request body type in TypeScript.
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.
"upcharge" | "deduct" | "add_posting" | "new_tx""add_posting"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.
"inline" | "deferred""inline"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.
falseHow 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.
1 <= properties{
"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"
}
]
}
}Human-readable description of what the policy is for.
1 <= length <= 255"Program bank transfer fee"Description used on the transactions of the fees created with this policy. The fee type's own description is used when null.
1 <= length <= 255"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"
}