The meCash Docs is live 🎉 🎉
Quotes
NGN - CNY Example

Create Quote Example - NGN to CNY

This example demonstrates a quote request for converting 5,000 NGN (Nigerian Naira) to CNY (Chinese Yuan). This quote locks in the exchange rate, fees, and amounts for a short period, which you can then use to initiate a payout transaction.

Supported Payment Channels

Quotes are often generated with a specific payout method in mind, as fees or limits might vary. This API supports getting quotes for payouts via:

  • ALIPAY: For recipients identified by email or mobile.
  • WECHAT: For recipients identified by mobile only.
  • BANK_TRANSFER: For transfers to both individual and business accounts in China.

Endpoint

POST https://{{baseURL}}/v1/quote

Authentication

Include these headers in your request:

HeaderDescriptionRequiredExample Value
x-api-keyAPI key for authentication✅ YesYOUR_API_KEY
Content-TypeRequest content type✅ Yesapplication/json

Remember to replace YOUR_API_KEY with your actual API key (Production or Sandbox).

Request Body

Your JSON request body should specify the source and target details, and optionally the intended payment channel.

{
  "paymentChannel": "string", // Optional: ALIPAY, WECHAT, BANK_TRANSFER
  "source": {
    "amount": number,
    "country": "string", // ISO 3166-1 alpha-2 code
    "currency": "string" // ISO 4217 currency code
  },
  "target": {
    "country": "string", // ISO 3166-1 alpha-2 code
    "currency": "string" // ISO 4217 currency code
  }
}

Request Example with WeChat as payment channel:

curl --location --request POST 'https://{{baseURL}}/v1/quote' \
--header 'x-api-key: YOUR_API_KEY' \
--header 'Content-Type: application/json' \
--data '{
   "paymentChannel": "WECHAT",
   "source": {
        "amount": 5000,
        "country": "NG",
        "currency": "NGN"
    },
    "target": {
        "country": "CN",
        "currency": "CNY"
    }
}'

To use other payment channels, simply replace WECHAT with either ALIPAY or BANK_TRANSFER

Sample Response (200 OK)

response.json
{
    "message": "quote successfully created",
    "status": "success",
    "data": {
        "id": "387ea2fc-564e-45c2-bcf9-6abc30127b7f",
        "source": {
            "currency": "NGN",
            "country": "NG",
            "amount": 5000
        },
        "target": {
            "currency": "CNY",
            "country": "CN",
            "amount": 24.04
        },
        "rate": 208.02,
        "fee": {
            "amount": 20
        },
        "rules": [
            {
                "category": "LIMIT",
                "appliedCurrency": "CNY",
                "appliedCountry": "CN",
                "transaction": {
                    "minimum": 10,
                    "maximum": 70,000
                },
                "invoice": 70000
            }
        ],
        "summary": {
            "total": 5020
        }
    }
}
ℹ️

Note: Our processing fee is dynamic.

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 (NGN)
source.countryStringCountry where the transaction originates (NG)
source.amountNumberAmount to be converted (5000 NGN)

Target (Receiving) Details

FieldTypeDescription
target.currencyStringTarget currency (CNY)
target.countryStringDestination country (CN)
target.amountNumberConverted amount (24.04 CNY)

Exchange Rate and Fees

FieldTypeDescription
rateNumberExchange rate applied (208.02)
fee.amountNumberTransaction fee (20 NGN)

Transaction Rules

FieldTypeDescription
rules[].categoryStringType of rule applied (LIMIT)
rules[].appliedCurrencyStringCurrency the rule applies to (CNY)
rules[].appliedCountryStringCountry the rule applies to (CN)
rules[].transaction.minimumNumberMinimum allowed transaction (10 CNY)
rules[].transaction.maximumNumberMaximum allowed transaction (70,000 CNY)
rules[].invoiceNumberMaximum invoice amount (70,000 CNY)

Summary

FieldTypeDescription
summary.totalNumberTotal amount user pays (5020 NGN)

Key Takeaways

  • The user sends 5,000 NGN, which is converted to 24.04 CNY at an exchange rate of 208.02.
  • A transaction fee of 20 NGN is applied.
  • The total amount the user must pay (including fees) is 20 NGN.
  • A transaction limit rule restricts transactions between 10 CNY and 70,000 CNY.

Best Practices

  • ✅ Include a valid API key (x-api-key) in the request headers to authenticate the request.
  • ✅ Ensure that the source and target country and currency codes are valid to prevent request failures.
  • ✅ Handle transaction limits appropriately to comply with API restrictions.