๐Ÿ“ฃ New Region Unlocked: You can now send payouts directly to Canada! ๐Ÿ‡จ๐Ÿ‡ฆ
Quotes
Create Quote

Create Quote API

The Create Quote API allows users to generate a quote for a specified source and destination currency.

Endpoint

POST : {{baseURL}}/v1/quote

Description

This endpoint creates a currency exchange quote for a user, considering applicable business rules. The response includes the converted amount, exchange rate, fees, and transaction limits.


Headers

All requests to the Quote API require:

HeaderDescriptionRequiredExample Value
x-api-keyAPI key for authenticationโœ… YesAPI_KEY_HERE
Content-TypeRequest content typeโœ… Yesapplication/json

Security Notes

  • Requests from non-whitelisted IPs will be rejected with 403.
  • All API keys are environment-specific (test/live).
  • Quotes expire 10 minutes after creation โ€” see expiresInSeconds in the response.

Request Body

{
  "paymentChannel": " ",  // Payment method for the transaction
  "source": {
    "amount": ,          // Amount in the source currency
    "country": " ",           // Source country code (ISO 3166-1 alpha-2)
    "currency": " "          // Source currency code (ISO 4217)
  },
  "target": {
    "country": " ",           // Target country code (ISO 3166-1 alpha-2)
    "currency": " "          // Target currency code (ISO 4217)
  }
}

Request Parameters

FieldTypeDescriptionRequiredExample Value
paymentChannelStringPayment method for the transactionโœ… Yes"BANK_TRANSFER" or "ALI_PAY"
source.amountNumberAmount in the source currencyโœ… Yes5000
source.countryStringSource country code (ISO 3166-1 alpha-2)โœ… Yes"NG"
source.currencyStringSource currency code (ISO 4217)โœ… Yes"NGN"
target.countryStringTarget country codeโœ… Yes"US"
target.currencyStringTarget currency codeโœ… Yes"USD"

Example Request

curl --location --globoff '{{baseURL}}/v1/quote' \
--header 'x-api-key: YOUR_API_KEY' \
--header 'Content-Type: application/json' \
--data '{
  "paymentChannel": "",
  "source": {
    "amount": 150000,
    "country": "NG",
    "currency": "NGN"
  },
  "target": {
    "country": "US",
    "currency": "USD"
  }
}'

Responses

response.json
{
  "message": "quote successfully created",
  "status": "success",
  "data": {
    "id": "e5eec724-38f9-40e2-9i86-xxxxxxxxxxxxx",
    "source": {
      "currency": "NGN",
      "country": "NG",
      "amount": 150000.00
    },
    "target": {
      "currency": "USD",
      "country": "US",
      "amount": 81.97
    },
    "rate": 1830.00000000,
    "fee": {
      "amount": 0.00
    },
    "rules": [
      {
        "category": "LIMIT",
        "appliedCurrency": "USD",
        "appliedCountry": "US",
        "transaction": {
          "minimum": 1.00,
          "maximum": 20000000000000.00
        },
        "invoice": 200000000000.00
      }
    ],
    "summary": {
      "total": 150000.00
    },
    "settlementTime":"1 hr",
    "quoteCurrency": "USD",
    "expiresInSeconds": 600
  }
}
โ„น๏ธ

Note: Every quote expires 10 minutes after it has been created.

Response Breakdown

General Information

FieldTypeDescription
messageStringConfirmation message
statusStringIndicates success or failure
data.idStringUnique identifier for the quote

Source (Sending) Details

FieldTypeDescription
source.currencyStringCurrency being exchanged
source.countryStringCountry where the transaction originates
source.amountNumberAmount to be converted

Target (Receiving) Details

FieldTypeDescription
target.currencyStringTarget currency
target.countryStringDestination country
target.amountNumberConverted amount

Exchange Rate and Fees

FieldTypeDescription
rateNumberExchange rate applied
fee.amountNumberTransaction fee

Transaction Rules

FieldTypeDescription
rules[].categoryStringType of rule applied
rules[].appliedCurrencyStringCurrency the rule applies to
rules[].appliedCountryStringCountry the rule applies to
rules[].transaction.minimumNumberMinimum allowed transaction
rules[].transaction.maximumNumberMaximum allowed transaction
rules[].invoiceNumberMaximum invoice amount

Summary & Expiration

FieldTypeDescription
data.summary.totalNumberThe total amount the user will pay (source amount + fee).
settlementTimeStringAn estimated time for the funds to be delivered to the recipient.
quoteCurrencyStringThe currency in which the quote is denominated.
expiresInSecondsNumberThe time in seconds until the quote is no longer valid.
โ„น๏ธ

Note:

  • Make sure to save the quote Id, it will be required for payouts
  • The exchange rate is dynamic and subject to change.
  • The fee and category parameters are preset in the meCash configuration.
  • Transaction limits (minimum/maximum amounts) are predefined in the system.

Error Handling

Status CodeMeaningExample ResponseHow to Handle
400Bad Request (No API Key)No API key found in requestEnsure x-api-key header is sent with a valid key
400Route Not FoundThe Route is not supportedContact support to get the correct route
400Validation ErrorRequired field missing or invalid requestCheck API documentation for required fields and input formats
401Unauthorized (Invalid API Key)Invalid authentication credentialsVerify API key in the header is correct and active in dashboard settings
403Forbidden (Non-whitelisted IP)Your IP address is not allowed to access this serviceWhitelist your IP address in the API Management settings on the dashboard
422Unprocessable Entity (Semantic Error)Invalid value in request bodyReview request body for semantic errors (e.g., invalid values or logic errors)
429Too Many Requests (Rate Limited)API rate limit exceedImplement retry with exponential backoff; respect rate limits (e.g., 50 requests/sec)
500Internal Server ErrorAn unexpected error occurred on the serverRetry after some time; if persistent, contact support

Best Practices

  • โœ… Always include a valid x-api-key in the request header.
  • โœ… Ensure that the source and target country and currency values are valid.