5.7. InApp Actions

This flow is only available to the users who have successfully authorized within their broker’s client areas. The following chart outlines how making a deposit works as an InApp action.

InApp Flow

The following stages are passed when making a deposit via an InApp action.

  1. The user interacts with an InApp control (e.g., a dedicated deposit button).

  2. The platform sends a request to the cTrader backend to attain an OT token.

  3. The cTrader backend sends a request to the broker’s CRM system to generate an OT token. This request includes userId as a parameter (API call 4.4.).

  4. The broker’s backend verifies the userId and generates the OT token. The OT token is, subsequently, sent to the cTrader backend (token) (API call 4.4.).

  5. The cTrader backend returns the token to the platform.

  6. The application opens a predefined URL as defined in Section 5.2.

  7. The browser sends a request to the broker’s backend to attain the user details.

  8. After validating the OT token, the CRM responds with the details of the user requesting the deposit form.

  9. The user fills out the deposit form.

  10. A deposit request is sent to the broker’s backend. The backend processes the request and acknowledges the arrival of the deposit received via the broker’s payment services provider.

  11. The broker’s backend, subsequently, sends a request for an account balance change to the cTrader backend (API call 3.5.).

  12. Following the balance change, the cTrader backend sends the balanceHistoryId to the broker’s CRM system (API call 3.5.). The broker’s backend sends a response to the web browser.

  13. The web browser redirects the user to a predetermined success URL.

  14. The app checks the URL and, upon success, closes the web browser.

  15. Simultaneously with stages 13-14, the cTrader backend sends a ‘pump’ to the trading platform confirming the change in the trading account balance.

As InApp controls could be attached to a wide variety of InApp actions, it is impossible to create detailed user flows for each InApp action. However, with some changes, the above chart can also be extrapolated to other InApp actions. For example, KYC checks are passed entirely within the broker’s client area, eliminating the need for sending a request to the cTrader backend (stages 10-11). KYC checks would also require the broker’s backend to perform additional actions not represented in the flow chart.

Last update: February 6, 2023