Skip to main content

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.

MethodURL
PUT/oauth2/ctid/referral

Request body

KeyRequired?Data typeDescription
brokerCrmNameYesstringSee broker identification.
partnerIdYesstringThe partner identifier string to assign.
userIdNo (required if assigning to a user)integerThe unique ID of the user.
ctidTraderAccountIdNo (required if assigning to an account)integerThe unique ID of the linkage between a user and a trading account.
info

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.

MethodURL
GET/oauth2/ctid/referral

Query parameters

ParameterRequired?Data typeDescription
brokerCrmNameYesstringSee broker identification.
userIdNo (required if the partner is a user)integerThe unique ID of the user.
ctidTraderAccountIdNo (required if the partner is an account)integerThe unique ID of the linkage between a user and a trading account.
info

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

KeyData typeDescription
userIdintegerThe unique ID of the user.
ctidTraderAccountIdintegerThe unique ID of the linkage between a user and a trading account.
partnerIdstringThe 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.

MethodURL
DELETE/oauth2/ctid/referral

Query parameters

ParameterRequired?Data typeDescription
brokerCrmNameYesstringSee broker identification.
userIdYesintegerThe unique ID of the user.
ctidTraderAccountIdNointegerThe unique ID of the linkage between a user and a trading account. If unspecified, only a record with an unspecified account is deleted.
info

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'