Calculate Swap & Send
GET /api-access/api/calculator/swap-and-send-calculator
Calculate combined swap and send transaction fees and amounts.
Authentication
Required Headers:
Authorization: HMAC-SHA256 PUBLIC_KEY:PRIVATE_KEY
X-Origin: third-party-api
X-Timestamp: 2025-10-12T14:30:00.000Z
Content-Type: application/jsonRequest
Query Parameters:
| Parameter | Type | Required | Description |
|---|---|---|---|
from_currency | string | Yes | Source currency code (e.g., cad, xof) |
to_currency | string | Yes | Target currency code (e.g., xof, cad) |
amount | number | Yes | Amount to swap and send |
payment_channel | string | Yes | Payment channel (e.g., mobile_money) |
priority | string | Yes | Transaction priority (e.g., standard) |
country | string | Yes | Destination country code (e.g., ci, ca) |
mode | string | Yes | Transaction mode (e.g., send) |
Example Query:
?from_currency=cad&to_currency=xof&amount=100&payment_channel=mobile_money&priority=standard&country=ci&mode=sendResponse
Success Response (200):
json
{
"data": {
"swap": {
"id": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
"from_currency": "string",
"to_currency": "string",
"channel": "string",
"input_amount": 0,
"maraboo_fees": 0,
"payment_partner_fees": 0,
"fx_partner_fees": 0,
"total_fees": 0,
"tax": 0,
"amount_to_pay": 0,
"amount_without_fees": 0,
"converted_amount": 0,
"exchange_rate": 0,
"created_at": "2025-10-12T10:27:30.704Z",
"updated_at": "2025-10-12T10:27:30.704Z",
"expiry_date": "2025-10-12T10:27:30.704Z",
"recipient_gets": 0,
"transaction_service_level": "both",
"effective_rate": 0,
"market_rate": 0,
"breakdown": {
"input_amount": 0,
"maraboo_fee": 0,
"payment_partner_fee": 0,
"fx_partner_fee": 0,
"tax_amount": 0,
"total_fee": 0,
"maraboo_percentage": 0,
"payment_partner_percentage": 0,
"fx_partner_percentage": 0,
"tax_percentage": 0,
"total_percentage": 0,
"amount_to_be_paid": 0,
"amount_without_fees": 0,
"market_rate": 0,
"effective_rate": 0,
"converted_amount": 0,
"total_percentage_fees": 0,
"total_flat_fees": 0
},
"fees": {
"revenue_line": "subscription",
"is_active": true,
"monthly_fee_amount": 0,
"channel": "mobile_money",
"base_currency": "xof",
"target_currency": "xof",
"maraboo_flat_fee": 0,
"maraboo_percentage_fee": 0,
"partner_flat_fee": 0,
"partner_percentage_fee": 0,
"fx_partner_percentage_fee": 0,
"tax_percentage": 0,
"id": "string",
"plan_id": "string",
"created_at": "2025-10-12T10:27:30.704Z",
"updated_at": "2025-10-12T10:27:30.704Z"
}
},
"payment": {
"id": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
"from_currency": "string",
"to_currency": "string",
"channel": "string",
"input_amount": 0,
"maraboo_fees": 0,
"payment_partner_fees": 0,
"fx_partner_fees": 0,
"total_fees": 0,
"tax": 0,
"amount_to_pay": 0,
"amount_without_fees": 0,
"converted_amount": 0,
"exchange_rate": 0,
"created_at": "2025-10-12T10:27:30.704Z",
"updated_at": "2025-10-12T10:27:30.704Z",
"expiry_date": "2025-10-12T10:27:30.704Z",
"recipient_gets": 0,
"transaction_service_level": "both",
"effective_rate": 0,
"market_rate": 0,
"breakdown": {
"input_amount": 0,
"maraboo_fee": 0,
"payment_partner_fee": 0,
"fx_partner_fee": 0,
"tax_amount": 0,
"total_fee": 0,
"maraboo_percentage": 0,
"payment_partner_percentage": 0,
"fx_partner_percentage": 0,
"tax_percentage": 0,
"total_percentage": 0,
"amount_to_be_paid": 0,
"amount_without_fees": 0,
"market_rate": 0,
"effective_rate": 0,
"converted_amount": 0,
"total_percentage_fees": 0,
"total_flat_fees": 0
},
"fees": {
"revenue_line": "subscription",
"is_active": true,
"monthly_fee_amount": 0,
"channel": "mobile_money",
"base_currency": "xof",
"target_currency": "xof",
"maraboo_flat_fee": 0,
"maraboo_percentage_fee": 0,
"partner_flat_fee": 0,
"partner_percentage_fee": 0,
"fx_partner_percentage_fee": 0,
"tax_percentage": 0,
"id": "string",
"plan_id": "string",
"created_at": "2025-10-12T10:27:30.705Z",
"updated_at": "2025-10-12T10:27:30.705Z"
}
},
"combined": {
"our_fee": 0,
"total_fees": 0,
"we_convert": 0,
"partner_fee": 0,
"exchange_rate": 0,
"converted": 0,
"user_pays": 0,
"errors": [
{
"error_code": "OTP_ERROR",
"suggested_receive_amount": 0,
"suggested_receive_amount_currency": "xof",
"suggested_values": {
"our_fee": 0,
"total_fees": 0,
"we_convert": 0,
"partner_fee": 0,
"exchange_rate": 0,
"converted": 0,
"user_pays": 0
}
}
],
"quote_id": "string",
"enabled": true,
"mode": "string",
"priority": "string",
"market_rate": 0
}
},
"success": true,
"message": "string",
"detail": {}
}Response Structure:
The response contains three main sections:
swap: Details of the currency swap operation with fees, rates, and breakdownpayment: Details of the payment operation with fees, rates, and breakdowncombined: Aggregated calculation combining both swap and payment
Key Fields:
| Field | Type | Description |
|---|---|---|
swap.id | string | Unique swap quote ID (UUID) |
swap.exchange_rate | number | Exchange rate for the swap |
swap.effective_rate | number | Effective rate after fees |
swap.market_rate | number | Current market rate |
swap.total_fees | number | Total fees for swap operation |
swap.breakdown | object | Detailed fee breakdown |
payment.id | string | Unique payment quote ID (UUID) |
payment.total_fees | number | Total fees for payment operation |
payment.recipient_gets | number | Amount recipient will receive |
combined.user_pays | number | Total amount user needs to pay |
combined.total_fees | number | Combined total fees |
combined.quote_id | string | Combined quote identifier |
Example
bash
curl -X GET "https://sandbox.mara.boo/api-access/api/calculator/swap-and-send-calculator?from_currency=cad&to_currency=xof&amount=100&payment_channel=mobile_money&priority=standard&country=ci&mode=send" \
-H "Authorization: HMAC-SHA256 YOUR_PUBLIC_KEY:YOUR_PRIVATE_KEY" \
-H "X-Origin: third-party-api" \
-H "X-Timestamp: 2025-10-12T14:30:00.000Z" \
-H "Content-Type: application/json"javascript
const params = new URLSearchParams({
from_currency: 'cad',
to_currency: 'xof',
amount: '100',
payment_channel: 'mobile_money',
priority: 'standard',
country: 'ci',
mode: 'send'
});
const response = await fetch(`https://sandbox.mara.boo/api-access/api/calculator/swap-and-send-calculator?${params}`, {
method: 'GET',
headers: {
'Authorization': 'HMAC-SHA256 YOUR_PUBLIC_KEY:YOUR_PRIVATE_KEY',
'X-Origin': 'third-party-api',
'X-Timestamp': '2025-10-12T14:30:00.000Z',
'Content-Type': 'application/json'
}
});
const data = await response.json();python
import requests
params = {
'from_currency': 'cad',
'to_currency': 'xof',
'amount': '100',
'payment_channel': 'mobile_money',
'priority': 'standard',
'country': 'ci',
'mode': 'send'
}
response = requests.get(
'https://sandbox.mara.boo/api-access/api/calculator/swap-and-send-calculator',
params=params,
headers={
'Authorization': 'HMAC-SHA256 YOUR_PUBLIC_KEY:YOUR_PRIVATE_KEY',
'X-Origin': 'third-party-api',
'X-Timestamp': '2025-10-12T14:30:00.000Z',
'Content-Type': 'application/json'
}
)
data = response.json()go
package main
import (
"net/http"
"io/ioutil"
)
func main() {
client := &http.Client{}
req, _ := http.NewRequest("GET", "https://sandbox.mara.boo/api-access/api/calculator/swap-and-send-calculator?from_currency=cad&to_currency=xof&amount=100&payment_channel=mobile_money&priority=standard&country=ci&mode=send", nil)
req.Header.Set("Authorization", "HMAC-SHA256 YOUR_PUBLIC_KEY:YOUR_PRIVATE_KEY")
req.Header.Set("X-Origin", "third-party-api")
req.Header.Set("X-Timestamp", "2025-10-12T14:30:00.000Z")
req.Header.Set("Content-Type", "application/json")
resp, _ := client.Do(req)
defer resp.Body.Close()
body, _ := ioutil.ReadAll(resp.Body)
}java
import java.net.http.HttpClient;
import java.net.http.HttpRequest;
import java.net.http.HttpResponse;
import java.net.URI;
HttpClient client = HttpClient.newHttpClient();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("https://sandbox.mara.boo/api-access/api/calculator/swap-and-send-calculator?from_currency=cad&to_currency=xof&amount=100&payment_channel=mobile_money&priority=standard&country=ci&mode=send"))
.header("Authorization", "HMAC-SHA256 YOUR_PUBLIC_KEY:YOUR_PRIVATE_KEY")
.header("X-Origin", "third-party-api")
.header("X-Timestamp", "2025-10-12T14:30:00.000Z")
.header("Content-Type", "application/json")
.GET()
.build();
HttpResponse<String> response = client.send(request, HttpResponse.BodyHandlers.ofString());csharp
using System.Net.Http;
using System.Net.Http.Headers;
var client = new HttpClient();
var request = new HttpRequestMessage(HttpMethod.Get, "https://sandbox.mara.boo/api-access/api/calculator/swap-and-send-calculator?from_currency=cad&to_currency=xof&amount=100&payment_channel=mobile_money&priority=standard&country=ci&mode=send");
request.Headers.Add("Authorization", "HMAC-SHA256 YOUR_PUBLIC_KEY:YOUR_PRIVATE_KEY");
request.Headers.Add("X-Origin", "third-party-api");
request.Headers.Add("X-Timestamp", "2025-10-12T14:30:00.000Z");
request.Content.Headers.ContentType = new MediaTypeHeaderValue("application/json");
var response = await client.SendAsync(request);
var content = await response.Content.ReadAsStringAsync();Error Responses
| Status Code | Description |
|---|---|
| 400 | Bad Request - Invalid parameters |
| 401 | Unauthorized - Invalid authentication |
| 403 | Forbidden - Missing required headers |
| 500 | Internal Server Error |