# Preview Margin Order Impact

<EndpointPage
  breadcrumbs={[
    { label: "Trading", href: "/trading/trading" },
    { label: "Margin Trading", href: "/trading/rest-api/margin" },
    { label: "Preview Margin Order Impact" },
  ]}
  title="Preview Margin Order Impact"
  method="POST"
  url="https://api.gemini.com/v1/margin/order/preview"
  description="Previews the margin impact of a hypothetical spot order without placing it. Returns pre-order and post-order margin risk statistics."
  note={{
    title: "Account Type",
    children: <p style={{ margin: 0 }}>This endpoint is only available for margin trading accounts.</p>
  }}
  example={{
    request: {
      method: "POST",
      url: "https://api.gemini.com/v1/margin/order/preview",
      headers: [
        { name: "X-GEMINI-APIKEY", value: "<string>" },
        { name: "X-GEMINI-PAYLOAD", value: "<string>" },
        { name: "X-GEMINI-SIGNATURE", value: "<string>" },
      ],
      body: {
        request: "/v1/margin/order/preview",
        nonce: "<nonce>",
        symbol: "btcusd",
        side: "buy",
        type: "limit",
        amount: "0.5",
        price: "50000.00",
      },
    },
  }}
  sections={[
    {
      heading: "Roles",
      children: (
        <>
          <p style={{ margin: "0 0 2px" }}>The API key you use to access this endpoint must have the Trader or Auditor 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:read</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: "Headers",
      children: <SpecHeaders operationId="previewMarginOrder" />,
    },
    {
      heading: "Request Body",
      children: <SpecParams operationId="previewMarginOrder" />,
    },
    {
      heading: "Responses",
      children: <SpecResponses operationId="previewMarginOrder" />,
    },
  ]}
/>

<PageNavigation
  prev={{ label: "Get Margin Interest Rates", href: "/trading/rest-api/margin/get-margin-interest-rates" }}
  next={{ label: "Staking", href: "/trading/rest-api/staking" }}
/>
