### Start 2FA Enablement (Shell) Source: https://api.bit2me.com/openapi Initiates the two-factor authentication (2FA) enablement process. After calling this endpoint, you must call the PUT /v1/account/settings/sfa endpoint with a TOTP to complete the setup. It returns a QR image, a secret key, and a name for authenticator apps. ```Shell # Start 2fa enablement curl -X POST ${SERVER_URL}/v1/account/settings/sfa -H 'Content-type: application/json' -H 'X-API-KEY: ' -H 'X-TOTP: <2fa code>' -H 'X-TOTP-TYPE: <['gauth', 'sms', 'email']>' -d '{}' ``` -------------------------------- ### Enable Main Account Google Authenticator 2FA (Bash) Source: https://api.bit2me.com/openapi This example shows the sequence of API calls to enable Google Authenticator 2FA for a main account. It involves retrieving verification details, starting the enablement process, and then ending it with the obtained secret and codes. ```bash # Retrieve 2fa user verification curl -X GET "https://api.bit2me.com/access/v1/sfa/verification" # Start 2fa enablement process (replace with actual response data) curl -X POST "https://api.bit2me.com/account/v1/settings/2fa/enable/start" \ -H "x-totp: <2fa-code obtained in previous step>" -H "x-totp-type: " # End 2fa enablement process (replace with actual response data) curl -X POST "https://api.bit2me.com/account/v1/settings/2fa/enable/end" \ -H "x-totp: <2fa-code obtained in previous step>" -H "x-totp-type: " ``` -------------------------------- ### POST /v1/account/2fa/subaccount/init Source: https://api.bit2me.com/openapi Initiates the Google Authenticator 2FA process for a subaccount. This endpoint is used to start the setup for two-factor authentication for a specific subaccount user. ```APIDOC ## POST /v1/account/2fa/subaccount/init ### Description Initiates the Google Authenticator 2FA process for a subaccount. This endpoint is used to start the setup for two-factor authentication for a specific subaccount user. ### Method POST ### Endpoint /v1/account/2fa/subaccount/init ### Parameters #### Request Body - **subaccountUserId** (string) - Required - The unique identifier of the subaccount user. ### Request Example ```json { "subaccountUserId": "user123" } ``` ### Response #### Success Response (200) - **secret** (string) - The secret key required for setting up Google Authenticator. #### Response Example ```json { "secret": "JBSWY3DPEHPK3PXP" } ``` ``` -------------------------------- ### Bit2Me API cURL Examples Source: https://api.bit2me.com/openapi This section provides cURL commands for interacting with the Bit2Me API. These examples demonstrate how to construct requests for various operations, including buying, selling, swapping, and withdrawing cryptocurrency, along with the necessary authentication headers. ```bash # Example for buy operation curl -X POST https://gateway.bit2me.com/v1/wallet/transaction/proforma \ -H "x-api-key: YOUR_API_KEY" \ -H "api-signature: YOUR_SIGNATURE" \ -H "x-nonce: YOUR_NONCE" \ -d '{ "operation": "buy", "pair": "BTC/EUR", "amount": "100", "currency": "EUR" }' ``` ```bash # Example for sell operation curl -X POST https://gateway.bit2me.com/v1/wallet/transaction/proforma \ -H "x-api-key: YOUR_API_KEY" \ -H "api-signature: YOUR_SIGNATURE" \ -H "x-nonce: YOUR_NONCE" \ -d '{ "operation": "sell", "pair": "BTC/EUR", "amount": "0.0002", "currency": "BTC" }' ``` ```bash # Example for swap operation curl -X POST https://gateway.bit2me.com/v1/wallet/transaction/proforma \ -H "x-api-key: YOUR_API_KEY" \ -H "api-signature: YOUR_SIGNATURE" \ -H "x-nonce: YOUR_NONCE" \ -d '{ "pocket": "", "amount": "0.001", "currency": "BTC", "destination": { "pocket": "" }, "type": "SEA", "userCurrency": "EUR" }' ``` ```bash # Example for withdraw operation curl -X POST https://gateway.bit2me.com/v1/wallet/transaction/proforma \ -H "x-api-key: YOUR_API_KEY" \ -H "api-signature: YOUR_SIGNATURE" \ -H "x-nonce: YOUR_NONCE" \ -d '{ "pocket": "", "amount": "10", "currency": "EUR", "type": "SEA", "concept": "", "note": "", "destination": { "bankAccount": { "bankAccount": "", "country": "ES", "receiverName": "Test" } }, "userCurrency": "EUR" }' ``` -------------------------------- ### cURL Request Example for Signing to Embed Subaccount Source: https://api.bit2me.com/index This is a cURL command example for the `post/v1/signin/embed` endpoint, used for signing in to embed a subaccount. It shows how to send the necessary JSON payload to generate access and refresh tokens, which can then be used for subsequent API calls. ```bash curl -X POST https://gateway.bit2me.com/v1/signin/embed \ -H "Content-Type: application/json" \ -d '{ "accessToken": "" }' ``` -------------------------------- ### Get Transaction Details using cURL Source: https://api.bit2me.com/openapi This example shows how to retrieve the details of a specific transaction using the Bit2Me API. It requires the transaction ID as a path parameter and optionally accepts a `userCurrency` query parameter to specify the currency for rate conversion. The API key is needed for authentication. ```curl curl -X GET /v1/wallet/transaction/{id}?userCurrency=EUR \ -H 'Content-type: application/json' \ -H 'X-API-KEY: ' ``` -------------------------------- ### Order Change Response Example (JSON) Source: https://api.bit2me.com/trading-websockets An example of the JSON response for the 'my-orders' channel, illustrating the details of an order status change, including symbol, price, amount, and status. ```json { "event": "my-orders", "symbol": "B2M/EUR", "data": { "id": "51002851-2f76-4c10-9b4c-bcc131f27b1d", "userId": "7bd4cc22-7682-4e45-85b3-29386b979d75", "timestamp": 1666006194005, "datetime": "2022-10-17T11:29:54.005Z", "side": "buy", "symbol": "B2M/EUR", "price": 1, "stopPrice": 0, "amount": 1000, "filled": 10, "remainingAmount": 990, "dustAmount": 0, "status": "cancelled", "type": "limit", "cost": 0, "cancelationReason": "The buy price can not be greater or equal than the best ask price", "feeAmount": 23.324123, "feeCurrency": "B2M" } } ``` -------------------------------- ### Trade Execution Response Example (JSON) Source: https://api.bit2me.com/trading-websockets An example of the JSON response received when subscribed to the 'my-trades' channel, detailing a specific trade execution, including symbol, price, amount, and fees. ```json { "event": "my-trades", "symbol": "B2M/EUR", "data": { "id": "9adb20ae-f673-49a4-b232-75442e3af617", "userId": "7bd4cc22-7682-4e45-85b3-29386b979d75", "timestamp": 1665997927993, "datetime": "2022-10-17T09:12:07.993Z", "symbol": "B2M/EUR", "order": "69d3df53-9248-430c-9850-d72ff1f0befa", "side": "sell", "price": 0.014, "amount": 100, "cost": 1.4, "fee": { "cost": 0.00224, "currency": "EUR", "rate": 0.16 }, "isMaker": true, "clientOrderId": "MY-CLIENT-ORDER-ID" } } ``` -------------------------------- ### GET /v2/loan/currency/configuration Source: https://api.bit2me.com/openapi Retrieves the configuration for loan currencies, including which currencies are available for loans and can be used as collateral. ```APIDOC ## GET /v2/loan/currency/configuration ### Description Get the configuration of loan currencies. This includes which currencies are available for loans and which can be used as guarantee. ### Method GET ### Endpoint /v2/loan/currency/configuration ### Response #### Success Response (200) - **loanCurrencies** (array) - List of currencies available for loans. - **currency** (string) - The currency code (e.g. BTC). - **minAmount** (number) - The minimum loan amount for this currency. - **maxAmount** (number) - The maximum loan amount for this currency. - **guaranteeCurrencies** (array) - List of currencies available as guarantee. - **currency** (string) - The currency code (e.g. BTC). - **minAmount** (number) - The minimum guarantee amount for this currency. - **maxAmount** (number) - The maximum guarantee amount for this currency. #### Response Example ```json { "loanCurrencies": [ { "currency": "BTC", "minAmount": 100, "maxAmount": 100000 } ], "guaranteeCurrencies": [ { "currency": "BTC", "minAmount": 0.01, "maxAmount": 5 }, { "currency": "USDC", "minAmount": 1000, "maxAmount": 1000000 } ] } ``` #### Error Response (401) - **code** (string) - Error code. - **message** (string) - Error message. #### Error Response (default) - **code** (string) - Error code. - **message** (string) - Error message. ``` -------------------------------- ### Quickstart - Postman Import Source: https://api.bit2me.com/trading-spot-rest Instructions on how to import the Bit2Me API specification into Postman for testing purposes, using either a link or a downloaded file. ```APIDOC ## Quickstart - Postman Import ### Description Test the Bit2Me API directly from Postman by importing our OpenAPI specification. You have two convenient options for importing. ### Option 1 — Import by Link 1. Open Postman and navigate to **Import**. 2. Select the **Link** tab. 3. Paste the following URL: `https://api.bit2me.com/openapi.json` ### Option 2 — Import by File 1. Download the OpenAPI specification file using the provided button (e.g., 'Download OpenAPI (for Postman)'). 2. In Postman, go to **Import**. 3. Select the **File** tab and choose the downloaded OpenAPI specification file. ``` -------------------------------- ### Logical Steps to Operate with API Source: https://api.bit2me.com/trading-spot-rest A step-by-step guide outlining the process for operating with the Bit2Me API, from obtaining API keys to withdrawing funds. ```APIDOC ## Logical Steps to Operate with API ### Description Follow these logical steps to effectively operate with the Bit2Me API for various financial and trading activities. 1. **[Auth] Obtain API Keys**: Get your API Keys for the production environment from the Bit2Me team. 2. **[Subaccount] Generate Sub Accounts**: Use your API Key to generate sub-accounts for each individual user. 3. **[KYC] Perform KYC**: Complete the Know Your Customer (KYC) process for the individual user. If you are a regulated entity, discuss reusing your existing KYC with the sales team. 4. **[Funding] Fund Parent Account**: Fund your parent account with fiat money. A minimum fiat balance is required. During onboarding, Bit2Me will provide the fiat account details. For banks, the parent fiat account may be held at your institution. Fiat money must be funded to the main account for day-to-day operations, and you should maintain records of fiat balances for each sub-account. * 4.1 Fund with EUR. * 4.2 Fund with BRL. * 4.3 Fund with ARS (Coming Soon). * *USD is currently only available in Bit2Me Pro; contact the sales team.* 5. **[Funding] Fund Account with Crypto**: Fund your account with cryptocurrencies. 6. **[Market] Obtain Market Information**: Get market data, including a list of assets and ticker information for currency pairs. * Get a list of assets. * Get ticker information for currency pair. 7. **[Wallet] Create Proforma Transaction**: Create a proforma transaction for buy, sell, or exchange operations. * **7.1 [Wallet] Execute Proforma Transaction**: Execute the previously created proforma transaction. 8. **[Trading] Use Bit2Me Pro**: Utilize Bit2Me Pro for high-frequency trading. * Deposit funds into your Bit2Me Pro account. * Place an order. 9. **[Earn] Deposit or Withdraw from Earn Protocols**: Manage funds within earn protocols. * List supported assets. * Get assets' annual percentage yields (APYs). * List sub-account earn wallets. * Deposit/withdraw cryptos in earn. 10. **[Transfers] Move Money Between Users (P2P)**: * First, create a transfer from the origin user. * Then, claim the transfer for the destination user. 11. **[Withdraw] Fiat**: Withdraw your fiat currency. 12. **[Withdraw] Crypto**: Withdraw your cryptocurrency. ``` -------------------------------- ### Connect and Authenticate WebSocket (JavaScript) Source: https://api.bit2me.com/openapi Example demonstrating how to establish a WebSocket connection, handle errors, authenticate using JWT or API key, and process incoming messages. It also includes logic for handling specific close event codes related to authentication and rate limiting. ```javascript const ws = new WebSocket (`wss://${host}:${port}/`); ws.addEventListener ('error', err => { console.error ('websocket error:', err); }); ws.addEventListener ('open', () => { console.debug ('websocket connected'); // send the jwt token to authenticate the connection ws.send (JSON.stringify ({ type: 'authenticate', payload: { token: jwt }})); // or alternatively authenticate with apikey ws.send (JSON.stringify ({ type: 'authenticate', payload: { apikey: [apikey] }})); }); ws.addEventListener ('message', message => { const msg = JSON.parse (message.data); console.debug (`websocket message: type: ${msg.type}, id: ${msg.id}, time: ${msg.time}`); }); ws.addEventListener ('close', evt => { if (evt.code === 4000) { console.log (`Error while authenticating: ${evt.code}/${evt.reason}`); } else if (evt.code === 4001) { console.log (`Error rate limit: ${evt.code}/${evt.reason}`); } // handle reconnect logic }); ``` -------------------------------- ### GET /v1/trading/ticker Source: https://api.bit2me.com/openapi Retrieves ticker information for all markets or a specific market. This endpoint is useful for getting real-time price data. ```APIDOC ## GET /v1/trading/ticker ### Description Retrieves ticker information for all markets or a specific market. This endpoint is useful for getting real-time price data. ### Method GET ### Endpoint /v1/trading/ticker ### Parameters #### Query Parameters - **symbol** (string) - Optional - Market symbol (optional, default all markets) ### Response #### Success Response (200) - **ticker information list** (object) - A list of ticker information objects. #### Response Example ```json { "example": "{\"symbol\": \"BTC-EUR\", \"lastPrice\": \"30000.00\", ...}" } ``` #### Error Response (404) - **Market symbol not found** (object) - Indicates that the requested market symbol does not exist. #### Error Response (default) - **Error** (object) - General error response. ``` -------------------------------- ### GET /v1/wallet/transaction/{id} Source: https://api.bit2me.com/openapi Get transaction details. Retrieve the specific details of a cryptocurrency transaction using its unique identifier. ```APIDOC ## GET /v1/wallet/transaction/{id} ### Description Get transaction details. Retrieve the specific details of a cryptocurrency transaction using its unique identifier. ### Method GET ### Endpoint /v1/wallet/transaction/{id} ### Parameters #### Path Parameters - **id** (string) - Required - The transaction id (returned by GET /v1/transaction) #### Query Parameters - **userCurrency** (string) - Optional - The user's currency (used to show a rate from it to Euro) ### Request Example ```json { "example": "GET /v1/wallet/transaction/a1b2c3d4-e5f6-7890-1234-567890abcdef?userCurrency=EUR" } ``` ### Response #### Success Response (200) - **date** (string) - When the transaction was created (ISO 8601) - **type** (string) - Type of the transaction (e.g., "deposit", "withdrawal", "transfer") - **concept** (string) - The concept of the transaction - **note** (string) - Personal note of the user - **origin** (object) - Transaction origin - **currency** (string) - The origin currency - **amount** (string) - The total amount of "money" that is taken from origin. - **pocketName** (string) - The origin pocket name - **pocketId** (string) - The origin pocket ID - **class** (string) - Type of the origin (e.g., "pocket", "network", "b2m", "card", "bank transfer") - **rate** (string) - The exchange rate used for the transaction - **destination** (object) - Transaction destination - **currency** (string) - The destination currency - **amount** (string) - The total amount of "money" that is sent to destination. - **pocketName** (string) - The destination pocket name - **pocketId** (string) - The destination pocket ID - **class** (string) - Type of the destination (e.g., "pocket", "network", "b2m", "card", "bank transfer") - **address** (string) - The destination address - **network** (string) - The destination network #### Response Example ```json { "date": "2023-10-27T10:00:00Z", "type": "transfer", "concept": "Crypto Transfer", "note": "", "origin": { "currency": "ETHTEST", "amount": "0.005", "pocketName": "My ETH Wallet", "pocketId": "a1b2c3d4-e5f6-7890-1234-567890abcdef", "class": "pocket", "rate": "1.0" }, "destination": { "currency": "ETHTEST", "amount": "0.005", "pocketName": null, "pocketId": null, "class": "network", "address": "0x1234567890abcdef1234567890abcdef12345678", "network": "Ropsten" } } ``` ``` -------------------------------- ### Enable Subaccount Google Authenticator 2FA (Bash) Source: https://api.bit2me.com/openapi This example demonstrates initiating the Google Authenticator 2FA enablement process for a subaccount. The API returns a secret that needs to be configured in a Google Authenticator app. ```bash curl -X POST "https://api.bit2me.com/account/v1/subaccount/2fa/init" ``` -------------------------------- ### Launchpad Purchase with Card with cURL Source: https://api.bit2me.com/openapi Initiates a proforma purchase for a launchpad project using a credit card. Requires API key, card ID, launchpad ID, amount, and currency. ```cURL curl -X POST /v1/wallet/transaction/proforma -H 'Content-type: application/json' -H 'X-API-KEY: ' -d '{ "operation": "launchpad-purchase", "origin": { "creditcard": { "cardId": "" } }, "destination": { "launchpad": "" }, "amount": "100", "currency": "EUR" }' ``` -------------------------------- ### POST /v1/account/settings/sfa Source: https://api.bit2me.com/openapi Starts the process to enable two-factor authentication. After calling this endpoint, you must call PUT /v1/account/settings/sfa and pass a TOTP to finish the process. ```APIDOC ## POST /v1/account/settings/sfa ### Description Starts the process to enable the two-factor authentication. After calling this endpoint you must call *(PUT) /v1/account/settings/sfa* and pass a TOTP to finish the process. ### Method POST ### Endpoint /v1/account/settings/sfa ### Parameters #### Query Parameters None #### Request Body This endpoint does not require a request body. ### Request Example ```json {} ``` ### Response #### Success Response (200) - **qrImage** (string) - QR image containing the otpauth URL for Google Authenticator (e.g. data:image/png;base64,iVB...YII=) - **secret** (string) - Shared secret key (base-32 encoded) - **name** (string) - The name to use with Google Authenticator #### Response Example ```json { "qrImage": "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAQAAAC1HAwCAAAAC0lEQVR42mNkYAAAAAYAAjCB0C8AAAAASUVORK5CYII=", "secret": "JBSWY3DPEHPK3PXP", "name": "user@example.com" } ``` #### Error Response (409) - **code** (integer) - Error code - **message** (string) - Error message #### Error Response (default) - **code** (integer) - Error code - **message** (string) - Error message ``` -------------------------------- ### POST /v3/account/verify/identity/init Source: https://api.bit2me.com/openapi Initializes the KYC (Know Your Customer) verification process for a user. This endpoint generates a redirect URL to an external verification service. ```APIDOC ## POST /v3/account/verify/identity/init ### Description Initializes the KYC (Know Your Customer) verification process for a user. This endpoint generates a redirect URL to an external verification service. It is recommended to open the `redirectUrl` in a native browser, not in webviews. ### Method POST ### Endpoint /v3/account/verify/identity/init ### Parameters #### Path Parameters None #### Query Parameters None #### Request Body - **locale** (string) - Required - The locale for the verification process (e.g., 'en', 'es'). - **workflowId** (number) - Optional - The ID of the workflow to use. Defaults to 10011. - **successUrl** (string) - Optional - The URL to redirect to upon successful verification. - **errorUrl** (string) - Optional - The URL to redirect to upon verification failure. ### Request Example ```json { "locale": "en", "workflowId": 10011, "successUrl": "https://example.com/success", "errorUrl": "https://example.com/error" } ``` ### Response #### Success Response (200) - **redirectUrl** (string) - The URL to redirect the user to for verification. - **token** (string) - A token associated with the verification process. - **reference** (string) - A reference identifier for the verification. - **provider** (string) - The verification provider (e.g., 'jumio', 'incode'). #### Response Example ```json { "redirectUrl": "https://verification.example.com/start?token=...", "token": "some_verification_token", "reference": "ref12345", "provider": "jumio" } ``` #### Error Responses - **401**: User not allowed. - **404**: User not found. - **406**: Not acceptable, limit exceeded. - **409**: Process already executed. - **412**: User type not valid. - **default**: Generic error response. ``` -------------------------------- ### GET /v1/loan/movements Source: https://api.bit2me.com/openapi Retrieves a history of user loan movements. ```APIDOC ## GET /v1/loan/movements ### Description Get loan user movements. ### Method GET ### Endpoint /v1/loan/movements ### Parameters #### Query Parameters - **orderId** (string) - Optional - Filter movements by a specific order ID. - **limit** (number) - Optional - The maximum number of rows to fetch. - **offset** (number) - Optional - The number of rows to skip. ### Response #### Success Response (200) - **movements** (array) - A list of loan movements. - **id** (string) - The unique identifier for the movement. - **orderId** (string) - The ID of the associated loan order. - **type** (string) - The type of movement (e.g., DEPOSIT, WITHDRAWAL, INTEREST_PAID). - **amount** (number) - The amount of the movement. - **currency** (string) - The currency of the movement. - **timestamp** (string) - The date and time of the movement (ISO 8601 format). #### Response Example ```json { "movements": [ { "id": "mvmt_12345", "orderId": "ord_abcde", "type": "INTEREST_PAID", "amount": 10.50, "currency": "USDC", "timestamp": "2023-10-27T10:00:00Z" } ] } ``` ``` -------------------------------- ### GET /websites/api_bit2me/explorer/tx/{hash} Source: https://api.bit2me.com/openapi Retrieves details of a specific transaction using its hash. ```APIDOC ## GET /websites/api_bit2me/explorer/tx/{hash} ### Description Retrieves details of a specific transaction using its hash. ### Method GET ### Endpoint /websites/api_bit2me/explorer/tx/{hash} ### Parameters #### Path Parameters - **hash** (string) - Required - The transaction hash. Must be a 64-character hexadecimal string. ### Response #### Success Response (200) - **txid** (string) - The transaction ID. - **version** (integer) - The transaction version. - **locktime** (integer) - The locktime of the transaction. - **vin** (array) - An array of inputs. - **vout** (array) - An array of outputs. - **size** (integer) - The size of the transaction in bytes. - **weight** (integer) - The weight of the transaction. - **fee** (integer) - The transaction fee. - **status** (object) - The status of the transaction. - **confirmed** (boolean) - Whether the transaction is confirmed. - **block_height** (integer) - The block height if confirmed. - **block_hash** (string) - The hash of the block if confirmed. - **block_time** (integer) - The timestamp of the block if confirmed. #### Response Example { "txid": "a1b2c3d4e5f678901234567890abcdef1234567890abcdef1234567890abcdef123456", "version": 1, "locktime": 0, "vin": [], "vout": [], "size": 225, "weight": 896, "fee": 1000, "status": { "confirmed": true, "block_height": 1000000, "block_hash": "0000000000000000000abcdef1234567890abcdef1234567890abcdef1234567890", "block_time": 1678886400 } } ``` -------------------------------- ### Subscribe to Transaction Notifications via WebSocket (Node.js) Source: https://api.bit2me.com/openapi Example for a Node.js environment to connect to a WebSocket, subscribe to the 'inv' room for transaction notifications from the BTC testnet explorer, and process incoming 'tx' messages. ```javascript const ws = new WebSocket (`wss://${host}:${port}/v1/explorer/BTCTEST`); ws.addEventListener ('error', err => { console.error ('websocket error:', err); }); ws.addEventListener ('open', () => { console.debug ('websocket connected'); // subscribe to 'inv' room ws.send (JSON.stringify ([ 'subscribe', 'inv' ])); }); ws.addEventListener ('message', message => { const msg = JSON.parse (message); // we want just transactions if (msg[0] === 'tx') { console.debug ('websocket message:', msg[1]); // ... } }); ws.addEventListener ('close', evt => { if (evt.code === 4001) { console.log (`Error rate limit: ${evt.code}/${evt.rea ``` -------------------------------- ### GET /v1/trading/order/{id}/trades Source: https://api.bit2me.com/openapi Retrieves all trades associated with a specific order. ```APIDOC ## GET /v1/trading/order/{id}/trades ### Description Get all trades associated to the order. ### Method GET ### Endpoint /v1/trading/order/{id}/trades #### Path Parameters - **id** (string) - Required - The unique identifier of the order. ### Request Example ```json { "example": "(No request body for GET request)" } ``` ### Response #### Success Response (200) - **trades** (array) - A list of trades associated with the order. #### Response Example ```json { "example": "(Response structure for trades not fully defined in provided text, but expected to be an array of trade objects)" } ``` ``` -------------------------------- ### Initialize KYC Verification using cURL Source: https://api.bit2me.com/openapi This snippet shows how to initiate a KYC verification process for a subaccount. It requires an API key and a locale. The response includes a redirect URL to complete the verification, a token, a reference, and the provider used for verification. It's crucial to open the redirectUrl in a native browser, not webviews. ```curl curl -X POST https://api.bit2me.com/v3/account/verify/identity/init \ -H "Content-Type: application/json" \ -H "X-API-KEY: " \ -d '{ "locale": "en", "workflowId": 10011, "successUrl": "https://example.com/success", "errorUrl": "https://example.com/error" }' ``` -------------------------------- ### GET /v1/loan/orders/{orderId} Source: https://api.bit2me.com/openapi Retrieves a specific user loan order by its ID. ```APIDOC ## GET /v1/loan/orders/{orderId} ### Description Get a user loan order. ### Method GET ### Endpoint /v1/loan/orders/{orderId} #### Path Parameters - **orderId** (string) - Required - The ID of the loan order. ### Response #### Success Response (200) - **UserLoan** (object) - Details of the user loan. #### Error Response - **400** - Validation Error - **401** - Unauthorized - **404** - Order not found - **default** - Error ``` -------------------------------- ### Launchpad Purchase with EUR Pocket with cURL Source: https://api.bit2me.com/openapi Initiates a proforma purchase for a launchpad project using an EUR pocket. Requires API key, EUR pocket ID, launchpad ID, amount, and currency. ```cURL curl -X POST /v1/wallet/transaction/proforma -H 'Content-type: application/json' -H 'X-API-KEY: ' -d '{ "operation": "launchpad-purchase", "pocket": "", "destination": { "launchpad": "" }, "amount": "100", "currency": "EUR" }' ``` -------------------------------- ### GET /v1/loan/orders/{orderId} Source: https://api.bit2me.com/openapi Retrieves a specific user loan order by its ID. ```APIDOC ## GET /v1/loan/orders/{orderId} ### Description Retrieves the details of a specific user loan order using its unique identifier. ### Method GET ### Endpoint /v1/loan/orders/{orderId} ### Parameters #### Path Parameters - **orderId** (string) - Required - The unique identifier of the loan order. ### Request Example ```json { "example": "GET /v1/loan/orders/123e4567-e89b-12d3-a456-426614174000" } ``` ### Response #### Success Response (200) - **LoanOrder** (object) - An object containing the details of the specified loan order. (Schema reference: #/components/schemas/LoanOrder) #### Response Example ```json { "example": "{ \"orderId\": \"123e4567-e89b-12d3-a456-426614174000\", \"loanCurrency\": \"USDC\", \"loanAmount\": \"1250.34\", \"guaranteeCurrency\": \"BTC\", \"guaranteeAmount\": \"0.5678\", \"status\": \"active\", \"createdAt\": \"2023-10-27T10:00:00Z\", \"updatedAt\": \"2023-10-27T10:05:00Z\" }" } ``` #### Error Responses - **400** - Validation Error - **401** - Unauthorized - **default** - An error object. (Schema reference: #/components/schemas/ErrorResponse) ``` -------------------------------- ### Create Account Address (Shell) Source: https://api.bit2me.com/openapi This code sample demonstrates how to create a new address for a user account using a cURL command. It requires authentication with an API key and optionally a subaccount ID. The request body specifies the address details. ```Shell # Create subaccount address curl -X POST ${SERVER_URL}/v2/account/address -H 'Content-type: application/json' -H 'X-API-KEY: ' -H 'X-SUBACCOUNT-ID: ' -d '{ "city": , "countryCode": , "nationalityCountryCode": , "stateCode": , "streetAddress": , "zip": }' ``` -------------------------------- ### GET /v1/social-pay/order Source: https://api.bit2me.com/openapi Retrieves a list of all pending pay orders for the authenticated user. ```APIDOC ## GET /v1/social-pay/order ### Description Get all pending pay order of a user. ### Method GET ### Endpoint /v1/social-pay/order ### Response #### Success Response (200) - **PayOrderData** (object) - Data for the user's pending pay orders. #### Response Example ```json { "example": "PayOrderData" } ``` #### Error Response (412, default) - **ErrorResponse** (object) - Details of the error. #### Response Example ```json { "example": "ErrorResponse" } ``` ``` -------------------------------- ### Create Subaccount Pocket (Shell) Source: https://api.bit2me.com/openapi Creates a new pocket for a subaccount with a specified currency, name, and optional color. Requires server URL, API key, and subaccount ID. ```Shell # Create subaccount pocket curl -X POST ${SERVER_URL}/v1/wallet/pocket -H 'Content-type: application/json' -H 'X-API-KEY: ' -H 'X-SUBACCOUNT-ID: ' -d ' { "currency":"BTC", "name":"Bitcoin pocket", "color":"0" }' ``` -------------------------------- ### GET /v1/account/subaccount Source: https://api.bit2me.com/openapi Retrieves a list of all subaccounts associated with the user's account. ```APIDOC ## GET /v1/account/subaccount ### Description Get my subaccounts ### Method GET ### Endpoint /v1/account/subaccount ### Parameters #### Query Parameters None #### Request Body None ### Response #### Success Response (200) - **total** (number) - The total number of subaccounts. - **data** (array) - An array of subaccount objects. - **id** (string) - The unique identifier for the subaccount. - **email** (string) - The email address of the subaccount. - **name** (string) - The first name of the subaccount user. - **surname** (string) - The last name of the subaccount user. - **phone** (string) - The phone number of the subaccount user. #### Response Example ```json { "total": 2, "data": [ { "id": "sub_123", "email": "sub1@example.com", "name": "John", "surname": "Doe", "phone": "+1234567890" }, { "id": "sub_456", "email": "sub2@example.com", "name": "Jane", "surname": "Smith", "phone": "+0987654321" } ] } ``` ``` -------------------------------- ### Receive BTC Testnet Transaction Notifications (Node.js) Source: https://api.bit2me.com/index This Node.js example shows how to connect to a specific WebSocket endpoint for BTC testnet transactions, subscribe to transaction notifications, and process incoming transaction data. It includes error handling for rate limits and incorrect explorer types. ```javascript const ws = new WebSocket (`wss://${host}:${port}/v1/explorer/BTCTEST`); ws.addEventListener ('error', err => { console.error ('websocket error:', err); }); ws.addEventListener ('open', () => { console.debug ('websocket connected'); // subscribe to 'inv' room ws.send (JSON.stringify ([ 'subscribe', 'inv' ])); }); ws.addEventListener ('message', message => { const msg = JSON.parse (message); // we want just transactions if (msg[0] === 'tx') { console.debug ('websocket message:', msg[1]); // ... } }); ws.addEventListener ('close', evt => { if (evt.code === 4001) { console.log (`Error rate limit: ${evt.code}/${evt.reason}`); } else if (evt.code === 4002) { console.log (`Wrong crypto explorer: ${evt.code}/${evt.reason}`); } // handle reconnect logic }); ``` -------------------------------- ### GET /v1/account/professions Source: https://api.bit2me.com/openapi Retrieves a list of professions. The profession names are returned in lowercase. ```APIDOC ## GET /v1/account/professions ### Description Retrieves a list of professions. The profession names are returned in lowercase. ### Method GET ### Endpoint /v1/account/professions ### Parameters #### Query Parameters - **langCode** (string) - Optional - Lang code for the response language. ### Response #### Success Response (200) - **total** (number) - The total number of professions available. - **data** (array) - An array of profession objects. - **name** (string) - The name of the profession (lowercase). #### Response Example ```json { "total": 5, "data": [ { "name": "engineer" }, { "name": "doctor" }, { "name": "teacher" }, { "name": "artist" }, { "name": "writer" } ] } ``` ``` -------------------------------- ### Order Creation Parameters Source: https://api.bit2me.com/openapi This section details the parameters required for creating various types of orders on the Bit2Me platform, including limit, stop-limit, and market orders. ```APIDOC ## POST /api/orders ### Description Creates a new order on the Bit2Me platform. Supports limit, stop-limit, and market orders with various options. ### Method POST ### Endpoint /api/orders ### Parameters #### Request Body - **side** (OrderSideParam) - Required - The direction of the order (buy or sell). - **symbol** (MarketSymbolParam) - Required - The market symbol for the trade (e.g., BTC/EUR). - **amount** (AmountParam) - Required - The order volume in the base currency. - **price** (AmountParam) - Optional - The price for limit orders in quote currency. - **stopPrice** (AmountParam) - Optional - The trigger price for stop-limit orders in quote currency. - **orderType** (OrderTypeParam) - Required - The type of order (limit, stop-limit, market). - **clientOrderId** (string) - Optional - A unique identifier for the order set by the client. - **postOnly** (PostOnlyParam) - Optional - If true, the limit order will only be created as a maker; otherwise, it will not be created. - **timeInForce** (TimeInForceParam) - Optional - Specifies how long the order should remain in the order book (GTC, IOC, FOK). - **amountInQuote** (boolean) - Optional - If true, the volume is expressed in quote currency. Supported only for market orders. ### Request Example ```json { "side": "buy", "symbol": "BTC/EUR", "price": "65000.5", "amount": "0.35", "orderType": "limit" } ``` ### Response #### Success Response (200) - **id** (uuid) - The unique identifier of the created order. - **status** (OrderStatusParam) - The current status of the order. #### Response Example ```json { "id": "536ee1dc-528a-419e-9c00-5e04c010658d", "status": "open" } ``` ``` -------------------------------- ### GET /v1/wallet/pocket Source: https://api.bit2me.com/openapi Retrieves details of a specific pocket or all pockets associated with the user. ```APIDOC ## GET /v1/wallet/pocket ### Description Retrieves the data of a specific pocket by its ID, or returns data for all pockets if no ID is provided. ### Method GET ### Endpoint /v1/wallet/pocket ### Parameters #### Path Parameters None #### Query Parameters - **id** (string) - Optional - The unique identifier of the pocket to retrieve. If omitted, all pockets for the user are returned. #### Request Body None ### Request Example ```shell # Get all pockets curl -X GET ${SERVER_URL}/v1/wallet/pocket \ -H 'Content-type: application/json' \ -H 'X-API-KEY: ' # Get a specific pocket curl -X GET ${SERVER_URL}/v1/wallet/pocket?id=01234567-89ab-cdef-0123-456789abcdef \ -H 'Content-type: application/json' \ -H 'X-API-KEY: ' ``` ### Response #### Success Response (200) - **id** (string) - The unique identifier of the pocket. - **name** (string) - The name of the pocket. - **color** (string) - The color identifier of the pocket. - **currency** (string) - The currency symbol of the pocket. - **balance** (number) - The current balance of the pocket. - **blockedBalance** (number) - The blocked balance of the pocket. - **createdAt** (string) - The timestamp when the pocket was created. #### Response Example ```json [ { "id": "01234567-89ab-cdef-0123-456789abcdef", "name": "Bitcoin pocket", "color": "0", "currency": "BTC", "balance": 1.2345, "blockedBalance": 0.5, "createdAt": "2023-10-27T10:00:00Z" } ] ``` ```