Update a shopper address
curl --request PATCH \
--url https://api.bspk.com/api/platform/v1/shoppers/{shopper_ref}/addresses/{address_ref}.json \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"address": {
"external_id": "<string>",
"first_name": "<string>",
"last_name": "<string>",
"company_name": "<string>",
"address_1": "<string>",
"address_2": "<string>",
"address_3": "<string>",
"address_4": "<string>",
"city": "<string>",
"province": "<string>",
"province_code": "<string>",
"country": "<string>",
"country_code": "<string>",
"zip": "<string>",
"phone": "<string>",
"latitude": 123,
"longitude": 123,
"time_zone": "<string>",
"is_default": true
}
}
'import requests
url = "https://api.bspk.com/api/platform/v1/shoppers/{shopper_ref}/addresses/{address_ref}.json"
payload = { "address": {
"external_id": "<string>",
"first_name": "<string>",
"last_name": "<string>",
"company_name": "<string>",
"address_1": "<string>",
"address_2": "<string>",
"address_3": "<string>",
"address_4": "<string>",
"city": "<string>",
"province": "<string>",
"province_code": "<string>",
"country": "<string>",
"country_code": "<string>",
"zip": "<string>",
"phone": "<string>",
"latitude": 123,
"longitude": 123,
"time_zone": "<string>",
"is_default": True
} }
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.patch(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PATCH',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
address: {
external_id: '<string>',
first_name: '<string>',
last_name: '<string>',
company_name: '<string>',
address_1: '<string>',
address_2: '<string>',
address_3: '<string>',
address_4: '<string>',
city: '<string>',
province: '<string>',
province_code: '<string>',
country: '<string>',
country_code: '<string>',
zip: '<string>',
phone: '<string>',
latitude: 123,
longitude: 123,
time_zone: '<string>',
is_default: true
}
})
};
fetch('https://api.bspk.com/api/platform/v1/shoppers/{shopper_ref}/addresses/{address_ref}.json', 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://api.bspk.com/api/platform/v1/shoppers/{shopper_ref}/addresses/{address_ref}.json",
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([
'address' => [
'external_id' => '<string>',
'first_name' => '<string>',
'last_name' => '<string>',
'company_name' => '<string>',
'address_1' => '<string>',
'address_2' => '<string>',
'address_3' => '<string>',
'address_4' => '<string>',
'city' => '<string>',
'province' => '<string>',
'province_code' => '<string>',
'country' => '<string>',
'country_code' => '<string>',
'zip' => '<string>',
'phone' => '<string>',
'latitude' => 123,
'longitude' => 123,
'time_zone' => '<string>',
'is_default' => true
]
]),
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://api.bspk.com/api/platform/v1/shoppers/{shopper_ref}/addresses/{address_ref}.json"
payload := strings.NewReader("{\n \"address\": {\n \"external_id\": \"<string>\",\n \"first_name\": \"<string>\",\n \"last_name\": \"<string>\",\n \"company_name\": \"<string>\",\n \"address_1\": \"<string>\",\n \"address_2\": \"<string>\",\n \"address_3\": \"<string>\",\n \"address_4\": \"<string>\",\n \"city\": \"<string>\",\n \"province\": \"<string>\",\n \"province_code\": \"<string>\",\n \"country\": \"<string>\",\n \"country_code\": \"<string>\",\n \"zip\": \"<string>\",\n \"phone\": \"<string>\",\n \"latitude\": 123,\n \"longitude\": 123,\n \"time_zone\": \"<string>\",\n \"is_default\": true\n }\n}")
req, _ := http.NewRequest("PATCH", 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.patch("https://api.bspk.com/api/platform/v1/shoppers/{shopper_ref}/addresses/{address_ref}.json")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"address\": {\n \"external_id\": \"<string>\",\n \"first_name\": \"<string>\",\n \"last_name\": \"<string>\",\n \"company_name\": \"<string>\",\n \"address_1\": \"<string>\",\n \"address_2\": \"<string>\",\n \"address_3\": \"<string>\",\n \"address_4\": \"<string>\",\n \"city\": \"<string>\",\n \"province\": \"<string>\",\n \"province_code\": \"<string>\",\n \"country\": \"<string>\",\n \"country_code\": \"<string>\",\n \"zip\": \"<string>\",\n \"phone\": \"<string>\",\n \"latitude\": 123,\n \"longitude\": 123,\n \"time_zone\": \"<string>\",\n \"is_default\": true\n }\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.bspk.com/api/platform/v1/shoppers/{shopper_ref}/addresses/{address_ref}.json")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Patch.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"address\": {\n \"external_id\": \"<string>\",\n \"first_name\": \"<string>\",\n \"last_name\": \"<string>\",\n \"company_name\": \"<string>\",\n \"address_1\": \"<string>\",\n \"address_2\": \"<string>\",\n \"address_3\": \"<string>\",\n \"address_4\": \"<string>\",\n \"city\": \"<string>\",\n \"province\": \"<string>\",\n \"province_code\": \"<string>\",\n \"country\": \"<string>\",\n \"country_code\": \"<string>\",\n \"zip\": \"<string>\",\n \"phone\": \"<string>\",\n \"latitude\": 123,\n \"longitude\": 123,\n \"time_zone\": \"<string>\",\n \"is_default\": true\n }\n}"
response = http.request(request)
puts response.read_body{
"id": 123,
"external_id": "<string>",
"first_name": "<string>",
"last_name": "<string>",
"company": "<string>",
"address": "<string>",
"address_2": "<string>",
"address_3": "<string>",
"address_4": "<string>",
"city": "<string>",
"state": "<string>",
"province": "<string>",
"province_code": "<string>",
"country": "<string>",
"country_code": "<string>",
"zip": "<string>",
"phone": "<string>",
"latitude": "<string>",
"longitude": "<string>",
"time_zone": "<string>",
"default": true,
"is_default": true
}Shopper Addresses
Update a shopper address
PATCH
/
api
/
platform
/
v1
/
shoppers
/
{shopper_ref}
/
addresses
/
{address_ref}
.json
Update a shopper address
curl --request PATCH \
--url https://api.bspk.com/api/platform/v1/shoppers/{shopper_ref}/addresses/{address_ref}.json \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"address": {
"external_id": "<string>",
"first_name": "<string>",
"last_name": "<string>",
"company_name": "<string>",
"address_1": "<string>",
"address_2": "<string>",
"address_3": "<string>",
"address_4": "<string>",
"city": "<string>",
"province": "<string>",
"province_code": "<string>",
"country": "<string>",
"country_code": "<string>",
"zip": "<string>",
"phone": "<string>",
"latitude": 123,
"longitude": 123,
"time_zone": "<string>",
"is_default": true
}
}
'import requests
url = "https://api.bspk.com/api/platform/v1/shoppers/{shopper_ref}/addresses/{address_ref}.json"
payload = { "address": {
"external_id": "<string>",
"first_name": "<string>",
"last_name": "<string>",
"company_name": "<string>",
"address_1": "<string>",
"address_2": "<string>",
"address_3": "<string>",
"address_4": "<string>",
"city": "<string>",
"province": "<string>",
"province_code": "<string>",
"country": "<string>",
"country_code": "<string>",
"zip": "<string>",
"phone": "<string>",
"latitude": 123,
"longitude": 123,
"time_zone": "<string>",
"is_default": True
} }
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.patch(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PATCH',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
address: {
external_id: '<string>',
first_name: '<string>',
last_name: '<string>',
company_name: '<string>',
address_1: '<string>',
address_2: '<string>',
address_3: '<string>',
address_4: '<string>',
city: '<string>',
province: '<string>',
province_code: '<string>',
country: '<string>',
country_code: '<string>',
zip: '<string>',
phone: '<string>',
latitude: 123,
longitude: 123,
time_zone: '<string>',
is_default: true
}
})
};
fetch('https://api.bspk.com/api/platform/v1/shoppers/{shopper_ref}/addresses/{address_ref}.json', 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://api.bspk.com/api/platform/v1/shoppers/{shopper_ref}/addresses/{address_ref}.json",
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([
'address' => [
'external_id' => '<string>',
'first_name' => '<string>',
'last_name' => '<string>',
'company_name' => '<string>',
'address_1' => '<string>',
'address_2' => '<string>',
'address_3' => '<string>',
'address_4' => '<string>',
'city' => '<string>',
'province' => '<string>',
'province_code' => '<string>',
'country' => '<string>',
'country_code' => '<string>',
'zip' => '<string>',
'phone' => '<string>',
'latitude' => 123,
'longitude' => 123,
'time_zone' => '<string>',
'is_default' => true
]
]),
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://api.bspk.com/api/platform/v1/shoppers/{shopper_ref}/addresses/{address_ref}.json"
payload := strings.NewReader("{\n \"address\": {\n \"external_id\": \"<string>\",\n \"first_name\": \"<string>\",\n \"last_name\": \"<string>\",\n \"company_name\": \"<string>\",\n \"address_1\": \"<string>\",\n \"address_2\": \"<string>\",\n \"address_3\": \"<string>\",\n \"address_4\": \"<string>\",\n \"city\": \"<string>\",\n \"province\": \"<string>\",\n \"province_code\": \"<string>\",\n \"country\": \"<string>\",\n \"country_code\": \"<string>\",\n \"zip\": \"<string>\",\n \"phone\": \"<string>\",\n \"latitude\": 123,\n \"longitude\": 123,\n \"time_zone\": \"<string>\",\n \"is_default\": true\n }\n}")
req, _ := http.NewRequest("PATCH", 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.patch("https://api.bspk.com/api/platform/v1/shoppers/{shopper_ref}/addresses/{address_ref}.json")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"address\": {\n \"external_id\": \"<string>\",\n \"first_name\": \"<string>\",\n \"last_name\": \"<string>\",\n \"company_name\": \"<string>\",\n \"address_1\": \"<string>\",\n \"address_2\": \"<string>\",\n \"address_3\": \"<string>\",\n \"address_4\": \"<string>\",\n \"city\": \"<string>\",\n \"province\": \"<string>\",\n \"province_code\": \"<string>\",\n \"country\": \"<string>\",\n \"country_code\": \"<string>\",\n \"zip\": \"<string>\",\n \"phone\": \"<string>\",\n \"latitude\": 123,\n \"longitude\": 123,\n \"time_zone\": \"<string>\",\n \"is_default\": true\n }\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.bspk.com/api/platform/v1/shoppers/{shopper_ref}/addresses/{address_ref}.json")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Patch.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"address\": {\n \"external_id\": \"<string>\",\n \"first_name\": \"<string>\",\n \"last_name\": \"<string>\",\n \"company_name\": \"<string>\",\n \"address_1\": \"<string>\",\n \"address_2\": \"<string>\",\n \"address_3\": \"<string>\",\n \"address_4\": \"<string>\",\n \"city\": \"<string>\",\n \"province\": \"<string>\",\n \"province_code\": \"<string>\",\n \"country\": \"<string>\",\n \"country_code\": \"<string>\",\n \"zip\": \"<string>\",\n \"phone\": \"<string>\",\n \"latitude\": 123,\n \"longitude\": 123,\n \"time_zone\": \"<string>\",\n \"is_default\": true\n }\n}"
response = http.request(request)
puts response.read_body{
"id": 123,
"external_id": "<string>",
"first_name": "<string>",
"last_name": "<string>",
"company": "<string>",
"address": "<string>",
"address_2": "<string>",
"address_3": "<string>",
"address_4": "<string>",
"city": "<string>",
"state": "<string>",
"province": "<string>",
"province_code": "<string>",
"country": "<string>",
"country_code": "<string>",
"zip": "<string>",
"phone": "<string>",
"latitude": "<string>",
"longitude": "<string>",
"time_zone": "<string>",
"default": true,
"is_default": true
}Authorizations
Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
Path Parameters
Shopper external ID
Address external ID
Body
application/json
Show child attributes
Show child attributes
Response
Address updated
⌘I
