diff --git a/_data/v3.yml b/_data/v3.yml index d9bb35ef8..c113d56b5 100644 --- a/_data/v3.yml +++ b/_data/v3.yml @@ -43,6 +43,8 @@ groups: title: Update Contract History - name: contracts_for title: Contracts For Symbol + - name: contracts_for_company + title: Contracts For Company - name: copy_start title: 'Copy Trading: Start' - name: copy_stop diff --git a/config/v3/contracts_for_company/example.json b/config/v3/contracts_for_company/example.json new file mode 100644 index 000000000..f4fb76ed9 --- /dev/null +++ b/config/v3/contracts_for_company/example.json @@ -0,0 +1,3 @@ +{ + "contracts_for_company": 1 +} diff --git a/config/v3/contracts_for_company/receive.json b/config/v3/contracts_for_company/receive.json new file mode 100644 index 000000000..9f74b893d --- /dev/null +++ b/config/v3/contracts_for_company/receive.json @@ -0,0 +1,114 @@ +{ + "$schema": "http://json-schema.org/draft-04/schema#", + "title": "Contracts For Company (response)", + "description": "Get the list of currently available contracts for a given landing company.", + "type": "object", + "required": [ + "echo_req", + "msg_type" + ], + "properties": { + "contracts_for_company": { + "title": "contracts_for_company", + "description": "List of available contracts for a given landing company.", + "type": "object", + "additionalProperties": false, + "required": [ + "available", + "hit_count" + ], + "properties": { + "available": { + "description": "List of available contracts.", + "type": "array", + "items": { + "type": "object", + "additionalProperties": false, + "required": [ + "barrier_category", + "contract_category", + "contract_category_display", + "contract_display", + "contract_type", + "sentiment" + ], + "properties": { + "barrier_category": { + "description": "Category of contract barrier.", + "type": "string", + "examples": [ + "american", + "asian", + "euro_atm", + "euro_non_atm" + ] + }, + "contract_category": { + "description": "Category of contract.", + "type": "string", + "examples": [ + "asian", + "callput" + ] + }, + "contract_category_display": { + "description": "Display name for the contract category, localized to selected language.", + "type": "string", + "examples": [ + "Asians", + "Up/Down" + ] + }, + "contract_display": { + "description": "Display name for the contract, localized to selected language.", + "type": "string", + "examples": [ + "Asian Up", + "Higher" + ] + }, + "contract_type": { + "description": "Type of contract.", + "type": "string", + "examples": [ + "ASIANU", + "CALL" + ] + }, + "sentiment": { + "description": "Type of sentiment.", + "type": "string", + "examples": [ + "differ", + "down", + "match", + "up" + ] + } + } + }, + "minItems": 1 + }, + "hit_count": { + "description": "Count of contracts available", + "type": "number" + } + } + }, + "echo_req": { + "description": "Echo of the request made.", + "type": "object" + }, + "msg_type": { + "description": "Action name of the request made.", + "type": "string", + "enum": [ + "contracts_for_company" + ] + }, + "req_id": { + "description": "Optional field sent in request to map to response, present only when request contains `req_id`.", + "type": "integer" + } + } +} diff --git a/config/v3/contracts_for_company/send.json b/config/v3/contracts_for_company/send.json new file mode 100644 index 000000000..dd1404225 --- /dev/null +++ b/config/v3/contracts_for_company/send.json @@ -0,0 +1,46 @@ +{ + "$schema": "http://json-schema.org/draft-04/schema#", + "title": "Contracts For Company (request)", + "description": "Get the list of currently available contracts for a given landing company.", + "type": "object", + "auth_required": 0, + "additionalProperties": false, + "required": [ + "contracts_for_company" + ], + "properties": { + "contracts_for_company": { + "description": "Must be `1`", + "type": "integer", + "enum": [ + 1 + ] + }, + "landing_company": { + "description": "[Optional] Indicates which landing company to get a list of contracts for. If you are logged in, your account's landing company will override this field.", + "type": "string", + "default": "virtual", + "enum": [ + "iom", + "malta", + "maltainvest", + "svg", + "virtual", + "vanuatu" + ] + }, + "loginid": { + "description": "[Optional] The login id of the user. If left unspecified, it defaults to the initial authorized token's login id.", + "type": "string", + "pattern": "^[A-Za-z]+[0-9]+$" + }, + "passthrough": { + "description": "[Optional] Used to pass data through the websocket, which may be retrieved via the `echo_req` output field.", + "type": "object" + }, + "req_id": { + "description": "[Optional] Used to map request to response.", + "type": "integer" + } + } +} diff --git a/docs/core-concepts/authorization-authentication/index.md b/docs/core-concepts/authorization-authentication/index.md index ece82ac93..533140f91 100644 --- a/docs/core-concepts/authorization-authentication/index.md +++ b/docs/core-concepts/authorization-authentication/index.md @@ -59,17 +59,17 @@ Here is the visual representation of how the OAuth authorisation connection work ## The authentication process -In order to authenticate your user, specify the URL that will be used as the OAuth Redirect URL on the [Dashboard](/dashboard) page, **Register application** tab in the **OAuth details** fields. Then, add a login button on your website or app and direct users to **`https://oauth.deriv.com/oauth2/authorize?app_id=your_app_id`** where your_app_id is the ID of your app. +In order to authenticate your user, specify the URL that will be used as the OAuth Authorisation URL on the [Dashboard](/dashboard) page, **Register application** tab in the **OAuth details** fields. Then, add a login button on your website or app and direct users to **`https://oauth.deriv.com/oauth2/authorize?app_id=your_app_id`** where your_app_id is the ID of your app. ![Deriv OAuth Login](/img/oauth_login.png 'Deriv OAuth Login') -Once a user signs up/logs in, they will be redirected to the URL that you entered as the Redirect URL. This URL will have arguments added to it with the user's session tokens, and will look similar to this: +Once a user signs up/logs in, they will be redirected to the URL that you entered as the Authorisation URL. This URL will have arguments added to it with the user's session tokens, and will look similar to this: `https://[YOUR_WEBSITE_URL]/redirect/?acct1=cr799393& token1=a1-f7pnteezo4jzhpxclctizt27hyeot&cur1=usd& acct2=vrtc1859315& token2=a1clwe3vfuuus5kraceykdsoqm4snfq& cur2=usd` ## The authorisation process -The query parameters in the redirect URL are the user's accounts and their related session tokens. You can map the query parameters to an array using the following approach: +The query parameters in the Authorisation URL are the user's accounts and their related session tokens. You can map the query parameters to an array using the following approach: ```js showLineNumbers const user_accounts = [ diff --git a/docs/guides/markup-calculation/index.md b/docs/guides/_markup-calculation/index.md similarity index 100% rename from docs/guides/markup-calculation/index.md rename to docs/guides/_markup-calculation/index.md diff --git a/docs/guides/about-the-deriv-api/index.md b/docs/guides/about-the-deriv-api/index.md index db2b32d85..6ce44ef80 100644 --- a/docs/guides/about-the-deriv-api/index.md +++ b/docs/guides/about-the-deriv-api/index.md @@ -39,7 +39,7 @@ Here are the steps to use the Deriv API: 2. **Familiarise yourself with the API documentation**: The Deriv API provides comprehensive documentation that explains how to use the API endpoints, including the available parameters and response formats. Make sure you are familiar with the documentation before you start using the API. -3. **Create an API application**: To create an API application, you need to provide a name for your application and a redirect URI. The redirect URI is the URL that the user will be redirected to after they have authorised your application to access their Deriv account. +3. **Create an API application**: To create an API application, you need to provide a name for your application and a Authorisation URL. The Authorisation URL is the URL that the user will be redirected to after they have authorised your application to access their Deriv account. 4. **Authorise your application**: Once you have created your API application, you need to authorise it to access your Deriv account. This involves logging into your Deriv account and granting permission for your application to access your account data. diff --git a/docs/guides/monetizing-the-deriv-api/index.md b/docs/guides/monetizing-the-deriv-api/index.md index f46519e46..4ae46fb45 100644 --- a/docs/guides/monetizing-the-deriv-api/index.md +++ b/docs/guides/monetizing-the-deriv-api/index.md @@ -39,3 +39,24 @@ There are several ways to monetize the Deriv API: 5. **Advertising**: If you have built a trading application that has a large user base, you could consider selling advertising space to relevant advertisers. This can be a good way to generate additional revenue. 6. **Markup**: Use the Deriv API to create your own websites and apps, and earn commissions on the trades and payments your clients make, monetizing your creations through markup. + +## Markup + +Boost your revenue by applying markups on every contract purchased through the trading app you've developed using the Deriv API. You can set the markup yourself, up to a maximum of 3%. + +Supported trade types include: Options, Multipliers, and Accumulators. + +Here's an example of how the markup is calculated: + +To get a payout of **2.00 USD**: + +- Client stake without markup = **1.07 USD** + +With the markup (e.g. 2%), a client pays: + +- Client's stake with the markup = Stake + (payout x markup) +- Client's stake with the markup = 1.07 USD + (2 USD x 2%) = **1.11 USD** + +## Earning commission + +Earn commissions on trades and payments made by your clients through the websites and apps you create with the Deriv API. Get more details about the commission plans [here](https://www.deriv.com/partners/affiliate-ib). diff --git a/docs/guides/oauth2/index.md b/docs/guides/oauth2/index.md index 57b19a9b0..860ed89bf 100644 --- a/docs/guides/oauth2/index.md +++ b/docs/guides/oauth2/index.md @@ -31,10 +31,10 @@ For more information on OAuth2, [see this guide](https://aaronparecki.com/oauth- ### How to use OAuth authorisation -1. Specify the URL that will be used as the **OAuth Redirect URL** on the app registration page in the **Website URL field**. +1. Specify the URL that will be used as the **OAuth Authorisation URL** on the app registration page in the **Website URL field**. 2. Add a login button on your website or app and direct users to `https://oauth.deriv.com/oauth2/authorize?app_id=your_app_id` where your_app_id is the ID of your app. -3. Once a user signs up, they will be redirected to the URL that you entered as the **Redirect URL**. This URL will have arguments added to it with the user's session tokens, and will look similar to: `https://[YOUR_WEBSITE_URL]/redirect/?acct1=cr799393& token1=a1-f7pnteezo4jzhpxclctizt27hyeot&cur1=usd& acct2=vrtc1859315& token2=a1clwe3vfuuus5kraceykdsoqm4snfq& cur2=usd&state=` +3. Once a user signs up, they will be redirected to the URL that you entered as the **Authorisation URL**. This URL will have arguments added to it with the user's session tokens, and will look similar to: `https://[YOUR_WEBSITE_URL]/redirect/?acct1=cr799393& token1=a1-f7pnteezo4jzhpxclctizt27hyeot&cur1=usd& acct2=vrtc1859315& token2=a1clwe3vfuuus5kraceykdsoqm4snfq& cur2=usd&state=` 4. In the parameters of the URL, you will see all the accounts and the session token for each account. Pass these tokens to the Authorize API call in order to perform actions on behalf of the account. diff --git a/docs/setting-up-a-deriv-application.md b/docs/setting-up-a-deriv-application.md index e13711e12..97bb2f3de 100644 --- a/docs/setting-up-a-deriv-application.md +++ b/docs/setting-up-a-deriv-application.md @@ -44,14 +44,14 @@ You need a token with the `Admin` scope to create an application. To create your application with the appropriate configuration options, select the **Register Application** tab in the Dashboard. You can make changes to your application's configuration at anytime in the **Manage Applications** tab. -| App information field | Description | -| --------------------- | -------------------------------------------------------------------------------------------------- | -| Account | The account you want to create the application with | -| API Token | The API token you want to create the application with | -| App Name | Application name | -| Markup | The commission added to the trade price to earn additional income | -| Authorisation URL | The URL that enables clients to log in to your app using their Deriv accounts without an API token | -| Verification URL | The OAuth redirect URL for the OAuth authorisation | +| App information field | Description | +| --------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------- | +| Account | The account you want to create the application with | +| API Token | The API token you want to create the application with | +| App Name | Application name | +| Markup | The commission added to the trade price to earn additional income | +| Authorisation URL | The URL that enables clients to log in to your app using their Deriv accounts without an API token | +| Verification URL | Used for email verification. If provided, the URL with the verification token is sent to the user's email; otherwise, the Authentication URL is used. | **To create an application, follow these steps:**