# Create New Order

<EndpointPage
  breadcrumbs={[
    { label: "Trading", href: "/trading/trading" },
    { label: "Orders", href: "/trading/rest-api/orders" },
    { label: "Create New Order" },
  ]}
  title="Create New Order"
  method="POST"
  url="https://api.gemini.com/v1/order/new"
  description={<>If you wish orders to be automatically cancelled when your session ends, see the <a href="/authentication/api-key#require-heartbeat" style={{ color: "inherit", textDecorationLine: "underline" }}>require heartbeat</a> section, or manually send the <a href="/trading/rest-api/orders/cancel-all-session-orders" style={{ color: "inherit", textDecorationLine: "underline" }}>cancel all session orders</a> message.</>}
  note={{
    title: "Note",
    children: <><p style={{ margin: "0 0 4px" }}>Master API keys do not support cancelation on disconnect via heartbeat.</p><p style={{ margin: 0 }}>Enabled for perpetuals accounts from July 10th, 0100hrs ET onwards.</p></>
  }}
  exampleNode={<SpecExample operationId="createNewOrder" />}
  sections={[
    {
      heading: "Roles",
      children: (
        <>
          <p style={{ margin: "0 0 2px" }}>The API key you use to access this endpoint must have the Trader role assigned. See <a href="https://docs.gemini.com/roles#roles" style={{ color: "inherit", textDecorationLine: "underline" }}>Roles</a> for more information.</p>
          <p style={{ margin: 0 }}>The OAuth scope must have <InlineBadge>orders:create</InlineBadge> assigned to access this endpoint. See <a href="/authentication/oauth#oauth-scopes" style={{ color: "inherit", textDecorationLine: "underline" }}>OAuth Scopes</a> for more information.</p>
        </>
      ),
    },
    {
      heading: "Margin Orders",
      children: (
        <>
          <p style={{ margin: "0 0 12px" }}>Set <InlineBadge>margin_order: true</InlineBadge> to place an order using borrowed funds on a margin-enabled account. This allows you to trade with leverage beyond your available balance.</p>
          <div style={{ display: "flex", gap: 12, padding: 16, background: "rgba(247,177,51,0.08)", borderRadius: 12 }}>
            <IconStaticStatusWarning style={{ width: 24, height: 24, flexShrink: 0, marginTop: 1 }} />
            <div>
              <p style={{ margin: "0 0 4px", fontFamily: "Geist, sans-serif", fontWeight: 600, fontSize: 16, lineHeight: "24px", color: "var(--content-primary, #010304)" }}>Important</p>
              <p style={{ margin: 0, fontFamily: "Geist, sans-serif", fontSize: 14, lineHeight: "20px", color: "var(--content-primary, #010304)" }}>Margin trading amplifies both gains and losses. Monitor your account using the <a href="https://docs.gemini.com/rest/margin-trading#get-margin-account-summary" style={{ color: "inherit", textDecorationLine: "underline" }}>Margin Account Summary</a> endpoint and preview order impacts with <a href="https://docs.gemini.com/rest/margin-trading#preview-margin-order-impact" style={{ color: "inherit", textDecorationLine: "underline" }}>Order Preview</a> before placing margin orders.</p>
            </div>
          </div>
        </>
      ),
    },
    {
      heading: "Stop-Limit Orders",
      children: (
        <p style={{ margin: 0 }}>A Stop-Limit order is an order type that allows for order placement when a price reaches a specified level. Stop-Limit orders take in both a <InlineBadge>price</InlineBadge> and a <InlineBadge>stop_price</InlineBadge> as parameters. The <InlineBadge>stop_price</InlineBadge> is the price that triggers the order to be placed on the continuous live order book at the <InlineBadge>price</InlineBadge>. For buy orders, the <InlineBadge>stop_price</InlineBadge> must be below the <InlineBadge>price</InlineBadge> while sell orders require the <InlineBadge>stop_price</InlineBadge> to be greater than the <InlineBadge>price</InlineBadge>.</p>
      ),
    },
    {
      heading: "What about market orders?",
      children: (
        <>
          <p style={{ margin: "0 0 2px" }}>The API doesn't directly support market orders because they provide you with no price protection.</p>
          <p style={{ margin: 0 }}>Instead, use the "immediate-or-cancel" order execution option, coupled with an aggressive limit price (i.e. very high for a buy order or very low for a sell order), to achieve the same result.</p>
        </>
      ),
    },
    {
      heading: "Order execution options",
      children: (
        <>
          <p style={{ margin: "0 0 16px" }}>Note that <InlineBadge>options</InlineBadge> is an array. If you omit <InlineBadge>options</InlineBadge> or provide an empty array, your order will be a standard limit order - it will immediately fill against any open orders at an equal or better price, then the remainder of the order will be posted to the order book.</p>
          <p style={{ margin: "0 0 16px" }}>If you specify more than one option (or an unsupported option) in the <InlineBadge>options</InlineBadge> array, the exchange will reject your order.</p>
          <p style={{ margin: "0 0 16px" }}>No <InlineBadge>options</InlineBadge> can be applied to stop-limit orders at this time.</p>
          <p style={{ margin: "0 0 16px" }}>The available limit order options are:</p>
          <div style={{ border: "1px solid var(--card-border-outlined-enabled, #e6e6e6)", borderRadius: 12, overflow: "hidden" }}>
            <div style={{ display: "flex", gap: 12, padding: "0 16px", borderBottom: "1px solid var(--card-border-outlined-enabled, #e6e6e6)" }}>
              <div style={{ width: 160, padding: "8px 0", fontFamily: "Geist, sans-serif", fontSize: 14, lineHeight: "20px", color: "var(--content-primary, #010304)", flexShrink: 0 }}>Option</div>
              <div style={{ flex: 1, padding: "8px 0", fontFamily: "Geist, sans-serif", fontSize: 14, lineHeight: "20px", color: "var(--content-primary, #010304)" }}>Description</div>
            </div>
            <div style={{ display: "flex", gap: 12, padding: "0 16px", borderBottom: "1px solid var(--card-border-outlined-enabled, #e6e6e6)", alignItems: "flex-start" }}>
              <div style={{ width: 160, padding: "8px 0", flexShrink: 0 }}><TableBadge style={{ fontSize: 12, height: 18 }}>"maker-or-cancel"</TableBadge></div>
              <div style={{ flex: 1, padding: "8px 0", fontFamily: "Geist, sans-serif", fontSize: 14, lineHeight: "20px", color: "var(--content-secondary, rgba(1,3,4,0.6))" }}>
                <p style={{ margin: "0 0 8px" }}>This order will only add liquidity to the order book.</p>
                <p style={{ margin: "0 0 8px" }}>If any part of the order could be filled immediately, the whole order will instead be canceled before any execution occurs.</p>
                <p style={{ margin: "0 0 8px" }}>If that happens, the response back from the API will indicate that the order has already been canceled (<TableBadge>"is_cancelled": true</TableBadge> in JSON).</p>
                <p style={{ margin: 0 }}>Note: some other exchanges call this option "post-only".</p>
              </div>
            </div>
            <div style={{ display: "flex", gap: 12, padding: "0 16px", borderBottom: "1px solid var(--card-border-outlined-enabled, #e6e6e6)", alignItems: "flex-start" }}>
              <div style={{ width: 160, padding: "8px 0", flexShrink: 0 }}><TableBadge style={{ fontSize: 12, height: 18 }}>"immediate-or-cancel"</TableBadge></div>
              <div style={{ flex: 1, padding: "8px 0", fontFamily: "Geist, sans-serif", fontSize: 14, lineHeight: "20px", color: "var(--content-secondary, rgba(1,3,4,0.6))" }}>
                <p style={{ margin: "0 0 8px" }}>This order will only remove liquidity from the order book.</p>
                <p style={{ margin: "0 0 8px" }}>It will fill whatever part of the order it can immediately, then cancel any remaining amount so that no part of the order is added to the order book.</p>
                <p style={{ margin: 0 }}>If the order doesn't fully fill immediately, the response back from the API will indicate that the order has already been canceled (<TableBadge>"is_cancelled": true</TableBadge> in JSON).</p>
              </div>
            </div>
            <div style={{ display: "flex", gap: 12, padding: "0 16px", alignItems: "flex-start" }}>
              <div style={{ width: 160, padding: "8px 0", flexShrink: 0 }}><TableBadge style={{ fontSize: 12, height: 18 }}>"fill-or-kill"</TableBadge></div>
              <div style={{ flex: 1, padding: "8px 0", fontFamily: "Geist, sans-serif", fontSize: 14, lineHeight: "20px", color: "var(--content-secondary, rgba(1,3,4,0.6))" }}>
                <p style={{ margin: "0 0 8px" }}>This order will only remove liquidity from the order book.</p>
                <p style={{ margin: "0 0 8px" }}>It will fill the entire order immediately or cancel.</p>
                <p style={{ margin: 0 }}>If the order doesn't fully fill immediately, the response back from the API will indicate that the order has already been canceled (<TableBadge>"is_cancelled": true</TableBadge> in JSON).</p>
              </div>
            </div>
          </div>
        </>
      ),
    },
    {
      heading: "Headers",
      children: <SpecHeaders operationId="createNewOrder" />,
    },
    {
      heading: "Request Body",
      children: <SpecParams operationId="createNewOrder" />,
    },
    {
      heading: "Responses",
      children: <SpecResponses operationId="createNewOrder" />,
    },
  ]}
/>

<PageNavigation
  prev={{ label: "Orders (1.0.0)", href: "/trading/rest-api/orders" }}
  next={{ label: "Cancel Order", href: "/trading/rest-api/orders/cancel-order" }}
/>
