Liquidating positions of an account
You can initiate a liquidation of an account by
POST /accounts/{account_id}/liquidations
Example request
{
"user_id": "7c9dc9d0-8953-42f9-9b5e-f602a6201577"
}
An account_liquidation_id
will be returned as a response. You can use this ID to track the progress of the liquidation and assign the resulting individual orders as described below.
For more information, see the 'Orders' guide.
Webhooks
A webhook is sent for each state transition that the liquidation undergoes in its lifecycle.
Example webhook
{
"id": "56510309-d9de-4730-9b5b-4a0ed047f3a9",
"created_at": "2021-07-21T14:10:00.00Z",
"type": "ACCOUNT_LIQUIDATION.NEW",
"object": {
"id": "b2f541dc-a27b-4d5a-b970-41812b0892b9",
"created_at": "2021-07-21T14:10:00.000Z",
"updated_at": "2021-07-21T14:10:00.000Z",
"account_id": "debf2026-f2da-4ff0-bb84-92e45babb1e3",
"user_id": "81dfb00e-9be6-4617-8994-dfd0407f34df",
"cash_amount": "1000",
"currency": "EUR",
"status": "NEW",
"orders": []
},
"webhook_id": "b838bde5-b6df-4f1f-bfc4-71d3fb01d430"
}
WARNING
Webhooks notify you of events in business processes, not the success or failure of the initialisation of those processes.
Please be sure to check the HTTP status of the response to your requests and handle failure cases appropriately.
Was this page helpful?