Preview a settlement rule
What a rule, or a draft of one, would pay on a payment of amount,
and which of the customer’s recent payments it would have fired on.
Nothing is created or paid.
splits lists the rule’s rows in order, each with what it would
send, computed exactly as an execution computes it: a percentage
rounds down, and the REMAINDER share takes what the others leave.
A share of 0 is not sent. ownerKeeps is what stays with the
customer. When the fixed and percentage shares add up to more than
amount, nothing would be paid, every row’s amount is 0 and
skipReason is AMOUNT_BELOW_RULE. Fees are not estimated: each
share is sent by its own quote, whose fees come off the share.
recentMatches are the customer’s completed bank and chain
deposits from the last 30 days that the rule’s currency and match
select, newest first, at most 20, whatever the customer’s other
rules would have done with them. Grid looks at the customer’s latest
200 such deposits. Use them to spot a pattern that selects payments
it should not.
Give either settlementRuleId or draft.
Authorizations
API token authentication using format <api token id>:<api client secret>
Body
The customer whose payments the rule splits.
"Customer:019542f5-b3e7-1d02-0000-000000000001"
A payment to split, in the smallest unit of the rule's currency.
1 <= x <= 90000000000000001000000
A rule of the customer to preview. Set this or draft.
"SettlementRule:019542f5-b3e7-1d02-0000-000000000001"
A rule as it would be created. Only the fields that decide what it pays and what it matches are needed; a priority is not.
Response
The preview
"USD"
The payment previewed.
1000000
Every row of the rule, in row order.
What stays with the customer.
450000
Why an execution paid nothing.
RULE_PAUSED, INCOMING_PAYMENT_RETURNED, AMOUNT_BELOW_RULE, LIMIT_EXCEEDED, CANCELLED, CREATOR_REVOKED