Creates fee policies
Creates one or more fee policies at once.
A fee policy tells Mono how much to charge your users for a kind of fee — for example,
the fee a subaccount pays for a bank-transfer payout — and whom it applies to: every
account of your users or customers (tenant), one program, one account holder or a
single subaccount. When a fee is charged, the most specific policy for the charged account
wins, so you can set a general price and override it only where you need to.
How the request works
Send the policies under policies, always as a list, even for a single one. The batch is
atomic: if any policy is rejected, none is created, and the error points at the item
that failed with its position in the list (for example /policies/1/strategies/COP). The
created policies come back under policies, in the order you sent them.
Keep in mind
- Your base or global policies — one per fee type, with
target_type: tenant— are set up by Mono. You can update them but not create or delete them: they are your default price, and the policies you create for programs, account holders or accounts override it. - Only one active policy per fee type and target. To change the price of a target that
already has one, update that policy: creating another is rejected with
fee_policy_already_exists. strategiesdecides the currencies the policy covers, and it must stay within the currencies its target supports. The policy only applies to the currencies it includes; for the others, the next less specific policy applies.processing_typeandprocessing_subtypemust be among the ones the fee type supports.- A new policy never starts out skipped (paused); use the update endpoint to skip it afterwards.
See the fee policies guide for how policies are resolved and priced, and the conditions reference for the properties and operators the rules can use.
In: header
Request Body
application/json
Fee policies to create
TypeScript Definitions
Use the request body type in TypeScript.
Fee policies to create in a single atomic batch, 50 at most.
1 <= items <= 50Response Body
application/json
application/json
application/json
application/json
application/json
application/json
curl -X POST "https://api.sandbox.cuentamono.com/v1/core/fees/policies" \ -H "Content-Type: application/json" \ -d '{ "policies": [ { "fee_type": "bank_transfer", "processing_subtype": "add_posting", "processing_type": "inline", "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" } ] }'{
"policies": [
{
"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": "409 Conflict",
"errors": [
{
"error_code": "fee_policy_already_exists",
"message": "A fee policy already exists for this target and fee type.",
"path": null,
"url": null
}
],
"id": "log_7MkWaFqvfosB8fzHhb1Eql",
"message": "Conflict"
}{
"code": "422 Unprocessable Content",
"errors": [
{
"error_code": "duplicated_fee_policies",
"message": "The request has more than one fee policy for the same target and fee type.",
"path": "#/path/to/field",
"url": null
}
],
"id": "log_7MkWaFqvfosB8fzHhb1Eql",
"message": "Validation errors"
}