---
updatedAt: 2026-04-20T21:43:36.000Z
agentTools:
  projectIndex: https://docs.dinari.com/llms.txt
---

# Create Market Buy Managed Order Request


Create a managed `OrderRequest` to place a market buy `Order`.

Fees for the `Order` can optionally be specified in the `OrderRequest` for DFN orders in USD, supporting up to 6 decimal places

If an `OrderRequest` with the same `client_order_id` already exists for the given account, the creation call will fail.


# OpenAPI definition

```json
{
  "info": {
    "description": "**Dinari API for enterprise usage.**\n\nDinari's dShares let businesses offer tokenized access to stocks to their customers through an easy-to-use API.\nIntegrate Dinari's API and offer over a hundred stocks and ETFs to your customers.\n",
    "contact": {
      "email": "hello@dinari.com"
    },
    "license": {
      "name": "Contact us"
    },
    "termsOfService": "https://dinari.com/terms",
    "title": "Dinari Enterprise API",
    "version": "v20261009-833c33c"
  },
  "servers": [
    {
      "url": "https://api-enterprise.sbt.dinari.com",
      "description": "Production"
    },
    {
      "url": "https://api-enterprise.sandbox.dinari.com",
      "description": "Sandbox"
    }
  ],
  "components": {
    "securitySchemes": {
      "ApiKeyId": {
        "type": "apiKey",
        "in": "header",
        "name": "X-API-Key-Id",
        "description": "The API key ID provided on the [Partners Dashboard](https://partners.dinari.com)."
      },
      "ApiSecretKey": {
        "type": "apiKey",
        "in": "header",
        "name": "X-API-Secret-Key",
        "description": "API Secret Key that is only shown once at API Key creation."
      }
    },
    "schemas": {
      "BaseOpenApiError": {
        "type": "object",
        "properties": {
          "status": {
            "type": "integer",
            "description": "HTTP status code"
          },
          "message": {
            "type": "string",
            "description": "Human-readable message"
          },
          "error_id": {
            "type": "string",
            "description": "Reference Id for Dinari support"
          },
          "error": {
            "description": "Additional context and information"
          }
        },
        "required": [
          "error_id",
          "message",
          "status"
        ],
        "additionalProperties": false
      },
      "BaseOpenApiFieldError": {
        "type": "object",
        "properties": {
          "field_name": {
            "type": "string",
            "description": "Name of field with error"
          },
          "field_error": {
            "type": "string",
            "description": "Description of error"
          }
        },
        "required": [
          "field_error",
          "field_name"
        ],
        "additionalProperties": false
      },
      "BaseOpenApiBodyError": {
        "type": "object",
        "properties": {
          "field_errors": {
            "type": "array",
            "description": "Contains list of field-specific errors",
            "items": {
              "$ref": "#/components/schemas/BaseOpenApiFieldError"
            }
          },
          "body_error": {
            "type": [
              "string",
              "null"
            ],
            "description": "Description of body-specific error (ex. JSON issues)"
          }
        },
        "required": [
          "field_errors"
        ],
        "additionalProperties": false
      },
      "BaseOpenApi422Error": {
        "type": "object",
        "properties": {
          "status": {
            "default": 422,
            "enum": [
              422
            ],
            "description": "HTTP status code"
          },
          "message": {
            "default": "Unprocessable Entity",
            "enum": [
              "Unprocessable Entity"
            ],
            "description": "Human-readable message"
          },
          "error_id": {
            "type": "string",
            "description": "Reference Id for Dinari support"
          },
          "error": {
            "description": "Additional context and information",
            "$ref": "#/components/schemas/BaseOpenApiBodyError"
          }
        },
        "required": [
          "error",
          "error_id"
        ],
        "additionalProperties": false
      },
      "OrderSide": {
        "type": "string",
        "enum": [
          "BUY",
          "SELL"
        ]
      },
      "OrderType": {
        "type": "string",
        "enum": [
          "MARKET",
          "LIMIT"
        ]
      },
      "OrderTif": {
        "type": "string",
        "enum": [
          "DAY",
          "GTC",
          "IOC",
          "FOK"
        ]
      },
      "OrderRequestStatus": {
        "type": "string",
        "enum": [
          "QUOTED",
          "PENDING",
          "PENDING_BRIDGE",
          "SUBMITTED",
          "ERROR",
          "CANCELLED",
          "EXPIRED",
          "REJECTED"
        ]
      },
      "OrderRequest": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "format": "uuid",
            "description": "ID of `OrderRequest`. This is the primary identifier for the `/order_requests` routes."
          },
          "account_id": {
            "type": "string",
            "format": "uuid",
            "description": "ID of `Account` placing the `OrderRequest`."
          },
          "status": {
            "description": "Status of `OrderRequest`. Possible values:\n- `QUOTED`: Order request created with fee quote provided, ready for processing\n- `PENDING`: Order request is being prepared for submission\n- `PENDING_BRIDGE`: Order is waiting for bridge transaction to complete\n- `SUBMITTED`: Order has been successfully submitted to the order book\n- `ERROR`: An error occurred during order processing\n- `CANCELLED`: Order request was cancelled\n- `EXPIRED`: Order request expired due to deadline passing\n- `REJECTED`: Order request was rejected",
            "$ref": "#/components/schemas/OrderRequestStatus"
          },
          "created_dt": {
            "type": "string",
            "format": "date-time",
            "description": "Datetime at which the `OrderRequest` was created. ISO 8601 timestamp."
          },
          "order_side": {
            "description": "Indicates whether `Order` is a buy or sell.",
            "$ref": "#/components/schemas/OrderSide"
          },
          "order_type": {
            "description": "Type of `Order`.",
            "$ref": "#/components/schemas/OrderType"
          },
          "order_tif": {
            "description": "Indicates how long `Order` is valid for.",
            "$ref": "#/components/schemas/OrderTif"
          },
          "recipient_account_id": {
            "type": [
              "string",
              "null"
            ],
            "format": "uuid",
            "description": "ID of recipient `Account`."
          },
          "order_id": {
            "type": [
              "string",
              "null"
            ],
            "format": "uuid",
            "description": "ID of `Order` created from the `OrderRequest`. This is the primary identifier for the `/orders` routes."
          },
          "client_order_id": {
            "type": [
              "string",
              "null"
            ],
            "description": "Customer-supplied ID to map this `OrderRequest` to an order in their own systems."
          },
          "cancel_message": {
            "type": [
              "string",
              "null"
            ],
            "description": "Reason for the order cancellation if the order status is CANCELLED"
          },
          "reject_message": {
            "type": [
              "string",
              "null"
            ],
            "description": "Reason for the order rejection if the order status is REJECTED"
          }
        },
        "required": [
          "account_id",
          "created_dt",
          "id",
          "order_side",
          "order_tif",
          "order_type",
          "status"
        ],
        "description": "\nA request to create an `Order`.\n\nAn `OrderRequest` is created when a user places an order through the Dinari API.\nThe `OrderRequest` is then fulfilled by creating an `Order` on-chain.\n\nThe `OrderRequest` is a record of the user's intent to place an order, while the `Order` is the actual transaction that occurs on the blockchain.\n    "
      },
      "CreateMarketBuyOrderRequestInput": {
        "type": "object",
        "properties": {
          "payment_amount": {
            "type": "number",
            "minimum": "0",
            "description": "\nAmount of currency (USD for US equities and ETFs) to pay for the order.\nMust be a positive number with a precision of up to 2 decimal places.\n"
          },
          "payment_token_address": {
            "type": [
              "string",
              "null"
            ],
            "format": "eth_address",
            "description": "Address of the payment token to be used for the payment of the order. If not provided, the default payment token (USD+) will be used."
          },
          "stock_id": {
            "type": [
              "string",
              "null"
            ],
            "format": "uuid",
            "description": "ID of `Stock`."
          },
          "alloy_id": {
            "type": [
              "string",
              "null"
            ],
            "format": "uuid",
            "description": "ID of `Alloy`."
          },
          "recipient_account_id": {
            "type": [
              "string",
              "null"
            ],
            "format": "uuid",
            "description": "ID of `Account` to receive the `Order`."
          },
          "client_order_id": {
            "type": [
              "string",
              "null"
            ],
            "description": "Customer-supplied ID to map this order to an order in their own systems. Must be unique within the entity."
          },
          "fee": {
            "type": [
              "number",
              "null"
            ],
            "minimum": "0",
            "description": "Optional fee amount associated with `Order` in USD for DFN orders. Must be a positive number with a precision of up to 6 decimal places."
          }
        },
        "required": [
          "payment_amount"
        ],
        "description": "Input parameters for creating a market buy `OrderRequest`."
      }
    },
    "responses": {
      "UNPROCESSABLE_ENTITY": {
        "description": "Unprocessable Entity",
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/BaseOpenApi422Error"
            }
          }
        }
      },
      "DEFAULT_ERROR": {
        "description": "Default error response",
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/BaseOpenApiError"
            }
          }
        }
      }
    }
  },
  "paths": {
    "/api/v2/accounts/{account_id}/order_requests/market_buy": {
      "post": {
        "responses": {
          "201": {
            "description": "Created",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/OrderRequest"
                }
              }
            }
          },
          "422": {
            "$ref": "#/components/responses/UNPROCESSABLE_ENTITY"
          },
          "423": {
            "description": "Locked",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/BaseOpenApiError"
                }
              }
            }
          },
          "default": {
            "$ref": "#/components/responses/DEFAULT_ERROR"
          }
        },
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CreateMarketBuyOrderRequestInput"
              }
            }
          }
        },
        "tags": [
          "Managed Orders"
        ],
        "summary": "Create Market Buy Managed Order Request",
        "description": "\nCreate a managed `OrderRequest` to place a market buy `Order`.\n\nFees for the `Order` can optionally be specified in the `OrderRequest` for DFN orders in USD, supporting up to 6 decimal places\n\nIf an `OrderRequest` with the same `client_order_id` already exists for the given account, the creation call will fail.\n",
        "operationId": "createMarketBuyManagedOrderRequest",
        "security": [
          {
            "ApiKeyId": [],
            "ApiSecretKey": []
          }
        ]
      },
      "parameters": [
        {
          "in": "path",
          "name": "account_id",
          "required": true,
          "schema": {
            "type": "string",
            "format": "uuid"
          }
        }
      ]
    }
  },
  "tags": [
    {
      "name": "Managed Orders",
      "description": "**Managed `Orders` represent the buying and selling of assets using a Dinari-managed `Wallet`.**\n\nSimilar to Proxied `Orders`, placing a managed `Order` creates an `OrderRequest` which is then submitted on chain by Dinari. Once the request is submitted on chain, the corresponding `Order` is created.\nUnlike Proxied `Orders`, managed `Orders` are available only for `Accounts` using Dinari-managed `Wallets`.\n\nNote that **fees are not included** in the `Order` amount. For buy orders, a fee will be added when placing the order. For sell orders, the fee will be deducted from the proceeds of the sale.\nCall the *Get Order Request Fee Quote* route for an estimate of the fee amount.\n"
    }
  ],
  "openapi": "3.1.0"
}
```