Skip to content

Sweep a disabled business

POST/v1/businesses/{id}/sweep

Requires 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

NameRequiredDescription
idrequired

Header parameters

NameRequiredDescription
Idempotency-Keyrequired

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-Personoptional

Request body

amountobjectrequired
+ show properties
amountstringrequired
currency"EUR" | "GBP" | "USD"required

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

200

The stored sweep, answered again for a retry of its key.

business_idstring (uuid)required
transfer_idstringrequired
amountobjectrequired
+ show properties
amountstringrequired
currency"EUR" | "GBP" | "USD"required
replayedbooleanrequired
201

The sweep.

business_idstring (uuid)required
transfer_idstringrequired
amountobjectrequired
+ show properties
amountstringrequired
currency"EUR" | "GBP" | "USD"required
replayedbooleanrequired
400

Validation error

typestringrequired
titlestringrequired
statusintegerrequired
detailstring
instancestring
401

Authentication required

typestringrequired
titlestringrequired
statusintegerrequired
detailstring
instancestring
403

Forbidden — the caller may not act on this programme, or (code `live_mode_card_read_only`) live mode refuses a business sweep, pending scheme certification

typestringrequired
titlestringrequired
statusintegerrequired
detailstring
instancestring
404

Business not found, or the business routes are not released

typestringrequired
titlestringrequired
statusintegerrequired
detailstring
instancestring
409

business_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

typestringrequired
titlestringrequired
statusintegerrequired
detailstring
instancestring
500

Internal server error

typestringrequired
titlestringrequired
statusintegerrequired
detailstring
instancestring