Sell Flow ========= .. _SELL Get an internal client account: Get an internal client account ****************************** `GET /v1/accounts/ `_ .. code-block:: python query = { "legal_entity_uuid": "3fa85f64-5717-4562-b3fc-2c963f66afa6", "client_uuid": "3fa85f64-5717-4562-b3fc-2c963f66afa6" } Orders will be linked to this account. .. _SELL Add an external bank account: Add an external bank account **************************** `POST /v1/external-bank-accounts/ `_ .. code-block:: python query = { "legal_entity_uuid": "3fa85f64-5717-4562-b3fc-2c963f66afa6", "client_uuid": "3fa85f64-5717-4562-b3fc-2c963f66afa6" } .. code-block:: python data = { "name": "string", "iban": "string", "bank_code": "string", "bank_name": "string", "holder_name": "string" } **Or get the client's external bank account if it has already been added:** `GET /v1/external-bank-accounts/ `_ .. code-block:: python query = { "legal_entity_uuid": "3fa85f64-5717-4562-b3fc-2c963f66afa6", "client_uuid": "3fa85f64-5717-4562-b3fc-2c963f66afa6" } The withdrawal will be sent to this client account. .. _SELL Get commissions: Get commissions *************** `GET /v1/sellbuy/orders/calculate-trade/ `_ .. code-block:: python query = { "legal_entity_uuid": "3fa85f64-5717-4562-b3fc-2c963f66afa6", "client_uuid": "3fa85f64-5717-4562-b3fc-2c963f66afa6", "incoming_provider_type": "crypto", "incoming_provider_uuid": "3fa85f64-5717-4562-b3fc-2c963f66afa6", "incoming_amount": 100, "outgoing_provider_type": "bank" } Make the following request to select an ``incoming_provider_uuid``: `GET /v1/references/providers/ `_ .. code-block:: python query = { "legal_entity_uuid": "3fa85f64-5717-4562-b3fc-2c963f66afa6", "type": "crypto" } .. _SELL Create an order: Create an order *************** `POST /v1/sellbuy/orders/ `_ .. code-block:: python query = { "legal_entity_uuid": "3fa85f64-5717-4562-b3fc-2c963f66afa6", "client_uuid": "3fa85f64-5717-4562-b3fc-2c963f66afa6" } .. code-block:: python data = { "account_uuid": "3fa85f64-5717-4562-b3fc-2c963f66afa6", "incoming_provider_uuid": "3fa85f64-5717-4562-b3fc-2c963f66afa6", "incoming_asset_code": "EURS", "incoming_amount": 100, "outgoing_provider_type": "bank", "outgoing_asset_code": "EUR", "outgoing_client_account_uuid": "3fa85f64-5717-4562-b3fc-2c963f66afa6" } * In step :ref:`SELL Get an internal client account` you got ``account_uuid``. * In step :ref:`SELL Add an external bank account` you got ``outgoing_client_account_uuid``. Make the following request to select an ``incoming_provider_uuid``: `GET /v1/references/providers/ `_ .. code-block:: python query = { "legal_entity_uuid": "3fa85f64-5717-4562-b3fc-2c963f66afa6", "type": "crypto" } .. _SELL Make a deposit: Make a deposit ************** The client needs to make a crypto deposit from the account specified in step :ref:`SELL Add an external bank account`, using the ``deposit_address`` value received in step :ref:`SELL Create an order`. .. _SELL Track the status of client orders: Get order status **************** `GET /v1/sellbuy/orders/ `_ .. code-block:: python query = { "legal_entity_uuid": "3fa85f64-5717-4562-b3fc-2c963f66afa6", "client_uuid": "3fa85f64-5717-4562-b3fc-2c963f66afa6" }