Create Address
curl --request POST \
--url https://api.wizcommerce.com/v2/customers/{customer_id}/addresses \
--header 'Content-Type: application/json' \
--header 'X-API-Key: <api-key>' \
--data '
{
"reference_id": "ADDR123",
"address_line_1": "123 Main St",
"city": "Anytown",
"type": "billing",
"first_name": "John",
"last_name": "Doe",
"phone": "+14155552671",
"email": "john.doe@example.com",
"address_line_2": "Apt 101",
"state": "CA",
"country": "US",
"zip_code": "12345",
"is_default": true,
"attributes": [
{
"name": "1234567890",
"value": "red"
}
]
}
'import requests
url = "https://api.wizcommerce.com/v2/customers/{customer_id}/addresses"
payload = {
"reference_id": "ADDR123",
"address_line_1": "123 Main St",
"city": "Anytown",
"type": "billing",
"first_name": "John",
"last_name": "Doe",
"phone": "+14155552671",
"email": "john.doe@example.com",
"address_line_2": "Apt 101",
"state": "CA",
"country": "US",
"zip_code": "12345",
"is_default": True,
"attributes": [
{
"name": "1234567890",
"value": "red"
}
]
}
headers = {
"X-API-Key": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'X-API-Key': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
reference_id: 'ADDR123',
address_line_1: '123 Main St',
city: 'Anytown',
type: 'billing',
first_name: 'John',
last_name: 'Doe',
phone: '+14155552671',
email: 'john.doe@example.com',
address_line_2: 'Apt 101',
state: 'CA',
country: 'US',
zip_code: '12345',
is_default: true,
attributes: [{name: '1234567890', value: 'red'}]
})
};
fetch('https://api.wizcommerce.com/v2/customers/{customer_id}/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.wizcommerce.com/v2/customers/{customer_id}/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([
'reference_id' => 'ADDR123',
'address_line_1' => '123 Main St',
'city' => 'Anytown',
'type' => 'billing',
'first_name' => 'John',
'last_name' => 'Doe',
'phone' => '+14155552671',
'email' => 'john.doe@example.com',
'address_line_2' => 'Apt 101',
'state' => 'CA',
'country' => 'US',
'zip_code' => '12345',
'is_default' => true,
'attributes' => [
[
'name' => '1234567890',
'value' => 'red'
]
]
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"X-API-Key: <api-key>"
],
]);
$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.wizcommerce.com/v2/customers/{customer_id}/addresses"
payload := strings.NewReader("{\n \"reference_id\": \"ADDR123\",\n \"address_line_1\": \"123 Main St\",\n \"city\": \"Anytown\",\n \"type\": \"billing\",\n \"first_name\": \"John\",\n \"last_name\": \"Doe\",\n \"phone\": \"+14155552671\",\n \"email\": \"john.doe@example.com\",\n \"address_line_2\": \"Apt 101\",\n \"state\": \"CA\",\n \"country\": \"US\",\n \"zip_code\": \"12345\",\n \"is_default\": true,\n \"attributes\": [\n {\n \"name\": \"1234567890\",\n \"value\": \"red\"\n }\n ]\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("X-API-Key", "<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.wizcommerce.com/v2/customers/{customer_id}/addresses")
.header("X-API-Key", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"reference_id\": \"ADDR123\",\n \"address_line_1\": \"123 Main St\",\n \"city\": \"Anytown\",\n \"type\": \"billing\",\n \"first_name\": \"John\",\n \"last_name\": \"Doe\",\n \"phone\": \"+14155552671\",\n \"email\": \"john.doe@example.com\",\n \"address_line_2\": \"Apt 101\",\n \"state\": \"CA\",\n \"country\": \"US\",\n \"zip_code\": \"12345\",\n \"is_default\": true,\n \"attributes\": [\n {\n \"name\": \"1234567890\",\n \"value\": \"red\"\n }\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.wizcommerce.com/v2/customers/{customer_id}/addresses")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["X-API-Key"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"reference_id\": \"ADDR123\",\n \"address_line_1\": \"123 Main St\",\n \"city\": \"Anytown\",\n \"type\": \"billing\",\n \"first_name\": \"John\",\n \"last_name\": \"Doe\",\n \"phone\": \"+14155552671\",\n \"email\": \"john.doe@example.com\",\n \"address_line_2\": \"Apt 101\",\n \"state\": \"CA\",\n \"country\": \"US\",\n \"zip_code\": \"12345\",\n \"is_default\": true,\n \"attributes\": [\n {\n \"name\": \"1234567890\",\n \"value\": \"red\"\n }\n ]\n}"
response = http.request(request)
puts response.read_body{
"data": {
"id": "01f5d171-d3e3-4b2b-bd57-0727194b5bed",
"customer_id": "01f5d171-d3e3-4b2b-bd57-0727194b5bed",
"reference_id": "ADDR123",
"first_name": "John",
"last_name": "Doe",
"phone": "+14155552671",
"email": "john.doe@example.com",
"address_line_1": "123 Main St",
"address_line_2": "Apt 101",
"city": "Anytown",
"state": "CA",
"state_info": {
"code": "US-CA",
"short_code": "CA",
"name": "California"
},
"country": "USA",
"zip_code": "12345",
"type": "billing",
"is_default": false,
"attributes": [
{
"id": "01f5d171-d3e3-4b2b-bd57-0727194b5bed",
"name": "Color",
"value": "Red",
"created_by": "01f5d171-d3e3-4b2b-bd57-0727194b5bed",
"updated_by": "01f5d171-d3e3-4b2b-bd57-0727194b5bed",
"created_at": "2021-01-01T00:00:00Z",
"updated_at": "2021-01-01T00:00:00Z"
}
],
"created_at": "2025-01-01T15:04:05Z",
"updated_at": "2025-01-01T15:04:05Z"
}
}{
"code": "<string>",
"message": "<string>",
"details": [
{
"field": "<string>",
"reason": "<string>"
}
]
}{
"code": "<string>",
"message": "<string>",
"details": [
{
"field": "<string>",
"reason": "<string>"
}
]
}{
"code": "<string>",
"message": "<string>",
"details": [
{
"field": "<string>",
"reason": "<string>"
}
]
}{
"code": "<string>",
"message": "<string>",
"details": [
{
"field": "<string>",
"reason": "<string>"
}
]
}Address
Create Address
Create Address
POST
/
v2
/
customers
/
{customer_id}
/
addresses
Create Address
curl --request POST \
--url https://api.wizcommerce.com/v2/customers/{customer_id}/addresses \
--header 'Content-Type: application/json' \
--header 'X-API-Key: <api-key>' \
--data '
{
"reference_id": "ADDR123",
"address_line_1": "123 Main St",
"city": "Anytown",
"type": "billing",
"first_name": "John",
"last_name": "Doe",
"phone": "+14155552671",
"email": "john.doe@example.com",
"address_line_2": "Apt 101",
"state": "CA",
"country": "US",
"zip_code": "12345",
"is_default": true,
"attributes": [
{
"name": "1234567890",
"value": "red"
}
]
}
'import requests
url = "https://api.wizcommerce.com/v2/customers/{customer_id}/addresses"
payload = {
"reference_id": "ADDR123",
"address_line_1": "123 Main St",
"city": "Anytown",
"type": "billing",
"first_name": "John",
"last_name": "Doe",
"phone": "+14155552671",
"email": "john.doe@example.com",
"address_line_2": "Apt 101",
"state": "CA",
"country": "US",
"zip_code": "12345",
"is_default": True,
"attributes": [
{
"name": "1234567890",
"value": "red"
}
]
}
headers = {
"X-API-Key": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'X-API-Key': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
reference_id: 'ADDR123',
address_line_1: '123 Main St',
city: 'Anytown',
type: 'billing',
first_name: 'John',
last_name: 'Doe',
phone: '+14155552671',
email: 'john.doe@example.com',
address_line_2: 'Apt 101',
state: 'CA',
country: 'US',
zip_code: '12345',
is_default: true,
attributes: [{name: '1234567890', value: 'red'}]
})
};
fetch('https://api.wizcommerce.com/v2/customers/{customer_id}/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.wizcommerce.com/v2/customers/{customer_id}/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([
'reference_id' => 'ADDR123',
'address_line_1' => '123 Main St',
'city' => 'Anytown',
'type' => 'billing',
'first_name' => 'John',
'last_name' => 'Doe',
'phone' => '+14155552671',
'email' => 'john.doe@example.com',
'address_line_2' => 'Apt 101',
'state' => 'CA',
'country' => 'US',
'zip_code' => '12345',
'is_default' => true,
'attributes' => [
[
'name' => '1234567890',
'value' => 'red'
]
]
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"X-API-Key: <api-key>"
],
]);
$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.wizcommerce.com/v2/customers/{customer_id}/addresses"
payload := strings.NewReader("{\n \"reference_id\": \"ADDR123\",\n \"address_line_1\": \"123 Main St\",\n \"city\": \"Anytown\",\n \"type\": \"billing\",\n \"first_name\": \"John\",\n \"last_name\": \"Doe\",\n \"phone\": \"+14155552671\",\n \"email\": \"john.doe@example.com\",\n \"address_line_2\": \"Apt 101\",\n \"state\": \"CA\",\n \"country\": \"US\",\n \"zip_code\": \"12345\",\n \"is_default\": true,\n \"attributes\": [\n {\n \"name\": \"1234567890\",\n \"value\": \"red\"\n }\n ]\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("X-API-Key", "<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.wizcommerce.com/v2/customers/{customer_id}/addresses")
.header("X-API-Key", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"reference_id\": \"ADDR123\",\n \"address_line_1\": \"123 Main St\",\n \"city\": \"Anytown\",\n \"type\": \"billing\",\n \"first_name\": \"John\",\n \"last_name\": \"Doe\",\n \"phone\": \"+14155552671\",\n \"email\": \"john.doe@example.com\",\n \"address_line_2\": \"Apt 101\",\n \"state\": \"CA\",\n \"country\": \"US\",\n \"zip_code\": \"12345\",\n \"is_default\": true,\n \"attributes\": [\n {\n \"name\": \"1234567890\",\n \"value\": \"red\"\n }\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.wizcommerce.com/v2/customers/{customer_id}/addresses")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["X-API-Key"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"reference_id\": \"ADDR123\",\n \"address_line_1\": \"123 Main St\",\n \"city\": \"Anytown\",\n \"type\": \"billing\",\n \"first_name\": \"John\",\n \"last_name\": \"Doe\",\n \"phone\": \"+14155552671\",\n \"email\": \"john.doe@example.com\",\n \"address_line_2\": \"Apt 101\",\n \"state\": \"CA\",\n \"country\": \"US\",\n \"zip_code\": \"12345\",\n \"is_default\": true,\n \"attributes\": [\n {\n \"name\": \"1234567890\",\n \"value\": \"red\"\n }\n ]\n}"
response = http.request(request)
puts response.read_body{
"data": {
"id": "01f5d171-d3e3-4b2b-bd57-0727194b5bed",
"customer_id": "01f5d171-d3e3-4b2b-bd57-0727194b5bed",
"reference_id": "ADDR123",
"first_name": "John",
"last_name": "Doe",
"phone": "+14155552671",
"email": "john.doe@example.com",
"address_line_1": "123 Main St",
"address_line_2": "Apt 101",
"city": "Anytown",
"state": "CA",
"state_info": {
"code": "US-CA",
"short_code": "CA",
"name": "California"
},
"country": "USA",
"zip_code": "12345",
"type": "billing",
"is_default": false,
"attributes": [
{
"id": "01f5d171-d3e3-4b2b-bd57-0727194b5bed",
"name": "Color",
"value": "Red",
"created_by": "01f5d171-d3e3-4b2b-bd57-0727194b5bed",
"updated_by": "01f5d171-d3e3-4b2b-bd57-0727194b5bed",
"created_at": "2021-01-01T00:00:00Z",
"updated_at": "2021-01-01T00:00:00Z"
}
],
"created_at": "2025-01-01T15:04:05Z",
"updated_at": "2025-01-01T15:04:05Z"
}
}{
"code": "<string>",
"message": "<string>",
"details": [
{
"field": "<string>",
"reason": "<string>"
}
]
}{
"code": "<string>",
"message": "<string>",
"details": [
{
"field": "<string>",
"reason": "<string>"
}
]
}{
"code": "<string>",
"message": "<string>",
"details": [
{
"field": "<string>",
"reason": "<string>"
}
]
}{
"code": "<string>",
"message": "<string>",
"details": [
{
"field": "<string>",
"reason": "<string>"
}
]
}Authorizations
API Key for authentication
Path Parameters
customer_id
Body
application/json
request
Maximum string length:
255Example:
"ADDR123"
Maximum string length:
255Example:
"123 Main St"
Maximum string length:
50Example:
"Anytown"
Available options:
billing, shipping Example:
"billing"
Maximum string length:
50Example:
"John"
Maximum string length:
50Example:
"Doe"
Example:
"+14155552671"
Example:
"john.doe@example.com"
Maximum string length:
255Example:
"Apt 101"
Maximum string length:
50Example:
"CA"
Example:
"US"
Maximum string length:
50Example:
"12345"
When true, this becomes the default address for its type.
Show child attributes
Show child attributes
Response
Created
Show child attributes
Show child attributes
Was this page helpful?
⌘I
