curl --request POST \
--url https://api.mervii.com/beta/price/centre-door \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"destinations": [
{
"city": "",
"country_code": "NG",
"item_weight": 1,
"region": {
"latitude": 7.427026700000001,
"longitude": 3.8900142
},
"state_code": "LA"
},
{
"city": "",
"country_code": "NG",
"item_weight": 1,
"region": {
"latitude": 7.427026700000001,
"longitude": 3.8900142
},
"state_code": "LA"
}
],
"pickup_origin": {
"addresss": "",
"centre_code": "",
"country_code": "",
"state_code": ""
}
}
'import requests
url = "https://api.mervii.com/beta/price/centre-door"
payload = {
"destinations": [
{
"city": "",
"country_code": "NG",
"item_weight": 1,
"region": {
"latitude": 7.427026700000001,
"longitude": 3.8900142
},
"state_code": "LA"
},
{
"city": "",
"country_code": "NG",
"item_weight": 1,
"region": {
"latitude": 7.427026700000001,
"longitude": 3.8900142
},
"state_code": "LA"
}
],
"pickup_origin": {
"addresss": "",
"centre_code": "",
"country_code": "",
"state_code": ""
}
}
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: [
{
city: '',
country_code: 'NG',
item_weight: 1,
region: {latitude: 7.427026700000001, longitude: 3.8900142},
state_code: 'LA'
},
{
city: '',
country_code: 'NG',
item_weight: 1,
region: {latitude: 7.427026700000001, longitude: 3.8900142},
state_code: 'LA'
}
],
pickup_origin: {addresss: '', centre_code: '', country_code: '', state_code: ''}
})
};
fetch('https://api.mervii.com/beta/price/centre-door', 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/centre-door",
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' => [
[
'city' => '',
'country_code' => 'NG',
'item_weight' => 1,
'region' => [
'latitude' => 7.427026700000001,
'longitude' => 3.8900142
],
'state_code' => 'LA'
],
[
'city' => '',
'country_code' => 'NG',
'item_weight' => 1,
'region' => [
'latitude' => 7.427026700000001,
'longitude' => 3.8900142
],
'state_code' => 'LA'
]
],
'pickup_origin' => [
'addresss' => '',
'centre_code' => '',
'country_code' => '',
'state_code' => ''
]
]),
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/centre-door"
payload := strings.NewReader("{\n \"destinations\": [\n {\n \"city\": \"\",\n \"country_code\": \"NG\",\n \"item_weight\": 1,\n \"region\": {\n \"latitude\": 7.427026700000001,\n \"longitude\": 3.8900142\n },\n \"state_code\": \"LA\"\n },\n {\n \"city\": \"\",\n \"country_code\": \"NG\",\n \"item_weight\": 1,\n \"region\": {\n \"latitude\": 7.427026700000001,\n \"longitude\": 3.8900142\n },\n \"state_code\": \"LA\"\n }\n ],\n \"pickup_origin\": {\n \"addresss\": \"\",\n \"centre_code\": \"\",\n \"country_code\": \"\",\n \"state_code\": \"\"\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/centre-door")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"destinations\": [\n {\n \"city\": \"\",\n \"country_code\": \"NG\",\n \"item_weight\": 1,\n \"region\": {\n \"latitude\": 7.427026700000001,\n \"longitude\": 3.8900142\n },\n \"state_code\": \"LA\"\n },\n {\n \"city\": \"\",\n \"country_code\": \"NG\",\n \"item_weight\": 1,\n \"region\": {\n \"latitude\": 7.427026700000001,\n \"longitude\": 3.8900142\n },\n \"state_code\": \"LA\"\n }\n ],\n \"pickup_origin\": {\n \"addresss\": \"\",\n \"centre_code\": \"\",\n \"country_code\": \"\",\n \"state_code\": \"\"\n }\n}")
.asString();{
"data": {
"destinations": [
{
"city": null,
"country_code": "NG",
"dropoff_centre": {
"centre_code": "lagos-ojodu-berger",
"centre_name": "Ojodu Berger Lagos"
},
"item_weight": 1,
"price": {
"amount": 11692.520875080363,
"amount_payable": 11692.520875080363,
"discount_amount": 0,
"discount_description": "0% discount",
"discount_type": "Percetage",
"distance": "68.26634062567 Kilometres to the drop off center ",
"duration": "1-4 days"
},
"region": {
"latitude": 7.427026700000001,
"longitude": 3.8900142
},
"state_code": "LA",
"weight": "1"
},
{
"city": null,
"country_code": "NG",
"dropoff_centre": {
"centre_code": "lagos-ojodu-berger",
"centre_name": "Ojodu Berger Lagos"
},
"item_weight": 1,
"price": {
"amount": 11692.520875080363,
"amount_payable": 11692.520875080363,
"discount_amount": 0,
"discount_description": "0% discount",
"discount_type": "Percetage",
"distance": "68.26634062567 Kilometres to the drop off center ",
"duration": "1-4 days"
},
"region": {
"latitude": 7.427026700000001,
"longitude": 3.8900142
},
"state_code": "LA",
"weight": "1"
}
],
"discount_description": "0% discount",
"discount_type": "Percetage",
"pickup_origin": {
"addresss": null,
"centre_code": "ibadan-sango",
"country_code": null,
"pickup_centre": {
"centre_code": "ibadan-sango",
"centre_name": "Sango Ibadan"
},
"state_code": null
},
"total_amount": 23385.041750160726,
"total_amount_payable": 23385.041750160726,
"total_discount_amount": 0
},
"message": "get price",
"status": true
}{
"message": "The pickup origin.centre code field is required.",
"status": false
}Centre-Door
Centre(hub) to Door (home delivery) Price Calculation
This API endpoint allows you to calculate the price for delivering items from a pickup center to one or more destinations.
Request Body
-
pickup_origin(object)-
state_code(string, optional): The state code of the pickup origin. -
country_code(string, optional): The country code of the pickup origin. -
centre_code(string): The code of the pickup center. -
address(string, optional): The address of the pickup origin.
-
-
destinations(array)-
country_code(string): The country code of the destination. -
state_code(string): The state code of the destination. -
city(string, optional): The city of the destination. -
region(object)-
latitude(number): The latitude of the destination. -
longitude(number): The longitude of the destination.
-
-
item_weight(number): The weight of the item to be delivered.
-
Response Body (JSON Schema)
{
"type": "object",
"properties": {
"status": {
"type": "boolean"
},
"message": {
"type": "string"
},
"data": {
"type": "object",
"properties": {
"pickup_origin": {
"type": "object",
"properties": {
"state_code": { "type": ["string", "null"] },
"country_code": { "type": ["string", "null"] },
"centre_code": { "type": "string" },
"address": { "type": ["string", "null"] },
"pickup_centre": {
"type": "object",
"properties": {
"centre_code": { "type": "string" },
"centre_name": { "type": "string" }
}
}
}
},
"destinations": {
"type": "array",
"items": {
"type": "object",
"properties": {
"country_code": { "type": "string" },
"state_code": { "type": "string" },
"city": { "type": ["string", "null"] },
"region": {
"type": "object",
"properties": {
"latitude": { "type": "number" },
"longitude": { "type": "number" }
}
},
"item_weight": { "type": "number" },
"dropoff_centre": {
"type": "object",
"properties": {
"centre_code": { "type": "string" },
"centre_name": { "type": "string" }
}
},
"price": {
"type": "object",
"properties": {
"amount": { "type": "number" },
"discount_amount": { "type": "number" },
"amount_payable": { "type": "number" },
"discount_type": { "type": "string" },
"discount_description": { "type": "string" },
"distance": { "type": "string" },
"duration": { "type": "string" },
"weight": { "type": "string" }
}
}
}
}
},
"total_amount": { "type": "number" },
"total_discount_amount": { "type": "number" },
"total_amount_payable": { "type": "number" },
"discount_type": { "type": "string" },
"discount_description": { "type": "string" }
}
}
}
}
curl --request POST \
--url https://api.mervii.com/beta/price/centre-door \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"destinations": [
{
"city": "",
"country_code": "NG",
"item_weight": 1,
"region": {
"latitude": 7.427026700000001,
"longitude": 3.8900142
},
"state_code": "LA"
},
{
"city": "",
"country_code": "NG",
"item_weight": 1,
"region": {
"latitude": 7.427026700000001,
"longitude": 3.8900142
},
"state_code": "LA"
}
],
"pickup_origin": {
"addresss": "",
"centre_code": "",
"country_code": "",
"state_code": ""
}
}
'import requests
url = "https://api.mervii.com/beta/price/centre-door"
payload = {
"destinations": [
{
"city": "",
"country_code": "NG",
"item_weight": 1,
"region": {
"latitude": 7.427026700000001,
"longitude": 3.8900142
},
"state_code": "LA"
},
{
"city": "",
"country_code": "NG",
"item_weight": 1,
"region": {
"latitude": 7.427026700000001,
"longitude": 3.8900142
},
"state_code": "LA"
}
],
"pickup_origin": {
"addresss": "",
"centre_code": "",
"country_code": "",
"state_code": ""
}
}
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: [
{
city: '',
country_code: 'NG',
item_weight: 1,
region: {latitude: 7.427026700000001, longitude: 3.8900142},
state_code: 'LA'
},
{
city: '',
country_code: 'NG',
item_weight: 1,
region: {latitude: 7.427026700000001, longitude: 3.8900142},
state_code: 'LA'
}
],
pickup_origin: {addresss: '', centre_code: '', country_code: '', state_code: ''}
})
};
fetch('https://api.mervii.com/beta/price/centre-door', 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/centre-door",
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' => [
[
'city' => '',
'country_code' => 'NG',
'item_weight' => 1,
'region' => [
'latitude' => 7.427026700000001,
'longitude' => 3.8900142
],
'state_code' => 'LA'
],
[
'city' => '',
'country_code' => 'NG',
'item_weight' => 1,
'region' => [
'latitude' => 7.427026700000001,
'longitude' => 3.8900142
],
'state_code' => 'LA'
]
],
'pickup_origin' => [
'addresss' => '',
'centre_code' => '',
'country_code' => '',
'state_code' => ''
]
]),
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/centre-door"
payload := strings.NewReader("{\n \"destinations\": [\n {\n \"city\": \"\",\n \"country_code\": \"NG\",\n \"item_weight\": 1,\n \"region\": {\n \"latitude\": 7.427026700000001,\n \"longitude\": 3.8900142\n },\n \"state_code\": \"LA\"\n },\n {\n \"city\": \"\",\n \"country_code\": \"NG\",\n \"item_weight\": 1,\n \"region\": {\n \"latitude\": 7.427026700000001,\n \"longitude\": 3.8900142\n },\n \"state_code\": \"LA\"\n }\n ],\n \"pickup_origin\": {\n \"addresss\": \"\",\n \"centre_code\": \"\",\n \"country_code\": \"\",\n \"state_code\": \"\"\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/centre-door")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"destinations\": [\n {\n \"city\": \"\",\n \"country_code\": \"NG\",\n \"item_weight\": 1,\n \"region\": {\n \"latitude\": 7.427026700000001,\n \"longitude\": 3.8900142\n },\n \"state_code\": \"LA\"\n },\n {\n \"city\": \"\",\n \"country_code\": \"NG\",\n \"item_weight\": 1,\n \"region\": {\n \"latitude\": 7.427026700000001,\n \"longitude\": 3.8900142\n },\n \"state_code\": \"LA\"\n }\n ],\n \"pickup_origin\": {\n \"addresss\": \"\",\n \"centre_code\": \"\",\n \"country_code\": \"\",\n \"state_code\": \"\"\n }\n}")
.asString();{
"data": {
"destinations": [
{
"city": null,
"country_code": "NG",
"dropoff_centre": {
"centre_code": "lagos-ojodu-berger",
"centre_name": "Ojodu Berger Lagos"
},
"item_weight": 1,
"price": {
"amount": 11692.520875080363,
"amount_payable": 11692.520875080363,
"discount_amount": 0,
"discount_description": "0% discount",
"discount_type": "Percetage",
"distance": "68.26634062567 Kilometres to the drop off center ",
"duration": "1-4 days"
},
"region": {
"latitude": 7.427026700000001,
"longitude": 3.8900142
},
"state_code": "LA",
"weight": "1"
},
{
"city": null,
"country_code": "NG",
"dropoff_centre": {
"centre_code": "lagos-ojodu-berger",
"centre_name": "Ojodu Berger Lagos"
},
"item_weight": 1,
"price": {
"amount": 11692.520875080363,
"amount_payable": 11692.520875080363,
"discount_amount": 0,
"discount_description": "0% discount",
"discount_type": "Percetage",
"distance": "68.26634062567 Kilometres to the drop off center ",
"duration": "1-4 days"
},
"region": {
"latitude": 7.427026700000001,
"longitude": 3.8900142
},
"state_code": "LA",
"weight": "1"
}
],
"discount_description": "0% discount",
"discount_type": "Percetage",
"pickup_origin": {
"addresss": null,
"centre_code": "ibadan-sango",
"country_code": null,
"pickup_centre": {
"centre_code": "ibadan-sango",
"centre_name": "Sango Ibadan"
},
"state_code": null
},
"total_amount": 23385.041750160726,
"total_amount_payable": 23385.041750160726,
"total_discount_amount": 0
},
"message": "get price",
"status": true
}{
"message": "The pickup origin.centre code field is required.",
"status": false
}Authorizations
Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
Body
Show child attributes
Show child attributes
[
{
"city": "",
"country_code": "NG",
"item_weight": 1,
"region": {
"latitude": 7.427026700000001,
"longitude": 3.8900142
},
"state_code": "LA"
},
{
"city": "",
"country_code": "NG",
"item_weight": 1,
"region": {
"latitude": 7.427026700000001,
"longitude": 3.8900142
},
"state_code": "LA"
}
]
Show child attributes
Show child attributes
Was this page helpful?
