Calculate transaction fees
curl --request POST \
--url https://api.mysoleas.com/transactions/fees/quote \
--header 'Content-Type: application/json' \
--header 'x-sp-auth-token: <api-key>' \
--data '
{
"amount": 10000,
"currency": "XAF",
"serviceId": 1,
"service_id": 1,
"provider": "mtn_cmr",
"origin": "APPLICATION",
"plugin": "CHECKOUT",
"feeBearer": "CUSTOMER",
"customerPaysFees": true,
"operation": "COLLECTION",
"amount_unit": "MAJOR"
}
'import requests
url = "https://api.mysoleas.com/transactions/fees/quote"
payload = {
"amount": 10000,
"currency": "XAF",
"serviceId": 1,
"service_id": 1,
"provider": "mtn_cmr",
"origin": "APPLICATION",
"plugin": "CHECKOUT",
"feeBearer": "CUSTOMER",
"customerPaysFees": True,
"operation": "COLLECTION",
"amount_unit": "MAJOR"
}
headers = {
"x-sp-auth-token": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'x-sp-auth-token': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
amount: 10000,
currency: 'XAF',
serviceId: 1,
service_id: 1,
provider: 'mtn_cmr',
origin: 'APPLICATION',
plugin: 'CHECKOUT',
feeBearer: 'CUSTOMER',
customerPaysFees: true,
operation: 'COLLECTION',
amount_unit: 'MAJOR'
})
};
fetch('https://api.mysoleas.com/transactions/fees/quote', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.mysoleas.com/transactions/fees/quote",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'amount' => 10000,
'currency' => 'XAF',
'serviceId' => 1,
'service_id' => 1,
'provider' => 'mtn_cmr',
'origin' => 'APPLICATION',
'plugin' => 'CHECKOUT',
'feeBearer' => 'CUSTOMER',
'customerPaysFees' => true,
'operation' => 'COLLECTION',
'amount_unit' => 'MAJOR'
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"x-sp-auth-token: <api-key>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.mysoleas.com/transactions/fees/quote"
payload := strings.NewReader("{\n \"amount\": 10000,\n \"currency\": \"XAF\",\n \"serviceId\": 1,\n \"service_id\": 1,\n \"provider\": \"mtn_cmr\",\n \"origin\": \"APPLICATION\",\n \"plugin\": \"CHECKOUT\",\n \"feeBearer\": \"CUSTOMER\",\n \"customerPaysFees\": true,\n \"operation\": \"COLLECTION\",\n \"amount_unit\": \"MAJOR\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("x-sp-auth-token", "<api-key>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.mysoleas.com/transactions/fees/quote")
.header("x-sp-auth-token", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"amount\": 10000,\n \"currency\": \"XAF\",\n \"serviceId\": 1,\n \"service_id\": 1,\n \"provider\": \"mtn_cmr\",\n \"origin\": \"APPLICATION\",\n \"plugin\": \"CHECKOUT\",\n \"feeBearer\": \"CUSTOMER\",\n \"customerPaysFees\": true,\n \"operation\": \"COLLECTION\",\n \"amount_unit\": \"MAJOR\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.mysoleas.com/transactions/fees/quote")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["x-sp-auth-token"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"amount\": 10000,\n \"currency\": \"XAF\",\n \"serviceId\": 1,\n \"service_id\": 1,\n \"provider\": \"mtn_cmr\",\n \"origin\": \"APPLICATION\",\n \"plugin\": \"CHECKOUT\",\n \"feeBearer\": \"CUSTOMER\",\n \"customerPaysFees\": true,\n \"operation\": \"COLLECTION\",\n \"amount_unit\": \"MAJOR\"\n}"
response = http.request(request)
puts response.read_body{
"code": 200,
"success": true,
"data": {
"baseAmount": 10000,
"feeAmount": 350,
"payableAmount": 10350,
"merchantNetAmount": 9650,
"currency": "XAF",
"feeBearer": "CUSTOMER",
"countryCode": "CMR",
"userTier": 5,
"source": "APPLICATION_CONFIGURATION"
},
"locale": "fr",
"message": "fees_quote"
}Collections
Transaction fee quote
Calculate the fee amount, payable amount, and fee bearer before a transaction.
POST
/
transactions
/
fees
/
quote
Calculate transaction fees
curl --request POST \
--url https://api.mysoleas.com/transactions/fees/quote \
--header 'Content-Type: application/json' \
--header 'x-sp-auth-token: <api-key>' \
--data '
{
"amount": 10000,
"currency": "XAF",
"serviceId": 1,
"service_id": 1,
"provider": "mtn_cmr",
"origin": "APPLICATION",
"plugin": "CHECKOUT",
"feeBearer": "CUSTOMER",
"customerPaysFees": true,
"operation": "COLLECTION",
"amount_unit": "MAJOR"
}
'import requests
url = "https://api.mysoleas.com/transactions/fees/quote"
payload = {
"amount": 10000,
"currency": "XAF",
"serviceId": 1,
"service_id": 1,
"provider": "mtn_cmr",
"origin": "APPLICATION",
"plugin": "CHECKOUT",
"feeBearer": "CUSTOMER",
"customerPaysFees": True,
"operation": "COLLECTION",
"amount_unit": "MAJOR"
}
headers = {
"x-sp-auth-token": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'x-sp-auth-token': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
amount: 10000,
currency: 'XAF',
serviceId: 1,
service_id: 1,
provider: 'mtn_cmr',
origin: 'APPLICATION',
plugin: 'CHECKOUT',
feeBearer: 'CUSTOMER',
customerPaysFees: true,
operation: 'COLLECTION',
amount_unit: 'MAJOR'
})
};
fetch('https://api.mysoleas.com/transactions/fees/quote', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.mysoleas.com/transactions/fees/quote",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'amount' => 10000,
'currency' => 'XAF',
'serviceId' => 1,
'service_id' => 1,
'provider' => 'mtn_cmr',
'origin' => 'APPLICATION',
'plugin' => 'CHECKOUT',
'feeBearer' => 'CUSTOMER',
'customerPaysFees' => true,
'operation' => 'COLLECTION',
'amount_unit' => 'MAJOR'
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"x-sp-auth-token: <api-key>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.mysoleas.com/transactions/fees/quote"
payload := strings.NewReader("{\n \"amount\": 10000,\n \"currency\": \"XAF\",\n \"serviceId\": 1,\n \"service_id\": 1,\n \"provider\": \"mtn_cmr\",\n \"origin\": \"APPLICATION\",\n \"plugin\": \"CHECKOUT\",\n \"feeBearer\": \"CUSTOMER\",\n \"customerPaysFees\": true,\n \"operation\": \"COLLECTION\",\n \"amount_unit\": \"MAJOR\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("x-sp-auth-token", "<api-key>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.mysoleas.com/transactions/fees/quote")
.header("x-sp-auth-token", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"amount\": 10000,\n \"currency\": \"XAF\",\n \"serviceId\": 1,\n \"service_id\": 1,\n \"provider\": \"mtn_cmr\",\n \"origin\": \"APPLICATION\",\n \"plugin\": \"CHECKOUT\",\n \"feeBearer\": \"CUSTOMER\",\n \"customerPaysFees\": true,\n \"operation\": \"COLLECTION\",\n \"amount_unit\": \"MAJOR\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.mysoleas.com/transactions/fees/quote")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["x-sp-auth-token"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"amount\": 10000,\n \"currency\": \"XAF\",\n \"serviceId\": 1,\n \"service_id\": 1,\n \"provider\": \"mtn_cmr\",\n \"origin\": \"APPLICATION\",\n \"plugin\": \"CHECKOUT\",\n \"feeBearer\": \"CUSTOMER\",\n \"customerPaysFees\": true,\n \"operation\": \"COLLECTION\",\n \"amount_unit\": \"MAJOR\"\n}"
response = http.request(request)
puts response.read_body{
"code": 200,
"success": true,
"data": {
"baseAmount": 10000,
"feeAmount": 350,
"payableAmount": 10350,
"merchantNetAmount": 9650,
"currency": "XAF",
"feeBearer": "CUSTOMER",
"countryCode": "CMR",
"userTier": 5,
"source": "APPLICATION_CONFIGURATION"
},
"locale": "fr",
"message": "fees_quote"
}This route calculates fees server-side before launching a collection or disbursement.
You can identify the service with
When
serviceId, service_id, provider, serviceCode, or service_code.
For a direct API application, the fee bearer comes from the authenticated application configuration or the internal X-SP-Fee-Bearer header.
For a plugin, send origin: "PLUGIN" and provide feeBearer in the payload or query string. The payload has priority.
| Field | Role |
|---|---|
amount | Base amount to charge |
amount_unit | Optional, root-level JSON field: MAJOR by default, or MINOR for integer cents USD/EUR |
currency | Currency expected by the service |
operation | COLLECTION by default, or DISBURSEMENT |
provider | Service code, for example mtn_cmr |
origin | APPLICATION by default, or PLUGIN |
feeBearer | CUSTOMER or MERCHANT |
feeBearer is CUSTOMER, payableAmount includes fees. When feeBearer is MERCHANT, merchantNetAmount indicates the merchant net amount after fees.
Send amount in major units by default: 4.01 for 4.01 USD/EUR. API clients that already send cents can set amount_unit: "MINOR" at the root of the JSON body, alongside amount and currency, rather than in metadata. Public responses return major units even when the request uses MINOR. See amounts and currencies.
baseAmount, feeAmount, payableAmount, and merchantNetAmount are returned in major units. Keep their decimals when displaying or comparing them.Authorizations
Bearer token obtained with the client_id and client_secret of the application created in SoleasPay. Format: Bearer <access_token>.
Query Parameters
Prioritaire seulement pour les flux plugin lorsque le payload ne fournit pas feeBearer.
Available options:
CUSTOMER, MERCHANT Body
application/json
Amount in major units by default: 4.01 for 4.01 USD/EUR. With root-level amount_unit MINOR, send integer cents (401).
Example:
10000
Example:
"XAF"
Example:
1
Example:
1
Example:
"mtn_cmr"
Available options:
APPLICATION, PLUGIN Example:
"APPLICATION"
Example:
"CHECKOUT"
Available options:
CUSTOMER, MERCHANT Example:
"CUSTOMER"
Example:
true
Available options:
COLLECTION, DISBURSEMENT Example:
"COLLECTION"
Unit of request amounts. Optional, MAJOR by default. Put this field at the root of the JSON body, not in metadata. MINOR preserves amounts already expressed in the smallest unit.
Available options:
MAJOR, MINOR Example:
"MAJOR"
⌘I
