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

# Calculate initial margin requirement



## OpenAPI

````yaml openapi/order-gateway.json POST /initial-margin-requirement
openapi: 3.1.0
info:
  title: ax-order-gateway
  description: ''
  license:
    name: ''
  version: 15.24.0
servers:
  - url: https://gateway.architect.exchange/orders
security: []
tags:
  - name: order-gateway
    description: Order gateway
paths:
  /initial-margin-requirement:
    post:
      tags:
        - order-gateway
      operationId: initial_margin_requirement
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/PlaceOrderRequest'
        required: true
      responses:
        '200':
          description: Initial margin requirement preview
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/InitialMarginRequirementResponse'
      security:
        - session_token: []
components:
  schemas:
    PlaceOrderRequest:
      type: object
      required:
        - s
        - d
        - q
        - p
        - tif
      properties:
        aid:
          type:
            - string
            - 'null'
          description: >-
            Optional account ID. If omitted, the account is inferred from the
            connection: the

            user's default account, or the session account for an account-scoped
            session.
        cid:
          oneOf:
            - type: 'null'
            - $ref: '#/components/schemas/ClientOrderId'
              description: Optional client order ID; 64 bit integer
        d:
          $ref: '#/components/schemas/Side'
          description: Order side; buying ("B") or selling ("S")
        p:
          type: string
          description: Order price in USD as decimal string; e.g. "1.2345"
        po:
          type: boolean
          description: >-
            Post-only ("maker-or-cancel"): `false` (default) lets the order
            take;

            `true` makes it maker-only. When post-only, `reprice_behavior`
            selects

            what happens if the order would cross on entry (default: reject).
        q:
          type: integer
          format: int64
          description: Order quantity in contracts; e.g. 100, 1000
          minimum: 0
        rb:
          $ref: '#/components/schemas/RepriceBehavior'
          description: >-
            Reprice behavior for an aggressive post-only order. Meaningful only
            when

            `post_only` is `true`; ignored otherwise. Defaults to `Reject` (the
            order

            is rejected if it would cross on entry).
        s:
          type: string
          description: Order symbol; e.g. XAU-PERP, EURUSD-PERP
        st:
          $ref: '#/components/schemas/SelfTradeBehavior'
          description: >-
            Self-trade prevention behavior. Defaults to `CancelIncoming`.


            The short aliases `xi`, `xr`, and `xb` are also accepted for
            `CancelIncoming`,

            `CancelResting`, and `CancelBoth`, respectively.


            - `CancelIncoming`: cancel the incoming aggressor order; resting
            orders remain on the book.

            - `CancelResting`: cancel resting orders that would self-match;
            allow the incoming aggressor order.

            - `CancelBoth`: cancel both the resting orders and the incoming
            aggressor order.
        tag:
          type:
            - string
            - 'null'
          description: Optional order tag; maximum 10 alphanumeric characters
        tif:
          type: string
          description: >-
            Order time in force; e.g. "GTC", "IOC".

            "DAY" is accepted but deprecated and will be removed in a future
            release — use "GTC" instead.
    InitialMarginRequirementResponse:
      type: object
      required:
        - im_pct
        - im
        - pos
        - mult
      properties:
        im:
          type: string
          description: Initial margin requirement for the order; e.g. "1000.00"
        im_pct:
          type: string
          description: Initial margin percentage for the order symbol
        mult:
          type: string
          description: Multiplier for the order symbol
        pos:
          type: integer
          format: int64
          description: Current signed position in the order symbol
    ClientOrderId:
      type: integer
      format: int64
      minimum: 0
    Side:
      type: string
      enum:
        - B
        - S
    RepriceBehavior:
      type: string
      description: >-
        Reprice behavior for an aggressive post-only order — the wire `rb`
        field,

        meaningful only alongside `po = true`. Defaults to `Reject`.
      enum:
        - rej
        - bo
        - tbl
    SelfTradeBehavior:
      type: string
      description: >-
        Controls how the matching engine handles an order that would trade
        against the

        submitter's own resting orders. Defaults to `CancelIncoming`.
      enum:
        - CancelIncoming
        - CancelResting
        - CancelBoth
  securitySchemes:
    session_token:
      type: http
      scheme: bearer
      description: User session token

````