Accounts: General
Close Account
Changed onInitiates closure of a customer account. Closure runs asynchronously: a successful call starts the offboarding process and returns the account with its current status (still opened); the status transitions to closed once offboarding completes.
If the account has open blockers (active positions, a remaining cash balance, or overdue fees), it remains opened with offboarding checks in action_required and does not close until those are resolved. The outstanding actions are available as offboarding checks on the account.
The endpoint is idempotent: calling it again while a closure is in progress, or on an already closed account, returns 200 without starting a new closure.
post/accounts/{account_id}/close
Request
- Base URLhttps://sandbox.api.lemon.markets/v1
- AuthHTTP bearer
- TypeScriptA function with typed inputs. Its response is checked against the schema.
Path parameters
account_idstring required
An account identifier.
Headers
LMG-Data-Privacy-Access-Principalstring required
LMG-Data-Privacy-Access-Justificationstring required
Request body
Example request
{
"reason": "customer_request"
}Response
Successful Response
Example response
{
"id": "cusa_c2c3f89ec0524b6e818ce00c16e4897f",
"customer": {
"id": "pers_f1e3a7f504414b5e99041ebc1c0f55cd",
"firstname": "Erika",
"lastname": "Mustermann",
"date_of_birth": "1964-08-13",
"place_of_birth": {
"city": "Berlin",
"country": "DE"
},
"nationalities": [
"DE"
],
"phone_number": "+49172997318",
"email": "erika.mustermann@example.com",
"registered_address": {
"line_1": "Heidestraße 17",
"postal_code": "51147",
"city": "Köln",
"country": "DE"
},
"tax_residencies": [
{
"country": "DE"
}
]
},
"history": [
{
"status": "created",
"timestamp": "2023-06-23T07:29:55.465000+00:00"
}
],
"agreements": [
{
"agreement": "agr_9902271f791d413aad781763c61b9bb0",
"accepted_at": "2023-06-29T14:39:29Z",
"person": "per_3a0baf04657b4fb9bcaa03d8120b5e9e"
},
{
"agreement": "agr_8ec894e1ec764a339e172292dff9aeff",
"accepted_at": "2023-06-29T14:39:29Z",
"person": "per_3a0baf04657b4fb9bcaa03d8120b5e9e"
}
]
}Changes
- info
endpoint added
- info