Create shipping zones Copy
curl --request POST \
--url http://staging.qshop.ng/apiv2/{shopId}/shipping/zones \
--header 'Content-Type: application/json' \
--data '
{
"label": "international",
"name": "Oyo south west",
"rates": [
{
"amount": 0,
"deliveryType": "delivery",
"name": "standard rate 5",
"rateType": "norate",
"rates": []
}
],
"states": [
"62c80815c9d738e14b8988f1"
]
}
'import requests
url = "http://staging.qshop.ng/apiv2/{shopId}/shipping/zones"
payload = {
"label": "international",
"name": "Oyo south west",
"rates": [
{
"amount": 0,
"deliveryType": "delivery",
"name": "standard rate 5",
"rateType": "norate",
"rates": []
}
],
"states": ["62c80815c9d738e14b8988f1"]
}
headers = {"Content-Type": "application/json"}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'Content-Type': 'application/json'},
body: JSON.stringify({
label: 'international',
name: 'Oyo south west',
rates: [
{
amount: 0,
deliveryType: 'delivery',
name: 'standard rate 5',
rateType: 'norate',
rates: []
}
],
states: ['62c80815c9d738e14b8988f1']
})
};
fetch('http://staging.qshop.ng/apiv2/{shopId}/shipping/zones', 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 => "http://staging.qshop.ng/apiv2/{shopId}/shipping/zones",
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([
'label' => 'international',
'name' => 'Oyo south west',
'rates' => [
[
'amount' => 0,
'deliveryType' => 'delivery',
'name' => 'standard rate 5',
'rateType' => 'norate',
'rates' => [
]
]
],
'states' => [
'62c80815c9d738e14b8988f1'
]
]),
CURLOPT_HTTPHEADER => [
"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 := "http://staging.qshop.ng/apiv2/{shopId}/shipping/zones"
payload := strings.NewReader("{\n \"label\": \"international\",\n \"name\": \"Oyo south west\",\n \"rates\": [\n {\n \"amount\": 0,\n \"deliveryType\": \"delivery\",\n \"name\": \"standard rate 5\",\n \"rateType\": \"norate\",\n \"rates\": []\n }\n ],\n \"states\": [\n \"62c80815c9d738e14b8988f1\"\n ]\n}")
req, _ := http.NewRequest("POST", url, payload)
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("http://staging.qshop.ng/apiv2/{shopId}/shipping/zones")
.header("Content-Type", "application/json")
.body("{\n \"label\": \"international\",\n \"name\": \"Oyo south west\",\n \"rates\": [\n {\n \"amount\": 0,\n \"deliveryType\": \"delivery\",\n \"name\": \"standard rate 5\",\n \"rateType\": \"norate\",\n \"rates\": []\n }\n ],\n \"states\": [\n \"62c80815c9d738e14b8988f1\"\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("http://staging.qshop.ng/apiv2/{shopId}/shipping/zones")
http = Net::HTTP.new(url.host, url.port)
request = Net::HTTP::Post.new(url)
request["Content-Type"] = 'application/json'
request.body = "{\n \"label\": \"international\",\n \"name\": \"Oyo south west\",\n \"rates\": [\n {\n \"amount\": 0,\n \"deliveryType\": \"delivery\",\n \"name\": \"standard rate 5\",\n \"rateType\": \"norate\",\n \"rates\": []\n }\n ],\n \"states\": [\n \"62c80815c9d738e14b8988f1\"\n ]\n}"
response = http.request(request)
puts response.read_body{
"data": {
"__v": 0,
"_id": "635a98d76231f050e45949a9",
"cities": [
"62c8341dee498d69b64c64a0",
"62c8341dee498d69b64c64a1"
],
"countries": [
"628c8d3c21ce8313e6293c8e"
],
"created": "2022-10-27T14:42:31.425Z",
"name": "Test Africanaers",
"regions": [
{
"_id": "635a98d76231f050e45949aa",
"country": "628c8d3c21ce8313e6293c8e",
"regions": [
{
"_id": "635a98d76231f050e45949ab",
"cities": [
"62c8341dee498d69b64c64a0",
"62c8341dee498d69b64c64a1"
],
"state": "62c80815c9d738e14b8988ce"
}
]
}
],
"restOfTheWorld": false,
"shop": "61a956d91a113f7e13c45c15",
"slug": "test-africanaers",
"states": [
"62c80815c9d738e14b8988ce"
],
"updated": "2022-10-27T14:42:31.425Z",
"updatedBy": "61a956551a113f7e13c45c10"
},
"msg": "Zone created successfully",
"success": true
}Shops - Shipping zones
Create shipping zones
POST
/
{shopId}
/
shipping
/
zones
Create shipping zones Copy
curl --request POST \
--url http://staging.qshop.ng/apiv2/{shopId}/shipping/zones \
--header 'Content-Type: application/json' \
--data '
{
"label": "international",
"name": "Oyo south west",
"rates": [
{
"amount": 0,
"deliveryType": "delivery",
"name": "standard rate 5",
"rateType": "norate",
"rates": []
}
],
"states": [
"62c80815c9d738e14b8988f1"
]
}
'import requests
url = "http://staging.qshop.ng/apiv2/{shopId}/shipping/zones"
payload = {
"label": "international",
"name": "Oyo south west",
"rates": [
{
"amount": 0,
"deliveryType": "delivery",
"name": "standard rate 5",
"rateType": "norate",
"rates": []
}
],
"states": ["62c80815c9d738e14b8988f1"]
}
headers = {"Content-Type": "application/json"}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'Content-Type': 'application/json'},
body: JSON.stringify({
label: 'international',
name: 'Oyo south west',
rates: [
{
amount: 0,
deliveryType: 'delivery',
name: 'standard rate 5',
rateType: 'norate',
rates: []
}
],
states: ['62c80815c9d738e14b8988f1']
})
};
fetch('http://staging.qshop.ng/apiv2/{shopId}/shipping/zones', 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 => "http://staging.qshop.ng/apiv2/{shopId}/shipping/zones",
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([
'label' => 'international',
'name' => 'Oyo south west',
'rates' => [
[
'amount' => 0,
'deliveryType' => 'delivery',
'name' => 'standard rate 5',
'rateType' => 'norate',
'rates' => [
]
]
],
'states' => [
'62c80815c9d738e14b8988f1'
]
]),
CURLOPT_HTTPHEADER => [
"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 := "http://staging.qshop.ng/apiv2/{shopId}/shipping/zones"
payload := strings.NewReader("{\n \"label\": \"international\",\n \"name\": \"Oyo south west\",\n \"rates\": [\n {\n \"amount\": 0,\n \"deliveryType\": \"delivery\",\n \"name\": \"standard rate 5\",\n \"rateType\": \"norate\",\n \"rates\": []\n }\n ],\n \"states\": [\n \"62c80815c9d738e14b8988f1\"\n ]\n}")
req, _ := http.NewRequest("POST", url, payload)
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("http://staging.qshop.ng/apiv2/{shopId}/shipping/zones")
.header("Content-Type", "application/json")
.body("{\n \"label\": \"international\",\n \"name\": \"Oyo south west\",\n \"rates\": [\n {\n \"amount\": 0,\n \"deliveryType\": \"delivery\",\n \"name\": \"standard rate 5\",\n \"rateType\": \"norate\",\n \"rates\": []\n }\n ],\n \"states\": [\n \"62c80815c9d738e14b8988f1\"\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("http://staging.qshop.ng/apiv2/{shopId}/shipping/zones")
http = Net::HTTP.new(url.host, url.port)
request = Net::HTTP::Post.new(url)
request["Content-Type"] = 'application/json'
request.body = "{\n \"label\": \"international\",\n \"name\": \"Oyo south west\",\n \"rates\": [\n {\n \"amount\": 0,\n \"deliveryType\": \"delivery\",\n \"name\": \"standard rate 5\",\n \"rateType\": \"norate\",\n \"rates\": []\n }\n ],\n \"states\": [\n \"62c80815c9d738e14b8988f1\"\n ]\n}"
response = http.request(request)
puts response.read_body{
"data": {
"__v": 0,
"_id": "635a98d76231f050e45949a9",
"cities": [
"62c8341dee498d69b64c64a0",
"62c8341dee498d69b64c64a1"
],
"countries": [
"628c8d3c21ce8313e6293c8e"
],
"created": "2022-10-27T14:42:31.425Z",
"name": "Test Africanaers",
"regions": [
{
"_id": "635a98d76231f050e45949aa",
"country": "628c8d3c21ce8313e6293c8e",
"regions": [
{
"_id": "635a98d76231f050e45949ab",
"cities": [
"62c8341dee498d69b64c64a0",
"62c8341dee498d69b64c64a1"
],
"state": "62c80815c9d738e14b8988ce"
}
]
}
],
"restOfTheWorld": false,
"shop": "61a956d91a113f7e13c45c15",
"slug": "test-africanaers",
"states": [
"62c80815c9d738e14b8988ce"
],
"updated": "2022-10-27T14:42:31.425Z",
"updatedBy": "61a956551a113f7e13c45c10"
},
"msg": "Zone created successfully",
"success": true
}Body
application/json
Was this page helpful?
⌘I