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

# Place a REAL market order (production)

> **Switched off.** Production trading is implemented but not available: orders are refused with `403 production_trading_disabled`. Once it opens, Bullionwale enables production access per account (see Production access requirements).

A REAL order, booked through the same path as the web. `Idempotency-Key` is required (1-64 characters) and is per ACCOUNT, so it survives key rotation. 201 = open; 202 = pending (hedge confirming: poll `GET /orders/{id}`); 200 + `Idempotent-Replayed: true` = replay of the same key and body; 409 `order_rejected` = the hedge refused it (a replay answers 409 again); 422 `idempotency_key_reused` = same key, different body. If the booking fails after submission the answer is what was committed: the order (201/202/409), or 503 `booking_not_completed` (nothing was booked yet) or `booking_outcome_unknown`; retry either 503 with the same key for the definitive outcome.



## OpenAPI

````yaml /openapi.json post /api/trading/v1/orders
openapi: 3.1.0
info:
  description: >-
    Place and read bullion orders with an API key. The test environment
    (`/api/trading/test/v1`) simulates orders; the production environment
    (`/api/trading/v1`) books real orders. **Test: available on request.
    Production: switched off.** See the availability notice in the
    documentation.
  title: Bullionwale API
  version: 1.0.0
servers:
  - description: Once the API is available
    url: https://api.bullionwale.com
security: []
tags:
  - description: >-
      Simulated orders for building and testing your integration. Nothing is
      booked. Available on request through the Bullionwale desk.
    name: Test environment
  - description: >-
      Real orders. Switched off: production trading is not available yet and,
      once it opens, is enabled per account by Bullionwale.
    name: Production environment
paths:
  /api/trading/v1/orders:
    post:
      tags:
        - Production environment
      summary: Place a REAL market order (production)
      description: >-
        **Switched off.** Production trading is implemented but not available:
        orders are refused with `403 production_trading_disabled`. Once it
        opens, Bullionwale enables production access per account (see Production
        access requirements).


        A REAL order, booked through the same path as the web. `Idempotency-Key`
        is required (1-64 characters) and is per ACCOUNT, so it survives key
        rotation. 201 = open; 202 = pending (hedge confirming: poll `GET
        /orders/{id}`); 200 + `Idempotent-Replayed: true` = replay of the same
        key and body; 409 `order_rejected` = the hedge refused it (a replay
        answers 409 again); 422 `idempotency_key_reused` = same key, different
        body. If the booking fails after submission the answer is what was
        committed: the order (201/202/409), or 503 `booking_not_completed`
        (nothing was booked yet) or `booking_outcome_unknown`; retry either 503
        with the same key for the definitive outcome.
      operationId: place_order_api_trading_v1_orders_post
      parameters:
        - description: >-
            Required, 1-64 characters. Per account: the same key with the same
            body replays the order.
          in: header
          name: Idempotency-Key
          required: true
          schema:
            anyOf:
              - maxLength: 64
                type: string
              - type: 'null'
            title: Idempotency-Key
      requestBody:
        content:
          application/json:
            examples:
              market_buy:
                summary: A market buy, 10 g
                value:
                  client_order_id: bot-42
                  quantity: 10
                  symbol_code: GOLD_TRADE_999
                  trade_type: buy
              with_expected_price:
                summary: >-
                  A sell with expected_price (409 price_moved past the
                  tolerance)
                value:
                  expected_price: 141250
                  quantity: 5
                  symbol_code: GOLD_TRADE_999
                  trade_type: sell
            schema:
              $ref: '#/components/schemas/ProductionOrderIn'
        required: true
      responses:
        '200':
          content:
            application/json:
              examples:
                replay:
                  summary: 'Replay of the same key and body (Idempotent-Replayed: true)'
                  value:
                    client_order_id: bot-42
                    created_at: '2026-10-14T09:31:05.120000+00:00'
                    deal_no: 240117
                    environment: production
                    id: 3f0c6a52-8a3e-4b8e-9a52-6d2f1c7e9b10
                    price: '141250.00'
                    quantity: '10'
                    source: api
                    status: open
                    status_detail: fixed
                    symbol_code: GOLD_TRADE_999
                    total: '141250.00'
                    trade_type: buy
                    unit: g
              schema:
                $ref: '#/components/schemas/ProductionOrder'
          description: Replay of an earlier order.
          headers:
            Idempotent-Replayed:
              description: '`true`.'
              schema:
                type: string
        '201':
          content:
            application/json:
              examples:
                open:
                  summary: Booked and open
                  value:
                    client_order_id: bot-42
                    created_at: '2026-10-14T09:31:05.120000+00:00'
                    deal_no: 240117
                    environment: production
                    id: 3f0c6a52-8a3e-4b8e-9a52-6d2f1c7e9b10
                    price: '141250.00'
                    quantity: '10'
                    source: api
                    status: open
                    status_detail: fixed
                    symbol_code: GOLD_TRADE_999
                    total: '141250.00'
                    trade_type: buy
                    unit: g
              schema:
                $ref: '#/components/schemas/ProductionOrder'
          description: Booked, open.
        '202':
          content:
            application/json:
              examples:
                pending:
                  summary: 'The hedge is confirming: poll GET /orders/{id}'
                  value:
                    client_order_id: bot-42
                    created_at: '2026-10-14T09:31:05.120000+00:00'
                    deal_no: 240117
                    environment: production
                    id: 3f0c6a52-8a3e-4b8e-9a52-6d2f1c7e9b10
                    price: '141250.00'
                    quantity: '10'
                    source: api
                    status: pending
                    status_detail: placing
                    symbol_code: GOLD_TRADE_999
                    total: '141250.00'
                    trade_type: buy
                    unit: g
              schema:
                $ref: '#/components/schemas/ProductionOrder'
          description: 'Pending: the hedge is confirming. Poll the order.'
        '400':
          content:
            application/json:
              examples:
                limit_exceeded:
                  summary: Over the account's weight limit
                  value:
                    detail:
                      code: limit_exceeded
                      message: Exceeds your gold limit — 40 g free of 1000 g.
              schema:
                $ref: '#/components/schemas/ApiError'
          description: >-
            `idempotency_key_required`: POST /orders needs an Idempotency-Key
            header.

            `symbol_not_trading`: Trading is disabled for the symbol.

            `invalid_side`: trade_type must be buy or sell.

            `no_live_price`: The symbol has no live price.

            `unpriced`: The symbol could not be priced.

            `symbol_frozen`: The symbol's price feed is frozen.

            `quantity_rule`: The quantity breaks the symbol's size rule.

            `group_quantity_rule`: The quantity breaks the group's size terms.

            `limit_exceeded`: The order would exceed the account's weight limit.

            `out_of_stock`: Not enough stock for a buy.
        '401':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiError'
          description: >-
            `missing_credential`: No X-API-Key header.

            `malformed_credential`: The key is not shaped like an API key.

            `wrong_tenant`: The key belongs to a different broker.

            `wrong_environment`: A test key on the production API, or the
            reverse.

            `invalid_credential`: Unknown key or wrong secret.

            `credential_revoked`: The key was revoked.

            `credential_rotated`: The key was replaced and its overlap period
            ended.

            `credential_expired`: The key expired.
        '403':
          content:
            application/json:
              examples:
                production_trading_disabled:
                  summary: A switch is off
                  value:
                    detail:
                      code: production_trading_disabled
                      message: Trading through the production API is not available.
                      reason: global
              schema:
                $ref: '#/components/schemas/ApiError'
          description: >-
            `api_access_disabled`: API access is switched off for this account.

            `account_inactive`: The account is not active.

            `insufficient_scope`: The key lacks the scope this route needs.

            `side_not_offered`: This broker does not offer that side.

            `trading_halted`: The desk halted trading.

            `group_trading_disabled`: Trading is disabled for the account's
            group.

            `production_trading_disabled`: Production trading is not available
            to your account right now; `detail.reason` is `deploy`, `global` or
            `account`.
        '404':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiError'
          description: '`unknown_symbol`: No such symbol.'
        '409':
          content:
            application/json:
              examples:
                order_rejected:
                  summary: The hedge refused the order
                  value:
                    detail:
                      code: order_rejected
                      message: The order could not be confirmed. Please try again.
                      order:
                        client_order_id: bot-42
                        created_at: '2026-10-14T09:31:05.120000+00:00'
                        deal_no: 240117
                        environment: production
                        id: 3f0c6a52-8a3e-4b8e-9a52-6d2f1c7e9b10
                        price: '141250.00'
                        quantity: '10'
                        source: api
                        status: rejected
                        status_detail: rejected
                        symbol_code: GOLD_TRADE_999
                        total: '141250.00'
                        trade_type: buy
                        unit: g
                      order_id: 3f0c6a52-8a3e-4b8e-9a52-6d2f1c7e9b10
                price_moved:
                  summary: The price moved beyond the tolerance from expected_price
                  value:
                    detail:
                      code: price_moved
                      message: >-
                        Price moved from ₹141250.00 to ₹141980.00 since you saw
                        it. Please review the new price and submit again.
              schema:
                $ref: '#/components/schemas/ApiError'
          description: >-
            `price_moved`: The price moved beyond the tolerance from
            expected_price.

            `booking_conflict`: A concurrent booking conflicted; retry with the
            same key.

            `order_rejected`: The hedge refused the order; `detail.order_id`
            names it and `detail.order` shows it. A replay of the same key
            answers 409 again, with the same fields.
        '422':
          content:
            application/json:
              examples:
                idempotency_key_reused:
                  summary: Same key, different body
                  value:
                    detail:
                      code: idempotency_key_reused
                      message: >-
                        This Idempotency-Key was already used for a different
                        order.
              schema:
                $ref: '#/components/schemas/ApiError'
          description: >-
            `invalid_request`: The request body or parameters are invalid; see
            `detail.errors`.

            `idempotency_key_reused`: The Idempotency-Key was used for a
            different order.
        '429':
          content:
            application/json:
              examples:
                rate_limited:
                  summary: Over the order budget; see Retry-After
                  value:
                    detail:
                      code: rate_limited
                      message: >-
                        API rate limit exceeded for this key or account. Retry
                        later.
              schema:
                $ref: '#/components/schemas/ApiError'
          description: >-
            `auth_throttled`: Too many failed authentications from this address;
            see Retry-After.

            `rate_limited`: This key (or, for orders, this account) exhausted
            its budget; see Retry-After.
        '503':
          content:
            application/json:
              examples:
                booking_not_completed:
                  summary: Failed, and no committed order was found (Retry-After)
                  value:
                    detail:
                      code: booking_not_completed
                      message: >-
                        Nothing was booked yet. Retry with the same
                        Idempotency-Key for the definitive outcome.
                booking_outcome_unknown:
                  summary: Failed, and the outcome could not be read (Retry-After)
                  value:
                    detail:
                      code: booking_outcome_unknown
                      message: >-
                        The outcome is unknown. Retry with the same
                        Idempotency-Key to get it.
              schema:
                $ref: '#/components/schemas/ApiError'
          description: >-
            `rate_limiter_unavailable`: Order rate limiting is temporarily
            unavailable, so orders are refused (reads keep working). Retry after
            `Retry-After` seconds.

            `rates_not_ready`: Rates are not loaded yet.

            `stale_rate`: The rate is stale.

            `tradeability_unverified`: The symbol's tradeability could not be
            verified.

            `symbol_unavailable`: The symbol is unavailable.

            `pricing_unavailable`: The group price could not be computed.

            `production_prerequisites_unmet`: Production trading is paused by
            Bullionwale. Nothing was booked. Retry later; there is nothing to
            change on your side.

            `booking_unavailable`: The order could not be recorded, so nothing
            was booked; retry with the same key.

            `booking_busy`: The booking waited too long behind the account's
            other bookings, so nothing was booked; retry with the same key after
            Retry-After.

            `booking_not_completed`: The booking failed and no committed order
            was found: nothing was booked yet; retry with the same key after
            Retry-After for the definitive outcome.

            `booking_outcome_unknown`: The booking failed and its outcome could
            not be read; retry with the same key after Retry-After to get it.
      security:
        - ApiKeyAuth: []
components:
  schemas:
    ProductionOrderIn:
      description: Same fields and bounds as a test order.
      properties:
        client_order_id:
          anyOf:
            - maxLength: 64
              type: string
            - type: 'null'
          title: Client Order Id
        expected_price:
          anyOf:
            - exclusiveMinimum: 0
              type: number
            - type: 'null'
          title: Expected Price
        quantity:
          exclusiveMinimum: 0
          maximum: 1000000
          title: Quantity
          type: number
        symbol_code:
          maxLength: 32
          title: Symbol Code
          type: string
        trade_type:
          title: Trade Type
          type: string
      required:
        - symbol_code
        - trade_type
        - quantity
      title: ProductionOrderIn
      type: object
    ProductionOrder:
      properties:
        client_order_id:
          anyOf:
            - type: string
            - type: 'null'
          title: Client Order Id
        close_price:
          anyOf:
            - type: string
            - type: 'null'
          title: Close Price
        closed_at:
          anyOf:
            - type: string
            - type: 'null'
          title: Closed At
        created_at:
          anyOf:
            - type: string
            - type: 'null'
          title: Created At
        deal_no:
          anyOf:
            - type: integer
            - type: 'null'
          description: The desk's deal number.
          title: Deal No
        environment:
          default: production
          title: Environment
          type: string
        id:
          title: Id
          type: string
        price:
          anyOf:
            - type: string
            - type: 'null'
          description: Rupees, 2 decimals, as a string.
          title: Price
        quantity:
          title: Quantity
          type: string
        realized_pnl:
          anyOf:
            - type: string
            - type: 'null'
          title: Realized Pnl
        source:
          anyOf:
            - type: string
            - type: 'null'
          description: 'Channel: web, mobile, api, ...'
          title: Source
        status:
          description: pending, open, closing, closed, rejected or deleted.
          title: Status
          type: string
        status_detail:
          description: The desk's raw status.
          title: Status Detail
          type: string
        symbol_code:
          title: Symbol Code
          type: string
        total:
          anyOf:
            - type: string
            - type: 'null'
          title: Total
        trade_type:
          title: Trade Type
          type: string
        unit:
          description: '`g` or `kg`.'
          title: Unit
          type: string
      required:
        - id
        - symbol_code
        - trade_type
        - quantity
        - unit
        - status
        - status_detail
      title: ProductionOrder
      type: object
    ApiError:
      description: Every refusal on the trading API.
      properties:
        detail:
          $ref: '#/components/schemas/ApiErrorDetail'
      required:
        - detail
      title: ApiError
      type: object
    ApiErrorDetail:
      additionalProperties: true
      properties:
        code:
          description: Stable machine code; branch on this, not on `message`.
          title: Code
          type: string
        message:
          description: Human-readable text; may change.
          title: Message
          type: string
      required:
        - code
        - message
      title: ApiErrorDetail
      type: object
  securitySchemes:
    ApiKeyAuth:
      in: header
      name: X-API-Key
      type: apiKey

````

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