Problem
When submitting an Order using identity_id and identity_account_id, the API returns an InvalidIdentityAccountId
error.
Root cause
The given Identity is unauthorized to trade on behalf of the Account, resulting in a 400 error.
Solution
Using the REST API, ensure the Account is authorized to trade on behalf of the Identity by doing one of the following:
- Replace the Identity with an Identity authorized to trade using the Account and resubmit the Order.
- Update the Account to authorize the Identity to trade and resubmit the Order.
REST error example
The following Order returns a 400 InvalidIdentityAccountId
error:
Request Example:
POST https://api.paxos.com/v2/profiles/141de381-28d7-4284-bd3f-cad3746f4c22/orders
{
"ref_id":"20220224",
"side":"BUY",
"market":"BTCUSD",
"type":"LIMIT",
"base_amount":"1.00",
"price":"44713.50",
"time_in_force":"IOC",
"identity_id":"9da8edac-e13d-4f10-8148-fab9d9a964ca",
"identity_account_id":"a8e2c6ef-a2d3-49c7-83bd-46c2e788bc91"
}
Response Example:
{
"type":"about:blank",
"title":"Bad Request",
"status":400,
"detail":"InvalidIdentityAccountId"
}
FIX error example
The New Order message with tag 50 for Identity ID and 5047 for Account ID returns an error:
Request Example:
8=FIX.4.2 9=0339 35=D 49=CUSTOMER 56=ITBIT 34=00629198 52=20220224-13:54:17.581
50=9da8edac-e13d-4f10-8148-fab9d9a964ca 5047=a8e2c6ef-a2d3-49c7-83bd-46c2e788bc91
...
If the Account doesn't belong to this Identity or is unauthorized by this Account, InvalidIdentityAccountId
is reported in the response:
Response Example:
8=FIX.4.2 9=0471 35=8 49=ITBIT 56=CUSTOMER 34=1109903 52=20220224-13:54:17
50=9da8edac-e13d-4f10-8148-fab9d9a964ca 5047=a8e2c6ef-a2d3-49c7-83bd-46c2e788bc91
151=0 150=8 60=20220224-13:54:17.606 59=6 58=InvalidIdentityAccountId ...
This indicates that Identity 9da8edac-e13d-4f10-8148-fab9d9a964ca is not present as a member
of Account a8e2c6ef-a2d3-49c7-83bd-46c2e788bc91.
Error resolution
To enable trading for both REST and FIX, add the authorized Identity `identity_id` as an Account member using the Update Account REST API.
Note: The PUT request must provide the list of all members, not just new members. Otherwise existing members will be removed from the Account.
Use a PUT request to the Update Account REST API:
PUT https://api.paxos.com/v2/identity/accounts
{
"account": {
"id": "a8e2c6ef-a2d3-49c7-83bd-46c2e788bc91",
"members": [ {
"identity_id": "9da8edac-e13d-4f10-8148-fab9d9a964ca",
"roles": ["AUTHORIZED_USER"]
}]
}
}