When sending the money , one should add charges and this endpoint is designed to do that ,it will determine the charge to be added to the amount been send to the receiver
200 Pet successfully created 200: OK Permission denied 400: Bad Request
Copy {
"status" : true ,
"message" : "success" ,
"amount" : 500 ,
"telcoName" : "MTN" ,
"telcoCharge" : 0.75 ,
"elevyCharge" : 1.5 ,
"chargedAmount" : 11.25 ,
"deductedAmount" : 488.75 ,
"moneyToSend" : 511.25 ,
"imageReference" : "https://e-levy-api.vercel.app/powered.png"
}
Response when the money is not applicable to E-levy charges
Copy {
"status" : true ,
"message" : "E-levy Charges are not applicable with amounts less than GHc 100"
}
Curl Java Javascript fetch Javascript Axios Python Request Dart
Copy curl -X POST \
'https://e-levy-api.vercel.app/api/v1/send' \
--header 'Accept: */*' \
--header 'Content-Type: application/json' \
--data-raw '{
"amount":50,
"telco":"MTN"
}'
Copy let headersList = {
"Accept" : "*/*" ,
"Content-Type" : "application/json"
}
let bodyContent = JSON .stringify ({
"amount" : 50 ,
"telco" : "MTN"
});
fetch ( "https://e-levy-api.vercel.app/api/v1/send" , {
method : "POST" ,
body : bodyContent ,
headers : headersList
}) .then ( function (response) {
return response .text ();
}) .then ( function (data) {
console .log (data);
})
Copy import axios from "axios" ;
let headersList = {
"Accept" : "*/*" ,
"Content-Type" : "application/json"
}
let bodyContent = JSON .stringify ({
"amount" : 50 ,
"telco" : "MTN"
});
let reqOptions = {
url : "https://e-levy-api.vercel.app/api/v1/send" ,
method : "POST" ,
headers : headersList ,
data : bodyContent ,
}
axios .request (reqOptions) .then ( function (response) {
console .log ( response .data);
})
Copy import requests
reqUrl = "https://e-levy-api.vercel.app/api/v1/send"
headersList = {
"Accept" : "*/*" ,
"Content-Type" : "application/json"
}
payload = json . dumps ({
"amount" : 50 ,
"telco" : "MTN"
})
response = requests . request ( "POST" , reqUrl, data = payload, headers = headersList)
print (response.text)
Copy var headersList = {
'Accept' : '*/*' ,
'Content-Type' : 'application/json'
};
var url = Uri . parse ( 'https://e-levy-api.vercel.app/api/v1/send' );
var body = {
"amount" : 50 ,
"telco" : "MTN"
};
var req = http. Request ( 'POST' , url);
req.headers. addAll (headersList);
req.body = json. encode (body);
var res = await req. send ();
final resBody = await res.stream. bytesToString ();
if (res.statusCode >= 200 && res.statusCode < 300 ) {
print (resBody);
}
else {
print (res.reasonPhrase);
}