3.6. Set a New Partner Identifier

Method URL
PUT /oauth2/ctid/referral

Creates a new partner by linking a partner identifier (defined in a string format) from a broker’s backend area to an existing user or an existing account on the cTrader backend.

Request Body

Key Required? Data Type Description
brokerCrmName Yes string Please, see Section 2.3.
partnerId Yes string The string assigned as a partner identifier to a specific user or an account.
userId No (if the chosen partner is an account) integer The unique ID of a specific user.
ctidTraderAccountId No (if the chosen partner is a user) integer The unique ID of the linkage between a specific user and one of their trading accounts.

Please, note that the request body can include a userId or a ctidTraderAccountId depending on the entity to which the partner identifier is assigned. To elaborate, userId is a mandatory parameter if the identifier is assigned to a user; alternatively, ctidTraderAccountId is a mandatory parameter if the identifier is assigned to an account. It is also possible to include both of these parameters if necessary.

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}’

Expected Response Status Code

200


Last update: September 26, 2022

Comments