Validate an address
curl --request POST \
--url https://panel.sendcloud.sc/api/v3/addresses/validate \
--header 'Authorization: Basic <encoded-value>' \
--header 'Content-Type: application/json' \
--data '
{
"address": {
"address_line_1": "Stadhuisplein",
"house_number": "50",
"address_line_2": "Apartment 17B",
"postal_code": "1013 AB",
"city": "Eindhoven",
"po_box": "<string>",
"state_province_code": "IT-RM",
"country_code": "NL"
},
"carrier_code": "trunkrs",
"validation_methods": [
"here"
]
}
'import requests
url = "https://panel.sendcloud.sc/api/v3/addresses/validate"
payload = {
"address": {
"address_line_1": "Stadhuisplein",
"house_number": "50",
"address_line_2": "Apartment 17B",
"postal_code": "1013 AB",
"city": "Eindhoven",
"po_box": "<string>",
"state_province_code": "IT-RM",
"country_code": "NL"
},
"carrier_code": "trunkrs",
"validation_methods": ["here"]
}
headers = {
"Authorization": "Basic <encoded-value>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Basic <encoded-value>', 'Content-Type': 'application/json'},
body: JSON.stringify({
address: {
address_line_1: 'Stadhuisplein',
house_number: '50',
address_line_2: 'Apartment 17B',
postal_code: '1013 AB',
city: 'Eindhoven',
po_box: '<string>',
state_province_code: 'IT-RM',
country_code: 'NL'
},
carrier_code: 'trunkrs',
validation_methods: ['here']
})
};
fetch('https://panel.sendcloud.sc/api/v3/addresses/validate', 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/v3/addresses/validate",
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([
'address' => [
'address_line_1' => 'Stadhuisplein',
'house_number' => '50',
'address_line_2' => 'Apartment 17B',
'postal_code' => '1013 AB',
'city' => 'Eindhoven',
'po_box' => '<string>',
'state_province_code' => 'IT-RM',
'country_code' => 'NL'
],
'carrier_code' => 'trunkrs',
'validation_methods' => [
'here'
]
]),
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/v3/addresses/validate"
payload := strings.NewReader("{\n \"address\": {\n \"address_line_1\": \"Stadhuisplein\",\n \"house_number\": \"50\",\n \"address_line_2\": \"Apartment 17B\",\n \"postal_code\": \"1013 AB\",\n \"city\": \"Eindhoven\",\n \"po_box\": \"<string>\",\n \"state_province_code\": \"IT-RM\",\n \"country_code\": \"NL\"\n },\n \"carrier_code\": \"trunkrs\",\n \"validation_methods\": [\n \"here\"\n ]\n}")
req, _ := http.NewRequest("POST", 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.post("https://panel.sendcloud.sc/api/v3/addresses/validate")
.header("Authorization", "Basic <encoded-value>")
.header("Content-Type", "application/json")
.body("{\n \"address\": {\n \"address_line_1\": \"Stadhuisplein\",\n \"house_number\": \"50\",\n \"address_line_2\": \"Apartment 17B\",\n \"postal_code\": \"1013 AB\",\n \"city\": \"Eindhoven\",\n \"po_box\": \"<string>\",\n \"state_province_code\": \"IT-RM\",\n \"country_code\": \"NL\"\n },\n \"carrier_code\": \"trunkrs\",\n \"validation_methods\": [\n \"here\"\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://panel.sendcloud.sc/api/v3/addresses/validate")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Basic <encoded-value>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"address\": {\n \"address_line_1\": \"Stadhuisplein\",\n \"house_number\": \"50\",\n \"address_line_2\": \"Apartment 17B\",\n \"postal_code\": \"1013 AB\",\n \"city\": \"Eindhoven\",\n \"po_box\": \"<string>\",\n \"state_province_code\": \"IT-RM\",\n \"country_code\": \"NL\"\n },\n \"carrier_code\": \"trunkrs\",\n \"validation_methods\": [\n \"here\"\n ]\n}"
response = http.request(request)
puts response.read_body{
"input_address_is_valid": true,
"results": [
{
"address": {
"address_line_1": "Stadhuisplein",
"house_number": "50",
"address_line_2": "Apartment 17B",
"postal_code": "1013 AB",
"city": "Eindhoven",
"po_box": "<string>",
"state_province_code": "IT-RM",
"country_code": "NL"
},
"validation_method": "here",
"recommended": true,
"analysis": {
"validation_result": {
"is_valid": true,
"reasons": [
"ADDRESS_TOO_LONG"
]
},
"changed_attributes": [
"<string>"
],
"invalid_attributes": [
"<string>"
]
}
}
]
}Address validation
Validate an address
Validate a shipping address before you use it in a shipment.
POST
/
addresses
/
validate
Validate an address
curl --request POST \
--url https://panel.sendcloud.sc/api/v3/addresses/validate \
--header 'Authorization: Basic <encoded-value>' \
--header 'Content-Type: application/json' \
--data '
{
"address": {
"address_line_1": "Stadhuisplein",
"house_number": "50",
"address_line_2": "Apartment 17B",
"postal_code": "1013 AB",
"city": "Eindhoven",
"po_box": "<string>",
"state_province_code": "IT-RM",
"country_code": "NL"
},
"carrier_code": "trunkrs",
"validation_methods": [
"here"
]
}
'import requests
url = "https://panel.sendcloud.sc/api/v3/addresses/validate"
payload = {
"address": {
"address_line_1": "Stadhuisplein",
"house_number": "50",
"address_line_2": "Apartment 17B",
"postal_code": "1013 AB",
"city": "Eindhoven",
"po_box": "<string>",
"state_province_code": "IT-RM",
"country_code": "NL"
},
"carrier_code": "trunkrs",
"validation_methods": ["here"]
}
headers = {
"Authorization": "Basic <encoded-value>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Basic <encoded-value>', 'Content-Type': 'application/json'},
body: JSON.stringify({
address: {
address_line_1: 'Stadhuisplein',
house_number: '50',
address_line_2: 'Apartment 17B',
postal_code: '1013 AB',
city: 'Eindhoven',
po_box: '<string>',
state_province_code: 'IT-RM',
country_code: 'NL'
},
carrier_code: 'trunkrs',
validation_methods: ['here']
})
};
fetch('https://panel.sendcloud.sc/api/v3/addresses/validate', 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/v3/addresses/validate",
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([
'address' => [
'address_line_1' => 'Stadhuisplein',
'house_number' => '50',
'address_line_2' => 'Apartment 17B',
'postal_code' => '1013 AB',
'city' => 'Eindhoven',
'po_box' => '<string>',
'state_province_code' => 'IT-RM',
'country_code' => 'NL'
],
'carrier_code' => 'trunkrs',
'validation_methods' => [
'here'
]
]),
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/v3/addresses/validate"
payload := strings.NewReader("{\n \"address\": {\n \"address_line_1\": \"Stadhuisplein\",\n \"house_number\": \"50\",\n \"address_line_2\": \"Apartment 17B\",\n \"postal_code\": \"1013 AB\",\n \"city\": \"Eindhoven\",\n \"po_box\": \"<string>\",\n \"state_province_code\": \"IT-RM\",\n \"country_code\": \"NL\"\n },\n \"carrier_code\": \"trunkrs\",\n \"validation_methods\": [\n \"here\"\n ]\n}")
req, _ := http.NewRequest("POST", 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.post("https://panel.sendcloud.sc/api/v3/addresses/validate")
.header("Authorization", "Basic <encoded-value>")
.header("Content-Type", "application/json")
.body("{\n \"address\": {\n \"address_line_1\": \"Stadhuisplein\",\n \"house_number\": \"50\",\n \"address_line_2\": \"Apartment 17B\",\n \"postal_code\": \"1013 AB\",\n \"city\": \"Eindhoven\",\n \"po_box\": \"<string>\",\n \"state_province_code\": \"IT-RM\",\n \"country_code\": \"NL\"\n },\n \"carrier_code\": \"trunkrs\",\n \"validation_methods\": [\n \"here\"\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://panel.sendcloud.sc/api/v3/addresses/validate")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Basic <encoded-value>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"address\": {\n \"address_line_1\": \"Stadhuisplein\",\n \"house_number\": \"50\",\n \"address_line_2\": \"Apartment 17B\",\n \"postal_code\": \"1013 AB\",\n \"city\": \"Eindhoven\",\n \"po_box\": \"<string>\",\n \"state_province_code\": \"IT-RM\",\n \"country_code\": \"NL\"\n },\n \"carrier_code\": \"trunkrs\",\n \"validation_methods\": [\n \"here\"\n ]\n}"
response = http.request(request)
puts response.read_body{
"input_address_is_valid": true,
"results": [
{
"address": {
"address_line_1": "Stadhuisplein",
"house_number": "50",
"address_line_2": "Apartment 17B",
"postal_code": "1013 AB",
"city": "Eindhoven",
"po_box": "<string>",
"state_province_code": "IT-RM",
"country_code": "NL"
},
"validation_method": "here",
"recommended": true,
"analysis": {
"validation_result": {
"is_valid": true,
"reasons": [
"ADDRESS_TOO_LONG"
]
},
"changed_attributes": [
"<string>"
],
"invalid_attributes": [
"<string>"
]
}
}
]
}OAuth2 scopes required:
write:parcel. See Scopes for OAuth apps.- checks the address against the carrier limits (e.g. maximum length of the address line, existence of the postal code for the country, etc.). See also Carrier address limits.
- optimizes (washes) the address to fit within the carrier limits. (e.g. deduplication of address lines, abbreviations, etc.)
Authorizations
HTTPBasicAuthOAuth2ClientCreds
Headers
If you are an official Sendcloud Tech Partner, you can provide this additional request header for the system to recognize you. Sendcloud Partner UUID is provided to Sendcloud partners. The token is not required but if the header is set, the system will try to validate it. An unknown UUID will cause the 404 return, whilst an invalid one will return 400.
Example:
"550e8400-e29b-41d4-a716-446655440000"
Body
application/json
Address Washer Request object model
Response
Address validation successful
Address Washer Response object model