Preview a settlement rule
What a rule the agent drafts would pay on a payment of amount, and which of the customer’s recent payments it would have fired on, as POST /settlement-rules/preview answers for a draft. Nothing is created or paid. The body is the draft’s fields and amount, with no customerId: the rule is for the agent’s customer.
The draft is checked as POST /agents/me/settlement-rules checks a rule, so a draft the agent could not create is refused here first: every selector’s creditedAccountId is the customer’s stablecoin Embedded Wallet that holds this agent’s key, currency is the wallet’s, and every share pays a destination an agent may pay, or the preview is refused with DESTINATION_NOT_ALLOWED.
Requires the MANAGE_SETTLEMENT_RULES permission.
Authorizations
Bearer token authentication for agent-scoped endpoints. The token is the accessToken returned when redeeming a device code via POST /agents/device-codes/redeem. Agent credentials are user-scoped: all requests are automatically bound to the agent's associated customer and subject to the agent's policy.
Body
A draft rule and a payment to split by it. The draft's fields sit at the top level, beside amount.
Code of the payments the rule splits, which is the currency of the Embedded Wallet its selectors name.
"USDB"
1 - 20 elementsThe shares, in the order they are paid. At most 20.
1A payment to split, in the smallest unit of the draft's currency.
1 <= x <= 90000000000000001000000
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, AGENT_PAUSED