Unlink Exchange Account
Unlink an exchange trading account from a dealer.
Endpoint
POST /api/v3/fermata/dealer/unlink
Description
Removes the link between an exchange trading account and a dealer. The account will no longer be used for hedging. Admin only.
Authentication
Requires Bearer token authentication with admin role.
Authorization: Bearer {access_token}
Request Body
| Field | Type | Required | Description |
|---|---|---|---|
dealerAccountId | string | Yes | Dealer account ID |
tradingAccountId | string | Yes | Exchange trading account ID to unlink |
Response
Returns a simple success response.
Usage
import requests
headers = {"Authorization": f"Bearer {access_token}"}
response = requests.post(
"https://cadenza-api.algo724.com/api/v3/fermata/dealer/unlink",
headers=headers,
json={
"dealerAccountId": "550e8400-e29b-41d4-a716-446655440000",
"tradingAccountId": "660e8400-e29b-41d4-a716-446655440001"
}
)
print(response.json())
curl -X POST https://cadenza-api.algo724.com/api/v3/fermata/dealer/unlink \
-H "Authorization: Bearer eyJhbGciOiJIUzI1NiIs..." \
-H "Content-Type: application/json" \
-d '{
"dealerAccountId": "550e8400-e29b-41d4-a716-446655440000",
"tradingAccountId": "660e8400-e29b-41d4-a716-446655440001"
}'
Example Response
{
"data": "ok",
"success": true,
"errno": 0,
"error": null
}
Error Responses
| HTTP Code | Error | Description |
|---|---|---|
| 400 | Invalid request | Account not linked or has open hedge positions |
| 401 | Unauthorized | Invalid or expired access token |
| 403 | Forbidden | Requires admin role |
| 404 | Not found | Dealer or trading account not found |
Example Error
{
"data": null,
"success": false,
"errno": -130008,
"error": "Cannot unlink account with open hedge positions"
}
Notes
- Cannot unlink if the account has open hedge positions -- settle them first
- If this is the dealer's last linked account, the dealer will not be able to generate quotes
- The exchange wallet history is preserved for audit