ChapaChapa Docs

Swap

Convert USD to ETB (Ethiopian Birr) using Chapa's Swap API

This documentation explains how to use our Swap API for converting USD to ETB (Ethiopian Birr).

Initiating a Swap

Endpoint: https://api.chapa.co/v1/swap
Method: POST
Authorization: Pass your secret key as a bearer token in the request header to authorize this call.

Body Parameters

ParameterRequiredTypeDescription
amountYesnumberThe amount to convert (minimum 1 USD)
fromYesstringSource currency code (USD)
toYesstringTarget currency code (ETB)

Important Notes:

  • The minimum amount for conversion is 1 USD
  • The maximum allowed amount for swap is $10,000
  • Current exchange rate is applied at the time of the swap
  • Swaps are processed immediately and cannot be reversed
  • The exchanged amount will be added to the business ETB balance
cURL
JavaScript
PHP
Python

Successful Response

{
  "message": "Swap has been made successfully.",
  "status": "success",
  "data": {
    "status": "Success",
    "ref_id": "SWPfSqc5BiwcC",
    "from_currency": "USD",
    "to_currency": "ETB",
    "amount": 1,
    "exchanged_amount": 127,
    "charge": 0,
    "rate": 127,
    "created_at": "2025-04-23T08:50:46.000000Z",
    "updated_at": "2025-04-23T08:50:46.000000Z"
  }
}

Response Parameters

ParameterTypeDescription
messagestringResponse message
statusstringStatus of the request (success/failed)
data.statusstringSwap status (Success)
data.ref_idstringUnique reference ID for the swap
data.from_currencystringSource currency (USD)
data.to_currencystringTarget currency (ETB)
data.amountnumberOriginal amount in source currency
data.exchanged_amountnumberAmount received in target currency
data.chargenumberTransaction fee (if any)
data.ratenumberExchange rate applied
data.created_atstringTimestamp when swap was created
data.updated_atstringTimestamp when swap was last updated

Failed Response

{
  "message": "Amount must be at least 1",
  "status": "failed",
  "data": null
}

Refer to our Error Codes page for all responses for this request.

Use Cases

  • Currency Conversion: Convert USD balance to ETB for local transactions
  • Balance Management: Manage multi-currency balances efficiently
  • Payment Processing: Convert funds before processing ETB payments

Best Practices

  • Check Exchange Rates: Exchange rates fluctuate, so check current rates before initiating swaps
  • Minimum Amount: Ensure the amount meets the minimum requirement of 1 USD
  • Maximum Limit: Be aware of the $10,000 maximum limit per swap
  • Irreversible: Remember that swaps cannot be reversed once processed
  • Balance Verification: Verify your USD balance before initiating a swap

Next Steps

On this page