Create Son 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 '
{
"order_reference_id": "<string>",
"labels": [
{}
],
"items": [
{}
]
}
'import requests
url = "https://live.nocnocstore.com/api/v2/packages"
payload = {
"order_reference_id": "<string>",
"labels": [{}],
"items": [{}]
}
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({order_reference_id: '<string>', labels: [{}], items: [{}]})
};
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([
'order_reference_id' => '<string>',
'labels' => [
[
]
],
'items' => [
[
]
]
]),
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 \"order_reference_id\": \"<string>\",\n \"labels\": [\n {}\n ],\n \"items\": [\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 \"order_reference_id\": \"<string>\",\n \"labels\": [\n {}\n ],\n \"items\": [\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 \"order_reference_id\": \"<string>\",\n \"labels\": [\n {}\n ],\n \"items\": [\n {}\n ]\n}"
response = http.request(request)
puts response.read_body{
"package_id": "PK111"
}
Packages
Create Son package
Creates a Son package for a single order. Each order requires its own Son package.
POST
/
api
/
v2
/
packages
Create Son 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 '
{
"order_reference_id": "<string>",
"labels": [
{}
],
"items": [
{}
]
}
'import requests
url = "https://live.nocnocstore.com/api/v2/packages"
payload = {
"order_reference_id": "<string>",
"labels": [{}],
"items": [{}]
}
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({order_reference_id: '<string>', labels: [{}], items: [{}]})
};
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([
'order_reference_id' => '<string>',
'labels' => [
[
]
],
'items' => [
[
]
]
]),
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 \"order_reference_id\": \"<string>\",\n \"labels\": [\n {}\n ],\n \"items\": [\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 \"order_reference_id\": \"<string>\",\n \"labels\": [\n {}\n ],\n \"items\": [\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 \"order_reference_id\": \"<string>\",\n \"labels\": [\n {}\n ],\n \"items\": [\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. Create a Son package per order, then group multiple Son packages into a Father package for consolidated first-mile shipping.
Authorization
string
required
Your seller API key. Provided by your nocnoc account manager.
Body parameters
string
required
The reference ID of the order included in this package.
array
required
Array of label objects. Minimum 1, maximum 10. Each object contains:
tracking_code(string) — tracking code of the packagecarrier(string) — first-mile carrier (e.g."FedEx","UPS"). Use"nocnoc"for a nocnoc labelurl(string) — URL to track the order
array
required
Array of item objects inside the package. Minimum 1, maximum 10. Each object contains:
sku(string) — item SKU, between 1 and 45 charactersquantity(integer) — quantity of the item, between 0 and 9999
Returns
The created Son package object with its package ID, which you’ll need to create a Father package.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 '{
"order_reference_id": "NC0000",
"labels": [
{
"tracking_code": "1234",
"carrier": "nocnoc",
"url": "https://tracking.example.com/1234"
}
],
"items": [
{
"sku": "SKU00000000",
"quantity": 1
}
]
}'
{
"package_id": "PK111"
}