---
description: this is the rest api endpoint for making request
---

# Rest API Endpoint

## Main Endpoint (send)

{% hint style="info" %}
**Good to know:** This API method was created using the API Method block, it's how you can build out an API method documentation from scratch. Have a play with the block and you'll see you can do some nifty things like add and reorder parameters, document responses, and give your methods detailed descriptions.
{% endhint %}

## Send Money Response

<mark style="color:green;">`POST`</mark> `https://e-levy-api.vercel.app/api/v1/send`

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

#### Request Body

| Name                                     | Type    | Description                                                                     |
| ---------------------------------------- | ------- | ------------------------------------------------------------------------------- |
| amount<mark style="color:red;">\*</mark> | integer | the amount to be sent to the reciever                                           |
| telco                                    | string  | <p>the telecommunication services </p><p>"MTN" , "VODAFONE" , "AIRTELTIGO" </p> |

{% tabs %}
{% tab title="200 Pet successfully created" %}
```javascript
{
  "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"
}
```
{% endtab %}

{% tab title="200: OK Permission denied" %}
Response when the money is not applicable to E-levy charges&#x20;

```javascript
{
  "status": true,
  "message": "E-levy Charges are not applicable with amounts less than GHc 100"
}
```
{% endtab %}

{% tab title="400: Bad Request " %}
```javascript
{
    // Response
}
```
{% endtab %}
{% endtabs %}

{% tabs %}
{% tab title="Curl" %}
```
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"
}'
```
{% endtab %}

{% tab title="Java" %}
```java
```
{% endtab %}

{% tab title="Javascript fetch" %}
```javascript
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);
})
```
{% endtab %}

{% tab title="Javascript Axios" %}
```javascript
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);
})
```
{% endtab %}

{% tab title="Python Request" %}
```python
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)
```
{% endtab %}

{% tab title="Dart" %}
```dart
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);
}
```
{% endtab %}
{% endtabs %}
