Pause / Unpause Account
API URL: POST https://userapi-demo.s2f.projectx.com/TradingAccount/setPaused
API Reference: /TradingAccount/setPaused
Description
Sets a Trading Account’s status to Paused. Paused states are useful for making adjustments to Trading Accounts (i.e. cash adjustments). When a Trading Account is paused, all open positions are liquidated and all working orders are canceled. The Trading Account will then be locked, preventing all trading until the account is unpaused.
Parameters
| Name | Type | Description | Required | Nullable |
|---|---|---|---|---|
| accountId | integer | The Trading Account's account id. | Required | false |
| paused | boolean | The pause state of the account. | Required | false |
Example Usage
Example Request
- Request
- cURL
{
"accountId": 10,
"paused": true
}
curl -X 'POST' \
'https://userapi-demo.s2f.projectx.com/TradingAccount/setPaused' \
-H 'accept: text/plain' \
-H 'Content-Type: application/json' \
-d '{
"accountId": 10,
"paused": true
}'
Example Response
- Success
- Error
0
// 0 = Success,
// 1 = AccountNotFound,
// 2 = AccountNotActive,
// 3 = AccountClosed,
// 4 = AlreadyPaused,
// 5 = AlreadyNotPaused,
// 6 = FailedToClosePositions,
// 7 = FailedToCloseOrders,
// 8 = LiveAccountsUnsupported
Error: response status is 401