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

# Create execution quote

> Creates a quote valid for 30 seconds with estimated pricing, fees, and a protected price. Requires trades:view. Use expires_at to track expiry. The optional business_bps affects displayed pricing only. Accept the returned quote_id to trade; liquidity is not reserved.



## OpenAPI

````yaml /openapi/openapi.json post /partner/exchange/quotes
openapi: 3.1.0
info:
  title: Stabyl API
  description: >-
    REST API for approved Stabyl accounts to automate exchange, wallet, and
    non-production simulation workflows.
  contact:
    name: Stabyl Support
    email: support@stabyl.com
  license:
    name: Proprietary
  version: 1.0.0
servers:
  - url: https://api.stabyl.com/v1
    description: Production
  - url: https://api-staging.stabyl.com/v1
    description: Staging
security: []
tags:
  - name: Exchange
    description: Trading market data and order management for account automation.
  - name: Wallets
    description: >-
      Supported routes, deposit destinations, balances, transactions, and saved
      recipients.
  - name: Webhooks
    description: >-
      Outbound event delivery configuration and eventually consistent delivery
      history. Verify Standard Webhooks webhook-id, webhook-timestamp, and
      webhook-signature headers against the unchanged raw request body before
      parsing JSON.
  - name: Simulation
    description: Non-production endpoints for testing integration behavior.
paths:
  /partner/exchange/quotes:
    post:
      tags:
        - Exchange
      summary: Create execution quote
      description: >-
        Creates a quote valid for 30 seconds with estimated pricing, fees, and a
        protected price. Requires trades:view. Use expires_at to track expiry.
        The optional business_bps affects displayed pricing only. Accept the
        returned quote_id to trade; liquidity is not reserved.
      operationId: post_partner_exchange_quotes
      requestBody:
        description: >-
          Pair, buy or sell side, and base-currency quantity as a decimal
          string. business_bps is an optional display spread.
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/MarketOrderEstimateRequest'
            example:
              business_bps: 25
              pair_id: USD/NGN
              quantity: '100.00'
              side: buy
        required: true
      responses:
        '200':
          description: Market-order estimate with executable quote
          content:
            application/json:
              schema:
                type: object
                required:
                  - status
                  - data
                properties:
                  data:
                    $ref: '#/components/schemas/PartnerMarketOrderEstimateResponse'
                  status:
                    type: string
                    enum:
                      - success
              example:
                data:
                  business_bps: 25
                  client_quote_notional: '150375'
                  client_quote_price: '1503.75'
                  estimated_at: '2026-09-29T12:00:00Z'
                  estimated_average_price: '1500'
                  estimated_fee_base: '0.10'
                  estimated_fill_quantity: '100'
                  estimated_notional: '150000'
                  estimated_slippage_bps: 0
                  expires_at: '2026-09-29T12:00:30Z'
                  fee_bps: 10
                  orderbook_sequence: 42
                  pair_id: USD/NGN
                  protected_limit_price: '1507.50'
                  quantity: '100'
                  quote_id: 01999a40-0000-7000-8000-000000000001
                  reference_price: '1500'
                  side: buy
                  slippage_tolerance_bps: 50
                  sufficient_liquidity: true
                status: success
        '400':
          description: Invalid side, quantity, spread, or unavailable liquidity
          content:
            application/json:
              schema:
                type: object
                required:
                  - status
                  - error
                properties:
                  error:
                    type: object
                    required:
                      - code
                      - message
                    properties:
                      code:
                        type: string
                        example: VALIDATION_FAILED
                      message:
                        type: string
                        example: invalid request parameters
                  status:
                    type: string
                    enum:
                      - error
              example:
                error:
                  code: VALIDATION_FAILED
                  message: invalid request parameters
                status: error
        '401':
          description: Unauthorized
          content:
            application/json:
              schema:
                type: object
                required:
                  - status
                  - error
                properties:
                  error:
                    type: object
                    required:
                      - code
                      - message
                    properties:
                      code:
                        type: string
                        example: UNAUTHORIZED
                      message:
                        type: string
                        example: missing X-Api-Key header
                  status:
                    type: string
                    enum:
                      - error
              example:
                error:
                  code: UNAUTHORIZED
                  message: missing X-Api-Key header
                status: error
      security:
        - api_key: []
components:
  schemas:
    MarketOrderEstimateRequest:
      type: object
      description: >-
        Request for execution pricing with an optional partner presentation
        spread.
      required:
        - pair_id
        - side
        - quantity
      properties:
        business_bps:
          type:
            - integer
            - 'null'
          format: int32
          description: >-
            Optional partner spread applied to the estimated execution price for
            a client quote.

            This does not alter Stabyl execution or fees.
          example: 25
          maximum: 10000
          minimum: 0
        pair_id:
          type: string
          description: Trading pair identifier.
          example: USD/NGN
        quantity:
          type: string
          description: Quantity in base currency.
          example: '100.00'
        side:
          type: string
          description: 'Order side: "buy" consumes asks and "sell" consumes bids.'
          example: buy
    PartnerMarketOrderEstimateResponse:
      allOf:
        - $ref: '#/components/schemas/MarketOrderEstimateResponse'
        - type: object
          required:
            - quote_id
            - expires_at
            - protected_limit_price
            - slippage_tolerance_bps
            - fee_bps
            - estimated_fee_base
          properties:
            estimated_fee_base:
              type: string
            expires_at:
              type: string
            fee_bps:
              type: integer
              format: int32
              description: >-
                Estimated account taker fee; the applied fee is fixed at order
                admission.
            protected_limit_price:
              type: string
            quote_id:
              type: string
              format: uuid
            slippage_tolerance_bps:
              type: integer
              format: int32
              minimum: 0
      description: >-
        Existing estimate fields plus an account-owned, executable protected
        quote.
    MarketOrderEstimateResponse:
      type: object
      description: Non-binding market-order execution and partner-quote estimate.
      required:
        - pair_id
        - side
        - quantity
        - estimated_fill_quantity
        - sufficient_liquidity
        - reference_price
        - estimated_average_price
        - estimated_slippage_bps
        - business_bps
        - client_quote_price
        - estimated_notional
        - client_quote_notional
        - orderbook_sequence
        - estimated_at
      properties:
        business_bps:
          type: integer
          format: int32
          description: Partner-supplied spread used to calculate `client_quote_price`.
          minimum: 0
        client_quote_notional:
          type: string
          description: Client-facing notional after applying `business_bps`.
        client_quote_price:
          type: string
          description: >-
            Average price with the partner spread applied (buy: add; sell:
            subtract).
        estimated_at:
          type: string
          description: Timestamp of the source order-book snapshot.
        estimated_average_price:
          type: string
          description: Quantity-weighted average execution price across visible levels.
        estimated_fill_quantity:
          type: string
          description: Quantity covered by the currently visible order-book depth.
        estimated_notional:
          type: string
          description: Estimated Stabyl execution notional for the covered quantity.
        estimated_slippage_bps:
          type: integer
          format: int32
          description: Estimated adverse movement from the best price, in basis points.
          minimum: 0
        orderbook_sequence:
          type: integer
          format: int64
          description: Order-book sequence used for the estimate.
          minimum: 0
        pair_id:
          type: string
        quantity:
          type: string
          description: Requested base quantity.
        reference_price:
          type: string
          description: Current best price on the consumed side of the book.
        side:
          type: string
        sufficient_liquidity:
          type: boolean
          description: Whether visible depth covers the entire request.
  securitySchemes:
    api_key:
      type: apiKey
      in: header
      name: X-Api-Key
      description: >-
        API credential. Withdrawal quote and submit operations additionally
        require the documented Ed25519 timestamp, nonce, and signature headers.
      x-default: sb_test_your_key

````

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