Close a business
/v1/businesses/{id}/closeRequires an API client bearer token.
Closes a disabled business, one way: a business closes only after it is disabled (409 business_not_disabled) and holds no money. When it has an account, the close first sweeps it at zero: the ledger refuses while the posted balance is not zero or a hold on it is active (409 business_balance_not_zero; sweep the business first), a programme with no float in the account's currency is 409 no_programme_float, and a sweep that succeeds seals the account against any later credit. Every call the route decides (the release flag on, a well-formed body, and a valid Idempotency-Key not already used with a different body), allowed or refused, writes one audit intent with the API client, the asserted person, the business and the decision; a replay of a stored outcome writes none, and neither does a 5xx. Requires an Idempotency-Key. Emits business.closed, and card_grant.ended per ended grant. An API client names its acting person in X-Rigid-Acting-Person (400 acting_person_required without it); the person needs an active membership of the business with role admin, else 403 acting_person_not_permitted. 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 |
Example
curl -X POST https://api.rigid.fi/v1/businesses/{id}/close \
-H "Authorization: Bearer $RIGID_API_TOKEN" \
-H "Idempotency-Key: $(uuidgen)"Responses
200The closed business.
+ show properties− hide properties
One of
Option 1
{
"type": "string",
"enum": [
"test_mode",
"customer_attested"
]
}Option 2
{
"type": "null"
}Option 3
{
"type": "null"
}400Validation error
401Authentication required
403Forbidden
404Business not found, or the business routes are not released
409Idempotency-Key reused with a different payload; business_not_disabled; business_closed; business_balance_not_zero; no_programme_float
500Internal server error
502The ledger failed the close sweep