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

# Quote a sale

> Naira you would receive for this much crypto.



## OpenAPI

````yaml https://merchant.bitliva.com/docs/openapi.json POST /quotes/sell
openapi: 3.1.0
info:
  title: Bitliva Merchant API
  version: 1.0.0
  license:
    name: Proprietary
  description: >-
    Create customers, give them crypto addresses, buy and sell crypto, sell gift
    cards, and read your naira wallet.


    Every response has the same shape: `status`, `message`, and `data` when
    there is something to return. Errors also carry a stable `code`.
servers:
  - url: https://merchant.bitliva.com/api/v1
security:
  - bearerAuth: []
tags:
  - name: Account and wallet
    description: Your key, naira balance and transaction history.
  - name: Customers and wallet addresses
    description: >-
      One customer per user of yours, with a deposit address per coin and
      network.
  - name: Buying and selling crypto
    description: Naira moves through your wallet; the crypto belongs to the customer.
  - name: Gift cards
    description: Sell gift card. Paid to your wallet on approval.
  - name: Sandbox-only helpers
    description: Sandbox only.
paths:
  /quotes/sell:
    post:
      tags:
        - Buying and selling crypto
      summary: Quote a sale
      description: Naira you would receive for this much crypto.
      operationId: quotesSell
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                currency:
                  type: string
                  description: One of btc, eth, usdt, sol, trx, bnb, ltc, usdc.
                amount:
                  oneOf:
                    - type: number
                    - type: string
                      pattern: ^\d+(\.\d+)?$
                  description: Crypto amount, up to 8 decimal places.
              required:
                - currency
                - amount
      responses:
        '200':
          description: Quote a sale
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Envelope'
              example:
                status: success
                message: Quotation retrieved successfully.
                data:
                  from_amount: '0.001'
                  from_currency: BTC
                  to_amount: '98010.00'
                  to_currency: NGN
        '401':
          $ref: '#/components/responses/Error'
        '403':
          $ref: '#/components/responses/Error'
        '409':
          $ref: '#/components/responses/Error'
        '422':
          $ref: '#/components/responses/Error'
        '429':
          $ref: '#/components/responses/Error'
components:
  schemas:
    Envelope:
      type: object
      properties:
        status:
          type: string
          enum:
            - success
            - error
        message:
          type: string
        data:
          type: object
    Error:
      type: object
      properties:
        status:
          type: string
          enum:
            - error
        message:
          type: string
        code:
          type: string
          enum:
            - invalid_api_key
            - account_inactive
            - live_not_enabled
            - sandbox_only
            - not_found
            - customer_not_found
            - method_not_allowed
            - reference_conflict
            - customer_pending
            - validation_failed
            - unsupported_currency
            - invalid_network
            - amount_below_minimum
            - insufficient_crypto_balance
            - insufficient_wallet_balance
            - sale_not_possible
            - address_required
            - customer_limit_reached
            - giftcard_unavailable
            - giftcard_submission_failed
            - rate_limited
            - service_unavailable
            - temporarily_unavailable
          description: >-
            - `invalid_api_key` (HTTP 401): The API key is missing, wrong or
            revoked.

            - `account_inactive` (HTTP 403): Your merchant account is not
            active. Contact support.

            - `live_not_enabled` (HTTP 403): Live access is not enabled: your
            business is not verified yet, or the account is suspended.

            - `sandbox_only` (HTTP 403): This endpoint only exists in the
            sandbox.

            - `not_found` (HTTP 404): Nothing with that id .

            - `customer_not_found` (HTTP 404): No customer with that id found.

            - `method_not_allowed` (HTTP 405): That endpoint does not accept
            this HTTP method.

            - `reference_conflict` (HTTP 409): This reference was already used
            for a different request. Use a new reference.

            - `customer_pending` (HTTP 409): This customer is still being set
            up. Retry in a moment with the same reference.

            - `validation_failed` (HTTP 422): One or more fields are missing or
            invalid. `errors` lists them by field name.

            - `unsupported_currency` (HTTP 422): That coin is not supported.

            - `invalid_network` (HTTP 422): The network is missing or not valid
            for that coin.

            - `amount_below_minimum` (HTTP 422): The amount is zero, or below
            the minimum for this action. The message states the minimum.

            - `insufficient_crypto_balance` (HTTP 422): The customer does not
            hold enough of that coin for this sale.

            - `insufficient_wallet_balance` (HTTP 422): Your naira wallet does
            not hold enough for this purchase. Top up in the dashboard.

            - `sale_not_possible` (HTTP 422): The sale could not be started,
            most often because the customer's balance is too low or the amount
            is too small to price. Check the balance and retry.

            - `address_required` (HTTP 422): The customer needs a deposit
            address for that coin first. Generate one, then retry.

            - `customer_limit_reached` (HTTP 422): The sandbox customer limit
            has been reached.

            - `giftcard_unavailable` (HTTP 422): That gift card cannot be sold
            right now, or does not exist.

            - `giftcard_submission_failed` (HTTP 422): The gift card could not
            be submitted.

            - `rate_limited` (HTTP 429): Too many requests. Wait the number of
            seconds in the `Retry-After` header.

            - `service_unavailable` (HTTP 502): Something went wrong on our
            side.

            - `temporarily_unavailable` (HTTP 503): This action is temporarily
            unavailable.
        errors:
          type: object
          description: Field errors, by field name, when `code` is `validation_failed`.
  responses:
    Error:
      description: Something went wrong. Match on `code`, never on `message`.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
          example:
            status: error
            message: Invalid or missing API key.
            code: invalid_api_key
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      description: Your API key.

````

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