---
title: "Create a quote"
method: POST
path: "/quote"
tags: ["Quote"]
---

# Create a quote

`POST /quote`

Create a quote for a given currency

## Request body

- CreateQuote
  - `amount` number, required — The amount in the target currency in its lowest denomination. e.g '500000' for 5000.00 NGN
  - `sourceCurrency` 'BTCSAT' | 'NGNKOBO', string, required — The source currency for the quote
  - `targetCurrency` 'NGNKOBO' | 'KESCENT' | 'ZARCENT' | 'GHSPESEWA' | 'BTCSAT', string, required — The local currency to convert the source currency to
  - `paymentMethod` 'LIGHTNING' | 'BANKTRANSFER', string, required — The payment method for the quote
  - `paymentCurrency` 'NGNKOBO' | 'BTCSAT' | 'KESCENT' | 'ZARCENT' | 'GHSPESEWA', string, required — Currency the amount is denominated in. Must be either sourceCurrency or targetCurrency. Determines what the 'amount' field represents. Example: if buying BTC with NGN and paymentCurrency is 'NGNKOBO', amount is in Naira; if 'BTCSAT', amount is in Bitcoin.
  - `customerReference` string, string — Your unique identifier for the quote
  - `autopayout` boolean
  - `beneficiary` union
    - object
      - `bankAccountNumber` string, required — The bank account number of the beneficiary
      - `bankAccountName` string, required — The name of the beneficiary
      - `bankCode` string, required — The bank code of the beneficiary
      - `bankName` string, required — The name of the bank of the beneficiary
    - object
      - `identifierType` 'paytophone' | 'paytobill' | 'paytotill', required — The type of identifier to use for the beneficiary
      - `identifiers` object, required
        - `phoneNumber` string — The phone number of the beneficiary if the identifierType is paytophone
        - `network` 'mpesa' | 'airtel' — The target mobile money network. Required when identifierType is paytophone.
        - `paybillNumber` string — The paybill number of the beneficiary if the identifierType is paytobill
        - `accountNumber` string — The account number of the beneficiary if the identifierType is paytobill
        - `tillNumber` string — The till number of the beneficiary if the identifierType is paytotill
        - `accountName` string — The account name of the beneficiary if the identifierType is paytobill or paytotill
    - object
      - `identifierType` 'MTN', required — The type of mobile network to use for the beneficiary
      - `identifiers` object, required
        - `phoneNumber` string — The phone number of the beneficiary if the identifierType is MTN
        - `accountName` string — The account name of the beneficiary if the identifierType is MTN
    - object
      - `name` string, required — The name of the beneficiary
      - `bankName` string, required — The name of the bank of the beneficiary
      - `bankAccountNumber` string, required — The bank account number of the beneficiary
    - object
      - `lnInvoice` string — Lightning Network invoice for Bitcoin payout (required when autopayout is true)
      - `lnAddress` string — Lightning address for Bitcoin payout (alternative to lnInvoice)
      - `onChainAddress` string — Bitcoin on-chain address for payout (alternative to lnInvoice)

## Response `200`

Quote response

- object
  - `status` string, string
  - `data` Quote
    - `id` string, uuid
    - `exchangeRate` number — The exchange rate is the rate of 1 BTC to the targetCurrency. So if you generated a quote for NGN->BTC (targetCurrency is BTC), the rate will be 1 because the exchange rate of 1 BTC to BTC is 1. If it's a quote of BTC->NGN (targetCurrency is NGN), the rate will likely be 103830225.71866913 i.e., 1 BTC to NGN
    - `usdToTargetCurrencyRate` number — The USD to target currency rate for the quote
    - `sourceCurrency` 'BTCSAT' | 'NGNKOBO', string — The source currency for the quote
    - `targetCurrency` 'NGNKOBO' | 'KESCENT' | 'ZARCENT' | 'GHSPESEWA', string — The target currency for the quote
    - `transactionFeesInSourceCurrency` number — The transaction fees in the source currency in its lowest denomination
    - `transactionFeesInTargetCurrency` string, string — The transaction fees in the target currency in its lowest denomination
    - `amountInSourceCurrency` number — The amount in the source currency in its lowest denomination
    - `amountInTargetCurrency` string, string — The amount in the target currency in its lowest denomination
    - `paymentMethod` 'LIGHTNING', string
    - `expiry` string, date-time
    - `isValid` boolean
    - `invoice` string, string — The lightning invoice to pay for the quote
    - `hash` string, string — The payment hash for the lightning invoice attached to the quote
    - `customerReference` string, string — Your unique identifier for the quote
    - `totalAmountInSourceCurrency` number — The total amount in the source currency in its lowest denomination
    - `customerInternalFee` number — An internal fee you can set to charge the customer. This fee is in the source currency in its lowest denomination
    - `createdAt` string, date-time — The date and time the quote was created
    - `updatedAt` string, date-time — The date and time the quote was last updated
    - `bankName` string, string — Bank name for NGN bank transfer (when paymentMethod is BANKTRANSFER)
    - `ngnBankAccountNumber` string, string — Bank account number for NGN payment (when paymentMethod is BANKTRANSFER)
    - `ngnAccountName` string, string — Account name for NGN payment (when paymentMethod is BANKTRANSFER)
    - `ngnBankCode` string, string — NIP bank code for NGN payment (when paymentMethod is BANKTRANSFER)
    - `orderId` string, string — Unique order identifier for tracking
    - `estimatedRoutingFee` number — Estimated routing fee for Lightning Network payments in satoshis

## Other responses

- `400` — Unexpected error

---

[API](https://skmtc.net/stealthmoney/apis/mavapay-api.md) · [All operations](https://skmtc.net/stealthmoney/apis/mavapay-api/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/stealthmoney/mavapay-api/revisions/94cb0ddffad0/schema)
