Sweep a disabled business
/v1/businesses/{id}/sweepRequires an API client bearer token.
Returns the whole posted balance of a disabled business's spending account to the programme float, and seals the account against every later credit. The only money operation a disabled business has: there is no partial return and no payout. `amount` is the balance as the caller read it (GET /v1/businesses/{id}/balance); any other figure is refused 409 sweep_not_full_balance, naming the posted figure, and an active hold is 409 sweep_active_holds. Only on a disabled business (409 business_not_disabled on an active one, business_closed on a closed one); 409 no_funding_account when the business never had an account; 409 no_programme_float when the programme has no float in the currency; 400 funding_currency_mismatch. Requires an Idempotency-Key: a retry answers the stored sweep (200, replayed true) before any state check, also after the business has closed, to a caller who could sweep again (the business visible, the acting person an admin). Refused in live mode. Emits business.swept. An API client names its acting person in X-Rigid-Acting-Person; the person needs role admin, else 403 acting_person_not_permitted. The sweep writes one audit entry (its replays add none), and every refusal with a code writes one, the Idempotency-Key refusals included. While the `business-cards` release flag is off for the caller's mode this route answers 404 to every authenticated, well-formed request not replaying an outcome stored while it was on, as if absent.
Parameters
Path parameters
| Name | Required | Description |
|---|---|---|
| id | required |
Header parameters
| Name | Required | Description |
|---|---|---|
| Idempotency-Key | required | Client-chosen. An identical retry with the same key returns the stored response; reusing the key with a different payload returns 409. |
| X-Rigid-Acting-Person | optional |
Request body
+ show properties− hide properties
Example
curl -X POST https://api.rigid.fi/v1/businesses/{id}/sweep \
-H "Authorization: Bearer $RIGID_API_TOKEN" \
-H "Content-Type: application/json" \
-H "Idempotency-Key: $(uuidgen)" \
-d '{
"amount": {
"amount": "string",
"currency": "EUR"
}
}'Responses
200The stored sweep, answered again for a retry of its key.
+ show properties− hide properties
201The sweep.
+ show properties− hide properties
400Validation error
401Authentication required
403Forbidden — the caller may not act on this programme, or (code `live_mode_card_read_only`) live mode refuses a business sweep, pending scheme certification
404Business not found, or the business routes are not released
409business_not_disabled; business_closed; no_funding_account; sweep_active_holds; sweep_not_full_balance; no_programme_float; module_not_enabled; or idempotency_key_reused, the Idempotency-Key used with a different payload
500Internal server error