Shipping Addresses
Update
Update a shipping address.
PUT
/
shipping
/
update
/
{id}
Update
curl --request PUT \
--url https://api.buybase.ai/shipping/update/{id} \
--header 'Content-Type: application/json' \
--header 'authorization: <authorization>' \
--data '
{
"shipping_address": {
"first_name": "<string>",
"last_name": "<string>",
"email": "<string>",
"phone": "<string>",
"address_1": "<string>",
"address_2": "<string>",
"city": "<string>",
"country_code": "<string>",
"province_code": "<string>",
"postal_code": "<string>"
}
}
'import requests
url = "https://api.buybase.ai/shipping/update/{id}"
payload = { "shipping_address": {
"first_name": "<string>",
"last_name": "<string>",
"email": "<string>",
"phone": "<string>",
"address_1": "<string>",
"address_2": "<string>",
"city": "<string>",
"country_code": "<string>",
"province_code": "<string>",
"postal_code": "<string>"
} }
headers = {
"authorization": "<authorization>",
"Content-Type": "application/json"
}
response = requests.put(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PUT',
headers: {authorization: '<authorization>', 'Content-Type': 'application/json'},
body: JSON.stringify({
shipping_address: {
first_name: '<string>',
last_name: '<string>',
email: '<string>',
phone: '<string>',
address_1: '<string>',
address_2: '<string>',
city: '<string>',
country_code: '<string>',
province_code: '<string>',
postal_code: '<string>'
}
})
};
fetch('https://api.buybase.ai/shipping/update/{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://api.buybase.ai/shipping/update/{id}",
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([
'shipping_address' => [
'first_name' => '<string>',
'last_name' => '<string>',
'email' => '<string>',
'phone' => '<string>',
'address_1' => '<string>',
'address_2' => '<string>',
'city' => '<string>',
'country_code' => '<string>',
'province_code' => '<string>',
'postal_code' => '<string>'
]
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"authorization: <authorization>"
],
]);
$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.buybase.ai/shipping/update/{id}"
payload := strings.NewReader("{\n \"shipping_address\": {\n \"first_name\": \"<string>\",\n \"last_name\": \"<string>\",\n \"email\": \"<string>\",\n \"phone\": \"<string>\",\n \"address_1\": \"<string>\",\n \"address_2\": \"<string>\",\n \"city\": \"<string>\",\n \"country_code\": \"<string>\",\n \"province_code\": \"<string>\",\n \"postal_code\": \"<string>\"\n }\n}")
req, _ := http.NewRequest("PUT", url, payload)
req.Header.Add("authorization", "<authorization>")
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://api.buybase.ai/shipping/update/{id}")
.header("authorization", "<authorization>")
.header("Content-Type", "application/json")
.body("{\n \"shipping_address\": {\n \"first_name\": \"<string>\",\n \"last_name\": \"<string>\",\n \"email\": \"<string>\",\n \"phone\": \"<string>\",\n \"address_1\": \"<string>\",\n \"address_2\": \"<string>\",\n \"city\": \"<string>\",\n \"country_code\": \"<string>\",\n \"province_code\": \"<string>\",\n \"postal_code\": \"<string>\"\n }\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.buybase.ai/shipping/update/{id}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Put.new(url)
request["authorization"] = '<authorization>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"shipping_address\": {\n \"first_name\": \"<string>\",\n \"last_name\": \"<string>\",\n \"email\": \"<string>\",\n \"phone\": \"<string>\",\n \"address_1\": \"<string>\",\n \"address_2\": \"<string>\",\n \"city\": \"<string>\",\n \"country_code\": \"<string>\",\n \"province_code\": \"<string>\",\n \"postal_code\": \"<string>\"\n }\n}"
response = http.request(request)
puts response.read_body{
"success": true,
"shipping": {
"id": "ship_12345",
"first_name": "John",
"last_name": "Smith",
"email": "john.smith@example.com",
"phone": "+1234567890",
"address_1": "456 Park Ave",
"address_2": "Suite 789",
"city": "New York",
"country_code": "US",
"province_code": "NY",
"postal_code": "10022",
"profile_id": "prof_67890",
"updated_at": "2023-09-16T10:15:22Z"
},
"id": "ship_12345",
"code": "SHIPPING_UPDATED"
}
Headers
string
required
Your API key for authorization.
Path Parameters
string
required
The ID of the shipping address to update.
Body Parameters
object
required
Show Shipping Address Object
Show Shipping Address Object
string
required
First name of the recipient.
string
required
Last name of the recipient.
string
required
Email address of the recipient.
string
required
Phone number of the recipient.
string
required
Primary address line.
string
Secondary address line (optional).
string
required
City name.
string
required
Country code (e.g., US, CA).
string
required
Province or state code.
string
required
Postal or ZIP code.
Response
boolean
Indicates whether the operation was successful.
object
The updated shipping address object containing:
Show Shipping address properties
Show Shipping address properties
string
The unique identifier for the shipping address.
string
First name of the recipient.
string
Last name of the recipient.
string
Email address of the recipient.
string
Phone number of the recipient.
string
Primary address line.
string
Secondary address line (if provided).
string
City name.
string
Country code (e.g., US, CA).
string
Province or state code.
string
Postal or ZIP code.
string
The ID of the profile this shipping address is attached to.
string
Timestamp when the shipping address was created.
string
Timestamp when the shipping address was last updated.
string
A code indicating the result of the operation. Possible values:
SHIPPING_UPDATED: Shipping address updated successfullySHIPPING_UPDATE_FAILED: Failed to update shipping address
string
Error message if the request fails.
When updating a shipping address, you need to provide the complete shipping address object with all fields, even those that haven’t changed.
{
"success": true,
"shipping": {
"id": "ship_12345",
"first_name": "John",
"last_name": "Smith",
"email": "john.smith@example.com",
"phone": "+1234567890",
"address_1": "456 Park Ave",
"address_2": "Suite 789",
"city": "New York",
"country_code": "US",
"province_code": "NY",
"postal_code": "10022",
"profile_id": "prof_67890",
"updated_at": "2023-09-16T10:15:22Z"
},
"id": "ship_12345",
"code": "SHIPPING_UPDATED"
}
⌘I
Update
curl --request PUT \
--url https://api.buybase.ai/shipping/update/{id} \
--header 'Content-Type: application/json' \
--header 'authorization: <authorization>' \
--data '
{
"shipping_address": {
"first_name": "<string>",
"last_name": "<string>",
"email": "<string>",
"phone": "<string>",
"address_1": "<string>",
"address_2": "<string>",
"city": "<string>",
"country_code": "<string>",
"province_code": "<string>",
"postal_code": "<string>"
}
}
'import requests
url = "https://api.buybase.ai/shipping/update/{id}"
payload = { "shipping_address": {
"first_name": "<string>",
"last_name": "<string>",
"email": "<string>",
"phone": "<string>",
"address_1": "<string>",
"address_2": "<string>",
"city": "<string>",
"country_code": "<string>",
"province_code": "<string>",
"postal_code": "<string>"
} }
headers = {
"authorization": "<authorization>",
"Content-Type": "application/json"
}
response = requests.put(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PUT',
headers: {authorization: '<authorization>', 'Content-Type': 'application/json'},
body: JSON.stringify({
shipping_address: {
first_name: '<string>',
last_name: '<string>',
email: '<string>',
phone: '<string>',
address_1: '<string>',
address_2: '<string>',
city: '<string>',
country_code: '<string>',
province_code: '<string>',
postal_code: '<string>'
}
})
};
fetch('https://api.buybase.ai/shipping/update/{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://api.buybase.ai/shipping/update/{id}",
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([
'shipping_address' => [
'first_name' => '<string>',
'last_name' => '<string>',
'email' => '<string>',
'phone' => '<string>',
'address_1' => '<string>',
'address_2' => '<string>',
'city' => '<string>',
'country_code' => '<string>',
'province_code' => '<string>',
'postal_code' => '<string>'
]
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"authorization: <authorization>"
],
]);
$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.buybase.ai/shipping/update/{id}"
payload := strings.NewReader("{\n \"shipping_address\": {\n \"first_name\": \"<string>\",\n \"last_name\": \"<string>\",\n \"email\": \"<string>\",\n \"phone\": \"<string>\",\n \"address_1\": \"<string>\",\n \"address_2\": \"<string>\",\n \"city\": \"<string>\",\n \"country_code\": \"<string>\",\n \"province_code\": \"<string>\",\n \"postal_code\": \"<string>\"\n }\n}")
req, _ := http.NewRequest("PUT", url, payload)
req.Header.Add("authorization", "<authorization>")
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://api.buybase.ai/shipping/update/{id}")
.header("authorization", "<authorization>")
.header("Content-Type", "application/json")
.body("{\n \"shipping_address\": {\n \"first_name\": \"<string>\",\n \"last_name\": \"<string>\",\n \"email\": \"<string>\",\n \"phone\": \"<string>\",\n \"address_1\": \"<string>\",\n \"address_2\": \"<string>\",\n \"city\": \"<string>\",\n \"country_code\": \"<string>\",\n \"province_code\": \"<string>\",\n \"postal_code\": \"<string>\"\n }\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.buybase.ai/shipping/update/{id}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Put.new(url)
request["authorization"] = '<authorization>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"shipping_address\": {\n \"first_name\": \"<string>\",\n \"last_name\": \"<string>\",\n \"email\": \"<string>\",\n \"phone\": \"<string>\",\n \"address_1\": \"<string>\",\n \"address_2\": \"<string>\",\n \"city\": \"<string>\",\n \"country_code\": \"<string>\",\n \"province_code\": \"<string>\",\n \"postal_code\": \"<string>\"\n }\n}"
response = http.request(request)
puts response.read_body{
"success": true,
"shipping": {
"id": "ship_12345",
"first_name": "John",
"last_name": "Smith",
"email": "john.smith@example.com",
"phone": "+1234567890",
"address_1": "456 Park Ave",
"address_2": "Suite 789",
"city": "New York",
"country_code": "US",
"province_code": "NY",
"postal_code": "10022",
"profile_id": "prof_67890",
"updated_at": "2023-09-16T10:15:22Z"
},
"id": "ship_12345",
"code": "SHIPPING_UPDATED"
}