Update customer address
curl --request PUT \
--url https://{subdomain}.truust.io/2.0/customers/{uuid}/addresses/{address_uuid} \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '{
"metadata": {}
}'import requests
url = "https://{subdomain}.truust.io/2.0/customers/{uuid}/addresses/{address_uuid}"
payload = { "metadata": {} }
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.put(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PUT',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({metadata: {}})
};
fetch('https://{subdomain}.truust.io/2.0/customers/{uuid}/addresses/{address_uuid}', 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://{subdomain}.truust.io/2.0/customers/{uuid}/addresses/{address_uuid}",
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([
'metadata' => [
]
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"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://{subdomain}.truust.io/2.0/customers/{uuid}/addresses/{address_uuid}"
payload := strings.NewReader("{\n \"metadata\": {}\n}")
req, _ := http.NewRequest("PUT", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
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://{subdomain}.truust.io/2.0/customers/{uuid}/addresses/{address_uuid}")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"metadata\": {}\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://{subdomain}.truust.io/2.0/customers/{uuid}/addresses/{address_uuid}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Put.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"metadata\": {}\n}"
response = http.request(request)
puts response.read_body{
"id": 123,
"self": "<string>",
"uuid": "<string>",
"name": "<string>",
"email": "<string>",
"prefix": "<string>",
"phone": "<string>",
"line1": "<string>",
"line2": "<string>",
"city": "<string>",
"state": "<string>",
"country": "<string>",
"zip_code": "<string>",
"tag": "<string>",
"metadata": {},
"created_at": "2023-11-07T05:31:56Z",
"connections": {}
}Customers
Update Customer Address
Only the metadata field can be updated on an existing address.
PUT
/
customers
/
{uuid}
/
addresses
/
{address_uuid}
Update customer address
curl --request PUT \
--url https://{subdomain}.truust.io/2.0/customers/{uuid}/addresses/{address_uuid} \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '{
"metadata": {}
}'import requests
url = "https://{subdomain}.truust.io/2.0/customers/{uuid}/addresses/{address_uuid}"
payload = { "metadata": {} }
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.put(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PUT',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({metadata: {}})
};
fetch('https://{subdomain}.truust.io/2.0/customers/{uuid}/addresses/{address_uuid}', 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://{subdomain}.truust.io/2.0/customers/{uuid}/addresses/{address_uuid}",
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([
'metadata' => [
]
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"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://{subdomain}.truust.io/2.0/customers/{uuid}/addresses/{address_uuid}"
payload := strings.NewReader("{\n \"metadata\": {}\n}")
req, _ := http.NewRequest("PUT", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
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://{subdomain}.truust.io/2.0/customers/{uuid}/addresses/{address_uuid}")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"metadata\": {}\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://{subdomain}.truust.io/2.0/customers/{uuid}/addresses/{address_uuid}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Put.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"metadata\": {}\n}"
response = http.request(request)
puts response.read_body{
"id": 123,
"self": "<string>",
"uuid": "<string>",
"name": "<string>",
"email": "<string>",
"prefix": "<string>",
"phone": "<string>",
"line1": "<string>",
"line2": "<string>",
"city": "<string>",
"state": "<string>",
"country": "<string>",
"zip_code": "<string>",
"tag": "<string>",
"metadata": {},
"created_at": "2023-11-07T05:31:56Z",
"connections": {}
}Authorizations
Use your account's Secret Key as the Bearer token.
Body
application/json
Response
200 - application/json
Updated address
Hypermedia links to related resources.
Show child attributes
Show child attributes
⌘I
