Amount conversion
Convert Currency (Quote)
Get a quote converting an amount between two currencies using your company’s configured exchange rates. Read-only — does not move money.
POST
Amount conversion
Overview
POST /company/exchange-rates/convert returns a quote for converting an amount between two currencies, using the exchange rates configured for your company. This call is read-only — it does not move any money. To execute a conversion, follow up with POST /wallets/deposit, passing the rate returned here.
When to use it
- Show a customer or operator the converted amount before they confirm a wallet-to-wallet conversion.
- Compute the destination amount before calling
POST /wallets/deposit.
Where rates come from
The rate returned is your company’s configured rate for the(fromCurrency, toCurrency) pair, not a system-wide market rate. If you have not configured a rate, the call returns 400. Configure rates via the dashboard (or via the company exchange-rate management endpoints).
Quote validity
The returned quote includes anexchangeRateId reflecting the rate version used. Quotes do not have a built-in expiry, but Cartevo treats stale rates conservatively — if the underlying rate is updated, the original exchangeRateId is no longer accepted by POST /wallets/deposit. Treat quotes as good for a few minutes and re-quote before applying for long-running flows.
Prerequisites
- Authenticated as a company user.
- An exchange rate is configured for the
(fromCurrency, toCurrency)pair.
Request
Headers
| Name | Required | Description |
|---|---|---|
Authorization | Yes | Bearer <access_token> |
Content-Type | Yes | application/json |
Body
| Field | Type | Required | Constraints | Description |
|---|---|---|---|---|
amount | number | Yes | > 0 | Amount to convert, in fromCurrency units. |
fromCurrency | string | Yes | Exactly 3 chars (ISO 4217) | Source currency. |
toCurrency | string | Yes | Exactly 3 chars (ISO 4217) | Target currency. |
Response
200 — Success
| Field | Type | Description |
|---|---|---|
convertedAmount | number | The result: amount × rate, in toCurrency units. |
rate | number | Multiplier: convertedAmount = amount × rate. So 1 fromCurrency = rate × toCurrency. |
exchangeRateId | string | Identifier of the rate version used. Pass to POST /wallets/deposit to apply this exact rate. |
fromCurrency | string | Echoes the request. |
toCurrency | string | Echoes the request. |
Worked example
Foramount = 600000 XAF, fromCurrency = "XAF", toCurrency = "USD", with rate = 0.001667:
Error responses
| Status | message example | Trigger |
|---|---|---|
400 | "No exchange rate configured for XAF → USD" | Your company has no configured rate for the requested pair. |
400 | "fromCurrency must be exactly 3 characters" | Field validation failed. |
400 | "User does not belong to any company" | Token has no associated company (rare; should not happen for partner tokens). |
Code examples
cURL
Node.js (axios)
Related
POST /wallets/deposit— apply a quote and actually move funds.- Glossary → Wallet
Authorizations
Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
Body
application/json