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

# Buy Quote

> Generate a price-locked quote for a Buy onramp transaction. Pass the returned quote id as quote_id when creating the transaction to lock the price.

**Onramp Price Lock**

Onramp Buy, Pool Buy, and External Buy transactions are price-locked only when they are created from a quote. Call the matching quote endpoint first, then pass the returned quote `id` as `quote_id` when creating the transaction.

Authentication uses the same HMAC client auth as the other client endpoints.

**Request rules**

- Provide exactly one of `from_amount` or `to_amount` — not both, not neither.

**Response fields**

| Field | Meaning |
| --- | --- |
| `id` | Quote id. Pass this as `quote_id` when creating the transaction. |
| `expiry` | Price-lock expiry. The quote must be used to create a transaction before this time. |
| `settlement_expiry` | Deadline by which the transaction must be completed (deposit settled). |
| `final_price` | Locked price used for the transaction. |
| `fee_breakup` keys | `platform_fee`, `network_fee`, `client_fee`, `discount`, `tax_on_fee`, `tds` |

A quote is single-use and tied to the client that created it.




## OpenAPI

````yaml openapi-v2.json POST /api/v2/wallet/s/quote
openapi: 3.1.0
info:
  title: Saber Money API (v2)
  version: v2
  description: >-
    ## Authentication


    There is no standalone API-key auth — every request must be **signed**. An
    API key by itself authenticates nothing. Each call requires four headers
    together: `X-Api-Key` (your key), `X-Signature` (HMAC-SHA256 of `apiKey +
    timestamp` — or `apiKey + timestamp + userId` when `X-User-Id` is required —
    keyed with your API secret), `X-Timestamp` (unix seconds), and
    `X-Request-Id` (any unique string per request). The signature must be
    computed by a client script; there is no way to derive it by hand. Use the
    HMAC Generator flow to compute valid values for manual testing.


    ## Common Authentication Errors


    - **Invalid Client ID**: {"error_code":6092,"message":"X-Client-Id
    invalid","success":false}

    - **Invalid Secret**: {"error_code":6090,"message":"invalid
    secret","success":false}

    - **Timestamp (Older than 10 secs)**:
    {"errors":{"error_code":6093,"text":"timestamp expired"},"success":false}
servers:
  - url: https://api.saber.money
security: []
paths:
  /api/v2/wallet/s/quote:
    post:
      tags:
        - Onramp
      summary: Buy Quote
      description: >
        Generate a price-locked quote for a Buy onramp transaction. Pass the
        returned quote id as quote_id when creating the transaction to lock the
        price.


        **Onramp Price Lock**


        Onramp Buy, Pool Buy, and External Buy transactions are price-locked
        only when they are created from a quote. Call the matching quote
        endpoint first, then pass the returned quote `id` as `quote_id` when
        creating the transaction.


        Authentication uses the same HMAC client auth as the other client
        endpoints.


        **Request rules**


        - Provide exactly one of `from_amount` or `to_amount` — not both, not
        neither.


        **Response fields**


        | Field | Meaning |

        | --- | --- |

        | `id` | Quote id. Pass this as `quote_id` when creating the
        transaction. |

        | `expiry` | Price-lock expiry. The quote must be used to create a
        transaction before this time. |

        | `settlement_expiry` | Deadline by which the transaction must be
        completed (deposit settled). |

        | `final_price` | Locked price used for the transaction. |

        | `fee_breakup` keys | `platform_fee`, `network_fee`, `client_fee`,
        `discount`, `tax_on_fee`, `tds` |


        A quote is single-use and tied to the client that created it.
      operationId: create-buy-quote-v2
      parameters:
        - name: X-Api-Key
          in: header
          required: true
          description: Your API key (configured in credentials)
          schema:
            type: string
        - name: X-Signature
          in: header
          required: true
          description: >-
            HMAC-SHA256 signature (auto-generated) To test manually: HMAC-SHA256
            of `apiKey + timestamp` (or `apiKey + timestamp + userId` when
            X-User-Id is required), keyed with your API secret. The HMAC
            Generator flow computes this for you.
          schema:
            type: string
        - name: X-Timestamp
          in: header
          required: true
          description: >-
            Unix timestamp in seconds (auto-generated) Unix seconds, e.g.
            `Math.floor(Date.now() / 1000)`. Must match the timestamp used in
            the X-Signature computation.
          schema:
            type: string
        - name: X-Request-Id
          in: header
          required: true
          description: >-
            Unique request identifier (auto-generated) Any unique string per
            request, e.g. a UUID.
          schema:
            type: string
        - name: X-User-Id
          in: header
          required: true
          description: User UUID (set above)
          schema:
            type: string
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                from_currency:
                  type: string
                  description: Fiat currency for the onramp transaction.
                to_currency:
                  type: string
                  description: Crypto currency for the onramp transaction.
                from_amount:
                  type: number
                  description: >-
                    Fiat amount. Provide exactly one of `from_amount` or
                    `to_amount` (not both, not neither).
                to_amount:
                  type: number
                  description: >-
                    Crypto amount. Provide exactly one of `from_amount` or
                    `to_amount` (not both, not neither).
                payment_method:
                  type: string
                  description: Payment method used to complete the onramp deposit leg.
              required:
                - from_currency
                - to_currency
                - payment_method
            example:
              from_currency: INR
              to_currency: USDT
              from_amount: '1230'
              payment_method: bank_transfer
      responses:
        '200':
          description: Successful response
          content:
            application/json:
              schema:
                type: object
                properties:
                  success:
                    type: boolean
                  data:
                    type: object
                    properties:
                      from_currency:
                        type: string
                      to_currency:
                        type: string
                      from_amount:
                        type: integer
                      pre_fee_to_amount:
                        type: number
                      to_amount:
                        type: number
                      base_price:
                        type: number
                      final_price:
                        type: number
                      total_fee:
                        type: integer
                      fee_currency:
                        type: string
                      fee_breakup:
                        type: object
                      payment_method:
                        type: string
                      transaction_type:
                        type: string
                      id:
                        type: string
                        enum:
                          - quote_id
                      expiry:
                        type: string
                      settlement_expiry:
                        type: string
                      created_at:
                        type: string
                      updated_at:
                        type: string
              example:
                success: true
                data:
                  from_currency: inr
                  to_currency: usdt
                  from_amount: 1230
                  pre_fee_to_amount: 13.04486159
                  to_amount: 13.04486159
                  base_price: 94.29
                  final_price: 94.29
                  total_fee: 0
                  fee_currency: inr
                  fee_breakup:
                    platform_fee: 0
                    network_fee: 0
                    client_fee: 0
                    discount: 0
                    tax_on_fee: 0
                    tds: 0
                  payment_method: bank_transfer
                  transaction_type: BUY
                  id: 39853414-d7bf-4db6-a7ba-4cc2961ef3b1
                  expiry: '2026-05-19T05:28:25.82991618Z'
                  settlement_expiry: '2026-05-19T05:50:55.82991618Z'
                  created_at: '2026-05-19T05:27:55.82782516Z'
                  updated_at: '2026-05-19T05:27:55.827825234Z'
        '400':
          description: >-
            `400001`: missing or invalid parameters; `402001`: unsupported
            currency pair, please contact support; `5033`: invalid amount
            provided; `6002`: invalid request; `9924`: quote invalid; `9933`:
            both from_amount and to_amount are not provided; `9934`: both
            from_amount and to_amount cannot be provided simultaneously
          content:
            application/json:
              schema:
                type: object
                properties:
                  success:
                    type: boolean
                    enum:
                      - false
                  errors:
                    type: array
                    items:
                      type: object
                      properties:
                        code:
                          type:
                            - integer
                            - string
                        text:
                          type: string
              example:
                success: false
                errors:
                  - code: 9933
                    text: both from_amount and to_amount are not provided
        '401':
          description: '`401001`: missing or absent auth token'
          content:
            application/json:
              schema:
                type: object
                properties:
                  success:
                    type: boolean
                    enum:
                      - false
                  errors:
                    type: array
                    items:
                      type: object
                      properties:
                        code:
                          type:
                            - integer
                            - string
                        text:
                          type: string
              example:
                success: false
                errors:
                  - code: 9933
                    text: both from_amount and to_amount are not provided
        '404':
          description: >-
            `402009`: price not available; `9010`: no data found in db; `4010`:
            exchange not found
          content:
            application/json:
              schema:
                type: object
                properties:
                  success:
                    type: boolean
                    enum:
                      - false
                  errors:
                    type: array
                    items:
                      type: object
                      properties:
                        code:
                          type:
                            - integer
                            - string
                        text:
                          type: string
              example:
                success: false
                errors:
                  - code: 9933
                    text: both from_amount and to_amount are not provided
        '500':
          description: '`499999`: Something went wrong!'
          content:
            application/json:
              schema:
                type: object
                properties:
                  success:
                    type: boolean
                    enum:
                      - false
                  errors:
                    type: array
                    items:
                      type: object
                      properties:
                        code:
                          type:
                            - integer
                            - string
                        text:
                          type: string
              example:
                success: false
                errors:
                  - code: 9933
                    text: both from_amount and to_amount are not provided
        '503':
          description: >-
            `402010`: service temporarily unavailable; `901011`: service
            configuration missing. please contact support
          content:
            application/json:
              schema:
                type: object
                properties:
                  success:
                    type: boolean
                    enum:
                      - false
                  errors:
                    type: array
                    items:
                      type: object
                      properties:
                        code:
                          type:
                            - integer
                            - string
                        text:
                          type: string
              example:
                success: false
                errors:
                  - code: 9933
                    text: both from_amount and to_amount are not provided

````

## Related topics

- [Pool Buy Quote](/api-reference/onramp/price-lock/pool-buy-quote.md)
- [External Buy Quote](/api-reference/onramp/price-lock/external-buy-quote.md)
- [Fetching Quote](/onramp/operations/quote.md)
- [Create External Buy](/api-reference/onramp/to-external-wallet/create-external-buy.md)
- [Create Pool Buy Transaction](/api-reference/onramp/to-pool-wallet/create-pool-buy-transaction.md)
