---
title: "Delete sub-account by sub-account ID."
method: DELETE
path: "/ledger/subaccounts/{subAccountIdRef}"
tags: ["ledger-sub-accounts"]
---

# Delete sub-account by sub-account ID.

`DELETE /ledger/subaccounts/{subAccountIdRef}`

This endpoint deletes sub-account by sub-account ID. The sub-account must have zero balance before it can be deleted.
The endpoint will return an error if the sub-account has a non-zero balance. The funds in the sub-account must be transferred to another account before deletion.
Once an account is deleted, it cannot be recovered, and a new sub-account must be created if needed.
The address associated with the sub-account will also be deleted upon successful deletion of the sub-account.

## Path parameters

- `subAccountIdRef` string, required

## Response `200`

Sub-account deleted Successfully

- StatusDto — Status data, check additional message field.
  - `success` boolean, required — Status can be successful or failed, a value of true indicates success.
  - `message` string — additional message describing status.
  - `data` object — Data associated with the status, this will not always be present
  - `error` ErrorMessageDto — Default error object for services. This gives consistent error object that all services may use.
    - `code` string, required — Error code
    - `message` string, required — Descriptive error message
    - `data` object — Additional data for this error message.

## Other responses

- `400` — Request could not be validated
- `401` — Client is not authorized to make request
- `403` — Expected permission is not available.
- `404` — Entity was not found
- `default` — Internal Server Error

---

[API](https://skmtc.net/nestechops/apis/onboard-external-api-gateway.md) · [All operations](https://skmtc.net/nestechops/apis/onboard-external-api-gateway/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/nestechops/onboard-external-api-gateway/versions/29661adc1ffc/schema)
