Account .sweep
POST /{namespace}/accounts/{from}/sweep
Sweep moves cash between two cash Accounts of the same owner, once or on a standing rule, within the Treasurer’s Limit.
- Noun
- Account
- Mode
do- Event
Account.swept
Inputs
| Input | Type | Required | Description |
|---|---|---|---|
from | Account | required | The cash Account the money leaves. |
to | Account | required | The cash Account it lands in. |
amount | money | How much to move. Leave it out and set keep to move everything above a floor. | |
keep | money | Leave this much in from and move the rest. | |
repeat | string | Turns the move into a standing rule that sweeps on this schedule. |
Outputs
| Output | Type | Required | Description |
|---|---|---|---|
account | Account | required | The to Account, with the money landed. |
transaction | Transaction | required | The move, reconciled on both Accounts. |
Effects
- Emits
Account.swept. - Performed by the Treasurer.
- Two-way: it runs at once, in the
try,sendanddomodes. - From the payments balance to the card balance, the money lands at once; from a bank it takes up to five business days.
- A standing rule skips a day when the move would leave
frombelowkeep.
Refuses when
| Check | Error | Fix | Then call |
|---|---|---|---|
| The key is valid, but its scopes do not allow this operation. | forbidden | Use a key whose scopes cover the operation, or ask an owner of the namespace to grant them. | Account.sweep |
When it waits
| Gate | Default |
|---|---|
| Decision class | Low: two-way, nothing at stake |
| Delay window | None: it runs once review passes. |
| Limit | The call Limit of the Permission it runs under. |
| Over the Limit | It waits pending for an Approval from the Founder. Approved, it runs; refused, it ends refused with limit-exceeded; unanswered by its deadline, it ends canceled. |