GetAllocationKeyDetails

class saxo_openapi.endpoints.trading.allocationkeys.GetAllocationKeyDetails(AllocationKeyId)

Get detailed information about an allocation key.

ENDPOINT = 'openapi/trade/v1/allocationkeys/{AllocationKeyId}'
EXPECTED_STATUS = 200
METHOD = 'GET'
__init__(AllocationKeyId)

Instantiate a GetAllocationKeyDetails request.

Parameters:AllocationKeyId (string (required)) – the allocation key id.
>>> import saxo_openapi
>>> import saxo_openapi.endpoints.trading as tr
>>> import json
>>> client = saxo_openapi.API(access_token=...)
>>> AllocationKeyId = 227
>>> r = tr.allocationkeys.GetAllocationKeyDetails(
...     AllocationKeyId=AllocationKeyId)
>>> client.request(r)
>>> print(json.dumps(r.response, indent=4))

Output:

{
  "AllocationKeyId": "227",
  "AllocationKeyName": "MyAllocation_Key",
  "AllocationUnitType": "Percentage",
  "MarginHandling": "Reduce",
  "OwnerAccountKey": "LZTc7DdejXODf-WSl2aCyQ==",
  "ParticipatingAccountsInfo": [
    {
      "AcceptRemainderAmount": true,
      "AccountKey": "LZTc7DdejXODf-WSl2aCyQ==",
      "Priority": 1,
      "UnitValue": 10.0
    },
    {
      "AcceptRemainderAmount": false,
      "AccountKey": "LZTc7DdejXODf-WSl2aCyQ==",
      "Priority": 1,
      "UnitValue": 90.0
    }
  ],
  "Status": "Active"
}
expected_status
response

response - get the response of the request.

status_code