- | ----------------------------------------- | --------------------------------------------------- |
| code | string | Status Code |
| data | [PageDataAccount](#schemapagedataaccount) | Generic Paginated Response |
| errorParam | object | Error Parameters |
| requestTime | string(timestamp) | Server Request Time |
| responseTime | string(timestamp) | Server Response Time |
| traceId | string | Trace ID for request tracing and support follow-up. |
### GenericPaginatedResponse
| Name | Type | Description |
| ------------------ | ---------------------------- | ----------------------------------------------------------------- |
| dataList | \[[Account](#schemaaccount)] | Data List |
| nextPageOffsetData | string | Offset token for the next page. Empty when there is no next page. |
### CollateralRecord
| Name | Type | Description |
| ------------ | ---------------------------------- | --------------------------------------------------- |
| code | string | Status Code |
| data | \[[Collateral](#schemacollateral)] | Response Data |
| errorParam | object | Error Parameters |
| requestTime | string(timestamp) | Server Request Time |
| responseTime | string(timestamp) | Server Response Time |
| traceId | string | Trace ID for request tracing and support follow-up. |
### CollateralTransactionRecord
| Name | Type | Description |
| ------------ | -------------------------------------------------------- | --------------------------------------------------- |
| code | string | Status Code |
| data | \[[CollateralTransaction](#schemacollateraltransaction)] | Response Data |
| errorParam | object | Error Parameters |
| requestTime | string(timestamp) | Server Request Time |
| responseTime | string(timestamp) | Server Response Time |
| traceId | string | Trace ID for request tracing and support follow-up. |
### CollateralTransactionDetails
| Name | Type | Description |
| ---------------------- | --------------- | --------------------------------------- |
| id | string(int64) | Unique Identifier |
| userId | string(int64) | User ID |
| accountId | string(int64) | Account ID |
| coinId | string(int64) | Coin ID |
| type | string | Detail Type |
| deltaAmount | string(decimal) | Collateral Change Amount |
| deltaLegacyAmount | string(decimal) | Legacy Balance Change Amount |
| beforeAmount | string(decimal) | Collateral Amount Before Change |
| beforeLegacyAmount | string(decimal) | Legacy Balance Amount Before Change |
| fillCloseSize | string(decimal) | Transaction Close Size |
| fillCloseValue | string | Transaction Close Value |
| fillCloseFee | string | Transaction Close Fee |
| fillOpenSize | string(decimal) | Transaction Open Size |
| fillOpenValue | string | Transaction Open Value |
| fillOpenFee | string | Transaction Open Fee |
| fillPrice | string(decimal) | Transaction Price |
| liquidateFee | string(decimal) | Liquidation Fee |
| realizePnl | string(decimal) | Realized Profit and Loss |
| isLiquidate | boolean | Is Liquidation |
| isDeleverage | boolean | Is Auto-Deleveraging |
| fundingTime | string(int64) | Funding Settlement Time |
| fundingRate | string(decimal) | Funding Rate |
| fundingIndexPrice | string(decimal) | Funding Index Price |
| fundingOraclePrice | string(decimal) | Funding Oracle Price |
| fundingPositionSize | string(decimal) | Position Size During Funding Settlement |
| depositId | string(int64) | Deposit Order ID |
| withdrawId | string(int64) | Withdrawal Order ID |
| transferInId | string(int64) | Transfer In Order ID |
| transferOutId | string(int64) | Transfer Out Order ID |
| transferReason | string | Transfer Reason |
| orderId | string(int64) | Order ID |
| orderFillTransactionId | string(int64) | Order Fill Transaction ID |
| orderAccountId | string(int64) | Order Account ID |
| positionContractId | string(int64) | Position Contract ID |
| positionTransactionId | string(int64) | Position Transaction ID |
| forceWithdrawId | string | Force Withdrawal Order ID |
| forceTradeId | string | Force Trade ID |
| extraType | string | Extra Type |
| extraDataJson | string | Extra Data |
| censorStatus | string | Current Censoring Status |
| censorTxId | string(int64) | Censoring Processing Sequence Number |
| censorTime | string(int64) | Censoring Processing Time |
| censorFailCode | string | Censoring Failure Code |
| censorFailReason | string | Censoring Failure Reason |
| l2TxId | string(int64) | L2 Push Transaction ID |
| l2RejectTime | string(int64) | L2 Rejection Time |
| l2RejectCode | string | L2 Rejection Error Code |
| l2RejectReason | string | L2 Rejection Reason |
| l2ApprovedTime | string(int64) | L2 Batch Verification Time |
| createdTime | string(int64) | Creation Time |
| updatedTime | string(int64) | Update Time |
#### Enumerated Values
| Property | Value |
| -------------- | --------------------------------------- |
| type | UNKNOWN\_COLLATERAL\_TRANSACTION\_TYPE |
| type | DEPOSIT |
| type | WITHDRAW |
| type | TRANSFER\_IN |
| type | TRANSFER\_OUT |
| type | POSITION\_BUY |
| type | POSITION\_SELL |
| type | POSITION\_FUNDING |
| type | FILL\_FEE\_INCOME |
| type | BUG\_FIX\_COLLATERAL\_TRANSACTION\_TYPE |
| type | UNRECOGNIZED |
| transferReason | UNKNOWN\_TRANSFER\_REASON |
| transferReason | USER\_TRANSFER |
| transferReason | FAST\_WITHDRAW |
| transferReason | CROSS\_DEPOSIT |
| transferReason | CROSS\_WITHDRAW |
| transferReason | UNRECOGNIZED |
| censorStatus | UNKNOWN\_TRANSACTION\_STATUS |
| censorStatus | INIT |
| censorStatus | CENSOR\_SUCCESS |
| censorStatus | CENSOR\_FAILURE |
| censorStatus | L2\_APPROVED |
| censorStatus | L2\_REJECT |
| censorStatus | L2\_REJECT\_APPROVED |
| censorStatus | UNRECOGNIZED |
### CollateralTransactionRecord
| Name | Type | Description |
| ------------ | --------------------------------------------------------------------- | --------------------------------------------------- |
| code | string | Status Code |
| data | [PageDataCollateralTransaction](#schemapagedatacollateraltransaction) | Generic Paginated Response |
| errorParam | object | Error Parameters |
| requestTime | string(timestamp) | Server Request Time |
| responseTime | string(timestamp) | Server Response Time |
| traceId | string | Trace ID for request tracing and support follow-up. |
### CollateralTransactionPage
| Name | Type | Description |
| ------------------ | -------------------------------------------------------- | ----------------------------------------------------------------- |
| dataList | \[[CollateralTransaction](#schemacollateraltransaction)] | Data List |
| nextPageOffsetData | string | Offset token for the next page. Empty when there is no next page. |
### PositionRecord
| Name | Type | Description |
| ------------ | ------------------------------ | --------------------------------------------------- |
| code | string | Status Code |
| data | \[[Position](#schemaposition)] | Response Data |
| errorParam | object | Error Parameters |
| requestTime | string(timestamp) | Server Request Time |
| responseTime | string(timestamp) | Server Response Time |
| traceId | string | Trace ID for request tracing and support follow-up. |
### PositionTermRecord
| Name | Type | Description |
| ------------ | --------------------------------------------------- | --------------------------------------------------- |
| code | string | Status Code |
| data | [PageDataPositionTerm](#schemapagedatapositionterm) | Generic Paginated Response |
| errorParam | object | Error Parameters |
| requestTime | string(timestamp) | Server Request Time |
| responseTime | string(timestamp) | Server Response Time |
| traceId | string | Trace ID for request tracing and support follow-up. |
### PositionTermPage
| Name | Type | Description |
| ------------------ | -------------------------------------- | ----------------------------------------------------------------- |
| dataList | \[[PositionTerm](#schemapositionterm)] | Data List |
| nextPageOffsetData | string | Offset token for the next page. Empty when there is no next page. |
### PositionTermPayload
| Name | Type | Description |
| --------------- | -------------- | -------------------------- |
| userId | string | User ID |
| accountId | string | Account ID |
| coinId | string | Collateral Coin ID |
| contractId | string | Contract ID |
| termCount | integer(int32) | Term Count |
| cumOpenSize | string | Cumulative Open Size |
| cumOpenValue | string | Cumulative Open Value |
| cumOpenFee | string | Cumulative Open Fee |
| cumCloseSize | string | Cumulative Close Size |
| cumCloseValue | string | Cumulative Close Value |
| cumCloseFee | string | Cumulative Close Fee |
| cumFundingFee | string | Cumulative Funding Fee |
| cumLiquidateFee | string | Cumulative Liquidation Fee |
| createdTime | string(int64) | Creation Time |
| updatedTime | string(int64) | Update Time |
| currentLeverage | string | Leverage at Close |
### PositionTransactionRecord
| Name | Type | Description |
| ------------ | ---------------------------------------------------- | --------------------------------------------------- |
| code | string | Status Code |
| data | \[[PositionTransaction](#schemapositiontransaction)] | Response Data |
| errorParam | object | Error Parameters |
| requestTime | string(timestamp) | Server Request Time |
| responseTime | string(timestamp) | Server Response Time |
| traceId | string | Trace ID for request tracing and support follow-up. |
### PositionTransactionPayload
| Name | Type | Description |
| ----------------------- | ------------- | --------------------------------------- |
| id | string(int64) | Unique Identifier |
| userId | string(int64) | User ID |
| accountId | string(int64) | Account ID |
| coinId | string(int64) | Collateral Coin ID |
| contractId | string(int64) | Contract ID |
| type | string | Detail Type |
| deltaOpenSize | string | Change in Open Size |
| deltaOpenValue | string | Change in Open Value |
| deltaOpenFee | string | Change in Open Fee |
| deltaFundingFee | string | Change in Funding Fee |
| beforeOpenSize | string | Open Size Before Change |
| beforeOpenValue | string | Open Value Before Change |
| beforeOpenFee | string | Open Fee Before Change |
| beforeFundingFee | string | Funding Fee Before Change |
| fillCloseSize | string | Transaction Close Size |
| fillCloseValue | string | Transaction Close Value |
| fillCloseFee | string | Transaction Close Fee |
| fillOpenSize | string | Transaction Open Size |
| fillOpenValue | string | Transaction Open Value |
| fillOpenFee | string | Transaction Open Fee |
| fillPrice | string | Transaction Price |
| liquidateFee | string | Liquidation Fee |
| realizePnl | string | Realized Profit and Loss |
| isLiquidate | boolean | Is Liquidation |
| isDeleverage | boolean | Is Auto-Deleveraging |
| fundingTime | string(int64) | Funding Settlement Time |
| fundingRate | string | Funding Rate |
| fundingIndexPrice | string | Funding Index Price |
| fundingOraclePrice | string | Funding Oracle Price |
| fundingPositionSize | string | Position Size During Funding Settlement |
| orderId | string(int64) | Order ID |
| orderFillTransactionId | string(int64) | Order Fill Transaction ID |
| collateralTransactionId | string(int64) | Collateral Transaction ID |
| forceTradeId | string | Force Trade ID |
| extraType | string | Extra Type |
| extraDataJson | string | Extra Data |
| censorStatus | string | Current Censoring Status |
| censorTxId | string(int64) | Censoring Processing Sequence Number |
| censorTime | string(int64) | Censoring Processing Time |
| censorFailCode | string | Censoring Failure Code |
| censorFailReason | string | Censoring Failure Reason |
| l2TxId | string(int64) | L2 Push Transaction ID |
| l2RejectTime | string(int64) | L2 Rejection Time |
| l2RejectCode | string | L2 Rejection Error Code |
| l2RejectReason | string | L2 Rejection Reason |
| l2ApprovedTime | string(int64) | L2 Batch Verification Time |
| createdTime | string(int64) | Creation Time |
| updatedTime | string(int64) | Update Time |
#### Enumerated Values
| Property | Value |
| ------------ | ------------------------------------- |
| type | UNKNOWN\_POSITION\_TRANSACTION\_TYPE |
| type | BUY\_POSITION |
| type | SELL\_POSITION |
| type | SETTLE\_FUNDING\_FEE |
| type | BUG\_FIX\_POSITION\_TRANSACTION\_TYPE |
| type | UNRECOGNIZED |
| censorStatus | UNKNOWN\_TRANSACTION\_STATUS |
| censorStatus | INIT |
| censorStatus | CENSOR\_SUCCESS |
| censorStatus | CENSOR\_FAILURE |
| censorStatus | L2\_APPROVED |
| censorStatus | L2\_REJECT |
| censorStatus | L2\_REJECT\_APPROVED |
| censorStatus | UNRECOGNIZED |
### PositionTransactionPageResult
| Name | Type | Description |
| ------------ | ----------------------------------------------------------------- | --------------------------------------------------- |
| code | string | Status Code |
| data | [PageDataPositionTransaction](#schemapagedatapositiontransaction) | Generic Paginated Response |
| errorParam | object | Error Parameters |
| requestTime | string(timestamp) | Server Request Time |
| responseTime | string(timestamp) | Server Response Time |
| traceId | string | Trace ID for request tracing and support follow-up. |
### PositionTransactionPage
| Name | Type | Description |
| ------------------ | ---------------------------------------------------- | ----------------------------------------------------------------- |
| dataList | \[[PositionTransaction](#schemapositiontransaction)] | Data List |
| nextPageOffsetData | string | Offset token for the next page. Empty when there is no next page. |
## POST Update Leverage Setting
POST /api/v2/private/account/updateLeverageSetting
Update leverage setting for trading account.
### Request Parameters
| Name | Type | Required | Description |
| ---------- | ------------- | -------- | ----------------------------------------------------------------- |
| accountId | string(int64) | Yes | Account ID |
| contractId | string(int64) | Yes | Contract ID. If 0, updates the account's default leverage setting |
| leverage | string | Yes | Leverage multiplier (e.g., "10", "20", "50") |
> Request Example
```json
{
"accountId": "543429922991899150",
"contractId": "10000001",
"leverage": "50"
}
```
> Response Example
> 200 Response
```json
{
"code": "SUCCESS",
"data": null,
"msg": null,
"errorParam": null,
"requestTime": "1734661416266",
"responseTime": "1734661416277",
"traceId": "a87a52a4e189045b7b7b9948ea7b5c54"
}
```
### Response
| Status Code | Status Code Description | Description | Data Model |
| ----------- | ------------------------------------------------------- | ----------- | --------------------- |
| 200 | [OK](https://tools.ietf.org/html/rfc7231#section-6.3.1) | Success | [Result](#resultvoid) |
**Notes:**
* This is a new endpoint added in V2
* Leverage setting affects margin requirements and liquidation risk
* Contract-specific leverage overrides account default leverage
* Setting contractId=0 updates the default leverage for all contracts
## POST Set Margin Mode
POST /api/v2/private/account/setMarginMode
Switch the margin mode for a contract position between cross margin and isolated margin.
### Request Parameters
| Name | Type | Required | Description |
| ------------ | ------------- | -------- | ---------------------------------------------------------------- |
| accountId | string(int64) | Yes | Account ID |
| contractId | string(int64) | Yes | Contract ID |
| marginMode | string | Yes | Margin mode. `0` = cross margin, `1` = isolated margin |
| l2Nonce | string(int64) | Yes | L2 signature nonce |
| l2ExpireTime | string(int64) | Yes | L2 signature expiration timestamp in milliseconds |
| signer | string | Yes | Signer address used for the L2 signature |
| l2Signature | string | Yes | EIP-712 L2 signature as a `0x`-prefixed 132-character hex string |
> Request Example
```json
{
"accountId": "543429922991899150",
"contractId": "10000001",
"marginMode": "1",
"l2Nonce": "123456",
"l2ExpireTime": "1719212400000",
"signer": "0xFCAd0B19bB29D4674531d6f115237E16AfCE377c",
"l2Signature": "0x1111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111"
}
```
> Response Example
> 200 Response
```json
{
"code": "SUCCESS",
"data": null,
"msg": null,
"errorParam": null,
"requestTime": "1734661416266",
"responseTime": "1734661416277",
"traceId": "a87a52a4e189045b7b7b9948ea7b5c54"
}
```
### Response
| Status Code | Status Code Description | Description | Data Model |
| ----------- | ------------------------------------------------------- | ----------- | --------------------- |
| 200 | [OK](https://tools.ietf.org/html/rfc7231#section-6.3.1) | Success | [Result](#resultvoid) |
**Notes:**
* This endpoint requires both standard private REST authentication and an additional EIP-712 L2 signature.
* The L2 typed-data payload used by the Python SDK signs `accountId`, `assetId` (`contractId`), `marginMode`, `nonce`, and `signer`.
* The Python SDK uses the `trading private key` for `setMarginMode`, not the wallet private key.
* Only `0` and `1` are accepted for `marginMode`; other values return `GATEWAY_PARAM_INVALID`.
## GET Get Position Orders
GET /api/v2/private/account/getPositionOrders
Get historical orders associated with a specific position term.
### Request Parameters
| Name | Type | Required | Description |
| ---------- | ------------- | -------- | ----------------------------------------- |
| accountId | string(int64) | Yes | Account ID |
| contractId | string(int64) | Yes | Contract ID |
| termCount | integer | Yes | Position term count |
| page | integer | No | Page number, must be ≥1. Default: 1 |
| pageSize | integer | No | Items per page, range: 1-100. Default: 20 |
> Response Example
> 200 Response
```json
{
"code": "SUCCESS",
"data": {
"page": 1,
"pageSize": 20,
"total": 5,
"orderList": [
{
"id": "564809510842007822",
"userId": "543429922866069763",
"accountId": "543429922991899150",
"coinId": "1000",
"contractId": "10000001",
"type": "LIMIT",
"side": "BUY",
"price": "96813.2",
"size": "0.001",
"unfillSize": "0.000",
"executedSize": "0.001",
"executedValue": "96.8132",
"executedFee": "0.048406",
"executedAvgPrice": "96813.2",
"status": "FILLED",
"timeInForce": "GTC",
"expireTime": "1734747481049",
"clientOrderId": "client123",
"reduceOnly": false,
"postOnly": false,
"hidden": false,
"createdTime": "1734661081049",
"updatedTime": "1734661081053"
}
]
},
"msg": null,
"errorParam": null,
"requestTime": "1734661416266",
"responseTime": "1734661416277",
"traceId": "a87a52a4e189045b7b7b9948ea7b5c54"
}
```
### Response
| Status Code | Status Code Description | Description | Data Model |
| ----------- | ------------------------------------------------------- | ----------- | --------------------------------------- |
| 200 | [OK](https://tools.ietf.org/html/rfc7231#section-6.3.1) | Success | [Result](#resultpositionorderpagemodel) |
### PositionOrderPageResult
| Name | Type | Description |
| ------------ | ------------------------------------------------------- | --------------------------------------------------- |
| code | string | Status Code |
| data | [PositionOrderPageModel](#schemapositionorderpagemodel) | Position Order Page Data |
| errorParam | object | Error Parameters |
| requestTime | string(timestamp) | Server Request Time |
| responseTime | string(timestamp) | Server Response Time |
| traceId | string | Trace ID for request tracing and support follow-up. |
### PositionOrderPagePayload
| Name | Type | Description |
| --------- | ------------------------ | ------------ |
| page | integer | Current Page |
| pageSize | integer | Page Size |
| total | integer | Total Count |
| orderList | \[[Order](#schemaorder)] | Order List |
**Notes:**
* This is a new endpoint added in V2
* Returns all orders that affected the specified position term
* Useful for tracking which orders opened, increased, or closed a 프로젝트로 돌아가기