Pacifica
  • Getting Started
    • Closed Alpha Guide
      • Link To Guide PDF
    • Closed Alpha Trading Competition
  • Trading on Pacifica
    • Overview
    • Contract Specifications
      • Oracle Price & Mark Price
      • Settlement Mechanism
    • Order Types
      • Market Order
      • Limit Order
      • Order Rules & Constraints
    • Margin & Leverage
    • Funding Rates
    • Liquidations
  • About Pacifica
  • API Documentation
    • API
      • REST API
        • Markets
          • Get market info
          • Get prices
          • Get kline (candle) data
          • Get recent trades
        • Account
          • Get account info
          • Get account settings
          • Update leverage
          • Update margin mode
          • Get positions
          • Get trade history
          • Get funding history
          • Get account equity history
          • Request withdrawal
        • Subaccounts
          • Create subaccount
          • Subaccount fund transfer
        • Orders
          • Get open orders
          • Get order history
          • Get order history by ID
          • Create order
          • Create stop order
          • Create position TP/SL
          • Cancel order
          • Cancel all orders
          • Cancel stop order
          • Batch order
      • Websocket
        • Subscriptions
          • Prices
          • Orderbook
          • Trades
          • Candle
          • Order updates
          • Account balance
          • Account margin
          • Account leverage
          • Account positions
          • Account orders
          • Account order updates
          • Account trades
        • Trading operations
          • Create order
          • Cancel order
          • Cancel all orders
      • Signing
        • Implementation
        • Operation Types
        • Error Handling
      • Rate limits
      • Tick and lot size
    • Specification
  • Other
    • Audits
    • Brand Assets
    • Contact Us
    • Glossary of Terms
Powered by GitBook
On this page
  1. API Documentation
  2. API
  3. REST API
  4. Subaccounts

Create subaccount

This endpoint allows regular accounts to create subaccounts with a secure authentication scheme. Both the main account and subaccount must sign to establish the relationship.

PreviousSubaccountsNextSubaccount fund transfer

Last updated 18 hours ago

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

Please refer to our for a comprehensive guide on subaccount creation via API

POST /api/v1/account/subaccount/create

Request Body

Field
Type
Need
Description
Example

"main_account"

string

required

Main account wallet address

42trU9A5...

"subaccount"

string

required

Subaccount wallet address

69trU9A5...

"timestamp"

integer

required

Current timestamp in milliseconds

1716200000000

"main_signature"

string

required

Main account signature

5j1Vy9Uq...

"sub_signature"

string

required

Subaccount signature

4k2Wx8Zq...

"expiry_window"

integer

optional

Signature expiry in milliseconds

30000

{
  "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

Code Example (Python)

Please refer to our for a comprehensive guide on subaccount creation via API

Python SDK
Python SDK