Skip to main content

Create Subaccount

Creates a new subaccount under your master account and returns its credentials.

MethodPOST
Path/dma/api/v1/master/subaccount/create
AuthAuthenticated (master account API key).

No request body is required.

Request

from reference_client import sign_request, BASE_URL
import requests

headers, path = sign_request("POST", "/dma/api/v1/master/subaccount/create")
r = requests.post(BASE_URL + path, headers=headers)
print(r.json())

Response

{
"message": "Subaccount successfully created and linked to master",
"data": {
"api_key": "cs_live_subaccount_key_abc...",
"api_secret": "subaccount_secret_xyz...",
"subaccount_id": 1001
}
}
FieldTypeDescription
data.api_keystringCoinSwitch API key for the new subaccount.
data.api_secretstringCoinSwitch API secret for the new subaccount. Store securely.
data.subaccount_idinteger (int64)Unique identifier for the subaccount — use this in all subsequent API calls.

Errors

StatusMessageCause
401X-Auth-Apikey header is requiredMissing authentication headers.
401invalid or expired API keyAPI key validation failed.
403user is not registered as a master accountCaller is not a registered master.
403this API key is not authorized...Subaccount API key used instead of master.
500internal server errorUnexpected failure.