---
title: "Create sub-account for a customer."
method: POST
path: "/ledger/subaccounts"
tags: ["ledger-sub-accounts"]
---

# Create sub-account for a customer.

`POST /ledger/subaccounts`

This endpoint helps to create sub-accounts for a customer. The endpoint requires the main account ID to create a sub-account under it.

## Request body

- CreateSubAccountRequest — Request to create a sub-account under a main account.
  - `accountId` string, uuid, required — The main account ID under which the sub-account will be created.
  - `reference` string, required — A unique reference for the sub-account. This must be unique across all sub-accounts.
  - `displayName` string — An optional name for the sub-account.

## Response `201`

Sub-account created Successfully

- SubAccount
  - `id` string, uuid, required — Unique sub-account ID
  - `accountId` string, uuid, required — The main account ID to which this sub-account belongs.
  - `displayName` string — An optional name for the sub-account.
  - `reference` string, required — A unique reference for the sub-account.
  - `currency` string, required — Currency of the sub-account
  - `accountBalance` AccountBalanceDetails, required — Account balance details
    - `balance` number — The actual ledger balance of the account
    - `availableBalance` number — The available balance for spending
  - `frozen` boolean, required — Indicates if the sub-account is frozen (locked) or not.
  - `createdDate` string, date-time, required — The date the sub-account was created.

## 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)
