Update a parcel
curl --request PUT \
--url https://panel.sendcloud.sc/api/v2/parcels \
--header 'Authorization: Basic <encoded-value>' \
--header 'Content-Type: application/json' \
--data '
{
"parcel": {
"id": 3,
"name": "Sendcloud Userß",
"address": "Stadhuisplein 10",
"postal_code": "5611 EM",
"city": "Eindhoven",
"country": "NL",
"company_name": "Summer Co"
}
}
'import requests
url = "https://panel.sendcloud.sc/api/v2/parcels"
payload = { "parcel": {
"id": 3,
"name": "Sendcloud Userß",
"address": "Stadhuisplein 10",
"postal_code": "5611 EM",
"city": "Eindhoven",
"country": "NL",
"company_name": "Summer Co"
} }
headers = {
"Authorization": "Basic <encoded-value>",
"Content-Type": "application/json"
}
response = requests.put(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PUT',
headers: {Authorization: 'Basic <encoded-value>', 'Content-Type': 'application/json'},
body: JSON.stringify({
parcel: {
id: 3,
name: 'Sendcloud Userß',
address: 'Stadhuisplein 10',
postal_code: '5611 EM',
city: 'Eindhoven',
country: 'NL',
company_name: 'Summer Co'
}
})
};
fetch('https://panel.sendcloud.sc/api/v2/parcels', 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://panel.sendcloud.sc/api/v2/parcels",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PUT",
CURLOPT_POSTFIELDS => json_encode([
'parcel' => [
'id' => 3,
'name' => 'Sendcloud Userß',
'address' => 'Stadhuisplein 10',
'postal_code' => '5611 EM',
'city' => 'Eindhoven',
'country' => 'NL',
'company_name' => 'Summer Co'
]
]),
CURLOPT_HTTPHEADER => [
"Authorization: Basic <encoded-value>",
"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://panel.sendcloud.sc/api/v2/parcels"
payload := strings.NewReader("{\n \"parcel\": {\n \"id\": 3,\n \"name\": \"Sendcloud Userß\",\n \"address\": \"Stadhuisplein 10\",\n \"postal_code\": \"5611 EM\",\n \"city\": \"Eindhoven\",\n \"country\": \"NL\",\n \"company_name\": \"Summer Co\"\n }\n}")
req, _ := http.NewRequest("PUT", url, payload)
req.Header.Add("Authorization", "Basic <encoded-value>")
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.put("https://panel.sendcloud.sc/api/v2/parcels")
.header("Authorization", "Basic <encoded-value>")
.header("Content-Type", "application/json")
.body("{\n \"parcel\": {\n \"id\": 3,\n \"name\": \"Sendcloud Userß\",\n \"address\": \"Stadhuisplein 10\",\n \"postal_code\": \"5611 EM\",\n \"city\": \"Eindhoven\",\n \"country\": \"NL\",\n \"company_name\": \"Summer Co\"\n }\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://panel.sendcloud.sc/api/v2/parcels")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Put.new(url)
request["Authorization"] = 'Basic <encoded-value>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"parcel\": {\n \"id\": 3,\n \"name\": \"Sendcloud Userß\",\n \"address\": \"Stadhuisplein 10\",\n \"postal_code\": \"5611 EM\",\n \"city\": \"Eindhoven\",\n \"country\": \"NL\",\n \"company_name\": \"Summer Co\"\n }\n}"
response = http.request(request)
puts response.read_body{
"parcel": [
{
"id": 3,
"name": "Anna Tester",
"company_name": "Summer Co",
"address": "Stadhuisplein 10",
"address_divided": {
"street": "Stadhuisplein",
"house_number": "10"
},
"city": "Eindhoven",
"postal_code": "5611 EM",
"telephone": "0612345678",
"email": "test@email.com",
"date_created": "01-01-2018 21:45:30",
"date_updated": "01-01-2018 21:45:31",
"date_announced": "01-01-2018 21:45:31",
"tracking_number": "S0M3TR4Ck1NgNumB3r",
"weight": "2.000",
"label": {
"normal_printer": [
"https://panel.sendcloud.sc/api/v2/label/normal_printer/3172?start_from=0&hash=bbfd669ee9ebb19408b85b33d181a50040fd9bc4",
"https://panel.sendcloud.sc/api/v2/label/normal_printer/3172?start_from=1&hash=bbfd669ee9ebb19408b85b33d181a50040fd9bc4",
"https://panel.sendcloud.sc/api/v2/label/normal_printer/3172?start_from=2&hash=bbfd669ee9ebb19408b85b33d181a50040fd9bc4",
"https://panel.sendcloud.sc/api/v2/label/normal_printer/3172?start_from=3&hash=bbfd669ee9ebb19408b85b33d181a50040fd9bc4"
],
"label_printer": "https://panel.sendcloud.sc/api/v2/label/label_printer/3172?hash=bbfd669ee9ebb19408b85b33d181a50040fd9bc4"
},
"customs_declaration": {},
"status": {
"id": 0,
"message": "Ready to send"
},
"data": {},
"country": {
"iso_2": "NL",
"iso_3": "NLD",
"name": "Netherlands"
},
"shipment": {
"id": 1,
"name": "PostNL Standard 0-23kg"
},
"carrier": {
"code": "postnl"
},
"colli_uuid": "ab3ecb5e-61b6-42b1-8034-7c6befdeaa63",
"collo_nr": 0,
"collo_count": 1,
"reference": "some_reference_123"
}
]
}Parcels API
Update a parcel
Update a parcel which has not yet been announced, either to make changes to the original parcel data, or to request a shipping label if one hasn’t yet been created.
PUT
/
parcels
Update a parcel
curl --request PUT \
--url https://panel.sendcloud.sc/api/v2/parcels \
--header 'Authorization: Basic <encoded-value>' \
--header 'Content-Type: application/json' \
--data '
{
"parcel": {
"id": 3,
"name": "Sendcloud Userß",
"address": "Stadhuisplein 10",
"postal_code": "5611 EM",
"city": "Eindhoven",
"country": "NL",
"company_name": "Summer Co"
}
}
'import requests
url = "https://panel.sendcloud.sc/api/v2/parcels"
payload = { "parcel": {
"id": 3,
"name": "Sendcloud Userß",
"address": "Stadhuisplein 10",
"postal_code": "5611 EM",
"city": "Eindhoven",
"country": "NL",
"company_name": "Summer Co"
} }
headers = {
"Authorization": "Basic <encoded-value>",
"Content-Type": "application/json"
}
response = requests.put(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PUT',
headers: {Authorization: 'Basic <encoded-value>', 'Content-Type': 'application/json'},
body: JSON.stringify({
parcel: {
id: 3,
name: 'Sendcloud Userß',
address: 'Stadhuisplein 10',
postal_code: '5611 EM',
city: 'Eindhoven',
country: 'NL',
company_name: 'Summer Co'
}
})
};
fetch('https://panel.sendcloud.sc/api/v2/parcels', 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://panel.sendcloud.sc/api/v2/parcels",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PUT",
CURLOPT_POSTFIELDS => json_encode([
'parcel' => [
'id' => 3,
'name' => 'Sendcloud Userß',
'address' => 'Stadhuisplein 10',
'postal_code' => '5611 EM',
'city' => 'Eindhoven',
'country' => 'NL',
'company_name' => 'Summer Co'
]
]),
CURLOPT_HTTPHEADER => [
"Authorization: Basic <encoded-value>",
"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://panel.sendcloud.sc/api/v2/parcels"
payload := strings.NewReader("{\n \"parcel\": {\n \"id\": 3,\n \"name\": \"Sendcloud Userß\",\n \"address\": \"Stadhuisplein 10\",\n \"postal_code\": \"5611 EM\",\n \"city\": \"Eindhoven\",\n \"country\": \"NL\",\n \"company_name\": \"Summer Co\"\n }\n}")
req, _ := http.NewRequest("PUT", url, payload)
req.Header.Add("Authorization", "Basic <encoded-value>")
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.put("https://panel.sendcloud.sc/api/v2/parcels")
.header("Authorization", "Basic <encoded-value>")
.header("Content-Type", "application/json")
.body("{\n \"parcel\": {\n \"id\": 3,\n \"name\": \"Sendcloud Userß\",\n \"address\": \"Stadhuisplein 10\",\n \"postal_code\": \"5611 EM\",\n \"city\": \"Eindhoven\",\n \"country\": \"NL\",\n \"company_name\": \"Summer Co\"\n }\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://panel.sendcloud.sc/api/v2/parcels")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Put.new(url)
request["Authorization"] = 'Basic <encoded-value>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"parcel\": {\n \"id\": 3,\n \"name\": \"Sendcloud Userß\",\n \"address\": \"Stadhuisplein 10\",\n \"postal_code\": \"5611 EM\",\n \"city\": \"Eindhoven\",\n \"country\": \"NL\",\n \"company_name\": \"Summer Co\"\n }\n}"
response = http.request(request)
puts response.read_body{
"parcel": [
{
"id": 3,
"name": "Anna Tester",
"company_name": "Summer Co",
"address": "Stadhuisplein 10",
"address_divided": {
"street": "Stadhuisplein",
"house_number": "10"
},
"city": "Eindhoven",
"postal_code": "5611 EM",
"telephone": "0612345678",
"email": "test@email.com",
"date_created": "01-01-2018 21:45:30",
"date_updated": "01-01-2018 21:45:31",
"date_announced": "01-01-2018 21:45:31",
"tracking_number": "S0M3TR4Ck1NgNumB3r",
"weight": "2.000",
"label": {
"normal_printer": [
"https://panel.sendcloud.sc/api/v2/label/normal_printer/3172?start_from=0&hash=bbfd669ee9ebb19408b85b33d181a50040fd9bc4",
"https://panel.sendcloud.sc/api/v2/label/normal_printer/3172?start_from=1&hash=bbfd669ee9ebb19408b85b33d181a50040fd9bc4",
"https://panel.sendcloud.sc/api/v2/label/normal_printer/3172?start_from=2&hash=bbfd669ee9ebb19408b85b33d181a50040fd9bc4",
"https://panel.sendcloud.sc/api/v2/label/normal_printer/3172?start_from=3&hash=bbfd669ee9ebb19408b85b33d181a50040fd9bc4"
],
"label_printer": "https://panel.sendcloud.sc/api/v2/label/label_printer/3172?hash=bbfd669ee9ebb19408b85b33d181a50040fd9bc4"
},
"customs_declaration": {},
"status": {
"id": 0,
"message": "Ready to send"
},
"data": {},
"country": {
"iso_2": "NL",
"iso_3": "NLD",
"name": "Netherlands"
},
"shipment": {
"id": 1,
"name": "PostNL Standard 0-23kg"
},
"carrier": {
"code": "postnl"
},
"colli_uuid": "ab3ecb5e-61b6-42b1-8034-7c6befdeaa63",
"collo_nr": 0,
"collo_count": 1,
"reference": "some_reference_123"
}
]
}Authorizations
HTTPBasicAuthOAuth2ClientCreds
Basic Authentication using API key and secrets is currently the main authentication mechanism.
Body
application/json
Parcel object for a parcel creation
Show child attributes
Show child attributes
Response
OK
Show child attributes
Show child attributes
⌘I