Wallet Conversions API

Wallet Conversions API Reference

Use the Wallet Conversions API to quote, execute, and list conversions between your supported Basqet wallet currencies.

All wallet conversion endpoints require a secret key in the Authorization header.

Before you proceed make sure you've read about how conversions work on Basqet


1. Create Conversion Quote API

API Details

FieldValue
ActionCreate Conversion Quote
MethodPOST
Path/v1/wallets/conversions/quotes
Auth RequirementSecret key

Business Summary

This endpoint generates a real-time quote for converting one wallet currency to another. The response includes the source amount, destination amount, exchange rate, and quote expiry time.

You can use this API to:

  • See the exact amount you will receive before converting.
  • Lock a temporary quote for a supported currency pair.
  • Get the quote_id required to create the final conversion.

Request Parameters

Request Headers

NameTypeRequiredDescription
AuthorizationstringYesBearer token in the form Bearer sec_..., using your secret key.
Content-TypestringYesMust be application/json.

Body Parameters

NameTypeRequiredDefaultAllowed ValuesDescription
from_currencystringYes-NGN, USDT, BTC, ETH, LTC, QDX, USDCCurrency slug of the wallet to debit.
to_currencystringYes-NGN, USDT, BTC, ETH, LTC, QDX, USDCCurrency slug of the wallet to credit. Must be different from from_currency.
amountnumberYes-Number greater than 0Amount to convert from your source wallet.

Request Example

cURL

curl --request POST \
  --url https://api.basqet.com/v1/wallets/conversions/quotes \
  --header 'Authorization: Bearer sec_live_xxxxxxxxxxxxx' \
  --header 'Content-Type: application/json' \
  --data '{
    "from_currency": "NGN",
    "to_currency": "USDT",
    "amount": 14000
  }'

Response Schema

FieldTypeNullableDescription
statusstringNoResponse status. Always success for 2xx responses.
dataobjectNoContainer for the quote details.
data.quote_idstringNoUnique quote identifier. Use this as quote_id when creating the conversion.
data.from_currencystringNoSource wallet currency slug.
data.to_currencystringNoDestination wallet currency slug.
data.from_amountnumberNoAmount to debit from your source wallet.
data.to_amountnumberNoAmount expected to be credited to your destination wallet.
data.exchange_ratenumberNoRate used to calculate to_amount.
data.expires_atstringNoISO 8601 timestamp when the quote expires.

Sample Response

{
  "status": "success",
  "data": {
    "quote_id": "cq_x9R4mL2pQ8sT7vA",
    "from_currency": "NGN",
    "to_currency": "USDT",
    "from_amount": 14000,
    "to_amount": 10,
    "exchange_rate": 0.000714285714285714,
    "expires_at": "2026-05-15T12:05:30.000Z"
  }
}

Error Reference

HTTP CodeMessageResolution
400Validation ErrorEnsure from_currency, to_currency, and amount are present. amount must be greater than 0.
400INVALID_REQUESTEnsure both currencies are supported and that from_currency and to_currency are different.
401No key providedSend your secret key in the Authorization header.
403Invalid KeyEnsure you are using a valid secret key beginning with sec_.
500CONVERSION_FAILEDAn unexpected error occurred while generating the quote. Retry the request or contact Basqet support.

2. Execute Conversion API

API Details

FieldValue
ActionCreate Wallet Conversion
MethodPOST
Path/v1/wallets/conversions
Auth RequirementSecret key

Business Summary

This endpoint executes a wallet conversion using a valid quote. Basqet debits your source wallet, credits your destination wallet, records the conversion, and returns the conversion details.

You can use this API to:

  • Convert funds from one supported wallet currency to another.
  • Record your own reference for reconciliation.
  • Make the converted funds immediately available in your destination wallet when the conversion succeeds.

Request Parameters

Request Headers

NameTypeRequiredDescription
AuthorizationstringYesBearer token in the form Bearer sec_..., using your secret key.
Content-TypestringYesMust be application/json.
Idempotency-KeystringNoRecommended for safe retries. Reusing the same key returns the cached result for your account and environment.

Body Parameters

NameTypeRequiredDefaultAllowed ValuesDescription
quote_idstringYes-Prefixed with cq_Quote identifier returned by the Create Conversion Quote API.
referencestringNonullMaximum 255 charactersOptional reference from your system. Must be unique for your account when provided.

Request Example

cURL

curl --request POST \
  --url https://api.basqet.com/v1/wallets/conversions \
  --header 'Authorization: Bearer sec_live_xxxxxxxxxxxxx' \
  --header 'Content-Type: application/json' \
  --header 'Idempotency-Key: conv-request-1024' \
  --data '{
    "quote_id": "cq_x9R4mL2pQ8sT7vA",
    "reference": "order-conv-1024"
  }'

Response Schema

FieldTypeNullableDescription
statusstringNoResponse status. Always success for 2xx responses.
dataobjectNoContainer for conversion details.
data.conversion_idstringNoUnique Basqet conversion identifier, prefixed with conv_.
data.rate_idstringNoQuote ID used for the conversion.
data.from_currencystringNoSource wallet currency slug.
data.to_currencystringNoDestination wallet currency slug.
data.from_amountnumberNoAmount debited from your source wallet.
data.to_amountnumberNoAmount credited to your destination wallet.
data.rate_usednumberNoExchange rate used for the conversion.
data.referencestring/nullYesReference from your system, or null if omitted.
data.created_atstringNoISO 8601 timestamp of conversion creation.

Sample Response

{
  "status": "success",
  "data": {
    "conversion_id": "conv_p4Y7xN8aK2mR5tQ",
    "rate_id": "cq_x9R4mL2pQ8sT7vA",
    "from_currency": "NGN",
    "to_currency": "USDT",
    "from_amount": 14000,
    "to_amount": 10,
    "rate_used": 0.000714285714285714,
    "reference": "order-conv-1024",
    "created_at": "2026-05-15T12:04:45.000Z"
  }
}

Error Reference

HTTP CodeMessageResolution
400Validation ErrorEnsure quote_id is present and is a non-empty string.
400QUOTE_EXPIREDCreate a new quote and retry the conversion.
400QUOTE_MISMATCHEnsure the quote was created with the same secret key and environment.
400INSUFFICIENT_BALANCEFund your source wallet or reduce the conversion amount.
400INVALID_REQUESTThe request is invalid. This can happen when your reference is already in use or another conversion is already in progress for your account.
401No key providedSend your secret key in the Authorization header.
403Invalid KeyEnsure you are using a valid secret key beginning with sec_.
404QUOTE_NOT_FOUNDThe quote does not exist, has expired, was already used, or is no longer available. Create a new quote.
409Request already processingA request with the same Idempotency-Key is already being processed. Wait and retry with the same key.
500CONVERSION_FAILEDAn unexpected error occurred while executing the conversion. Retry only after checking whether the conversion was created.

3. List Wallet Conversions API

API Details

FieldValue
ActionList Wallet Conversions
MethodGET
Path/v1/wallets/conversions
Auth RequirementSecret key

Business Summary

Returns a paginated list of wallet conversions for your account. Results are returned for the environment tied to the secret key you use.


Request Parameters

Request Headers

NameTypeRequiredDescription
AuthorizationstringYesBearer token in the form Bearer sec_..., using your secret key.

Query Parameters

NameTypeRequiredDefaultAllowed ValuesDescription
limitnumberNo50Integer from 1 to 100Number of records to return.
offsetnumberNo0Integer greater than or equal to 0Number of records to skip.
referencestringNo-Maximum 255 charactersFilter conversions by your reference.

Request Example

cURL

curl --request GET \
  --url 'https://api.basqet.com/v1/wallets/conversions?limit=20&offset=0&reference=order-conv-1024' \
  --header 'Authorization: Bearer sec_live_xxxxxxxxxxxxx'

Response Schema

FieldTypeNullableDescription
statusstringNoResponse status. Always success for 2xx responses.
dataarrayNoArray of conversion objects.
meta.limitnumberNoLimit applied to the request.
meta.countnumberNoNumber of records returned in this page.
meta.hasNextbooleanNotrue if more records exist beyond this page.

Sample Response

{
  "status": "success",
  "data": [
    {
      "conversion_id": "conv_p4Y7xN8aK2mR5tQ",
      "rate_id": "cq_x9R4mL2pQ8sT7vA",
      "from_currency": "NGN",
      "to_currency": "USDT",
      "from_amount": 14000,
      "to_amount": 10,
      "rate_used": 0.000714285714285714,
      "reference": "order-conv-1024",
      "created_at": "2026-05-15T12:04:45.000Z"
    }
  ],
  "meta": {
    "limit": 20,
    "count": 1,
    "hasNext": false
  }
}

Wallet Updated Webhook

When a conversion succeeds and wallet balances are updated, Basqet may send wallet.updated webhooks to your configured webhook URL. A conversion normally produces one wallet update for the debited wallet and one wallet update for the credited wallet.

Sample Payload

{
  "event": "wallet.updated",
  "data": {
    "wallet": {
      "transaction_reference": "conv_p4Y7xN8aK2mR5tQ",
      "available_balance": 36000,
      "ledger_balance": 0,
      "currency": "NGN",
      "name": "Nigerian Naira",
      "type": "FIAT",
      "amount": 14000,
      "is_live": true
    }
  }
}

Notes

  • Public keys are not accepted for wallet conversion endpoints.
  • Use test secret keys for sandbox conversions and live secret keys for live conversions.
  • Quotes and conversions cannot be shared across environments.
  • A quote can only be used once. After a successful conversion, the quote cannot be reused.
  • Send an Idempotency-Key when creating conversions so network retries do not create duplicate conversions.