### Ripio Trade API: Sample Response for Get User Open Orders Source: https://apidocs.ripiotrade.co/index This snippet provides an example of a 200 OK response when calling the 'Get User Open Orders' endpoint. The 'data' object contains an 'orders' array, each representing an open order with detailed attributes, and a 'pagination' object for navigating results. ```JSON { "data": { "orders": [ { "create_date": "2017-12-08T23:42:54.960Z", "executed_amount": 0.02347418, "external_id": "B4A9F7F4-9C79-4921-9330-224C17260BDF", "id": "857C0A3B-D70F-4256-9051-1C62FADBA8FA", "pair": "BTC_BRL", "price": 42600, "remaining_amount": 0, "remaining_value": 0, "requested_amount": 0.02347418, "requested_value": 1000, "side": "buy", "status": "executed_completely", "fee": 0.004, "total_value": 1000, "type": "limit", "update_date": "2017-12-13T21:48:48.817Z" }, { "create_date": "2017-10-20T00:26:40.403Z", "executed_amount": 0.00033518, "external_id": "13080055-7357-4110-81B1-981E6699FA57", "id": "3ECBE371-DE24-42E8-841C-4281B3164CCE", "pair": "BTC_BRL", "price": 16352.12, "remaining_amount": 0, "remaining_value": 0, "requested_amount": 0.00033518, "requested_value": 5.48090358, "side": "buy", "status": "executed_completely", "fee": 0.004, "total_value": 5.48090358, "type": "limit", "update_date": "2017-10-20T00:26:40.467Z" } ], "pagination": { "current_page": 1, "registers_count": 21, "total_pages": 1, "page_size": 100 } }, "error_code": null, "message": null } ``` -------------------------------- ### JSON: Ripio Trade User Trades Subscription Request Payload Source: https://apidocs.ripiotrade.co/index This JSON snippet provides an example payload for subscribing to the 'user_trades' WebSocket topic. It demonstrates how to specify the 'subscribe' method, include 'user_trades' in the topics array, and provide a valid authentication 'ticket'. This sample serves as a practical guide for initiating a WebSocket subscription. ```json { "method": "subscribe", "topics": [ "user_trades" ], "ticket": "97794B95-AFE7-454F-81B0-9109112548C2" } ``` -------------------------------- ### Ripio Trade API: Get Orders List Response Sample Source: https://apidocs.ripiotrade.co/index This snippet provides an example of a successful response when retrieving a list of orders from the Ripio Trade API. It demonstrates the structure of order data, including details like creation date, executed amount, pair, price, and status, along with pagination information. ```APIDOC { "response_type": "200 OK", "content_type": "application/json", "example": { "data": { "orders": [ { "create_date": "2017-12-08T23:42:54.960Z", "executed_amount": 0.02347418, "external_id": "B4A9F7F4-9C79-4921-9330-224C17260BDF", "id": "857C0A3B-D70F-4256-9051-1C62FADBA8FA", "pair": "BTC_BRL", "price": 42600, "remaining_amount": 0, "remaining_value": 0, "requested_amount": 0.02347418, "requested_value": 1000, "side": "buy", "status": "executed_completely", "total_value": 1000, "type": "limit", "update_date": "2017-12-13T21:48:48.817Z", "fee": 1 }, { "create_date": "2017-10-20T00:26:40.403Z", "executed_amount": 0.00033518, "external_id": "13080055-7357-4110-81B1-981E6699FA57", "id": "3ECBE371-DE24-42E8-841C-4281B3164CCE", "pair": "BTC_BRL", "price": 16352.12, "remaining_amount": 0, "remaining_value": 0, "requested_amount": 0.00033518, "requested_value": 5.48090358, "side": "buy", "status": "executed_completely", "total_value": 5.48090358, "type": "limit", "update_date": "2017-10-20T00:26:40.467Z", "fee": 1 } ], "pagination": { "current_page": 1, "registers_count": 21, "total_pages": 1, "page_size": 100 } }, "error_code": null, "message": null } } ``` -------------------------------- ### Subscribe to Ripio Trade WebSocket Topics Source: https://apidocs.ripiotrade.co/index Learn how to connect to the Ripio Trade WebSocket service and subscribe to various topics. This includes examples for public topic subscriptions and how to use a generated ticket for private topics like order_status. ```JSON { "method": "subscribe", "topics": ["topic@BASE_QUOTE"] } ``` ```JSON { "message": null, "data": { "ticket": "d90a9a10-06af-44af-8592-baf866dd1503"} } ``` ```JSON { "method": "subscribe", "topics": ["order_status"], "ticket": "d90a9a10-06af-44af-8592-baf866dd1503" } ``` -------------------------------- ### Listen to `trade@BASE_QUOTE` WebSocket Topic Source: https://apidocs.ripiotrade.co/index This section details the `trade@BASE_QUOTE` WebSocket topic, which provides real-time updates on trades for a specified currency pair. It includes the request body schema for subscription and a comprehensive example of the trade event response, showing detailed trade information. ```APIDOC Request Body Schema: application/json Properties: - method: string (MethodEnum) (required) Enum: "subscribe", "unsubscribe", "ping" Description: Method to be executed - topics: Array of strings (TopicEnum) (required) Items Enum: "trade", "orderbook/level_3", "orderbook/level_2", "orderbook/level_2_with_users", "orderbook/level_2_delta", "ticker", "order_status", "balance", "user_trades", "deposit", "withdrawal" Description: Topics to subscribe to Response Schema: application/json Properties: - body: object (ISocketTrade) (required) - id: number (required) Description: Each WebSocket message includes a sequential numeric id. Each topic has its own unique sequence, and for private topics, the sequence is unique to each topic and user. It's important to note that some topics will send a "welcome message", which will have an id value of -1. Additionally, this sequence may be reset between connections, so be sure to update this value locally whenever you reconnect. - timestamp: number (required) Description: Timestamp in milliseconds - topic: string (TopicEnum) (required) Enum: "trade", "orderbook/level_3", "orderbook/level_2", "orderbook/level_2_with_users", "orderbook/level_2_delta", "ticker", "order_status", "balance", "user_trades", "deposit", "withdrawal" ``` ```JSON { "method": "subscribe", "topics": [ "trade@ETH_BRL" ] } ``` ```JSON { "id": 1, "topic": "trade@ETH_BRL", "timestamp": 1672856503549, "body": { "amount": 0.2404764, "date": "2019-01-03T02:27:33.947Z", "id": "2B222F22-5235-45FA-97FC-E9DBFA2575EE", "maker_order_id": "F49F5BD8-3F5B-4364-BCEE-F36F62DB966A", "maker_side": "buy", "maker_type": "limit", "pair": "ETH_BRL", "price": 15160, "taker_order_id": "FEAB5CEC-7F9E-4F95-B67D-9E8D5C739BE3", "taker_side": "sell", "taker_type": "market", "timestamp": 1675780847920, "total_value": 3638.4 } } ``` -------------------------------- ### Ripio Trade API Authorization Methods Source: https://apidocs.ripiotrade.co/index This section details the authorization process for the Ripio Trade API, covering required headers, timestamp-based security, and the method for generating request signatures. It provides examples to guide developers in securing their API calls. ```APIDOC ### Authorization - Headers - Timestamp Security - Generating Signature - Examples ``` -------------------------------- ### Ripio Trade API: Sample Response for Get Trades by Order ID Source: https://apidocs.ripiotrade.co/index This snippet shows an example of a 200 OK response from the 'Get Trades based on an order id' endpoint. The 'data' object contains a 'trades' array, where each element represents a trade with details like amount, date, fee, pair, price, and side, along with pagination. ```JSON { "data": { "trades": [ { "amount": 0.00270754, "date": "2019-04-02T11:22:22.403Z", "fee": 0.25, "fee_currency": "USDC", "id": "488F9395-47ED-4924-98AB-C860E1733A03", "maker_order_id": "1FD30735-E055-4200-AD3D-007B02A5BA92", "pair_code": "BTC_USDC", "taker_or_maker": "maker", "price": 18550, "side": "sell", "taker_order_id": "DBC6D4AF-D454-46DF-80EC-E19528A0FB25", "timestamp": 1675708481219, "type": "market", "total_value": 50.22 }, { "amount": 0.0026938, "date": "2019-04-02T11:25:41.512Z", "fee": 0.00001347, "fee_currency": "BTC", "id": "C79ED37D-DC21-4D54-8AFC-4262347E3F8D", "maker_order_id": "F49F5BD8-3F5B-4364-BCEE-F36F62DB966A", "pair_code": "BTC_USDC", "taker_or_maker": "taker", "price": 18550, "side": "buy", "taker_order_id": "FEAB5CEC-7F9E-4F95-B67D-9E8D5C739BE3", "timestamp": 1675708481220, "type": "market", "total_value": 49.96 } ], "pagination": { "current_page": 1, "registers_count": 21, "total_pages": 1, "page_size": 100 } }, "error_code": null, "message": null } ``` -------------------------------- ### APIDOC: Get Authenticated Tickers Statistics Source: https://apidocs.ripiotrade.co/index This endpoint, requiring API credentials, returns 24-hour window statistics for all currency pairs. It provides an overview of market activity for each pair. ```APIDOC Endpoint: GET /v4/ticker URL: https://api.ripiotrade.co/v4/ticker Authorizations: - API Credentials Responses: 200 OK Description: Ok Response Schema: application/json data (required): Array of objects (TickersResponseData) error_code (required): number or null. Value: null message (required): string or null Sample: (No sample provided in source content) ``` -------------------------------- ### APIDOC: Order Status Topic Overview Source: https://apidocs.ripiotrade.co/index This section details the 'order_status' WebSocket topic, which provides real-time updates on a user's orders. It includes the expected response schema, a sample request payload for subscription, and an example of a 200 OK response containing order details. Dependencies include a valid 'ticket' obtained from the Ripio Trade API. ```APIDOC Response Schema: application/json Properties: body: object (IOrderStatus) - Required id: number - Required Description: Each WebSocket message includes a sequential numeric id. Each topic has its own unique sequence, and for private topics, the sequence is unique to each topic and user. It's important to note that some topics will send a "welcome message", which will have an id value of -1. Additionally, this sequence may be reset between connections, so be sure to update this value locally whenever you reconnect. timestamp: number - Required Description: Timestamp in milliseconds topic: string (TopicEnum) - Required Enum: "trade", "orderbook/level_3", "orderbook/level_2", "orderbook/level_2_with_users", "orderbook/level_2_delta", "ticker", "order_status", "balance", "user_trades", "deposit", "withdrawal" ``` ```APIDOC Request Sample Payload: Content type: application/json { "method": "subscribe", "topics": [ "order_status" ], "ticket": "97794B95-AFE7-454F-81B0-9109112548C2" } ``` ```APIDOC Response Sample (200 OK): Content type: application/json { "id": 7, "topic": "order_status", "timestamp": 1672856713677, "body": { "amount": 4, "average_execution_price": 6, "id": "F55E4E01-C39B-4AA7-848B-1C6A362C386E", "created_at": "2023-01-24T17:28:32.247Z", "executed_amount": 4, "external_id": null, "pair": "ETH_BRL", "price": 6, "remaining_amount": 0, "side": "buy", "status": "executed_completely", "type": "limit", "updated_at": "2023-01-24T17:28:33.993Z", "user_id": "30B8CDBB-BDBD-4B60-A90F-860AB46B76F7" } } ``` -------------------------------- ### Ripio Trade API: Get User Open Orders Endpoint Source: https://apidocs.ripiotrade.co/index This section details the API endpoint for retrieving a user's open orders. It requires API Credentials for authorization and accepts several query parameters to filter and paginate the results. The response provides a list of open orders along with pagination details. ```APIDOC Method: GET Path: /v4/orders/open Base URL: https://api.ripiotrade.co Authorization: API Credentials Description: Lists the user's open orders. Query Parameters: - pair: string (Example: BTC_BRL) - Currency pair code - side: string (OrderSideParamV4) - Enum: "buy", "sell" - Order side (buy or sell) - page_size: number (PageSizeParamV4) - Range: [1..1000] - Default: 200 - Example: 100 - Number of registers per page - current_page: number (CurrentPageParamV4) - Default: 1 - Example: 3 - Current page Responses: - 200 OK: Description: Ok Content-Type: application/json Schema: - data: object (UserOpenOrdersDataV4) - required - error_code: number or null - required (Value: null) - message: string or null - required ``` -------------------------------- ### Ripio Trade API: Get Ticker By Pair Source: https://apidocs.ripiotrade.co/index Retrieves 24-hour window statistics for a specific currency pair. Requires API Credentials for authorization. The `pair` parameter is mandatory and specifies the currency pair code (e.g., BTC_BRL). ```APIDOC Endpoint: GET /ticker/{pair} Base URL: https://api.ripiotrade.co/v4 Description: Returns a 24 hour window statistics for a given pair. Authorizations: - API Credentials Path Parameters: - pair (required): string Example: BTC_BRL Description: Currency pair code Responses: - 200 OK Content-Type: application/json Schema: data (required): object (TickersResponseDataV4) error_code (required): number or null (Value: null) message (required): string or null ``` ```json { "data": { "ask": 95629, "base_code": "BTC", "base_id": "9A5E2EF4-9547-418A-8EC6-C6EADBB8B32F", "bid": 94171, "date": "2022-11-11T01:31:35.820Z", "first": 98444, "high": 98444, "is_frozen": false, "last": 94311, "low": 85034, "pair": "BTC_BRL", "price_change_percent_24h": "-12", "quote_id": "48898138-8623-4555-9468-B1A1505A9352", "quote_code": "BRL", "quote_volume": 150.1, "trades_quantity": 1199, "volume": 27.26776846 }, "error_code": null, "message": null } ``` -------------------------------- ### JSON: Ripiotrade User Statement Response Sample Source: https://apidocs.ripiotrade.co/index This JSON object illustrates a sample response for a user's financial statement, including transaction details like amount, balance, currency, date, and operation, along with pagination information. It provides an example of the data structure returned by statement-related API calls. ```json { "data": { "statement": [ { "amount": -0.00000476, "after_balance": 8605.31353851, "currency": "BTC", "date": "2022-01-27T18:16:10.557Z", "operation": "Tax over buy, executed" }, { "amount": 0.00119048, "after_balance": 8605.31354327, "currency": "BTC", "date": "2022-01-27T18:16:10.557Z", "operation": "Buy" } ], "pagination": { "current_page": 1, "registers_count": 21, "total_pages": 1, "page_size": 100 } }, "error_code": null, "message": null } ``` -------------------------------- ### Ripiotrade API: Get User Trading Fees Source: https://apidocs.ripiotrade.co/index Retrieves the trading fees for the authenticated user. This endpoint requires API Credentials for authorization. It takes a 'pair' code as a query parameter and returns an array of objects detailing maker and taker fees for both buy and sell sides. ```APIDOC Endpoint: GET /user/trading-fees URL: https://api.ripiotrade.co/v4/user/trading-fees Authorizations: - API Credentials Query Parameters: - pair (required): string - Pair code Responses: - 200 OK Content-Type: application/json Response Schema: data (required): Array of objects (UserPairFeeData) error_code (required): number or null (Value: null) message (required): string or null Response Sample (200 OK): Content-Type: application/json { "data": [ { "side": "buy", "maker": 0.21, "taker": 0.3 }, { "side": "sell", "maker": 0.21, "taker": 0.3 } ], "error_code": null, "message": null } ``` -------------------------------- ### Ripiotrade API: Generic Response Sample for Limits Source: https://apidocs.ripiotrade.co/index This is a generic response sample demonstrating the structure for an API call that might return currency-specific limits. It shows the currency_code, amount_limit, and amount_remaining for various assets. This sample is provided without a specific endpoint context but illustrates a common data structure. ```APIDOC Response Sample (200 OK): Content-Type: application/json { "data": [ { "currency_code": "1INCH", "amount_limit": 1933.3333333333333, "amount_remaining": 1933.3333333333333 }, { "currency_code": "AAVE", "amount_limit": 23.333333333333332, "amount_remaining": 23.333333333333332 }, { "currency_code": "ACA", "amount_limit": 23.333333333333332, "amount_remaining": 23.333333333333332 } ], "error_code": null, "message": null } ``` -------------------------------- ### Ripio Trade API: Generating Request Signatures Source: https://apidocs.ripiotrade.co/index This guide details the process for generating the cryptographic signature required for all private Ripio Trade API requests. It specifies that the signature must be an HMAC-SHA256 hash, Base64 encoded, derived from a concatenated message of Timestamp, HTTP Method, Path, and JSON Payload. Special considerations for GET requests and numerical payload formatting are also provided to prevent invalid signatures. ```APIDOC Signature Generation: - Encryption: HMAC-SHA256 and Base64 encoding. - Message Components (concatenated, no '+' signs): - Timestamp (same as sent in Header) - HTTP Method (e.g., GET, POST) - Path (For GET Requests, consider PATH without Query Params. E.g., '/withdrawals/estimate-rate/ADA?network=cardano_testnet' becomes '/withdrawals/estimate-fee') - JSON Payload (string, must be same as request Body; empty string for GET requests) - Important: - Avoid unnecessary decimal places in request body properties (e.g., use '1' instead of '1.0'). - Numbers can be sent as strings in the request body. ``` ```JSON { "amount": "0.01", "pair": "BTC_BRL", "price": "300000", "side": "buy", "type": "limit" } ``` -------------------------------- ### JSON Response Sample for Ticker Topic Source: https://apidocs.ripiotrade.co/index This JSON snippet provides a sample response for the "ticker@ETH_BRL" topic, delivering 24-hour window statistics for the ETH_BRL trading pair. It includes details such as bid/ask prices, volume, price change percentage, and other relevant market data. This response is received periodically after subscribing to the ticker topic. ```json { "id": 6, "topic": "ticker@ETH_BRL", "timestamp": 1672856683447, "body": { "ask": 4.01, "base_code": "ETH", "base_id": "27698137-8178-4395-9841-C1B1505C9352", "conversions": [ { "currency_code": "BRL", "volume": 0 }, { "currency_code": "BTC", "volume": 0 }, { "currency_code": "ETH", "volume": 0 }, { "currency_code": "USD", "volume": 0 }, { "currency_code": "USDC", "volume": 0 }, { "currency_code": "UXD", "volume": 0 }, { "currency_code": "ARS", "volume": 0 }, { "currency_code": "MXN", "volume": 0 } ], "bid": 5, "date": "2022-09-28T19:13:40.887Z", "high": 20, "low": 20, "pair": "ETH_BRL", "price_change_percent_24h": "-16.66", "quote_code": "BRL", "quote_id": "48898138-8623-4555-9468-B1A1505A9352", "quote_volume": 600, "trades_quantity": 10, "volume": 124, "first": 10, "last": 20 } } ``` -------------------------------- ### APIDOC: Get Public Server Time Source: https://apidocs.ripiotrade.co/index This endpoint returns the current server time in milliseconds. It is useful for synchronizing client-side operations with the server's timestamp. ```APIDOC Endpoint: GET /v4/public/server-time URL: https://api.ripiotrade.co/v4/public/server-time Responses: 200 OK Description: return the server time in miliseconds Response Schema: application/json message (required): string or null data (required): object Sample: { "data": { "timestamp": 1670004661380 }, "message": null } ``` -------------------------------- ### Ripio Trade API: Market Tickers List Response Sample Source: https://apidocs.ripiotrade.co/index This sample illustrates the structure of a successful API response containing a list of market tickers. Each ticker provides details like ask/bid prices, volume, and 24-hour price change for various currency pairs. ```json { "data": [ { "ask": 250000.15, "base_code": "BTC", "base_id": "9A5E2EF4-9547-418A-8EC6-C6EADBB8B32F", "bid": 240000.15, "date": "2017-10-20T00:00:00Z", "first": 245000.15, "high": 250000.15, "is_frozen": false, "last": 245000.15, "low": 200000.15, "pair": "BTC_BRL", "price_change_percent_24h": "-12", "quote_code": "BRL", "quote_id": "48898138-8623-4555-9468-B1A1505A9352", "quote_volume": 150.1, "trades_quantity": 123, "volume": 123.12345678 }, { "ask": 15600.12, "base_code": "ETH", "base_id": "13A4B83B-E74F-425C-BC0A-03A9C0F29FAD", "bid": 15400.12, "date": "2017-10-20T00:00:00Z", "first": 15999.15, "high": 15999.12, "is_frozen": false, "last": 15500.12, "low": 15000.12, "pair": "ETH_BRL", "price_change_percent_24h": "-12", "quote_id": "48898138-8623-4555-9468-B1A1505A9352", "quote_code": "BRL", "quote_volume": 180.1, "trades_quantity": 123, "volume": 123.12345678 } ], "error_code": null, "message": null } ``` -------------------------------- ### Ripio Trade API v4.0 Overview and General Information Source: https://apidocs.ripiotrade.co/index This section introduces the Ripio Trade API version 4.0, highlighting its current version, important considerations regarding endpoint usage (Market vs. Public), and the standard JSON response format for both success and error cases. It also details the URL structure and API rate limits based on user documentation status, along with their respective error messages. ```APIDOC ### Version This API is currently in the version 4. If there is need for any big change, a new version will be launched and this version will be maintained for at least 3 months. If you're still using the version 3, [access the old documentation](../v3) and check the [migration guide](#tag/V3-Endpoint-Migrations). ### Important Use the `Market` endpoints for all trading operations. The `Public` endpoints have a delay (cache) of up to 30 seconds. All successful requests will result in a 200 HTTP Status. All requests returns data in JSON format (application/json) and have a default body: ### Success ``` { "error_code": null, "message": null, "data": { } } ``` ### Error ``` { "error_code": [Error code], "message": "Error description", "data": null } ``` Endpoints that have a date filter will return data for the last 6 months if no value is sent in the `start_date` parameter. ### URL structure The endpoints URL follow this pattern: `https://api.ripiotrade.co/{version}/{method}[/{parameter}][?parameter=value...]` `https://api.ripiotrade.co/v4/tickers/BTC_BRL` ### Limits The request limits are based on the user's operational limits. There are two types of limit, one of requests per second and another of daily requests. Both of them should be taken in consideration and the requests should be balanced so the daily limit isn't reached. Users **without approved documentation** have 1 request per second or 86.400 daily requests. Users **with approved documentation** have 3.5 requests per second or 302.400 daily requests. These limits can be increased, and the support team should be contacted for that. When the requests per second limit is reached, the response HTTP Status returned is 429 and the response body is: ``` { "message": "Too many requests" } ``` When the daily requests limit is reached, the response HTTP Status returned is 429 and the response body is: ``` { "message": "Limit Exceeded" } ``` ``` -------------------------------- ### Ripio Trade API: Get User Balances Source: https://apidocs.ripiotrade.co/index Lists the authenticated user's current balances across various assets. This endpoint requires API Credentials for authorization. ```APIDOC Endpoint: GET /user/balances Description: Lists the user's balances. Authorizations: - API Credentials Responses: - 200 OK ``` -------------------------------- ### JSON Request Sample for Ticker Topic Subscription Source: https://apidocs.ripiotrade.co/index This JSON snippet demonstrates a sample request payload for subscribing to the "ticker@ETH_BRL" topic. It uses the "subscribe" method to request real-time 24-hour window statistics for the ETH_BRL trading pair. This request is used to initiate a data stream for ticker updates. ```json { "method": "subscribe", "topics": [ "ticker@ETH_BRL" ] } ``` -------------------------------- ### Get Ticker By Pair (24h Statistics) - Ripio Trade API Source: https://apidocs.ripiotrade.co/index Retrieves 24-hour window statistics for a specific trading pair. The pair is specified as a path parameter. This endpoint provides detailed metrics for a single currency pair. ```APIDOC ## Ticker By Pair Returns a 24 hour window statistics for a given pair. ##### path Parameters | | | | --- | --- | | pair required | string Example: BTC_BRL Currency pair code | ### Responses **200** Ok ##### Response Schema: application/json | | | | --- | --- | | data required | object (TickersResponseDataV4) | | error_code required | number or null Value: null | | message required | string or null | get/public/tickers/{pair} https://api.ripiotrade.co/v4/public/tickers/{pair} ### Response samples * 200 Content type application/json `{ * "data": { + "ask": 95629, + "base_code": "BTC", + "base_id": "9A5E2EF4-9547-418A-8EC6-C6EADBB8B32F", + "bid": 94171, + "date": "2022-11-11T01:31:35.820Z", + "first": 98444, + "high": 98444, + "is_frozen": false, + "last": 94311, + "low": 85034, + "pair": "BTC_BRL", + "price_change_percent_24h": "-12", + "quote_id": "48898138-8623-4555-9468-B1A1505A9352", + "quote_code": "BRL", + "quote_volume": 150.1, + "trades_quantity": 1199, + "volume": 27.26776846}, * "error_code": null, * "message": null }` ``` -------------------------------- ### Understand `orderbook/level_3@BASE_QUOTE` WebSocket Topic Source: https://apidocs.ripiotrade.co/index This topic provides real-time notifications for order book changes, including new orders, cancellations, and trades for a given currency pair. It ensures updates every 30 seconds, even without transactions, and includes up to 100 orders per side. ```APIDOC Topic: orderbook/level_3@BASE_QUOTE Description: This topic will notify whenever an order is opened, canceled or a trade happens for the given pair (BASE_QUOTE). By default, the system notifies the topic every 30 seconds, even if a transaction has not taken place. Each side will contain up to 100 orders. ``` -------------------------------- ### Ripio Trade API: Obtaining Credentials and Authorization Source: https://apidocs.ripiotrade.co/index This section details the process of creating API credentials (API Token and Secret Key) required for authenticating and signing all private REST requests on Ripio Trade. It highlights the critical importance of securely saving the Secret Key, which is viewable only once, and explains the different access types (Read, Buy/Sell, Cryptocurrency withdrawals) associated with API tokens. ```APIDOC API Credentials: - API Token: Used for authentication. - Secret Key: Used for signing private requests (viewable once, cannot be retrieved). Access Types: - Read: Default access for all tokens. - Buy/Sell: Allows trading operations. - Cryptocurrency withdrawals: Allows crypto withdrawals. - Tokens with Buy/Sell or Withdrawal access implicitly include Read access. ``` -------------------------------- ### Ripiotrade API: Get Daily Withdrawal Limits Source: https://apidocs.ripiotrade.co/index Documents the API endpoint to retrieve a user's daily withdrawal limits. This endpoint requires API Credentials for authorization and returns an array of UserWithdrawLimitData objects, along with error_code and message. ```APIDOC Endpoint: GET /v4/user/withdrawal-daily-limits URL: https://api.ripiotrade.co/v4/user/withdrawal-daily-limits Description: Gets the user daily withdrawal limits. Authorizations: - API Credentials Responses: 200 OK: Description: Ok Content-Type: application/json Schema: data: type: Array of objects (UserWithdrawLimitData) required: true error_code: type: number or null value: null required: true message: type: string or null required: true ``` ```JSON { "data": [ { "currency_code": "1INCH", "amount_limit": 58000, "amount_remaining": 58000 }, { "currency_code": "AAVE", "amount_limit": 700, "amount_remaining": 700 }, { "currency_code": "ACA", "amount_limit": 700, "amount_remaining": 700 } ], "error_code": null, "message": null } ``` -------------------------------- ### Ripio Trade WebSocket API: Deposit Topic Source: https://apidocs.ripiotrade.co/index This section details the WebSocket API for subscribing to deposit notifications. It outlines the required request body parameters for subscription and the structure of the successful response, including details about the deposit event. A valid ticket obtained from the /v4/ticket endpoint is necessary for authentication. ```APIDOC Request Body Schema: application/json - method: string (MethodEnum) required. Enum: "subscribe", "unsubscribe", "ping". Method to be executed. - topics: Array of strings (TopicEnum) required. Items Enum: "trade", "orderbook/level_3", "orderbook/level_2", "orderbook/level_2_with_users", "orderbook/level_2_delta", "ticker", "order_status", "balance", "user_trades", "deposit", "withdrawal". Topics to subscribe to. - ticket: string required. Ticket created using the endpoint POST https://api.ripiotrade.co/v4/ticket. ``` ```APIDOC Response Schema (200): application/json - body: SendFiatCashInToSocketUseCaseParams (object) or SendCryptoCashInToSocketUseCaseParams (object) (SendCashInToSocketUseCaseParams) required. - id: number required. Each WebSocket message includes a sequential numeric id. Each topic has its own unique sequence, and for private topics, the sequence is unique to each topic and user. It's important to note that some topics will send a "welcome message", which will have an id value of "-1". Additionally, this sequence may be reset between connections, so be sure to update this value locally whenever you reconnect. - timestamp: number required. Timestamp in milliseconds. - topic: string (TopicEnum) required. Enum: "trade", "orderbook/level_3", "orderbook/level_2", "orderbook/level_2_with_users", "orderbook/level_2_delta", "ticker", "order_status", "balance", "user_trades", "deposit", "withdrawal". ``` ```json { "method": "subscribe", "topics": [ "deposit" ], "ticket": "97794B95-AFE7-454F-81B0-9109112548C2" } ``` ```json { "id": 10, "topic": "deposit", "timestamp": 1673271591764, "body": { "id": "08799ECC-F6B1-498E-B89C-2A05E6A181B9", "amount": 1, "hash": "0x79704c92b31061b8f51e26486d6454aff3e3c58aa0d51f0f803d6fd063be8100", "currency_code": "ETH", "is_internal": false, "status": "confirmed", "create_date": "2023-01-09T13:39:24.057Z", "update_date": "2023-01-09T13:39:25.001Z", "user_id": "5B6A43AE-8012-402D-966F-87CF64689535", "confirmation_date": "2023-01-09T13:39:25.001Z", "address": "3PQhyXH1EZs1bZ23ZafqQDyeViqxn5KdXN", "network": "bitcoincash" } } ``` -------------------------------- ### Ripiotrade API: Get Monthly Withdrawal Limits Source: https://apidocs.ripiotrade.co/index Documents the API endpoint to retrieve a user's monthly withdrawal limits. This endpoint requires API Credentials for authorization and returns an array of UserWithdrawLimitData objects, along with error_code and message. ```APIDOC Endpoint: GET /v4/user/withdrawal-monthly-limits URL: https://api.ripiotrade.co/v4/user/withdrawal-monthly-limits Description: Gets the user monthly withdrawal limits. Authorizations: - API Credentials Responses: 200 OK: Description: Ok Content-Type: application/json Schema: data: type: Array of objects (UserWithdrawLimitData) required: true error_code: type: number or null value: null required: true message: type: string or null required: true ``` ```JSON { "data": [ { "currency_code": "1INCH", "amount_limit": 58000, "amount_remaining": 58000 }, { "currency_code": "AAVE", "amount_limit": 700, "amount_remaining": 700 }, { "currency_code": "ACA", "amount_limit": 700, "amount_remaining": 700 } ], "error_code": null, "message": null } ``` -------------------------------- ### APIDOC: Get Estimated Order Price Source: https://apidocs.ripiotrade.co/index This endpoint retrieves an estimated price for an order based on the specified currency pair. It requires the currency pair as a path parameter. The response includes the estimated price, along with error code and message fields. ```APIDOC GET /v4/orders/estimate-price/{pair} Base URL: https://api.ripiotrade.co Response Schema: application/json data required: object (EstimatedPriceResponseDataV4) error_code required: number or null (Value: null) message required: string or null Response Sample (200): { "data": { "price": 54049.12 }, "error_code": null, "message": null } ``` -------------------------------- ### Ripio Trade General Utility Endpoints Source: https://apidocs.ripiotrade.co/index This section highlights general utility endpoints in the Ripio Trade API, specifically focusing on retrieving a list of all supported trading pairs. This endpoint provides essential information for understanding available markets. ```APIDOC ### General endpoints - getPairs ``` -------------------------------- ### APIDOC: Get Single Cryptocurrency Deposit Source: https://apidocs.ripiotrade.co/index This endpoint retrieves details for a specific cryptocurrency deposit using either its unique ID or transaction hash. It requires API credentials for authorization. The response provides a single deposit object with comprehensive details. ```APIDOC GET /v4/deposits/deposit Base URL: https://api.ripiotrade.co Authorizations: API Credentials Query Parameters: id: string (Example: id=000A650D-F8A5-419A-A4C4-194452345981, Deposit identifier) hash: string (Example: hash=000A650D-F8A5-419A-A4C4-194452345981, Transaction hash) Responses: 200: Ok Response Schema: application/json data required: object (DepositV4) error_code required: number or null (Value: null) message required: string or null Response Sample (200): { "data": { "amount": 2.29999999, "confirmation_date": "2017-10-12T22:40:08.273Z", "create_date": "2017-10-12T22:40:08.273Z", "currency_code": "BTC", "id": "3D41EEF3-A709-4EE5-BDEE-B6435CAA84C8", "is_internal": false, "hash": "4f87d009d88524e627b60c6fbe4ebe671a99lk9ad72aab17e0963c5fbef118e2", "network": "bitcoin", "status": "confirmed" }, "error_code": null, "message": null } ``` -------------------------------- ### Ripio Trade API: Sample Generic 200 OK Response Source: https://apidocs.ripiotrade.co/index This snippet illustrates a successful 200 OK API response structure. It contains a 'data' object with various fields like 'create_date', 'executed_amount', 'id', 'pair', 'price', 'side', 'status', and 'type'. It also includes 'error_code' and 'message' fields, which are null on success. ```JSON { "data": { "create_date": "2017-12-08T23:42:54.960Z", "executed_amount": 0.02347418, "external_id": "B4A9F7F4-9C79-4921-9330-224C17260BDF", "id": "7155ED34-9EC4-4733-8B32-1E4319CB662F", "pair": "BTC_BRL", "price": 42600, "remaining_amount": 0.1, "remaining_value": 0.6, "requested_amount": 0.02347418, "requested_value": 1000, "side": "buy", "status": "canceled", "total_value": 1000, "type": "limit", "update_date": "2017-12-13T21:48:48.817Z" }, "error_code": null, "message": null } ``` -------------------------------- ### Get All Tickers (24h Statistics) - Ripio Trade API Source: https://apidocs.ripiotrade.co/index Retrieves 24-hour window statistics for all available trading pairs. The response includes various metrics like ask/bid prices, volumes, and price changes. This endpoint is part of the public API. ```APIDOC ## Tickers Returns a 24 hour window statistics for all pairs. ### Responses **200** Ok ##### Response Schema: application/json | | | | --- | --- | | data required | Array of objects (TickersResponseData) | | error_code required | number or null Value: null | | message required | string or null | get/public/tickers https://api.ripiotrade.co/v4/public/tickers ### Response samples * 200 Content type application/json `{ * "data": [ + { - "ask": 250000.15, - "base_code": "BTC", - "base_id": "9A5E2EF4-9547-418A-8EC6-C6EADBB8B32F", - "bid": 240000.15, - "date": "2017-10-20T00:00:00Z", - "first": 245000.15, - "high": 250000.15, - "is_frozen": false, - "last": 245000.15, - "low": 200000.15, - "pair": "BTC_BRL", - "price_change_percent_24h": "-12", - "quote_code": "BRL", - "quote_id": "48898138-8623-4555-9468-B1A1505A9352", - "quote_volume": 150.1, - "trades_quantity": 123, - "volume": 123.12345678}, + { - "ask": 15600.12, - "base_code": "ETH", - "base_id": "13A4B83B-E74F-425C-BC0A-03A9C0F29FAD", - "bid": 15400.12, - "date": "2017-10-20T00:00:00Z", - "first": 15999.15, - "high": 15999.12, - "is_frozen": false, - "last": 15500.12, - "low": 15000.12, - "pair": "ETH_BRL", - "price_change_percent_24h": "-12", - "quote_id": "48898138-8623-4555-9468-B1A1505A9352", - "quote_code": "BRL", - "quote_volume": 180.1, - "trades_quantity": 123, - "volume": 123.12345678}], * "error_code": null, * "message": null }` ``` -------------------------------- ### Ripio Trade Ticker Information Endpoints Source: https://apidocs.ripiotrade.co/index This section focuses on Ripio Trade API endpoints dedicated to retrieving ticker information. It includes methods to get all market tickers and to query the ticker for a specific trading pair, providing real-time price and volume data. ```APIDOC ### Ticker - getTickers - getTicker By Pair ``` -------------------------------- ### JSON Response for Orderbook Level 2 with Users Source: https://apidocs.ripiotrade.co/index This JSON snippet illustrates a sample response for the "orderbook/level_2_with_users" topic. It provides real-time order book data, including bid and ask prices, amounts, and associated user IDs for each order. This data is crucial for understanding market depth and participant activity. ```json { "id": 5, "topic": "orderbook/level_2_with_users@ETH_BRL", "timestamp": 1672856653428, "body": { "asks": [ { "amount": 184.9, "price": 20, "users": [ "5EF6B2C9-28C9-4C50-99EA-7F3A38958F0A" ] }, { "amount": 10, "price": 25, "users": [ "5EF6B2C9-28C9-4C50-99EA-7F3A38958F0A" ] } ], "bids": [ { "amount": 400, "price": 5, "users": [ "5EF6B2C9-28C9-4C50-99EA-7F3A38958F0A" ] }, { "amount": 20, "price": 4, "users": [ "5EF6B2C9-28C9-4C50-99EA-7F3A38958F0A" ] } ], "pair": "ETH_BRL", "hash": "2254383345" } } ```