Skip to main content
The subaccount creation process follows the below steps.
  1. The main account must authorize the creation of a subaccount under its control
  2. The subaccount must consent to being controlled by the main account
  3. The API server must verify both signatures to prevent unauthorized subaccount creation
Valid addresses must be used in order to establish main/subaccount relationships via API:
  • Neither account can be a subaccount of another account.
  • The subaccount address cannot have any deposit/trade history
Please refer to the Python SDK for a comprehensive guide on subaccount creation via API
POST /api/v1/account/subaccount/create

Request Body

FieldTypeNeedDescriptionExample
”main_account”stringrequiredMain account wallet address42trU9A5…
“subaccount”stringrequiredSubaccount wallet address69trU9A5…
“timestamp”integerrequiredCurrent timestamp in milliseconds1716200000000
”main_signature”stringrequiredMain account signature5j1Vy9Uq…
“sub_signature”stringrequiredSubaccount signature4k2Wx8Zq…
“expiry_window”integeroptionalSignature expiry in milliseconds30000
{
  "main_account": "42trU9A5...",
  "subaccount": "69trU9A5...",
  "main_signature": "5j1Vy9Uq...",
  "sub_signature": "4k2Wx8Zq...",
  "timestamp": 1716200000000,
  "expiry_window": 30000
}

Response

  • Status 200: Subaccount created successfully
{
  "success": true,
  "data": null,
  "error": null,
  "code": null,
}
  • Status 400: Bad request
{
  "success": false,
  "data": null,
  "error": "Account already exists: CRTxBM...",
  "code": 2
}
  • Status 500: Internal server error