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

# Place an order

> Permissions required: **Execute trades**

Places an order into the account or subaccount identified by `accountId` in
the path.

The `accountId` may be either an **account ID** or a **subaccount ID**.
Subaccounts are treated exactly like accounts for order placement,
and account and subaccount IDs are globally unique, so the kind of
ID provided is recognized automatically.

Accounts are one of two types, both of which can have subaccounts:
- **OMNIBUS**: orders may book at the account level.
- **FBO**: nothing can be done at the account level. Every order
  must land in a subaccount, either by placing it with a subaccount
  ID or by fully allocating it via the `allocations` field.

The kind of ID determines which fields are allowed in the request
body:
- **Account ID**: the order may be split across subaccounts via the
  `allocations` field. For **OMNIBUS** accounts `allocations` is
  optional: when omitted, the entire order books directly into the
  account. For **FBO** accounts `allocations` is required. Spec lot
  IDs, if used, are provided per allocation. The order-level
  `specLotId` must not be specified.
- **Subaccount ID**: the order books directly into that subaccount
  (valid for both OMNIBUS and FBO accounts). The `allocations` field
  must not be specified. A spec lot ID, if used, is provided via the
  order-level `specLotId`.

Rejections. A request that passes schema validation but breaks a
business rule returns the listed status with a `message` of the
form `<rejectCode>: <detail>`, where `<rejectCode>` is one of the
`rejectCode` values of the Order schema. A request that fails
schema validation, such as a malformed field, returns 400 with
the validator's message and no code.
See the `rejectCode` description of the Order schema for which
rejections, such as `INSUFFICIENT_BALANCE` and `DUPLICATE_ORDER`,
are returned synchronously. An `Idempotency-Key` reused with a
different request body also returns 409.



## OpenAPI

````yaml /knowledge-base/openapi/v4.yaml post /accounts/{accountId}/orders
openapi: 3.1.0
info:
  title: Anchorage Digital Account APIs (v4)
  version: 4.0.0-beta
  description: >-
    Reference for the Anchorage Digital v4 API, the surface behind Crypto as a
    Service: account management (accounts and the account tree, beneficiaries,
    freeze/unfreeze/close), balances and transactions, trusted destinations,
    orders and allocations, withdrawals, deposit instructions, deposit
    attributions, the policy engine (policies, approval keys), and supported
    asset types. Approval groups, endorsements, compliance profiles, customers
    (onboarding), fee configuration updates, interest enrollment, funding
    allocations, and destination removal are under construction and return
    mocked data only.


    Status: BETA. The v4 API is available in the sandbox only
    (https://api.anchorage-staging.com/v4) and is not available in production
    yet. The contract may change until general availability. Which endpoints are
    live, in final testing, or under construction:
    https://docs.anchorage.com/platform/developers/caas/caas-overview


    Authentication: every request carries an `Api-Access-Key` header. Every
    POST, PATCH, and DELETE additionally requires an `Idempotency-Key`, and is
    signed with `Api-Signature` (hex-encoded Ed25519 over
    `timestamp_epoch_seconds + uppercase(http_method) + request_path +
    request_body`) plus `Api-Timestamp` (unix epoch seconds).


    Pagination: list endpoints accept `after` (cursor) and `limit` (page size, 1
    to 1000, default 100) and return a `page.endCursor` to continue from. Errors
    use a common envelope with a human-readable `message`; batch endpoints
    return a result per item instead.


    Guides: https://docs.anchorage.com/platform/developers/caas/caas-overview
servers:
  - url: https://api.anchorage-staging.com/v4
security:
  - Api-Access-Key: []
tags:
  - name: Accounts
  - name: Compliance Profiles
  - name: Balances
  - name: Transactions
  - name: Trusted Destinations
  - name: Orders & Allocations
  - name: Withdrawals
  - name: Deposit Instructions
  - name: Deposit Attributions
  - name: Policies
  - name: Approval Groups
  - name: Endorsements
  - name: Customers
  - name: Asset Types
paths:
  /accounts/{accountId}/orders:
    post:
      tags:
        - Orders & Allocations
      summary: Place an order
      description: >-
        Permissions required: **Execute trades**


        Places an order into the account or subaccount identified by `accountId`
        in

        the path.


        The `accountId` may be either an **account ID** or a **subaccount ID**.

        Subaccounts are treated exactly like accounts for order placement,

        and account and subaccount IDs are globally unique, so the kind of

        ID provided is recognized automatically.


        Accounts are one of two types, both of which can have subaccounts:

        - **OMNIBUS**: orders may book at the account level.

        - **FBO**: nothing can be done at the account level. Every order
          must land in a subaccount, either by placing it with a subaccount
          ID or by fully allocating it via the `allocations` field.

        The kind of ID determines which fields are allowed in the request

        body:

        - **Account ID**: the order may be split across subaccounts via the
          `allocations` field. For **OMNIBUS** accounts `allocations` is
          optional: when omitted, the entire order books directly into the
          account. For **FBO** accounts `allocations` is required. Spec lot
          IDs, if used, are provided per allocation. The order-level
          `specLotId` must not be specified.
        - **Subaccount ID**: the order books directly into that subaccount
          (valid for both OMNIBUS and FBO accounts). The `allocations` field
          must not be specified. A spec lot ID, if used, is provided via the
          order-level `specLotId`.

        Rejections. A request that passes schema validation but breaks a

        business rule returns the listed status with a `message` of the

        form `<rejectCode>: <detail>`, where `<rejectCode>` is one of the

        `rejectCode` values of the Order schema. A request that fails

        schema validation, such as a malformed field, returns 400 with

        the validator's message and no code.

        See the `rejectCode` description of the Order schema for which

        rejections, such as `INSUFFICIENT_BALANCE` and `DUPLICATE_ORDER`,

        are returned synchronously. An `Idempotency-Key` reused with a

        different request body also returns 409.
      operationId: placeOrder
      parameters:
        - name: accountId
          in: path
          schema:
            type: string
            format: uuid
            example: 3486b413-93d3-4447-afce-2b9c9dc34a32
          required: true
          description: >-
            Account ID or subaccount ID (a UUID) for this order to book into.
            See the endpoint description for how this affects the allowed
            request body fields. An unknown ID is rejected with a 400 and code
            `INVALID_ACCOUNT`.
        - name: Idempotency-Key
          in: header
          schema:
            type: string
          required: true
          description: >-
            Client-supplied key that deduplicates retried requests. Reusing a
            key returns the original result instead of repeating the action.
        - name: Api-Signature
          in: header
          required: true
          schema:
            type: string
            pattern: ^[0-9A-Fa-f]{128,160}$
          description: >-
            A hex-encoded Ed25519 signature of `timestamp_epoch_seconds +
            uppercase(http_method) + request_path + request_body`.
        - name: Api-Timestamp
          in: header
          required: true
          schema:
            type: integer
            format: int64
          description: Current timestamp, represented as unix epoch seconds
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/PlaceOrderRequest'
            examples:
              marketOrder:
                summary: Market buy order
                value:
                  symbol: BTC-USD
                  side: BUY
                  currency: USD
                  quantity: '15000.00'
                  orderType: MARKET
                  externalId: 0a3f9c1e-8b7d-4c2a-9e5f-6d1b2a3c4d5e
                  timestamp: '2026-08-11T14:30:00Z'
              limitOrder:
                summary: Limit sell order (accountId is a subaccount ID)
                value:
                  symbol: BTC-USD
                  side: SELL
                  currency: BTC
                  quantity: '1.5'
                  orderType: LIMIT
                  limitPrice: '65000.00'
                  timeInForce: GTD
                  expiryTime: '2026-08-18T00:00:00Z'
                  externalId: 7e2d4b6a-1c3f-4a5e-8b9d-0f1e2d3c4b5a
                  timestamp: '2026-08-11T14:31:00Z'
              stopLimitOrder:
                summary: Stop-limit sell order
                value:
                  symbol: BTC-USD
                  side: SELL
                  currency: BTC
                  quantity: '0.5'
                  orderType: STOP_LIMIT
                  limitPrice: '59500.00'
                  triggerPrice: '60000.00'
                  timeInForce: GTC
                  externalId: 3c1b5d7f-9e2a-4b6c-8d0e-1f2a3b4c5d6e
                  timestamp: '2026-08-11T14:32:00Z'
              allocatedOrder:
                summary: >-
                  Market sell allocated across subaccounts (accountId is an
                  account ID)
                value:
                  symbol: BTC-USD
                  side: SELL
                  currency: BTC
                  quantity: '1.0'
                  orderType: MARKET
                  timeInForce: IOC
                  externalId: 5b8e2f4d-6a1c-4e9b-b3d7-2c4e6f8a0b1c
                  timestamp: '2026-08-11T14:33:00Z'
                  allocations:
                    - subaccountId: 7d1e3f5a-2b4c-4d6e-8f0a-1c2e3a4b5c6d
                      quantity: '0.6'
                    - subaccountId: 2a4c6e8f-1b3d-4f5a-9c7e-2d4f6a8b0c1e
                      quantity: '0.4'
      responses:
        '201':
          description: >-
            Order accepted. Only the order ID and external ID are returned; the
            client is expected to look up the order's state via the order lookup
            endpoint.
          headers:
            Location:
              description: Path of the created order.
              schema:
                type: string
                example: >-
                  /accounts/9f8e7d6c-5b4a-4c3d-9e2f-1a0b9c8d7e6f/orders/a94c8d75-6c9d-4903-95f3-5b0893e76cb7
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PlaceOrderResponse'
              examples:
                accepted:
                  summary: Order accepted
                  value:
                    data:
                      id: a94c8d75-6c9d-4903-95f3-5b0893e76cb7
                      externalId: 0a3f9c1e-8b7d-4c2a-9e5f-6d1b2a3c4d5e
        '400':
          description: Bad Request
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorDetails'
        '401':
          description: Unauthenticated
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorDetails'
        '403':
          description: Forbidden
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorDetails'
        '409':
          description: Conflict
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorDetails'
        '429':
          description: Too Many Requests
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorDetails'
        '500':
          description: Internal Server Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorDetails'
components:
  schemas:
    PlaceOrderRequest:
      title: Place Order Request
      type: object
      required:
        - symbol
        - side
        - currency
        - quantity
        - orderType
        - timestamp
      properties:
        symbol:
          type: string
          pattern: ^[A-Z0-9_]+-[A-Z0-9_]+$
          description: Symbol for the order, e.g. BTC-USD.
        side:
          type: string
          description: Order side, either "BUY" or "SELL".
          enum:
            - BUY
            - SELL
        currency:
          type: string
          description: "The currency in which order quantity is specified in, e.g. BTC\nor USD. Must be one of the two legs of `symbol`.\n- For `FOK` orders, a `BUY` must specify the quote currency\n\t(e.g. USD for BTC-USD) and a `SELL` must specify the base\n\tcurrency (e.g. BTC for BTC-USD). Violations are rejected with\n\t`INVALID_CURRENCY_FOR_FOK`.\n- For `STOP_LOSS` orders, `currency` must be the base currency\n\tof `symbol` (e.g. BTC for BTC-USD).\n- For all other time-in-force values and order types, either\n\tleg may be used."
        quantity:
          type: string
          pattern: ^\d+(\.\d+)?$
          description: >-
            Order quantity in units of currency, as a positive decimal number
            encoded as a string.
        orderType:
          type: string
          default: MARKET
          description: "Order type. One of:\n* `MARKET` - executes immediately at the best available price,\n\twith a maximum slippage of 5% from the current market price.\n\tAlways executed with `IOC` time in force: whatever can be filled\n\twithin the slippage bound is executed immediately and the\n\tremainder is canceled. `limitPrice` must not be specified.\n* `LIMIT` - executes at `limitPrice` or better. `limitPrice` is\n\trequired.\n* `STOP_LOSS` - dormant until the market reaches `triggerPrice`,\n\tthen submitted as a market order. Used to limit losses on an\n\texisting position. `triggerPrice` is required; `limitPrice` must\n\tnot be specified. Execution price is not guaranteed. Must be a\n\t`SELL` with `quantity` in the base currency of `symbol`; any\n\tother `side` or currency leg is rejected.\n* `STOP_LIMIT` - dormant until the market reaches `triggerPrice`,\n\tthen submitted as a limit order at `limitPrice`. Both\n\t`triggerPrice` and `limitPrice` are required. Unlike\n\t`STOP_LOSS`, execution price is bounded by `limitPrice`, but the\n\torder may not fill if the market moves through it.\n* `TAKE_PROFIT_LIMIT` - dormant until the market reaches\n\t`triggerPrice` in the profitable direction, then submitted as a\n\tlimit order at `limitPrice`. Used to lock in gains on an\n\texisting position. Both `triggerPrice` and `limitPrice` are\n\trequired."
          enum:
            - MARKET
            - LIMIT
            - STOP_LOSS
            - STOP_LIMIT
            - TAKE_PROFIT_LIMIT
        limitPrice:
          type: string
          pattern: ^\d+(\.\d+)?$
          description: >-
            Limit price for the order, as a positive decimal number encoded

            as a string.

            - Required for `LIMIT`, `STOP_LIMIT`, and `TAKE_PROFIT_LIMIT`
            orders.

            - Must not be specified for `MARKET` and `STOP_LOSS` orders.
        triggerPrice:
          type: string
          pattern: ^\d+(\.\d+)?$
          description: "Market price at which a dormant order is triggered and submitted\nto the book, as a positive decimal number encoded as a string.\n- Required for `STOP_LOSS`, `STOP_LIMIT`, and `TAKE_PROFIT_LIMIT`\n\torders.\n- Must not be specified for `MARKET` and `LIMIT` orders.\n- For `STOP_LOSS`, which is always a `SELL`: triggers when the\n\tmarket moves against the position, at or below `triggerPrice`.\n- For `STOP_LIMIT`: triggers when the market moves against the\n\tposition (at or below `triggerPrice` for `SELL`, at or above\n\tfor `BUY`).\n- For `TAKE_PROFIT_LIMIT`: triggers when the market moves in\n\tfavor of the position (at or above `triggerPrice` for `SELL`,\n\tat or below for `BUY`)."
        timeInForce:
          type: string
          description: "How long the order remains active before it is executed or\nexpires. If not provided, defaults to `GTC` for all order types\nexcept `MARKET`, which is always executed as `IOC`. One of:\n* `FOK` (fill or kill) - the order must be fully filled\n\timmediately, otherwise it is canceled with no partial\n\texecution. Note the currency-leg restriction on FOK orders\n\tdescribed under `currency`.\n* `IOC` (immediate or cancel) - any portion that can be filled\n\timmediately is executed, and the remainder is canceled.\n* `GTC` (good till canceled) - the order remains active until it\n\tis fully executed or explicitly canceled.\n* `GTD` (good till date) - the order remains active until it is\n\tfully executed or `expiryTime` is reached. `expiryTime` is required.\n\n`MARKET` orders are always executed as `IOC`: for `MARKET`\norders this field may be omitted or set to `IOC`; any other value\nis rejected."
          enum:
            - FOK
            - IOC
            - GTC
            - GTD
        expiryTime:
          description: "Time at which the order expires and is automatically canceled if\nnot yet fully executed.\n- Required when `timeInForce` is `GTD`.\n- Must not be specified for any other time in force.\n- Must be in the future. Date-times are always in UTC RFC 3339\n\t'date-time'."
          type: string
          format: date-time
          example: '2019-01-02T12:34:56.000Z'
        externalId:
          type: string
          minLength: 1
          maxLength: 36
          description: "Unique client-assigned external ID, between 1 and 36 characters.\n- Must be unique among accepted orders: submitting an order with\n\tthe `externalId` of a previously accepted order is rejected\n\twith 409 `DUPLICATE_ORDER`.\n- If a previous submission was rejected (e.g. due to a validation\n\terror), its `externalId` may be reused."
        timestamp:
          description: >-
            Timestamp when submitting this order. Date-times are always in UTC
            RFC 3339 'date-time'.
          type: string
          format: date-time
          example: '2019-01-02T12:34:56.000Z'
        allocations:
          type: array
          minItems: 1
          description: "Order subaccount allocations: how the order is split across\nsubaccounts.\n- Only allowed when the `accountId` path parameter is an account ID; it\n\tis illegal to provide allocations when `accountId` is a subaccount ID.\n- Optional for `OMNIBUS` accounts: when omitted, the entire\n\torder books at the account level.\n- Required for `FBO` accounts, since FBO orders cannot book at\n\tthe account level.\n- If provided, must contain at least one allocation. Note that\n\tto book an entire order into a single subaccount, there are\n\ttwo equivalent options: place the order with the subaccount ID\n\tin the path (and no allocations), or place it with the account\n\tID and a single-entry `allocations` array.\n- The allocation quantities must sum to the order `quantity`."
          items:
            $ref: '#/components/schemas/OrderAllocationRequest'
        specLotId:
          type: string
          description: "Optional specification lot ID for tax reporting purposes, scoped\nto the entire order. When provided, instructs the tax service to\nretire the specified lot for this trade.\n- Only allowed when the `accountId` path parameter is a subaccount ID.\n\tWhen `accountId` is an account ID, use the allocation-level\n\t`specLotId` instead; the two are mutually exclusive.\n- Only applicable for `SELL` orders with `timeInForce` `FOK`.\n\tSpec lots cannot be retired on `IOC`, `GTC`, or `GTD` orders,\n\tsince the lot can only be assigned when the fill is\n\tall-or-nothing.\n\t`MARKET` orders execute as `IOC` and therefore cannot carry one."
      additionalProperties: false
    PlaceOrderResponse:
      title: Place Order Response
      type: object
      required:
        - data
      properties:
        data:
          $ref: '#/components/schemas/PlaceOrderResult'
    ErrorDetails:
      title: ErrorDetails
      type: object
      properties:
        message:
          description: A human-readable message providing more details about the error.
          example: Missing required field 'amount'.
          type: string
      required:
        - message
    OrderAllocationRequest:
      title: Order Allocation Request
      type: object
      description: >-
        A portion of the order allocated to a subaccount. Only allowed when the
        `accountId` path parameter is an account ID.
      required:
        - subaccountId
        - quantity
      properties:
        subaccountId:
          description: The subaccount identifier (a UUID).
          type: string
          format: uuid
          example: 3486b413-93d3-4447-afce-2b9c9dc34a32
        quantity:
          type: string
          pattern: ^\d+(\.\d+)?$
          description: >-
            Quantity to allocate to the subaccount, in the same currency as the
            order `quantity`, as a positive decimal number encoded as a string.
        specLotId:
          type: string
          description: "Optional specification lot ID for tax reporting purposes, scoped\nto this allocation. When provided, instructs the tax service to\nretire the specified lot for this allocation's portion of the\ntrade.\n- Only applicable for `SELL` orders with `timeInForce` `FOK`.\n\tSpec lots cannot be retired on `IOC`, `GTC`, or `GTD` orders,\n\tsince the lot can only be assigned when the fill is\n\tall-or-nothing.\n\t`MARKET` orders execute as `IOC` and therefore cannot carry one.\n- Mutually exclusive with the order-level `specLotId`."
      additionalProperties: false
    PlaceOrderResult:
      title: Place Order Result
      type: object
      required:
        - id
      properties:
        id:
          description: >-
            Unique order ID (a UUID), assigned when the order is accepted. Use
            this to look up the order's state via the order lookup endpoint.
          type: string
          format: uuid
          example: 3486b413-93d3-4447-afce-2b9c9dc34a32
        externalId:
          type: string
          description: External ID echoed from the request.
  securitySchemes:
    Api-Access-Key:
      type: apiKey
      name: Api-Access-Key
      in: header
      description: An API key associated with a security role

````

## Related topics

- [Place an order](https://docs.anchorage.com/knowledge-base/porto/api-reference/v2/trading/place-an-order.md)
- [Quote & placing orders](https://docs.anchorage.com/knowledge-base/platform/developers/trading/rfq-orders.md)
- [Orders](https://docs.anchorage.com/knowledge-base/platform/developers/caas/caas-orders.md)
- [Place an async order](https://docs.anchorage.com/knowledge-base/porto/api-reference/v2/trading/place-an-async-order.md)
