Create an address book entry
curl --request POST \
--url https://panel.sendcloud.sc/api/v3/addresses/address-book \
--header 'Authorization: Basic <encoded-value>' \
--header 'Content-Type: application/json' \
--data '
{
"name": "John Doe",
"address_line_1": "Stadhuisplein",
"postal_code": "5611 EM",
"city": "Eindhoven",
"country_code": "NL",
"company_name": "Sendcloud",
"email": "johndoe@example.com",
"phone_number": "+31612345678",
"house_number": "10",
"address_line_2": "",
"state_province_code": null
}
'import requests
url = "https://panel.sendcloud.sc/api/v3/addresses/address-book"
payload = {
"name": "John Doe",
"address_line_1": "Stadhuisplein",
"postal_code": "5611 EM",
"city": "Eindhoven",
"country_code": "NL",
"company_name": "Sendcloud",
"email": "johndoe@example.com",
"phone_number": "+31612345678",
"house_number": "10",
"address_line_2": "",
"state_province_code": None
}
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({
name: 'John Doe',
address_line_1: 'Stadhuisplein',
postal_code: '5611 EM',
city: 'Eindhoven',
country_code: 'NL',
company_name: 'Sendcloud',
email: 'johndoe@example.com',
phone_number: '+31612345678',
house_number: '10',
address_line_2: '',
state_province_code: null
})
};
fetch('https://panel.sendcloud.sc/api/v3/addresses/address-book', 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/address-book",
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([
'name' => 'John Doe',
'address_line_1' => 'Stadhuisplein',
'postal_code' => '5611 EM',
'city' => 'Eindhoven',
'country_code' => 'NL',
'company_name' => 'Sendcloud',
'email' => 'johndoe@example.com',
'phone_number' => '+31612345678',
'house_number' => '10',
'address_line_2' => '',
'state_province_code' => null
]),
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/address-book"
payload := strings.NewReader("{\n \"name\": \"John Doe\",\n \"address_line_1\": \"Stadhuisplein\",\n \"postal_code\": \"5611 EM\",\n \"city\": \"Eindhoven\",\n \"country_code\": \"NL\",\n \"company_name\": \"Sendcloud\",\n \"email\": \"johndoe@example.com\",\n \"phone_number\": \"+31612345678\",\n \"house_number\": \"10\",\n \"address_line_2\": \"\",\n \"state_province_code\": null\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/address-book")
.header("Authorization", "Basic <encoded-value>")
.header("Content-Type", "application/json")
.body("{\n \"name\": \"John Doe\",\n \"address_line_1\": \"Stadhuisplein\",\n \"postal_code\": \"5611 EM\",\n \"city\": \"Eindhoven\",\n \"country_code\": \"NL\",\n \"company_name\": \"Sendcloud\",\n \"email\": \"johndoe@example.com\",\n \"phone_number\": \"+31612345678\",\n \"house_number\": \"10\",\n \"address_line_2\": \"\",\n \"state_province_code\": null\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://panel.sendcloud.sc/api/v3/addresses/address-book")
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 \"name\": \"John Doe\",\n \"address_line_1\": \"Stadhuisplein\",\n \"postal_code\": \"5611 EM\",\n \"city\": \"Eindhoven\",\n \"country_code\": \"NL\",\n \"company_name\": \"Sendcloud\",\n \"email\": \"johndoe@example.com\",\n \"phone_number\": \"+31612345678\",\n \"house_number\": \"10\",\n \"address_line_2\": \"\",\n \"state_province_code\": null\n}"
response = http.request(request)
puts response.read_body{
"data": {
"id": 1,
"name": "John Doe",
"company_name": "Sendcloud",
"email": "johndoe@example.com",
"phone_number": "+31612345678",
"address_line_1": "Stadhuisplein",
"house_number": "10",
"address_line_2": "",
"postal_code": "5611 EM",
"city": "Eindhoven",
"country_code": "NL",
"state_province_code": null
}
}Address book
Create an address book entry
Add an address to your address book.
POST
/
addresses
/
address-book
Create an address book entry
curl --request POST \
--url https://panel.sendcloud.sc/api/v3/addresses/address-book \
--header 'Authorization: Basic <encoded-value>' \
--header 'Content-Type: application/json' \
--data '
{
"name": "John Doe",
"address_line_1": "Stadhuisplein",
"postal_code": "5611 EM",
"city": "Eindhoven",
"country_code": "NL",
"company_name": "Sendcloud",
"email": "johndoe@example.com",
"phone_number": "+31612345678",
"house_number": "10",
"address_line_2": "",
"state_province_code": null
}
'import requests
url = "https://panel.sendcloud.sc/api/v3/addresses/address-book"
payload = {
"name": "John Doe",
"address_line_1": "Stadhuisplein",
"postal_code": "5611 EM",
"city": "Eindhoven",
"country_code": "NL",
"company_name": "Sendcloud",
"email": "johndoe@example.com",
"phone_number": "+31612345678",
"house_number": "10",
"address_line_2": "",
"state_province_code": None
}
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({
name: 'John Doe',
address_line_1: 'Stadhuisplein',
postal_code: '5611 EM',
city: 'Eindhoven',
country_code: 'NL',
company_name: 'Sendcloud',
email: 'johndoe@example.com',
phone_number: '+31612345678',
house_number: '10',
address_line_2: '',
state_province_code: null
})
};
fetch('https://panel.sendcloud.sc/api/v3/addresses/address-book', 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/address-book",
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([
'name' => 'John Doe',
'address_line_1' => 'Stadhuisplein',
'postal_code' => '5611 EM',
'city' => 'Eindhoven',
'country_code' => 'NL',
'company_name' => 'Sendcloud',
'email' => 'johndoe@example.com',
'phone_number' => '+31612345678',
'house_number' => '10',
'address_line_2' => '',
'state_province_code' => null
]),
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/address-book"
payload := strings.NewReader("{\n \"name\": \"John Doe\",\n \"address_line_1\": \"Stadhuisplein\",\n \"postal_code\": \"5611 EM\",\n \"city\": \"Eindhoven\",\n \"country_code\": \"NL\",\n \"company_name\": \"Sendcloud\",\n \"email\": \"johndoe@example.com\",\n \"phone_number\": \"+31612345678\",\n \"house_number\": \"10\",\n \"address_line_2\": \"\",\n \"state_province_code\": null\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/address-book")
.header("Authorization", "Basic <encoded-value>")
.header("Content-Type", "application/json")
.body("{\n \"name\": \"John Doe\",\n \"address_line_1\": \"Stadhuisplein\",\n \"postal_code\": \"5611 EM\",\n \"city\": \"Eindhoven\",\n \"country_code\": \"NL\",\n \"company_name\": \"Sendcloud\",\n \"email\": \"johndoe@example.com\",\n \"phone_number\": \"+31612345678\",\n \"house_number\": \"10\",\n \"address_line_2\": \"\",\n \"state_province_code\": null\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://panel.sendcloud.sc/api/v3/addresses/address-book")
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 \"name\": \"John Doe\",\n \"address_line_1\": \"Stadhuisplein\",\n \"postal_code\": \"5611 EM\",\n \"city\": \"Eindhoven\",\n \"country_code\": \"NL\",\n \"company_name\": \"Sendcloud\",\n \"email\": \"johndoe@example.com\",\n \"phone_number\": \"+31612345678\",\n \"house_number\": \"10\",\n \"address_line_2\": \"\",\n \"state_province_code\": null\n}"
response = http.request(request)
puts response.read_body{
"data": {
"id": 1,
"name": "John Doe",
"company_name": "Sendcloud",
"email": "johndoe@example.com",
"phone_number": "+31612345678",
"address_line_1": "Stadhuisplein",
"house_number": "10",
"address_line_2": "",
"postal_code": "5611 EM",
"city": "Eindhoven",
"country_code": "NL",
"state_province_code": null
}
}OAuth2 scopes required:
write:address-book. See Scopes for OAuth apps.5611EM is stored as 5611 EM), and a house number is required in countries that need one, such as the Netherlands.
A house number that is already part of address_line_1 is rejected. If you send a state_province_code, it must belong to the country_code.
Fields that are not listed below, including id, are rejected.Authorizations
HTTPBasicAuthOAuth2ClientCreds
Body
application/json
The address to add.