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

# Place order

> Place a good-till-cancelled limit order. Requires mm:trade and trading to be available for your account. The full quantity is accepted or the order is refused; D1 never resizes an order. A refused order creates nothing. Fills from the placement are on /executions when the response arrives.

If the result is unknown (timeout, network error, 5xx), resend the identical request with the same clientOrderId. Never re-send the same intent under a new clientOrderId.

Guide: [Orders](/market-makers/orders#place-an-order), [Trading Rules](/market-makers/trading-rules).



## OpenAPI

````yaml /api-reference/openapi.json post /mm/v1/orders
openapi: 3.1.0
info:
  title: D1 Market Maker API
  version: mm/v1
  description: >-
    API for authorized market makers: market data, account state, order
    placement and cancellation, fills and sequenced executions. Read endpoints
    require the mm:read scope; trading endpoints require mm:trade.
servers:
  - url: '{D1_API_URL}'
    description: Base URL provided by D1 during onboarding.
    variables:
      D1_API_URL:
        default: $D1_API_URL
        description: Provided by D1 during onboarding.
security:
  - bearerAuth:
      - mm:read
tags:
  - name: Status
  - name: Market data
  - name: Account
  - name: Orders
  - name: Trading
  - name: Executions
paths:
  /mm/v1/orders:
    post:
      tags:
        - Trading
      summary: Place order
      description: >-
        Place a good-till-cancelled limit order. Requires mm:trade and trading
        to be available for your account. The full quantity is accepted or the
        order is refused; D1 never resizes an order. A refused order creates
        nothing. Fills from the placement are on /executions when the response
        arrives.


        If the result is unknown (timeout, network error, 5xx), resend the
        identical request with the same clientOrderId. Never re-send the same
        intent under a new clientOrderId.


        Guide: [Orders](/market-makers/orders#place-an-order), [Trading
        Rules](/market-makers/trading-rules).
      operationId: placeOrder
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/PlaceOrderRequest'
            example:
              clientOrderId: q-20270115-000123
              instrumentId: <instrument-id>
              side: BUY
              type: LIMIT
              price:
                units: '105'
                decimals: 0
              quantity:
                units: '2'
                decimals: 0
      responses:
        '200':
          description: >-
            Duplicate: this clientOrderId already has an order with the same
            terms. Nothing new was created.
          content:
            application/json:
              schema:
                type: object
                properties:
                  order:
                    $ref: '#/components/schemas/Order'
                  duplicate:
                    type: boolean
                    description: >-
                      true when this clientOrderId already had an order with the
                      same terms; order is its current state.
                  serverTimeMs:
                    type: string
                    description: D1 server time, Unix milliseconds, as a decimal string.
                    example: '1800000000510'
                required:
                  - order
                  - duplicate
                  - serverTimeMs
              example:
                order:
                  orderId: <order-id>
                  clientOrderId: q-20270115-000123
                  instrumentId: <instrument-id>
                  side: BUY
                  type: LIMIT
                  price:
                    units: '105'
                    decimals: 0
                  quantity:
                    units: '2'
                    decimals: 0
                  requestedQuantity:
                    units: '2'
                    decimals: 0
                  acceptedQuantity:
                    units: '2'
                    decimals: 0
                  filledQuantity:
                    units: '1'
                    decimals: 0
                  remainingQuantity:
                    units: '1'
                    decimals: 0
                  cancelledQuantity:
                    units: '0'
                    decimals: 0
                  reductionReason: null
                  status: PARTIALLY_FILLED
                  cancelReason: null
                  createdAtMs: '1800000000500'
                  updatedAtMs: '1800000004000'
                  filledAtMs: null
                  cancelledAtMs: null
                duplicate: true
                serverTimeMs: '1800000000510'
        '201':
          description: 'Created: a new order.'
          content:
            application/json:
              schema:
                type: object
                properties:
                  order:
                    $ref: '#/components/schemas/Order'
                  duplicate:
                    type: boolean
                    description: >-
                      true when this clientOrderId already had an order with the
                      same terms; order is its current state.
                  serverTimeMs:
                    type: string
                    description: D1 server time, Unix milliseconds, as a decimal string.
                    example: '1800000000510'
                required:
                  - order
                  - duplicate
                  - serverTimeMs
              example:
                order:
                  orderId: <order-id>
                  clientOrderId: q-20270115-000123
                  instrumentId: <instrument-id>
                  side: BUY
                  type: LIMIT
                  price:
                    units: '105'
                    decimals: 0
                  quantity:
                    units: '2'
                    decimals: 0
                  requestedQuantity:
                    units: '2'
                    decimals: 0
                  acceptedQuantity:
                    units: '2'
                    decimals: 0
                  filledQuantity:
                    units: '1'
                    decimals: 0
                  remainingQuantity:
                    units: '1'
                    decimals: 0
                  cancelledQuantity:
                    units: '0'
                    decimals: 0
                  reductionReason: null
                  status: PARTIALLY_FILLED
                  cancelReason: null
                  createdAtMs: '1800000000500'
                  updatedAtMs: '1800000004000'
                  filledAtMs: null
                  cancelledAtMs: null
                duplicate: false
                serverTimeMs: '1800000000510'
        '400':
          $ref: '#/components/responses/BadRequestTrading'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '403':
          $ref: '#/components/responses/TradingForbidden'
        '404':
          description: UNKNOWN_INSTRUMENT.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
              example:
                error: UNKNOWN_INSTRUMENT
                message: …
        '409':
          description: IDEMPOTENCY_CONFLICT, MARKET_NOT_TRADING or MARKET_PAUSED.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
              example:
                error: IDEMPOTENCY_CONFLICT
                message: …
        '422':
          description: >-
            INSUFFICIENT_FUNDS, INSUFFICIENT_POSITION or RISK_LIMIT (with
            limit).
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
              example:
                error: RISK_LIMIT
                message: …
                limit: MAX_OPEN_EXPOSURE
        '429':
          $ref: '#/components/responses/RateLimited'
        '500':
          $ref: '#/components/responses/Internal'
      security:
        - bearerAuth:
            - mm:trade
components:
  schemas:
    PlaceOrderRequest:
      type: object
      additionalProperties: false
      properties:
        clientOrderId:
          type: string
          pattern: ^[A-Za-z0-9][A-Za-z0-9._:-]{0,63}$
          description: >-
            Your identifier for this order, unique per account forever. Retrying
            with the same clientOrderId and the same terms returns the existing
            order.
        instrumentId:
          type: string
          description: The market.
        side:
          type: string
          enum:
            - BUY
            - SELL
          description: SELL is sell-to-close only.
        type:
          type: string
          enum:
            - LIMIT
        price:
          allOf:
            - $ref: '#/components/schemas/Exact'
          description: >-
            Limit price. A multiple of priceTick, with the same decimals. units
            is a positive integer string.
        quantity:
          allOf:
            - $ref: '#/components/schemas/Exact'
          description: >-
            Contracts. A multiple of quantityStep, with the same decimals. units
            is a positive integer string.
      required:
        - clientOrderId
        - instrumentId
        - side
        - type
        - price
        - quantity
    Order:
      type: object
      properties:
        orderId:
          type: string
          description: Opaque order identifier.
        clientOrderId:
          type: string
          description: Client identifier the order was submitted with.
        instrumentId:
          type: string
        side:
          type: string
          enum:
            - BUY
            - SELL
        type:
          type: string
          enum:
            - LIMIT
        price:
          $ref: '#/components/schemas/Exact'
        quantity:
          $ref: '#/components/schemas/Exact'
          description: Accepted quantity. Same as acceptedQuantity; kept for compatibility.
        requestedQuantity:
          oneOf:
            - $ref: '#/components/schemas/Exact'
            - type: 'null'
          description: >-
            Quantity requested. Equal to acceptedQuantity for orders placed
            through this API. Null only on older orders that did not record it.
        acceptedQuantity:
          $ref: '#/components/schemas/Exact'
          description: >-
            Quantity D1 accepted. External MM V1 never reduces an order, so this
            equals requestedQuantity.
        filledQuantity:
          oneOf:
            - $ref: '#/components/schemas/Exact'
            - type: 'null'
          description: Executed so far. Null if not recorded.
        remainingQuantity:
          $ref: '#/components/schemas/Exact'
          description: Still resting and executable.
        cancelledQuantity:
          oneOf:
            - $ref: '#/components/schemas/Exact'
            - type: 'null'
          description: >-
            accepted − filled on a cancelled order, otherwise 0. Null when
            filledQuantity is unknown.
        reductionReason:
          oneOf:
            - type: string
              enum:
                - RISK_LIMIT
            - type: 'null'
          description: Why D1 accepted less than requested. Always null in V1.
        status:
          type: string
          enum:
            - PENDING_VALIDATION
            - OPEN
            - PARTIALLY_FILLED
            - FILLED
            - CANCEL_PENDING
            - CANCELLED
            - REJECTED
            - EXPIRED
        cancelReason:
          oneOf:
            - type: string
            - type: 'null'
          description: >-
            Why the order was cancelled; null if not cancelled or not recorded.
            Published values: USER, DEALER, DEALER_MASS_CANCEL, WATCHDOG,
            LOSS_LIMIT, ADMIN_PULL, ADMIN_HALT, EXPIRY_SOLVENCY, EXPIRY,
            SELF_TRADE_PREVENTION. Treat an unrecognised value as cancelled for
            an unknown reason.
        createdAtMs:
          type: string
          description: Creation time, Unix milliseconds, as a decimal string.
          example: '1800000000000'
        updatedAtMs:
          oneOf:
            - type: string
            - type: 'null'
          description: Unix milliseconds as a decimal string, or null if not recorded.
        filledAtMs:
          oneOf:
            - type: string
            - type: 'null'
          description: Unix milliseconds as a decimal string, or null.
        cancelledAtMs:
          oneOf:
            - type: string
            - type: 'null'
          description: Unix milliseconds as a decimal string, or null.
      required:
        - orderId
        - clientOrderId
        - instrumentId
        - side
        - type
        - price
        - quantity
        - requestedQuantity
        - acceptedQuantity
        - filledQuantity
        - remainingQuantity
        - cancelledQuantity
        - reductionReason
        - status
        - cancelReason
        - createdAtMs
        - updatedAtMs
        - filledAtMs
        - cancelledAtMs
    Error:
      type: object
      properties:
        error:
          type: string
          description: Stable error code.
          enum:
            - AUTH_REQUIRED
            - INVALID_API_KEY
            - API_KEY_REVOKED
            - DEALER_SUSPENDED
            - INSUFFICIENT_SCOPE
            - MALFORMED_REQUEST
            - INVALID_CURSOR
            - NOT_FOUND
            - RATE_LIMITED
            - INTERNAL
            - TRADING_DISABLED
            - UNKNOWN_INSTRUMENT
            - MARKET_NOT_TRADING
            - MARKET_PAUSED
            - INVALID_PRICE
            - INVALID_QUANTITY
            - IDEMPOTENCY_CONFLICT
            - INSUFFICIENT_FUNDS
            - INSUFFICIENT_POSITION
            - RISK_LIMIT
            - ORDER_NOT_FOUND
            - ORDER_NOT_CANCELLABLE
        message:
          type: string
          description: Human-readable message. Do not parse.
        limit:
          type: string
          enum:
            - MAX_OPEN_EXPOSURE
            - MAX_RESTING_ORDERS
            - MAX_RESTING_ORDERS_PER_INSTRUMENT
          description: >-
            Present only when error is RISK_LIMIT: the limit the order would
            exceed.
      required:
        - error
        - message
    Exact:
      type: object
      properties:
        units:
          type: string
          description: >-
            Integer value as a decimal string. May be negative. May exceed 2^53
            − 1: parse with BigInt or a decimal library, never Number.
          example: '105000123456'
        decimals:
          type: integer
          minimum: 0
          description: Scale. value = units × 10^-decimals.
          example: 6
      required:
        - units
        - decimals
      description: Exact fixed-point number. value = units × 10^-decimals.
  responses:
    BadRequestTrading:
      description: MALFORMED_REQUEST, INVALID_PRICE or INVALID_QUANTITY.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
          example:
            error: INVALID_PRICE
            message: …
    Unauthorized:
      description: AUTH_REQUIRED, INVALID_API_KEY or API_KEY_REVOKED.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
          example:
            error: INVALID_API_KEY
            message: …
    TradingForbidden:
      description: TRADING_DISABLED, DEALER_SUSPENDED or INSUFFICIENT_SCOPE.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
          example:
            error: TRADING_DISABLED
            message: …
    RateLimited:
      description: >-
        RATE_LIMITED: not admitted. Wait Retry-After seconds, then retry the
        same request.
      headers:
        Retry-After:
          description: Seconds until the rate-limit window ends (at least 1).
          schema:
            type: integer
            minimum: 1
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
          example:
            error: RATE_LIMITED
            message: Too many requests. Retry after the indicated delay.
    Internal:
      description: INTERNAL. Retry with backoff.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
          example:
            error: INTERNAL
            message: …
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      description: >-
        Authorization: Bearer <your-api-key>. Scopes: mm:read (GET endpoints),
        mm:trade (POST endpoints).

````

This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.