Ripio General endpoints API

The General endpoints API from Ripio — 3 operation(s) for general endpoints.

Operations 3

GET /pairs Pairs #
GET /trades Trades #
GET /currencies Currencies #

Work with this as data

Every API here is available over the APIs.io API and to AI agents over MCP.

MCP server

One button, every client — Claude, Cursor, VS Code and the rest.

https://apis.io/mcp

Tools for apis

7 MCP tools reach this
  • find_apisBrowse and filter every API in the catalog.
  • get_api_artifactsOne API's artifacts, grouped by type.
  • get_openapiThe primary OpenAPI for this API.
  • find_similar_apisAPIs that look like this one.
  • apis_io_searchSTART HERE — APIs, providers and tags for one query, each with its total.
  • resolveTurn a domain, URL or GitHub org into the provider it belongs to.
  • find_cohortsEvery scored population of providers in the catalog.
All 92 tools →

Call it yourself

curl for this page
This API
curl "https://apis.io/api/v1/apis/ripio-general-endpoints-api"
All apis
curl "https://apis.io/api/v1/apis?limit=25"

Discovery needs no key. Ratings and market analysis are Pro.

Get an API key

Free tier, no form to fill in. Signing in shares your email address with us — we store it to create your key and to recognise you if you sign in with another provider. See our Privacy Policy and Terms.

A second provider on the same verified email joins the account you already have.

OpenAPI Specification

ripio-general-endpoints-api-openapi.yml Raw ↑
openapi: 3.2.0
info:
  title: Ripio Trade - API Documentation General endpoints API
  version: v4.0
  description: Welcome to the Ripio Trade API documentation.
  contact:
    name: Jorn Filho
  x-logo:
    url: https://trade-images.ripio.com/general_images/logo-ripio.png
    href: '#'
servers:
- url: https://api.ripiotrade.co/v4/
tags:
- name: General Endpoints
paths:
  /pairs:
    get:
      operationId: GetPairs
      responses:
        '200':
          description: Ok
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PairsResponseV4'
      description: Lists the active currency pairs available in the platform.
      summary: Pairs
      tags:
      - General Endpoints
      security:
      - API Credentials:
        - Read
      parameters:
      - description: Currency pair code
        in: query
        name: pair
        required: false
        schema:
          type: string
        example: BTC_BRL
      - in: query
        name: countries
        required: false
        schema:
          $ref: '#/components/schemas/CountriesParamV4'
      x-mcp:
        enabled: true
        name: get_trading_pairs
        usage: '- To list all available trading pairs for authenticated users

          - To get pair configuration and trading rules with user-specific permissions

          - For building trading interfaces with user context'
  /trades:
    get:
      operationId: GetTrades
      responses:
        '200':
          description: Ok
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/CursorTradesResponse'
      description: Lists the trades history based on the filtering criteria.
      summary: Trades
      tags:
      - General Endpoints
      security:
      - API Credentials:
        - Read
      parameters:
      - description: Currency pair code
        in: query
        name: pair
        required: true
        schema:
          type: string
        example: BTC_BRL
      - in: query
        name: start_time
        required: false
        schema:
          $ref: '#/components/schemas/StartDateTimeNoMinParamV4'
      - in: query
        name: end_time
        required: false
        schema:
          $ref: '#/components/schemas/EndDateTimeNoMinParamV4'
      - in: query
        name: page_size
        required: false
        schema:
          $ref: '#/components/schemas/PageSizeParamV4'
      - description: The `c` parameter is the cursor you should use to fetch the next page of results
        in: query
        name: c
        required: false
        schema:
          type: string
      x-mcp:
        enabled: true
        name: get_trades_history
        usage: '- To get authenticated user trades history for a trading pair

          - To analyze user-specific market activity and trading patterns

          - For tracking personal trading volume and performance'
  /currencies:
    get:
      operationId: GetCurrencies
      responses:
        '200':
          description: Ok
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/CurrenciesResponseV4'
      description: Lists the active currencies available in the platform.
      summary: Currencies
      tags:
      - General Endpoints
      security:
      - API Credentials:
        - Read
      parameters:
      - description: Currency code
        in: query
        name: currency_code
        required: false
        schema:
          type: string
      - in: query
        name: countries
        required: false
        schema:
          $ref: '#/components/schemas/CountriesParamV4'
      x-mcp:
        enabled: true
        name: get_currencies
        usage: '- To list available currencies for authenticated users

          - To get currency information with user-specific permissions

          - For building trading interfaces with user context and restrictions'
components:
  schemas:
    CursorTradesResponse:
      properties:
        data:
          $ref: '#/components/schemas/CursorTradesResponseData'
        error_code:
          type:
          - number
          - 'null'
          enum:
          - null
          example: null
        message:
          type:
          - string
          - 'null'
          example: null
      required:
      - data
      - error_code
      - message
      type: object
      additionalProperties: false
    EndDateTimeNoMinParamV4:
      type: string
      default: '[Current datetime]'
      example: '2020-01-02T23:59:59-03:00'
      format: datetime
      description: Final datetime filter in ISO-8601 format
    CursorTradesResponseData:
      properties:
        trades:
          items:
            $ref: '#/components/schemas/Trade'
          type: array
          example:
          - 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: BTC_BRL
            price: 15160
            taker_order_id: FEAB5CEC-7F9E-4F95-B67D-9E8D5C739BE3
            taker_side: sell
            taker_type: market
            timestamp: 1675708481219
            total_value: 3638.4
          - amount: 0.00563617
            date: '2019-01-03T02:27:33.943Z'
            id: CDC492A5-B1BF-4353-BE7A-43F51C371388
            maker_order_id: 53BF30D2-901C-43D5-B0D1-62CD05DFD02A
            maker_side: buy
            maker_type: limit
            pair: BTC_BRL
            price: 15163
            taker_order_id: E4B1B38D-C871-4476-9314-3DC23292F45E
            taker_side: sell
            taker_type: limit
            timestamp: 1675708481220
            total_value: 84.91
          - amount: 0.00680154
            date: '2019-01-03T02:27:33.940Z'
            id: 910AA20F-211F-4755-90A7-94227DB407D8
            maker_order_id: 1FD30735-E055-4200-AD3D-007B02A5BA92
            maker_side: buy
            maker_type: limit
            pair: BTC_BRL
            price: 15163.03
            taker_order_id: DBC6D4AF-D454-46DF-80EC-E19528A0FB25
            taker_side: sell
            taker_type: limit
            timestamp: 1675708481221
            total_value: 104.1
        nc:
          type:
          - string
          - 'null'
          description: This is the next cursor, use its value with the `c` parameter to retrieve the next page
        pc:
          type:
          - string
          - 'null'
          description: This is the previous cursor, use its value with the `c` parameter to retrieve the previous page
      required:
      - trades
      type: object
      additionalProperties: false
    PublicNetwork:
      properties:
        code:
          type: string
          description: Network code
          format: string
        memo:
          $ref: '#/components/schemas/PublicMemo'
          description: Memo information
          format: PublicTag
        tag:
          $ref: '#/components/schemas/PublicTag'
          description: Tag information
          format: PublicTag
      required:
      - code
      - memo
      - tag
      type: object
      additionalProperties: false
    PublicMemo:
      properties:
        deposit:
          type: boolean
          description: Flag that indicates if the network has memo for deposit
          format: boolean
        withdrawal:
          type: boolean
          description: Flag that indicates if the network has memo for withdrawal
          format: boolean
      required:
      - deposit
      - withdrawal
      type: object
      additionalProperties: false
    PublicCurrencyLogo:
      properties:
        svg:
          type: string
          description: Currency svg logo
          format: string
      required:
      - svg
      type: object
      additionalProperties: false
    StartDateTimeNoMinParamV4:
      type: string
      default: '[6 months ago]'
      example: '2020-01-01T00:00:00-03:00'
      format: datetime
      description: Initial datetime filter in ISO-8601 format
    CountriesParamV4:
      type: string
      example: BR,AR
      format: string
      description: Countries (One or many, use "," to separate)
    Trade:
      properties:
        amount:
          type: number
          format: double
          description: Amount
        date:
          type: string
          description: Trade date (UTC format)
        id:
          type: string
          description: Trade id
        maker_order_id:
          type: string
          description: Maker order id
        maker_side:
          type: string
          description: Maker order side (sell / buy)
        maker_type:
          type: string
          description: Maker order type (market / limit)
        price:
          type: number
          format: double
          description: Price
        pair:
          type: string
          description: Currency pair code
          example: BTC_BRL
        taker_order_id:
          type: string
          description: Taker order id
        taker_side:
          type: string
          description: Taker order side (sell / buy)
        taker_type:
          type: string
          description: Taker order type (market / limit)
        timestamp:
          type: number
          format: double
          description: Current timestamp
          example: 1675708481219
        total_value:
          type: number
          format: float
          description: Total value
      required:
      - amount
      - date
      - id
      - maker_order_id
      - maker_side
      - maker_type
      - price
      - pair
      - taker_order_id
      - taker_side
      - taker_type
      - timestamp
      - total_value
      type: object
      additionalProperties: false
    PublicTag:
      properties:
        deposit:
          type: boolean
          description: Flag that indicates if the network has tag for deposit
          format: boolean
        withdrawal:
          type: boolean
          description: Flag that indicates if the network has tag for withdrawal
          format: boolean
      required:
      - deposit
      - withdrawal
      type: object
      additionalProperties: false
    PairsResponseV4:
      properties:
        data:
          items:
            $ref: '#/components/schemas/PublicPairV4'
          type: array
        error_code:
          type:
          - number
          - 'null'
          enum:
          - null
          example: null
        message:
          type:
          - string
          - 'null'
          example: null
      required:
      - data
      - error_code
      - message
      type: object
      additionalProperties: false
    PublicCurrencyV4:
      properties:
        active:
          type: boolean
          description: Whether the currency is currently active for trading
          format: boolean
        can_deposit:
          type: boolean
          description: Whether deposits are enabled for this currency
          format: boolean
        can_withdraw:
          type: boolean
          description: Whether withdrawals are enabled for this currency
          format: boolean
        code:
          type: string
          description: Currency code
          example: BTC
        id:
          type: string
          description: Currency id
          format: string
        min_withdraw_amount:
          type: number
          format: float
          description: Minimum withdrawal amount
        name:
          type: string
          description: Currency name
          format: string
        needs_block_id_for_tx_sync:
          type: boolean
          description: Whether the currency requires a block ID for transaction synchronization
          format: boolean
        networks:
          items:
            $ref: '#/components/schemas/PublicNetwork'
          type: array
          description: Supported networks for the currency (undefined for fiduciary currency)
          format: PublicNetwork[]
        precision:
          type: number
          format: int32
          description: Currency decimal places
        logo:
          $ref: '#/components/schemas/PublicCurrencyLogo'
          description: Currency logo
          format: PublicCurrencyLogo
        countries:
          items:
            type: string
          type: array
          description: Available countries
      required:
      - active
      - can_deposit
      - can_withdraw
      - code
      - id
      - min_withdraw_amount
      - name
      - needs_block_id_for_tx_sync
      - precision
      - logo
      - countries
      type: object
      additionalProperties: false
      example:
        active: true
        can_deposit: true
        can_withdraw: true
        code: BTC
        id: e7a079d8-828d-42c8-bf48-8ee3ac1862d1
        min_withdraw_amount: 0.001
        name: Bitcoin
        needs_block_id_for_tx_sync: true
        networks:
        - code: bitcoin
          memo:
            deposit: false
            withdrawal: false
          tag:
            deposit: false
            withdrawal: false
        precision: 8
        countries:
        - BR
        - AR
        logo:
          svg: https://cryptocurrency-logos.ripio.com/svg/btc.svg
    PublicPairV4:
      properties:
        amount_tick:
          type: number
          format: float
          description: Smallest amount increment allowed
        base:
          type: string
          description: Base currency code
          format: string
        base_name:
          type: string
          description: Base currency full name
          format: string
        quote:
          type: string
          description: Quote currency code
          format: string
        quote_name:
          type: string
          description: Quote currency full name
          format: string
        symbol:
          type: string
          description: 'Currency pair code (format: BASE_QUOTE)'
          format: string
        enabled:
          type: boolean
          description: Whether the pair is currently available for trading
          format: boolean
        min_amount:
          type: number
          format: float
          description: Minimum order amount in base currency
        price_tick:
          type: number
          format: float
          description: Smallest price increment allowed
        min_value:
          type: number
          format: float
          description: Minimum order value in quote currency
        countries:
          items:
            type: string
          type: array
          description: Available countries
        max_price_variation:
          type: number
          format: int32
          description: Maximum price variation (in percentage), applicable either upward or downward, relative to the best price in the order book (e.g., `10` means `10%`)
      required:
      - amount_tick
      - base
      - base_name
      - quote
      - quote_name
      - symbol
      - enabled
      - min_amount
      - price_tick
      - min_value
      - countries
      type: object
      additionalProperties: false
      example:
        amount_tick: 0.0001
        base: BTC
        base_name: Bitcoin
        enabled: true
        min_amount: 0.0005
        min_value: 10
        price_tick: 1
        quote: BRL
        quote_name: Brazilian real
        symbol: BTC_BRL
        countries:
        - BR
        max_price_variation: 10
    PageSizeParamV4:
      type: number
      format: int32
      default: 200
      example: 100
      description: Number of records per page
      maximum: 1000
      minimum: 1
    CurrenciesResponseV4:
      properties:
        data:
          items:
            $ref: '#/components/schemas/PublicCurrencyV4'
          type: array
        error_code:
          type:
          - number
          - 'null'
          enum:
          - null
          example: null
        message:
          type:
          - string
          - 'null'
          example: null
      required:
      - data
      - error_code
      - message
      type: object
      additionalProperties: false
  securitySchemes:
    API_Credentials:
      type: apiToken
      in: header
      name: Authorization
      description: "You can create API Credentials on: <https://trade.ripio.com/market/api/token>.\n\n After creating the **API Credentials**, you'll need to save in a safe place two pieces of information, an **API Token** and a **Secret Key**. The credentials are required respectively to **Authenticate** and **Sign** all Private REST Requests.\n\n **Attention**: The Secret Key can only be viewed once and cannot be retrieved later. **If you lose the Secret Key, delete the set of credentials and create a new one**. \n\n Each endpoint requires a type of access, which can be `Read`, `Buy/Sell`, `Cryptocurrency withdrawals`, or can contain all of these, each one for its own function. It is possible for the token to be `Read` only, or it may have several types, if it has any other type of access such as: `Buy/Sell` or `Cryptocurrency withdrawals`, it will also be `Read` by default.\n\n\n## Headers\n\n\nFor all private routes, these Headers are required:\n\n| Header       | Description   |\n|--------------|---------------|\n| **Authorization**     | The API Token as a string.    |\n| **Timestamp**     | A timestamp in milliseconds. See the Timestamp Security section for more details.    |\n| **Timestamp-tolerance**     | An additional, non-required parameter, that you can send to specify the number of milliseconds after the timestamp for the request to be valid. See the Timestamp Security section for more details.   |\n| **Signature**     | See the Generating Signature section for more details.   |\n\n## Timestamp Security\n\n Timestamp Security is a security method to guarantee the validation of the acceptable time window, in addition to guaranteeing the uniqueness of the request **Signature**.\n\n* **All Private Requests** also require a **Header** parameter, **Timestamp**, which must be the timestamp in milliseconds of when the request was created and sent. Can be generated with `Date.now()` if you're using JavaScript, for example.\n\n* An additional parameter, **Timestamp-tolerance**, non-required, may be sent to specify the max number of milliseconds after the timestamp, that the request is valid. If Timestamp-tolerance is not sent, it defaults to **5000 (5 seconds)**.\n\n*  **It is recommended to use a small Timestamp-tolerance of 5000 (5 seconds) or less. The maximum value is 60,000 (60 seconds)**. \n\n## Generating Signature\n\nTo create a signature for all Private Requests, you must **encrypt** the hash-based message using **sha256 HMAC** and encode it in **Base64**. \n\n The **message** must contain:\n\n```\nTimestamp + HTTP Method + Path + JSON Payload\n```\n * Not including the **'+'** sign, just concatenate the content into a string.\n\n* The **Timestamp** is the same as the one sent in the Header.\n\n* For **GET** Requests, it is necessary to consider the **PATH** without **Query Params**. For example, this route: `/withdrawals/estimate-rate/ADA?network=cardano_testnet`. Just `/withdrawals/estimate-fee` is considered. Additionally, the **BODY** is considered an empty **String**.\n\n* **JSON Payload** must be a string and must be the same as the one sent in the request **Body**.\n\n**IMPORTANT:** To prevent an invalid signature, avoid using unnecessary decimal places in the request body properties. For instance, use `1` instead of `1.0`. Alternatively, you can also send numbers as strings in the request body, ensuring they are in the same format but as strings. For example:\n\n```json\n{\n  'amount': '0.01',\n  'pair': 'BTC_BRL',\n  'price': '300000', \n  'side': 'buy', \n  'type': 'limit'\n}\n\n```\n\n### Examples \n\nWe provide functional examples of how to authenticate with this API, written in various programming languages. You can find these examples in our GitHub repository: https://github.com/ripio/api."
      scopes:
        Read: Endpoints / token with read access.
        Buy/Sell: Endpoints / token with Buy and Sell orders access.
        Crypto Withdrawals: Endpoints / token with Crypto Withdrawals access.
        Fiat Withdrawals: Endpoints / token with Fiat Withdrawals access.
x-websocket-api:
  description: "# WebSocket API\n\nThe WebSocket API allows you to perform trading operations (create, cancel, and update orders) via WebSocket connection. This is separate from the WebSocket Stream service which provides real-time market data.\n\n## General API Information\n\n- **Base endpoint**: `wss://ws-api.ripio.com`\n- Connections remain active as long as there is activity; idle connections are disconnected after **60 seconds** of inactivity\n- The WebSocket server will automatically send ping frames to maintain connection health\n- If the WebSocket server does not receive a pong frame back from the connection within **60 seconds**, the connection will be disconnected\n- When you receive a ping, you must send a pong with a copy of ping's payload as soon as possible\n- Unsolicited pong frames are allowed, but will not prevent disconnection\n- Authentication is done using **API Token, Secret, and Timestamp** (same as REST API)\n- All timestamps are in **milliseconds** in UTC\n- All field names and values are **case-sensitive**\n- APIs have a timeout of **10 seconds** when processing a request\n\n## Authentication\n\nThe WebSocket API uses the same authentication mechanism as the REST API, including API Token, Secret, and Timestamp-based signature generation.\n\nFor complete authentication details, including signature generation, please refer to the **Authorization** section.\n\n### Key Points for WebSocket API:\n\n- Use the same **API Token** and **Secret** from your REST API credentials\n- Include `apiToken`, `timestamp`, and `signature` in the `params` object of each request\n- The signature is generated using: **Timestamp + JSON Body (business parameters only)**\n\n### Signature Generation for WebSocket API\n\nUnlike the REST API, the WebSocket signature is simpler because there's no HTTP method or path:\n\n**Message to sign:** `Timestamp + JSON Body`\n\n**Where:**\n- `Timestamp`: The same timestamp sent in the `params.timestamp` field (in milliseconds)\n- `JSON Body`: **ONLY the business parameters** (pair, side, type, amount, price, etc.). **DO NOT include** `apiToken`, `timestamp`, or `signature` in the body to sign.\n\n**Important:** Do NOT include `+` signs - just concatenate the values directly.\n\n### Signature Example\n\n**Request to send:**\n```json\n{\n  \"id\": \"req-001\",\n  \"method\": \"order.create\",\n  \"params\": {\n    \"pair\": \"BTC_BRL\",\n    \"side\": \"buy\",\n    \"type\": \"limit\",\n    \"amount\": 0.001,\n    \"price\": 100000,\n    \"apiToken\": \"your-api-token\",\n    \"timestamp\": 1634567890000,\n    \"signature\": \"calculated-signature\"\n  }\n}\n```\n\n**Body to sign (only business params):**\n```json\n{\n  \"pair\": \"BTC_BRL\",\n  \"side\": \"buy\",\n  \"type\": \"limit\",\n  \"amount\": 0.001,\n  \"price\": 100000\n}\n```\n\n**Message to sign:**\n```\n1634567890000{\"pair\":\"BTC_BRL\",\"side\":\"buy\",\"type\":\"limit\",\"amount\":0.001,\"price\":100000}\n```\n\n**Then generate HMAC SHA256 signature:**\n```javascript\nconst crypto = require('crypto');\nconst message = timestamp.toString() + JSON.stringify(bodyParams);\nconst signature = crypto.createHmac('sha256', secretKey).update(message).digest('base64');\n```\n\n## Request Format\n\nAll WebSocket API requests must follow this format:\n\n```json\n{\n  \"id\": \"unique-request-id\",\n  \"method\": \"order.create\",\n  \"params\": {\n    ...body parameters...,\n    \"apiToken\": \"your-api-token\",\n    \"timestamp\": 1634567890000,\n    \"signature\": \"calculated-signature\"\n  }\n}\n```\n\n## Response Format\n\n### Success Response\n\n```json\n{\n  \"id\": \"unique-request-id\",\n  \"status\": 200,\n  \"result\": {\n    \"id\": \"7155ED34-9EC4-4733-8B32-1E4319CB662F\",\n    \"create_date\": \"2024-03-27T13:27:19.853Z\",\n    \"executed_amount\": 0,\n    \"external_id\": \"BEAB10B1-45B0-4999-9B2F-D2ED048D6C42\",\n    \"pair\": \"BTC_BRL\",\n    \"remaining_amount\": 10,\n    \"remaining_value\": 1000,\n    \"requested_amount\": 10,\n    \"requested_value\": 1000,\n    \"side\": \"buy\",\n    \"status\": \"open\"\n  }\n}\n```\n\n### Error Response\n\n```json\n{\n  \"id\": \"unique-request-id\",\n  \"status\": 400,\n  \"result\": null,\n  \"error\": {\n    \"error_code\": 40011,\n    \"message\": \"Insufficient funds.\"\n  }\n}\n```"
  methods:
    order.create:
      summary: Create Order via WebSocket
      description: Creates a new trading order via WebSocket API. Supports all order types available in the REST API including limit, market, stop-limit, trailing, ceiling, and iceberg orders.
      requestSchema:
        $ref: '#/components/schemas/WebSocketCreateRequest'
      responseSchema:
        $ref: '#/components/schemas/WebSocketResponse'
      errorSchema:
        $ref: '#/components/schemas/WebSocketErrorResponse'
      examples:
        limitBuyOrder:
          summary: Create Limit Buy Order
          value:
            id: req-001
            method: order.create
            params:
              apiToken: your-api-token
              timestamp: 1634567890000
              signature: calculated-signature
              pair: BTC_BRL
              side: buy
              type: limit
              amount: 0.001
              price: 100000
              external_id: my-order-123
        marketSellOrder:
          summary: Create Market Sell Order
          value:
            id: req-002
            method: order.create
            params:
              apiToken: your-api-token
              timestamp: 1634567890000
              signature: calculated-signature
              pair: ETH_BRL
              side: sell
              type: market
              amount: 0.1
              value: 1000
      successResponse:
        id: req-001
        status: 200
        result:
          id: 7155ED34-9EC4-4733-8B32-1E4319CB662F
          status: open
          create_date: '2024-03-27T13:27:19.853Z'
          external_id: my-order-123
          pair: BTC_BRL
          side: buy
          executed_amount: 0
          remaining_amount: 0.001
          remaining_value: 100
          requested_amount: 0.001
          requested_value: 100
    order.cancel:
      summary: Cancel Order via WebSocket
      description: Cancels an active trading order via WebSocket API. You can cancel by order ID or external ID.
      requestSchema:
        type: object
        properties:
          id:
            type: string
            description: Unique request identifier for correlation
          method:
            type: string
            enum:
            - order.cancel
            description: WebSocket API method
          params:
            type: object
            properties:
              apiToken:
                type: string
                description: API Token for authentication
              timestamp:
                type: integer
                format: int64
                description: Timestamp in milliseconds
              signature:
                type: string
                description: HMAC SHA256 signature
              id:
                type: string
                description: Order ID (use either id or external_id, not both)
              external_id:
                type: string
                description: External Order ID (use either id or external_id, not both)
            required:
            - apiToken
            - timestamp
            - signature
        required:
        - id
        - method
        - params
      responseSchema:
        $ref: '#/components/schemas/WebSocketCancelResponse'
      errorSchema:
        $ref: '#/components/schemas/WebSocketErrorResponse'
      examples:
        cancelById:
          summary: Cancel Order by ID
          value:
            id: req-003
            method: order.cancel
            params:
              apiToken: your-api-token
              timestamp: 1634567890000
              signature: calculated-signature
              id: 7155ED34-9EC4-4733-8B32-1E4319CB662F
        cancelByExternalId:
          summary: Cancel Order by External ID
          value:
            id: req-004
            method: order.cancel
            params:
              apiToken: your-api-token
              timestamp: 1634567890000
              signature: calculated-signature
              external_id: my-order-123
      successResponse:
        id: req-003
        status: 200
        result:
          id: 7155ED34-9EC4-4733-8B32-1E4319CB662F
          create_date: '2024-03-27T13:27:19.853Z'
          executed_amount: 0
          remaining_amount: 0.001
          remaining_value: 100
          requested_amount: 0.001
          status: canceled
          total_value: 100
          type: limit
          price: 100000
          update_date: '2024-03-27T13:30:45.123Z'
          pair: BTC_BRL
          external_id: my-order-123
    order.update:
      summary: Update Order via WebSocket
      description: Updates the price and/or amount of an existing active order via WebSocket API. It is not possible to change a canceled or fully executed order.
      requestSchema:
        type: object
        properties:
          id:
            type: string
            description: Unique request identifier for correlation
          method:
            type: string
            enum:
            - order.update
            description: WebSocket API method
          params:
            type: object
            properties:
              apiToken:
                type: string
                description: API Token for authentication
              timestamp:
                type: integer
                format: int64
                description: Timestamp in milliseconds
              signature:
                type: string
                description: HMAC SHA256 signature
              order_id:
                type: string
                description: Order ID to update
              price:
                type: number
                description: New unit price (optional, but at least one of price or amount must be provided)
              amount:
                type: number
                description: New order amount (optional, but at least one of price or amount must be provided)
            required:
            - apiToken
            - timestamp
            - signature
            - order_id
        required:
        - id
        - method
        - params
      responseSchema:
        $ref: '#/components/schemas/WebSocketUpdateResponse'
      errorSchema:
        $ref: '#/components/schemas/WebSocketErrorResponse'
      examples:
        updatePriceAndAmount:
          summary: Update Order Price and Amount
          value:
            id: req-005
            method: order.update
            params:
              apiToken: your-api-token
              timestamp: 1634567890000
              signature: calculated-signature
              order_id: 7155ED34-9EC4-4733-8B32-1E4319CB662F
              price: 105000
              amount: 0.002
        updatePriceOnly:
          summary: Update Order Price Only
          value:
            id: req-006
            method: order.update
            params:
              apiToken: your-api-token
              timestamp: 1634567890000
              signature: calculated-signature
              order_id: 7155ED34-9EC4-4733-8B32-1E4319CB662F
              price: 110000
        updateAmountOnly:
          summary: Update Order Amount Only
          value:
            id: req-007
            method: order.update
            params:
              apiToken: your-api-token
              timestamp: 1634567890000
              signature: calculated-signature
              order_id: 7155ED34-9EC4-4733-8B32-1E4319CB662F
              amount: 0.003
      successResponse:
        id: req-005
        status: 200
        result: null