Skip to main content
POST
/
v2
/
addresses
curl
curl -i -X POST \
https://api.goshippo.com/v2/addresses \
-H 'Authorization: ShippoToken <API_TOKEN>' \
-H 'Content-Type: application/json' \
-d '{
  "name": "Wilson",
  "organization": "Shippo",
  "email": "user@shippo.com",
  "phone": "+1-4155550132",
  "address_line_1": "731 Market Street",
  "address_line_2": "#200",
  "city_locality": "San Francisco",
  "state_province": "CA",
  "postal_code": "94103",
  "country_code": "US",
  "address_type": "residential"
}'
import requests

url = "https://api.goshippo.com/v2/addresses"

payload = {
"name": "Wilson",
"address_line_1": "731 Market Street",
"country_code": "US",
"organization": "Shippo",
"email": "user@shippo.com",
"phone": "+1-4155550132",
"address_line_2": "#200",
"city_locality": "San Francisco",
"state_province": "CA",
"postal_code": "94103",
"address_type": "residential"
}
headers = {
"Authorization": "<api-key>",
"Content-Type": "application/json"
}

response = requests.post(url, json=payload, headers=headers)

print(response.text)
const options = {
method: 'POST',
headers: {Authorization: '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
name: 'Wilson',
address_line_1: '731 Market Street',
country_code: 'US',
organization: 'Shippo',
email: 'user@shippo.com',
phone: '+1-4155550132',
address_line_2: '#200',
city_locality: 'San Francisco',
state_province: 'CA',
postal_code: '94103',
address_type: 'residential'
})
};

fetch('https://api.goshippo.com/v2/addresses', 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.goshippo.com/v2/addresses",
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' => 'Wilson',
'address_line_1' => '731 Market Street',
'country_code' => 'US',
'organization' => 'Shippo',
'email' => 'user@shippo.com',
'phone' => '+1-4155550132',
'address_line_2' => '#200',
'city_locality' => 'San Francisco',
'state_province' => 'CA',
'postal_code' => '94103',
'address_type' => 'residential'
]),
CURLOPT_HTTPHEADER => [
"Authorization: <api-key>",
"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.goshippo.com/v2/addresses"

payload := strings.NewReader("{\n \"name\": \"Wilson\",\n \"address_line_1\": \"731 Market Street\",\n \"country_code\": \"US\",\n \"organization\": \"Shippo\",\n \"email\": \"user@shippo.com\",\n \"phone\": \"+1-4155550132\",\n \"address_line_2\": \"#200\",\n \"city_locality\": \"San Francisco\",\n \"state_province\": \"CA\",\n \"postal_code\": \"94103\",\n \"address_type\": \"residential\"\n}")

req, _ := http.NewRequest("POST", url, payload)

req.Header.Add("Authorization", "<api-key>")
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://api.goshippo.com/v2/addresses")
.header("Authorization", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"name\": \"Wilson\",\n \"address_line_1\": \"731 Market Street\",\n \"country_code\": \"US\",\n \"organization\": \"Shippo\",\n \"email\": \"user@shippo.com\",\n \"phone\": \"+1-4155550132\",\n \"address_line_2\": \"#200\",\n \"city_locality\": \"San Francisco\",\n \"state_province\": \"CA\",\n \"postal_code\": \"94103\",\n \"address_type\": \"residential\"\n}")
.asString();
require 'uri'
require 'net/http'

url = URI("https://api.goshippo.com/v2/addresses")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Post.new(url)
request["Authorization"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"name\": \"Wilson\",\n \"address_line_1\": \"731 Market Street\",\n \"country_code\": \"US\",\n \"organization\": \"Shippo\",\n \"email\": \"user@shippo.com\",\n \"phone\": \"+1-4155550132\",\n \"address_line_2\": \"#200\",\n \"city_locality\": \"San Francisco\",\n \"state_province\": \"CA\",\n \"postal_code\": \"94103\",\n \"address_type\": \"residential\"\n}"

response = http.request(request)
puts response.read_body
{
  "id": "e9f1f6fd20f84982afe471ff06c5a80f",
  "address": {
    "name": "Wilson",
    "address_line_1": "731 Market Street",
    "country_code": "US",
    "email": "user@shippo.com",
    "phone": "+1-4155550132",
    "organization": "Shippo",
    "address_line_2": "#200",
    "city_locality": "San Francisco",
    "state_province": "CA",
    "postal_code": "94103",
    "address_type": "residential"
  },
  "updated_at": "2023-11-07T05:31:56Z",
  "created_at": "2023-11-07T05:31:56Z"
}

Authorizations

Authorization
string
header
default:ShippoToken
required

Enter your shippo token with the ShippoToken prefix.

Example: ShippoToken shippo_live_xxxx

Body

application/json
name
string
required

The name of the addressee

Maximum string length: 64
Example:

"Wilson"

address_line_1
string
required

The first line of the address

Required string length: 1 - 100
Example:

"731 Market Street"

country_code
string
required

The ISO 3166 country code

Required string length: 2
Example:

"US"

organization
string | null

The organization of the addressee

Maximum string length: 100
Example:

"Shippo"

email
string<email> | null

The email of the addressee

Required string length: 5 - 128
Example:

"user@shippo.com"

phone
string | null

The phone number of the addressee

Required string length: 3 - 32
Example:

"+1-4155550132"

address_line_2
string | null

The second line of the address. Must be percent encoded when passed as a query parameter (e.g. #200%23200).

Maximum string length: 50
Example:

"#200"

city_locality
string | null

The city or locality of the address

Maximum string length: 64
Example:

"San Francisco"

state_province
string | null

The state, province, county, or municipal division

Maximum string length: 32
Example:

"CA"

postal_code
string

The postal code or zip code

Maximum string length: 16
Example:

"94103"

address_type
enum<string>
default:unknown

The category of the address. It may affect how certain carriers charge for a delivery/pickup.It is recommended to specify it, if it is known.

Available options:
unknown,
residential,
commercial,
po_box,
military
Example:

"residential"

Response

Successful Response

id
string
required
Example:

"e9f1f6fd20f84982afe471ff06c5a80f"

address
Address · object
required
updated_at
string<date-time>
required
created_at
string<date-time>
required