Create Father package
curl --request POST \
--url https://live.nocnocstore.com/api/v2/packages \
--header 'Content-Type: application/json' \
--header 'X-Api-Key: <x-api-key>' \
--data '
{
"subpackages": [
{}
],
"labels": [
{}
]
}
'import requests
url = "https://live.nocnocstore.com/api/v2/packages"
payload = {
"subpackages": [{}],
"labels": [{}]
}
headers = {
"X-Api-Key": "<x-api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'X-Api-Key': '<x-api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({subpackages: [{}], labels: [{}]})
};
fetch('https://live.nocnocstore.com/api/v2/packages', 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://live.nocnocstore.com/api/v2/packages",
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([
'subpackages' => [
[
]
],
'labels' => [
[
]
]
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"X-Api-Key: <x-api-key>"
],
]);
$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://live.nocnocstore.com/api/v2/packages"
payload := strings.NewReader("{\n \"subpackages\": [\n {}\n ],\n \"labels\": [\n {}\n ]\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("X-Api-Key", "<x-api-key>")
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://live.nocnocstore.com/api/v2/packages")
.header("X-Api-Key", "<x-api-key>")
.header("Content-Type", "application/json")
.body("{\n \"subpackages\": [\n {}\n ],\n \"labels\": [\n {}\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://live.nocnocstore.com/api/v2/packages")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["X-Api-Key"] = '<x-api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"subpackages\": [\n {}\n ],\n \"labels\": [\n {}\n ]\n}"
response = http.request(request)
puts response.read_body{
"package_id": "PK111"
}
Packages
Create Father package
Creates a Father package by consolidating multiple Son packages for bulk first-mile shipping.
POST
/
api
/
v2
/
packages
Create Father package
curl --request POST \
--url https://live.nocnocstore.com/api/v2/packages \
--header 'Content-Type: application/json' \
--header 'X-Api-Key: <x-api-key>' \
--data '
{
"subpackages": [
{}
],
"labels": [
{}
]
}
'import requests
url = "https://live.nocnocstore.com/api/v2/packages"
payload = {
"subpackages": [{}],
"labels": [{}]
}
headers = {
"X-Api-Key": "<x-api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'X-Api-Key': '<x-api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({subpackages: [{}], labels: [{}]})
};
fetch('https://live.nocnocstore.com/api/v2/packages', 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://live.nocnocstore.com/api/v2/packages",
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([
'subpackages' => [
[
]
],
'labels' => [
[
]
]
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"X-Api-Key: <x-api-key>"
],
]);
$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://live.nocnocstore.com/api/v2/packages"
payload := strings.NewReader("{\n \"subpackages\": [\n {}\n ],\n \"labels\": [\n {}\n ]\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("X-Api-Key", "<x-api-key>")
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://live.nocnocstore.com/api/v2/packages")
.header("X-Api-Key", "<x-api-key>")
.header("Content-Type", "application/json")
.body("{\n \"subpackages\": [\n {}\n ],\n \"labels\": [\n {}\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://live.nocnocstore.com/api/v2/packages")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["X-Api-Key"] = '<x-api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"subpackages\": [\n {}\n ],\n \"labels\": [\n {}\n ]\n}"
response = http.request(request)
puts response.read_body{
"package_id": "PK111"
}
Requests go to the live environment — all actions are real.
nocnoc manages two types of packages: Son and Father. You must first create individual Son packages before grouping them into a Father package.
Authorization
string
required
Your seller API key. Provided by your nocnoc account manager.
Body parameters
array
required
Array of Son package IDs to include in this Father package.
array
Array of label objects for the consolidated shipment. Minimum 1, maximum 10. Each object contains:
tracking_code(string, required) — tracking code of the consolidated packagecarrier(string, required) — first-mile carrier (e.g."FedEx","UPS")url(string, required) — URL to track the shipment
Returns
The created Father package object confirming the consolidated shipment.Example request
curl -X POST https://live.nocnocstore.com/api/v2/packages \
-H "X-Api-Key: YOUR_SELLER_KEY" \
-H "Content-Type: application/json" \
-d '{
"labels": [
{
"tracking_code": "FX2021",
"carrier": "FedEx",
"url": "https://www.fedex.com/tracking/FX2021"
}
],
"subpackages": ["PK1", "PK2", "PK3"]
}'
{
"package_id": "PK111"
}
⌘I