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

# Create quote

> Quote every eligible provider for a corridor and amount. Returns one binding quote per provider, ranked by what the recipient receives. Quotes expire in about two minutes.



## OpenAPI

````yaml /openapi.yaml post /v1/ramp/quote
openapi: 3.1.0
info:
  title: Onstacks Backend API
  version: 0.1.0
  summary: >-
    Public API contract for workspace wallet, transfer, provider routing, API
    key, and webhook flows.
servers:
  - url: https://api.onstacks.io
security: []
tags:
  - name: Health
  - name: Workspace
  - name: Wallets
  - name: Transfers
  - name: Corridors
  - name: Providers
  - name: Quotes
  - name: Ramp
paths:
  /v1/ramp/quote:
    post:
      tags:
        - Ramp
      summary: Create quote
      description: >-
        Quote every eligible provider for a corridor and amount. Returns one
        binding quote per provider, ranked by what the recipient receives.
        Quotes expire in about two minutes.
      parameters:
        - $ref: '#/components/parameters/EnvironmentQuery'
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/RampCreateQuoteRequest'
      responses:
        '201':
          description: Quotes
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/RampQuotesResponse'
        '400':
          $ref: '#/components/responses/ValidationError'
        '401':
          $ref: '#/components/responses/Unauthorized'
      security:
        - apiKeyBearer: []
components:
  parameters:
    EnvironmentQuery:
      in: query
      name: environment
      description: >-
        Environment scope for environment-partitioned resources. Defaults to
        `sandbox` when omitted.
      required: false
      schema:
        $ref: '#/components/schemas/EnvironmentScope'
  schemas:
    RampCreateQuoteRequest:
      type: object
      required:
        - direction
        - source_asset
        - source_amount
        - destination_asset
        - country_code
        - rail
      properties:
        direction:
          $ref: '#/components/schemas/RampDirection'
        source_asset:
          type: string
          example: USDC
        source_network:
          type: string
          example: base
          description: >-
            Optional. When omitted Onstacks chooses the network for the
            transaction.
        source_amount:
          type: string
          example: '1000000'
        destination_asset:
          type: string
          example: NGN
        destination_network:
          type: string
          description: For on-ramps, the network to deliver the stablecoin on. Optional.
        country_code:
          type: string
          example: NG
        rail:
          $ref: '#/components/schemas/RampRail'
        preferred_providers:
          type: array
          items:
            type: string
          description: >-
            Restrict quoting to these provider codes. Omit to quote every
            eligible provider.
        metadata:
          type: object
          additionalProperties: true
    RampQuotesResponse:
      type: object
      required:
        - data
        - error
        - request_id
      properties:
        data:
          type: object
          properties:
            quotes:
              type: array
              items:
                $ref: '#/components/schemas/RampQuote'
            recommended_quote_reference:
              type: string
        error:
          type: 'null'
        request_id:
          type: string
    EnvironmentScope:
      type: string
      enum:
        - sandbox
        - live
      default: sandbox
    RampDirection:
      type: string
      enum:
        - on_ramp
        - off_ramp
    RampRail:
      type: string
      enum:
        - bank
        - mobile_money
        - wallet
        - ach
        - wire
        - sepa
        - faster_payments
        - interac
    RampQuote:
      type: object
      properties:
        quote_reference:
          type: string
        direction:
          $ref: '#/components/schemas/RampDirection'
        rail:
          $ref: '#/components/schemas/RampRail'
        provider:
          type: string
          description: Provider code that will settle the fiat leg.
        source:
          $ref: '#/components/schemas/RampAmount'
        destination:
          $ref: '#/components/schemas/RampAmount'
        fee:
          $ref: '#/components/schemas/RampAmount'
        rate:
          type: string
        source_country:
          type: string
        destination_country:
          type: string
        expires_at:
          type: string
          format: date-time
        metadata:
          type: object
          additionalProperties: true
    ErrorEnvelope:
      type: object
      required:
        - data
        - error
        - request_id
      properties:
        data:
          type: 'null'
        error:
          $ref: '#/components/schemas/ApiError'
        request_id:
          type: string
    RampAmount:
      type: object
      required:
        - amount
        - asset
      properties:
        amount:
          type: string
          description: Minor units for fiat, base units for crypto, as a decimal string.
          example: '1000000'
        asset:
          type: string
          example: USDC
        network:
          type: string
          description: Network code for crypto assets.
          example: base
    ApiError:
      type: object
      required:
        - code
        - message
      properties:
        code:
          type: string
        message:
          type: string
        details:
          type: object
          additionalProperties: true
  responses:
    ValidationError:
      description: Request payload is invalid
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorEnvelope'
    Unauthorized:
      description: Caller is not authenticated
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorEnvelope'
  securitySchemes:
    apiKeyBearer:
      type: http
      scheme: bearer
      bearerFormat: API key
      description: 'Workspace API key. Send it as `Authorization: Bearer <api_key>`.'

````

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