intral-city
curl --request POST \
--url https://api.mervii.com/beta/price/intral-city \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"destinations": [],
"item_weight": 1,
"pickup_origin": {
"city": "Lagos",
"country_code": "NG",
"region": {
"latitude": 6.4612672,
"longitude": 3.3961466
},
"state_code": "LA"
}
}
'import requests
url = "https://api.mervii.com/beta/price/intral-city"
payload = {
"destinations": [],
"item_weight": 1,
"pickup_origin": {
"city": "Lagos",
"country_code": "NG",
"region": {
"latitude": 6.4612672,
"longitude": 3.3961466
},
"state_code": "LA"
}
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
destinations: [],
item_weight: 1,
pickup_origin: {
city: 'Lagos',
country_code: 'NG',
region: {latitude: 6.4612672, longitude: 3.3961466},
state_code: 'LA'
}
})
};
fetch('https://api.mervii.com/beta/price/intral-city', 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.mervii.com/beta/price/intral-city",
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([
'destinations' => [
],
'item_weight' => 1,
'pickup_origin' => [
'city' => 'Lagos',
'country_code' => 'NG',
'region' => [
'latitude' => 6.4612672,
'longitude' => 3.3961466
],
'state_code' => 'LA'
]
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$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.mervii.com/beta/price/intral-city"
payload := strings.NewReader("{\n \"destinations\": [],\n \"item_weight\": 1,\n \"pickup_origin\": {\n \"city\": \"Lagos\",\n \"country_code\": \"NG\",\n \"region\": {\n \"latitude\": 6.4612672,\n \"longitude\": 3.3961466\n },\n \"state_code\": \"LA\"\n }\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
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.mervii.com/beta/price/intral-city")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"destinations\": [],\n \"item_weight\": 1,\n \"pickup_origin\": {\n \"city\": \"Lagos\",\n \"country_code\": \"NG\",\n \"region\": {\n \"latitude\": 6.4612672,\n \"longitude\": 3.3961466\n },\n \"state_code\": \"LA\"\n }\n}")
.asString();{
"data": {
"destinations": [
{
"city": "Lagos",
"country_code": "NG",
"price": {
"amount": 28366.4,
"amount_payable": 22693.12,
"discount_amount": 5673.28,
"discount_description": "20% discount",
"discount_type": "percentage",
"distance": "142 km",
"duration": "2 hours 4 mins"
},
"region": {
"latitude": 7.427026700000001,
"longitude": 3.8900142
},
"state_code": "LA"
},
{
"city": "Lagos",
"country_code": "NG",
"price": {
"amount": 28366.4,
"amount_payable": 22693.12,
"discount_amount": 5673.28,
"discount_description": "20% discount",
"discount_type": "percentage",
"distance": "142 km",
"duration": "2 hours 4 mins"
},
"region": {
"latitude": 7.427026700000001,
"longitude": 3.8900142
},
"state_code": "LA"
}
],
"discount_description": "See the destination parcel details",
"discount_type": "percentage",
"pickup_origin": {
"city": "Lagos",
"country_code": "NG",
"region": {
"latitude": 6.4612672,
"longitude": 3.3961466
},
"state_code": "LA"
},
"total_amount": 56732.8,
"total_amount_payable": 45386.24,
"total_discount_amount": 11346.56
},
"message": "Pickup and destination addresses successfully verified",
"status": true
}intral-city
CitySwift (Intral city) Price Calculation
This endpoint allows you to calculate the price for an intracity trip based on the pickup origin and destination.
POST
/
price
/
intral-city
intral-city
curl --request POST \
--url https://api.mervii.com/beta/price/intral-city \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"destinations": [],
"item_weight": 1,
"pickup_origin": {
"city": "Lagos",
"country_code": "NG",
"region": {
"latitude": 6.4612672,
"longitude": 3.3961466
},
"state_code": "LA"
}
}
'import requests
url = "https://api.mervii.com/beta/price/intral-city"
payload = {
"destinations": [],
"item_weight": 1,
"pickup_origin": {
"city": "Lagos",
"country_code": "NG",
"region": {
"latitude": 6.4612672,
"longitude": 3.3961466
},
"state_code": "LA"
}
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
destinations: [],
item_weight: 1,
pickup_origin: {
city: 'Lagos',
country_code: 'NG',
region: {latitude: 6.4612672, longitude: 3.3961466},
state_code: 'LA'
}
})
};
fetch('https://api.mervii.com/beta/price/intral-city', 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.mervii.com/beta/price/intral-city",
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([
'destinations' => [
],
'item_weight' => 1,
'pickup_origin' => [
'city' => 'Lagos',
'country_code' => 'NG',
'region' => [
'latitude' => 6.4612672,
'longitude' => 3.3961466
],
'state_code' => 'LA'
]
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$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.mervii.com/beta/price/intral-city"
payload := strings.NewReader("{\n \"destinations\": [],\n \"item_weight\": 1,\n \"pickup_origin\": {\n \"city\": \"Lagos\",\n \"country_code\": \"NG\",\n \"region\": {\n \"latitude\": 6.4612672,\n \"longitude\": 3.3961466\n },\n \"state_code\": \"LA\"\n }\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
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.mervii.com/beta/price/intral-city")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"destinations\": [],\n \"item_weight\": 1,\n \"pickup_origin\": {\n \"city\": \"Lagos\",\n \"country_code\": \"NG\",\n \"region\": {\n \"latitude\": 6.4612672,\n \"longitude\": 3.3961466\n },\n \"state_code\": \"LA\"\n }\n}")
.asString();{
"data": {
"destinations": [
{
"city": "Lagos",
"country_code": "NG",
"price": {
"amount": 28366.4,
"amount_payable": 22693.12,
"discount_amount": 5673.28,
"discount_description": "20% discount",
"discount_type": "percentage",
"distance": "142 km",
"duration": "2 hours 4 mins"
},
"region": {
"latitude": 7.427026700000001,
"longitude": 3.8900142
},
"state_code": "LA"
},
{
"city": "Lagos",
"country_code": "NG",
"price": {
"amount": 28366.4,
"amount_payable": 22693.12,
"discount_amount": 5673.28,
"discount_description": "20% discount",
"discount_type": "percentage",
"distance": "142 km",
"duration": "2 hours 4 mins"
},
"region": {
"latitude": 7.427026700000001,
"longitude": 3.8900142
},
"state_code": "LA"
}
],
"discount_description": "See the destination parcel details",
"discount_type": "percentage",
"pickup_origin": {
"city": "Lagos",
"country_code": "NG",
"region": {
"latitude": 6.4612672,
"longitude": 3.3961466
},
"state_code": "LA"
},
"total_amount": 56732.8,
"total_amount_payable": 45386.24,
"total_discount_amount": 11346.56
},
"message": "Pickup and destination addresses successfully verified",
"status": true
}Authorizations
Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
Body
application/json
Was this page helpful?
⌘I
