> ## Documentation Index
> Fetch the complete documentation index at: https://docs.cdp.coinbase.com/llms.txt
> Use this file to discover all available pages before exploring further.

# private/get_order_margin_by_ids

> Retrieves the initial margin requirements for one or more orders identified by their order IDs. Initial margin is the amount of funds required to open a position with these orders.

This method is useful for calculating margin requirements before placing orders, helping to ensure sufficient funds are available.

**Scope:** `rat#view` or `wallet:transactions:read`

[Try in API console](https://test.deribit.com/api_console?method=%2Fprivate%2Fget_order_margin_by_ids)





## OpenAPI

````yaml /api-reference/coinbase-deribit-app-api/adv-starbase-openapi.json get /private/get_order_margin_by_ids
openapi: 3.0.0
info:
  description: Coinbase Retail Advanced Trade API for derivatives trading.
  title: Coinbase Retail Advanced Trade (Deribit) API
  version: 2.1.1
servers:
  - url: https://drb.coinbase.com/api/v2
security: []
tags:
  - description: Can only be used over websockets.
    name: WebSocket Only
  - description: Public methods can be used without authentication.
    name: Public
  - description: >-
      <p>Private methods require authentication. All requests must include a
      valid OAuth2 token.</p>

      <p>A token can be requested using the <a
      href="#public-auth">/public/auth</a> method.</p>

      <p>When using the websockets protocol, the token must be included as a
      parameter <code>access_token</code> in the message. When using REST (HTTP
      GET), the token may also be passed in the <code>Authorization</code>
      header.</p>
    name: Private
  - name: Authentication
  - name: Session Management
  - description: >-
      Subscription works as [notifications](#notifications), so users will
      automatically (after subscribing) receive messages from the server.
      Overview for each channel response format is described in
      [subscriptions](#subscriptions) section.
    name: Subscription Management
  - name: Account Management
  - name: Trading
  - name: Market Data
paths:
  /private/get_order_margin_by_ids:
    get:
      tags:
        - Trading
        - Private
      description: >+
        Retrieves the initial margin requirements for one or more orders
        identified by their order IDs. Initial margin is the amount of funds
        required to open a position with these orders.


        This method is useful for calculating margin requirements before placing
        orders, helping to ensure sufficient funds are available.


        **Scope:** `rat#view` or `wallet:transactions:read`


        [Try in API
        console](https://test.deribit.com/api_console?method=%2Fprivate%2Fget_order_margin_by_ids)

      parameters:
        - description: Ids of orders
          explode: true
          in: query
          name: ids
          required: true
          schema:
            example:
              - ETH-349280
              - ETH-349279
              - ETH-349278
            items:
              example: '123456'
              type: string
            type: array
          style: form
      requestBody:
        content:
          application/json:
            examples:
              request:
                description: JSON-RPC Request Example
                value:
                  id: 5625
                  jsonrpc: '2.0'
                  method: private/get_order_margin_by_ids
                  params:
                    ids:
                      - ETH-349280
                      - ETH-349279
                      - ETH-349278
        description: JSON-RPC request body
      responses:
        '200':
          $ref: '#/components/responses/PrivateGetOrderMarginByIdsResponse'
components:
  responses:
    PrivateGetOrderMarginByIdsResponse:
      content:
        application/json:
          examples:
            response:
              description: Response example
              value:
                id: 5625
                jsonrpc: '2.0'
                result:
                  - initial_margin: 0.00091156
                    initial_margin_currency: ETH
                    order_id: ETH-349278
                  - initial_margin: 0
                    initial_margin_currency: ETH
                    order_id: ETH-349279
                  - initial_margin: 0
                    initial_margin_currency: ETH
                    order_id: ETH-349280
          schema:
            $ref: '#/components/schemas/PrivateGetOrderMarginByIdsResponse'
      description: Success response
  schemas:
    PrivateGetOrderMarginByIdsResponse:
      properties:
        id:
          description: The id that was sent in the request
          type: integer
        jsonrpc:
          description: The JSON-RPC version (2.0)
          enum:
            - '2.0'
          type: string
        result:
          items:
            $ref: '#/components/schemas/order_id_initial_margin_pair'
          type: array
      required:
        - jsonrpc
        - result
      type: object
    order_id_initial_margin_pair:
      properties:
        initial_margin:
          description: Initial margin of order
          type: number
        initial_margin_currency:
          description: Currency of initial margin
          type: string
        order_id:
          $ref: '#/components/schemas/order_id'
      required:
        - order_id
        - initial_margin
      type: object
    order_id:
      description: Unique order identifier
      example: ETH-100234
      type: string

````