Skip to main content

Archive Dealer

Archive a dealer permanently.

Endpoint

POST /api/v3/fermata/dealer/archive

Description

Archives a dealer, permanently stopping all operations. All open positions must be closed before archiving. This is a terminal state. Admin only.

Authentication

Requires Bearer token authentication with admin role.

Authorization: Bearer {access_token}

Request Body

FieldTypeRequiredDescription
dealerAccountIdstringYesDealer account ID to archive

Response

Returns the updated dealer object with status: "ARCHIVED".

Usage

import requests

headers = {"Authorization": f"Bearer {access_token}"}

response = requests.post(
"https://cadenza-api.algo724.com/api/v3/fermata/dealer/archive",
headers=headers,
json={"dealerAccountId": "550e8400-e29b-41d4-a716-446655440000"}
)

dealer = response.json()["data"]
print(f"Dealer {dealer['name']} is now {dealer['status']}")
curl -X POST https://cadenza-api.algo724.com/api/v3/fermata/dealer/archive \
-H "Authorization: Bearer eyJhbGciOiJIUzI1NiIs..." \
-H "Content-Type: application/json" \
-d '{"dealerAccountId": "550e8400-e29b-41d4-a716-446655440000"}'

Example Response

{
"data": {
"dealerAccountId": "550e8400-e29b-41d4-a716-446655440000",
"name": "Main Dealer",
"status": "ARCHIVED",
"baseCurrencies": ["USDT", "USDC"],
"riskThreshold": "1000000",
"linkedAccountIds": [],
"config": {},
"createdAt": 1711929600000,
"createdAtDateTime": "2025-04-01T00:00:00.000Z",
"updatedAt": 1711931400000,
"updatedAtDateTime": "2025-04-01T00:30:00.000Z"
},
"success": true,
"errno": 0,
"error": null
}

Error Responses

HTTP CodeErrorDescription
400Invalid requestDealer has open positions or is already archived
401UnauthorizedInvalid or expired access token
403ForbiddenRequires admin role
404Not foundDealer not found

Example Error

{
"data": null,
"success": false,
"errno": -130006,
"error": "Cannot archive dealer with open positions"
}

Notes

  • Archiving is permanent -- an archived dealer cannot be reactivated
  • All open positions must be closed and hedges settled before archiving
  • The dealer's wallet and transaction history are preserved for audit purposes
  • Linked exchange accounts are automatically unlinked on archive