Partner attribution
Broker → cTrader endpoints for managing the partnerId used in trader attribution. Authenticated with the Manager Token (see Authentication of API calls).
Set a partner identifier
Assigns a partner identifier from the broker's backend to an existing user or account in cTrader.
| Method | URL |
|---|---|
PUT | /oauth2/ctid/referral |
Request body
| Key | Required? | Data type | Description |
|---|---|---|---|
brokerCrmName | Yes | string | See broker identification. |
partnerId | Yes | string | The partner identifier string to assign. |
userId | No (required if assigning to a user) | integer | The unique ID of the user. |
ctidTraderAccountId | No (required if assigning to an account) | integer | The unique ID of the linkage between a user and a trading account. |
Include either userId or ctidTraderAccountId, depending on the entity the identifier is assigned to: userId if it is assigned to a user, ctidTraderAccountId if it is assigned to an account.
Expected status code
200
Errors
See Error codes.
Request example
curl -X PUT 'https://HOST:PORT/cid/oauth2/ctid/referral?token=04d95575-c9af-42fba72e-2f0ce93f01d4' -H 'Content-Type: application/json' -H 'Accept: application/json' -d '{"brokerCrmName": "BESTBROKERCRM", "ctidTraderAccountId": 9017800, "partnerId": "somePartnerId", "userId": 10345533}'
Read a partner identifier
Retrieves the partner identifier assigned to a specific user or account.
| Method | URL |
|---|---|
GET | /oauth2/ctid/referral |
Query parameters
| Parameter | Required? | Data type | Description |
|---|---|---|---|
brokerCrmName | Yes | string | See broker identification. |
userId | No (required if the partner is a user) | integer | The unique ID of the user. |
ctidTraderAccountId | No (required if the partner is an account) | integer | The unique ID of the linkage between a user and a trading account. |
Include either userId or ctidTraderAccountId, depending on the entity the identifier is assigned to: userId if it is assigned to a user, ctidTraderAccountId if it is assigned to an account.
Output
| Key | Data type | Description |
|---|---|---|
userId | integer | The unique ID of the user. |
ctidTraderAccountId | integer | The unique ID of the linkage between a user and a trading account. |
partnerId | string | The partner identifier string assigned to the entity. |
Expected status code
200
Errors
See Error codes.
Request example
curl -X GET 'https://HOST:PORT/cid/oauth2/ctid/referral?token=04d95575-c9af-42fba72e-2f0ce93f01d4&ctidTraderAccountId=9017800&brokerCrmName=BESTBROKERCRM' -H 'Accept: application/json'
Response example
{
"userId": 10345533,
"ctidTraderAccountId": 9017800,
"partnerId": "somePartnerId"
}
Delete a partner identifier
Deletes the partner identifier attached to a specific user or account.
| Method | URL |
|---|---|
DELETE | /oauth2/ctid/referral |
Query parameters
| Parameter | Required? | Data type | Description |
|---|---|---|---|
brokerCrmName | Yes | string | See broker identification. |
userId | Yes | integer | The unique ID of the user. |
ctidTraderAccountId | No | integer | The unique ID of the linkage between a user and a trading account. If unspecified, only a record with an unspecified account is deleted. |
Unlike setting and reading, deletion is always keyed on the user: userId is required, and ctidTraderAccountId only narrows the deletion to a specific account record.
Expected status code
200
Errors
See Error codes.
Request example
curl -X DELETE 'https://HOST:PORT/cid/oauth2/ctid/referral?token=04d95575-c9af-42fba72e-2f0ce93f01d4&userId=10345533&ctidTraderAccountId=9017800&brokerCrmName=BESTBROKERCRM' -H 'Accept: application/json'