Update an address book entry
curl --request PATCH \
--url https://panel.sendcloud.sc/api/v3/addresses/address-book/{id} \
--header 'Authorization: Basic <encoded-value>' \
--header 'Content-Type: application/json' \
--data '
{
"name": "Jane Doe",
"email": "janedoe@example.com"
}
'import requests
url = "https://panel.sendcloud.sc/api/v3/addresses/address-book/{id}"
payload = {
"name": "Jane Doe",
"email": "janedoe@example.com"
}
headers = {
"Authorization": "Basic <encoded-value>",
"Content-Type": "application/json"
}
response = requests.patch(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PATCH',
headers: {Authorization: 'Basic <encoded-value>', 'Content-Type': 'application/json'},
body: JSON.stringify({name: 'Jane Doe', email: 'janedoe@example.com'})
};
fetch('https://panel.sendcloud.sc/api/v3/addresses/address-book/{id}', 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/{id}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PATCH",
CURLOPT_POSTFIELDS => json_encode([
'name' => 'Jane Doe',
'email' => 'janedoe@example.com'
]),
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/{id}"
payload := strings.NewReader("{\n \"name\": \"Jane Doe\",\n \"email\": \"janedoe@example.com\"\n}")
req, _ := http.NewRequest("PATCH", 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.patch("https://panel.sendcloud.sc/api/v3/addresses/address-book/{id}")
.header("Authorization", "Basic <encoded-value>")
.header("Content-Type", "application/json")
.body("{\n \"name\": \"Jane Doe\",\n \"email\": \"janedoe@example.com\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://panel.sendcloud.sc/api/v3/addresses/address-book/{id}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Patch.new(url)
request["Authorization"] = 'Basic <encoded-value>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"name\": \"Jane Doe\",\n \"email\": \"janedoe@example.com\"\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
Update an address book entry
Change one or more fields of an address book entry.
PATCH
/
addresses
/
address-book
/
{id}
Update an address book entry
curl --request PATCH \
--url https://panel.sendcloud.sc/api/v3/addresses/address-book/{id} \
--header 'Authorization: Basic <encoded-value>' \
--header 'Content-Type: application/json' \
--data '
{
"name": "Jane Doe",
"email": "janedoe@example.com"
}
'import requests
url = "https://panel.sendcloud.sc/api/v3/addresses/address-book/{id}"
payload = {
"name": "Jane Doe",
"email": "janedoe@example.com"
}
headers = {
"Authorization": "Basic <encoded-value>",
"Content-Type": "application/json"
}
response = requests.patch(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PATCH',
headers: {Authorization: 'Basic <encoded-value>', 'Content-Type': 'application/json'},
body: JSON.stringify({name: 'Jane Doe', email: 'janedoe@example.com'})
};
fetch('https://panel.sendcloud.sc/api/v3/addresses/address-book/{id}', 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/{id}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PATCH",
CURLOPT_POSTFIELDS => json_encode([
'name' => 'Jane Doe',
'email' => 'janedoe@example.com'
]),
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/{id}"
payload := strings.NewReader("{\n \"name\": \"Jane Doe\",\n \"email\": \"janedoe@example.com\"\n}")
req, _ := http.NewRequest("PATCH", 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.patch("https://panel.sendcloud.sc/api/v3/addresses/address-book/{id}")
.header("Authorization", "Basic <encoded-value>")
.header("Content-Type", "application/json")
.body("{\n \"name\": \"Jane Doe\",\n \"email\": \"janedoe@example.com\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://panel.sendcloud.sc/api/v3/addresses/address-book/{id}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Patch.new(url)
request["Authorization"] = 'Basic <encoded-value>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"name\": \"Jane Doe\",\n \"email\": \"janedoe@example.com\"\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."state_province_code": null to remove the state. No other field accepts null.
The complete address, including the fields you did not send, is validated again before it is saved. If a stored field no longer passes validation, for example a missing house number for a Dutch address, include a corrected value for that field in the same request.
When you change the country_code without sending a state_province_code, the stored state is removed, because it belongs to the previous country.
Fields that are not listed below, including id, are rejected. Remove id before you send back an entry you retrieved.Authorizations
HTTPBasicAuthOAuth2ClientCreds
Body
application/json
The fields of an address book entry. Leading and trailing whitespace is removed from all text fields.