Create Customer
curl --request POST \
--url https://api.wizcommerce.com/v2/customers \
--header 'Content-Type: application/json' \
--header 'X-API-Key: <api-key>' \
--data '
{
"reference_id": "CUS123",
"assigned_sales_rep_ids": [
"<string>"
],
"assigned_price_list_id": "<string>",
"company_name": "Company Name",
"display_name": "Customer Display Name",
"display_id": "1234567890",
"freight_term": "<string>",
"shipping_method": "<string>",
"payment_mode": "<string>",
"payment_term": "<string>",
"first_name": "John",
"last_name": "Doe",
"phone": "+14155552671",
"email": "john.doe@example.com",
"addresses": [
{
"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"
}
]
}
],
"contacts": [
{
"reference_id": "CUS123",
"first_name": "John",
"last_name": "Doe",
"email": "john.doe@example.com",
"phone": "+14155552671",
"designation": "Sales Manager",
"is_default": true,
"attributes": [
{
"name": "1234567890",
"value": "red"
}
]
}
],
"attributes": [
{
"name": "1234567890",
"value": "red"
}
],
"tax_rate": 0,
"customer_type": "retail"
}
'import requests
url = "https://api.wizcommerce.com/v2/customers"
payload = {
"reference_id": "CUS123",
"assigned_sales_rep_ids": ["<string>"],
"assigned_price_list_id": "<string>",
"company_name": "Company Name",
"display_name": "Customer Display Name",
"display_id": "1234567890",
"freight_term": "<string>",
"shipping_method": "<string>",
"payment_mode": "<string>",
"payment_term": "<string>",
"first_name": "John",
"last_name": "Doe",
"phone": "+14155552671",
"email": "john.doe@example.com",
"addresses": [
{
"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"
}
]
}
],
"contacts": [
{
"reference_id": "CUS123",
"first_name": "John",
"last_name": "Doe",
"email": "john.doe@example.com",
"phone": "+14155552671",
"designation": "Sales Manager",
"is_default": True,
"attributes": [
{
"name": "1234567890",
"value": "red"
}
]
}
],
"attributes": [
{
"name": "1234567890",
"value": "red"
}
],
"tax_rate": 0,
"customer_type": "retail"
}
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: 'CUS123',
assigned_sales_rep_ids: ['<string>'],
assigned_price_list_id: '<string>',
company_name: 'Company Name',
display_name: 'Customer Display Name',
display_id: '1234567890',
freight_term: '<string>',
shipping_method: '<string>',
payment_mode: '<string>',
payment_term: '<string>',
first_name: 'John',
last_name: 'Doe',
phone: '+14155552671',
email: 'john.doe@example.com',
addresses: [
{
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'}]
}
],
contacts: [
{
reference_id: 'CUS123',
first_name: 'John',
last_name: 'Doe',
email: 'john.doe@example.com',
phone: '+14155552671',
designation: 'Sales Manager',
is_default: true,
attributes: [{name: '1234567890', value: 'red'}]
}
],
attributes: [{name: '1234567890', value: 'red'}],
tax_rate: 0,
customer_type: 'retail'
})
};
fetch('https://api.wizcommerce.com/v2/customers', 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",
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' => 'CUS123',
'assigned_sales_rep_ids' => [
'<string>'
],
'assigned_price_list_id' => '<string>',
'company_name' => 'Company Name',
'display_name' => 'Customer Display Name',
'display_id' => '1234567890',
'freight_term' => '<string>',
'shipping_method' => '<string>',
'payment_mode' => '<string>',
'payment_term' => '<string>',
'first_name' => 'John',
'last_name' => 'Doe',
'phone' => '+14155552671',
'email' => 'john.doe@example.com',
'addresses' => [
[
'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'
]
]
]
],
'contacts' => [
[
'reference_id' => 'CUS123',
'first_name' => 'John',
'last_name' => 'Doe',
'email' => 'john.doe@example.com',
'phone' => '+14155552671',
'designation' => 'Sales Manager',
'is_default' => true,
'attributes' => [
[
'name' => '1234567890',
'value' => 'red'
]
]
]
],
'attributes' => [
[
'name' => '1234567890',
'value' => 'red'
]
],
'tax_rate' => 0,
'customer_type' => 'retail'
]),
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"
payload := strings.NewReader("{\n \"reference_id\": \"CUS123\",\n \"assigned_sales_rep_ids\": [\n \"<string>\"\n ],\n \"assigned_price_list_id\": \"<string>\",\n \"company_name\": \"Company Name\",\n \"display_name\": \"Customer Display Name\",\n \"display_id\": \"1234567890\",\n \"freight_term\": \"<string>\",\n \"shipping_method\": \"<string>\",\n \"payment_mode\": \"<string>\",\n \"payment_term\": \"<string>\",\n \"first_name\": \"John\",\n \"last_name\": \"Doe\",\n \"phone\": \"+14155552671\",\n \"email\": \"john.doe@example.com\",\n \"addresses\": [\n {\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 }\n ],\n \"contacts\": [\n {\n \"reference_id\": \"CUS123\",\n \"first_name\": \"John\",\n \"last_name\": \"Doe\",\n \"email\": \"john.doe@example.com\",\n \"phone\": \"+14155552671\",\n \"designation\": \"Sales Manager\",\n \"is_default\": true,\n \"attributes\": [\n {\n \"name\": \"1234567890\",\n \"value\": \"red\"\n }\n ]\n }\n ],\n \"attributes\": [\n {\n \"name\": \"1234567890\",\n \"value\": \"red\"\n }\n ],\n \"tax_rate\": 0,\n \"customer_type\": \"retail\"\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")
.header("X-API-Key", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"reference_id\": \"CUS123\",\n \"assigned_sales_rep_ids\": [\n \"<string>\"\n ],\n \"assigned_price_list_id\": \"<string>\",\n \"company_name\": \"Company Name\",\n \"display_name\": \"Customer Display Name\",\n \"display_id\": \"1234567890\",\n \"freight_term\": \"<string>\",\n \"shipping_method\": \"<string>\",\n \"payment_mode\": \"<string>\",\n \"payment_term\": \"<string>\",\n \"first_name\": \"John\",\n \"last_name\": \"Doe\",\n \"phone\": \"+14155552671\",\n \"email\": \"john.doe@example.com\",\n \"addresses\": [\n {\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 }\n ],\n \"contacts\": [\n {\n \"reference_id\": \"CUS123\",\n \"first_name\": \"John\",\n \"last_name\": \"Doe\",\n \"email\": \"john.doe@example.com\",\n \"phone\": \"+14155552671\",\n \"designation\": \"Sales Manager\",\n \"is_default\": true,\n \"attributes\": [\n {\n \"name\": \"1234567890\",\n \"value\": \"red\"\n }\n ]\n }\n ],\n \"attributes\": [\n {\n \"name\": \"1234567890\",\n \"value\": \"red\"\n }\n ],\n \"tax_rate\": 0,\n \"customer_type\": \"retail\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.wizcommerce.com/v2/customers")
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\": \"CUS123\",\n \"assigned_sales_rep_ids\": [\n \"<string>\"\n ],\n \"assigned_price_list_id\": \"<string>\",\n \"company_name\": \"Company Name\",\n \"display_name\": \"Customer Display Name\",\n \"display_id\": \"1234567890\",\n \"freight_term\": \"<string>\",\n \"shipping_method\": \"<string>\",\n \"payment_mode\": \"<string>\",\n \"payment_term\": \"<string>\",\n \"first_name\": \"John\",\n \"last_name\": \"Doe\",\n \"phone\": \"+14155552671\",\n \"email\": \"john.doe@example.com\",\n \"addresses\": [\n {\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 }\n ],\n \"contacts\": [\n {\n \"reference_id\": \"CUS123\",\n \"first_name\": \"John\",\n \"last_name\": \"Doe\",\n \"email\": \"john.doe@example.com\",\n \"phone\": \"+14155552671\",\n \"designation\": \"Sales Manager\",\n \"is_default\": true,\n \"attributes\": [\n {\n \"name\": \"1234567890\",\n \"value\": \"red\"\n }\n ]\n }\n ],\n \"attributes\": [\n {\n \"name\": \"1234567890\",\n \"value\": \"red\"\n }\n ],\n \"tax_rate\": 0,\n \"customer_type\": \"retail\"\n}"
response = http.request(request)
puts response.read_body{
"data": {
"id": "01f5d171-d3e3-4b2b-bd57-0727194b5bed",
"reference_id": "1234567890",
"display_id": "WC_1234567890",
"name": "Customer Name",
"display_name": "Customer Display Name",
"first_name": "John",
"last_name": "Doe",
"phone": "+14155552671",
"email": "john.doe@example.com",
"freight_term": "Cust. Pickup",
"shipping_method": "DHL",
"payment_mode": "AMEX",
"payment_term": "NET30",
"assigned_sales_reps": [
{
"id": "01f5d171-d3e3-4b2b-bd57-0727194b5bed",
"email": "john.doe@example.com",
"first_name": "John",
"last_name": "Doe",
"phone": "+14155552671",
"department": "Sales",
"status": "active",
"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"
}
],
"assigned_price_list": {
"id": "0c05a9a7-84ed-46f0-819b-653545730920",
"name": "Price List 1",
"status": "active",
"reference_id": "PRC-20250101",
"description": "Price List 1 Description",
"created_at": "2025-01-01T00:00:00Z",
"updated_at": "2025-01-01T00:00:00Z"
},
"addresses": [
{
"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"
}
],
"contacts": [
{
"id": "0c05a9a7-84ed-46f0-819b-653545730920",
"reference_id": "CUS123",
"first_name": "John",
"last_name": "Doe",
"email": "john.doe@example.com",
"phone": "+14155552671",
"designation": "Sales Manager",
"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"
}
],
"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"
}
],
"tax_rate": 0,
"customer_type": "customer",
"status": "active",
"source": "openapi",
"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>"
}
]
}Customer
Create Customer
Create Customer
POST
/
v2
/
customers
Create Customer
curl --request POST \
--url https://api.wizcommerce.com/v2/customers \
--header 'Content-Type: application/json' \
--header 'X-API-Key: <api-key>' \
--data '
{
"reference_id": "CUS123",
"assigned_sales_rep_ids": [
"<string>"
],
"assigned_price_list_id": "<string>",
"company_name": "Company Name",
"display_name": "Customer Display Name",
"display_id": "1234567890",
"freight_term": "<string>",
"shipping_method": "<string>",
"payment_mode": "<string>",
"payment_term": "<string>",
"first_name": "John",
"last_name": "Doe",
"phone": "+14155552671",
"email": "john.doe@example.com",
"addresses": [
{
"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"
}
]
}
],
"contacts": [
{
"reference_id": "CUS123",
"first_name": "John",
"last_name": "Doe",
"email": "john.doe@example.com",
"phone": "+14155552671",
"designation": "Sales Manager",
"is_default": true,
"attributes": [
{
"name": "1234567890",
"value": "red"
}
]
}
],
"attributes": [
{
"name": "1234567890",
"value": "red"
}
],
"tax_rate": 0,
"customer_type": "retail"
}
'import requests
url = "https://api.wizcommerce.com/v2/customers"
payload = {
"reference_id": "CUS123",
"assigned_sales_rep_ids": ["<string>"],
"assigned_price_list_id": "<string>",
"company_name": "Company Name",
"display_name": "Customer Display Name",
"display_id": "1234567890",
"freight_term": "<string>",
"shipping_method": "<string>",
"payment_mode": "<string>",
"payment_term": "<string>",
"first_name": "John",
"last_name": "Doe",
"phone": "+14155552671",
"email": "john.doe@example.com",
"addresses": [
{
"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"
}
]
}
],
"contacts": [
{
"reference_id": "CUS123",
"first_name": "John",
"last_name": "Doe",
"email": "john.doe@example.com",
"phone": "+14155552671",
"designation": "Sales Manager",
"is_default": True,
"attributes": [
{
"name": "1234567890",
"value": "red"
}
]
}
],
"attributes": [
{
"name": "1234567890",
"value": "red"
}
],
"tax_rate": 0,
"customer_type": "retail"
}
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: 'CUS123',
assigned_sales_rep_ids: ['<string>'],
assigned_price_list_id: '<string>',
company_name: 'Company Name',
display_name: 'Customer Display Name',
display_id: '1234567890',
freight_term: '<string>',
shipping_method: '<string>',
payment_mode: '<string>',
payment_term: '<string>',
first_name: 'John',
last_name: 'Doe',
phone: '+14155552671',
email: 'john.doe@example.com',
addresses: [
{
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'}]
}
],
contacts: [
{
reference_id: 'CUS123',
first_name: 'John',
last_name: 'Doe',
email: 'john.doe@example.com',
phone: '+14155552671',
designation: 'Sales Manager',
is_default: true,
attributes: [{name: '1234567890', value: 'red'}]
}
],
attributes: [{name: '1234567890', value: 'red'}],
tax_rate: 0,
customer_type: 'retail'
})
};
fetch('https://api.wizcommerce.com/v2/customers', 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",
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' => 'CUS123',
'assigned_sales_rep_ids' => [
'<string>'
],
'assigned_price_list_id' => '<string>',
'company_name' => 'Company Name',
'display_name' => 'Customer Display Name',
'display_id' => '1234567890',
'freight_term' => '<string>',
'shipping_method' => '<string>',
'payment_mode' => '<string>',
'payment_term' => '<string>',
'first_name' => 'John',
'last_name' => 'Doe',
'phone' => '+14155552671',
'email' => 'john.doe@example.com',
'addresses' => [
[
'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'
]
]
]
],
'contacts' => [
[
'reference_id' => 'CUS123',
'first_name' => 'John',
'last_name' => 'Doe',
'email' => 'john.doe@example.com',
'phone' => '+14155552671',
'designation' => 'Sales Manager',
'is_default' => true,
'attributes' => [
[
'name' => '1234567890',
'value' => 'red'
]
]
]
],
'attributes' => [
[
'name' => '1234567890',
'value' => 'red'
]
],
'tax_rate' => 0,
'customer_type' => 'retail'
]),
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"
payload := strings.NewReader("{\n \"reference_id\": \"CUS123\",\n \"assigned_sales_rep_ids\": [\n \"<string>\"\n ],\n \"assigned_price_list_id\": \"<string>\",\n \"company_name\": \"Company Name\",\n \"display_name\": \"Customer Display Name\",\n \"display_id\": \"1234567890\",\n \"freight_term\": \"<string>\",\n \"shipping_method\": \"<string>\",\n \"payment_mode\": \"<string>\",\n \"payment_term\": \"<string>\",\n \"first_name\": \"John\",\n \"last_name\": \"Doe\",\n \"phone\": \"+14155552671\",\n \"email\": \"john.doe@example.com\",\n \"addresses\": [\n {\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 }\n ],\n \"contacts\": [\n {\n \"reference_id\": \"CUS123\",\n \"first_name\": \"John\",\n \"last_name\": \"Doe\",\n \"email\": \"john.doe@example.com\",\n \"phone\": \"+14155552671\",\n \"designation\": \"Sales Manager\",\n \"is_default\": true,\n \"attributes\": [\n {\n \"name\": \"1234567890\",\n \"value\": \"red\"\n }\n ]\n }\n ],\n \"attributes\": [\n {\n \"name\": \"1234567890\",\n \"value\": \"red\"\n }\n ],\n \"tax_rate\": 0,\n \"customer_type\": \"retail\"\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")
.header("X-API-Key", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"reference_id\": \"CUS123\",\n \"assigned_sales_rep_ids\": [\n \"<string>\"\n ],\n \"assigned_price_list_id\": \"<string>\",\n \"company_name\": \"Company Name\",\n \"display_name\": \"Customer Display Name\",\n \"display_id\": \"1234567890\",\n \"freight_term\": \"<string>\",\n \"shipping_method\": \"<string>\",\n \"payment_mode\": \"<string>\",\n \"payment_term\": \"<string>\",\n \"first_name\": \"John\",\n \"last_name\": \"Doe\",\n \"phone\": \"+14155552671\",\n \"email\": \"john.doe@example.com\",\n \"addresses\": [\n {\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 }\n ],\n \"contacts\": [\n {\n \"reference_id\": \"CUS123\",\n \"first_name\": \"John\",\n \"last_name\": \"Doe\",\n \"email\": \"john.doe@example.com\",\n \"phone\": \"+14155552671\",\n \"designation\": \"Sales Manager\",\n \"is_default\": true,\n \"attributes\": [\n {\n \"name\": \"1234567890\",\n \"value\": \"red\"\n }\n ]\n }\n ],\n \"attributes\": [\n {\n \"name\": \"1234567890\",\n \"value\": \"red\"\n }\n ],\n \"tax_rate\": 0,\n \"customer_type\": \"retail\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.wizcommerce.com/v2/customers")
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\": \"CUS123\",\n \"assigned_sales_rep_ids\": [\n \"<string>\"\n ],\n \"assigned_price_list_id\": \"<string>\",\n \"company_name\": \"Company Name\",\n \"display_name\": \"Customer Display Name\",\n \"display_id\": \"1234567890\",\n \"freight_term\": \"<string>\",\n \"shipping_method\": \"<string>\",\n \"payment_mode\": \"<string>\",\n \"payment_term\": \"<string>\",\n \"first_name\": \"John\",\n \"last_name\": \"Doe\",\n \"phone\": \"+14155552671\",\n \"email\": \"john.doe@example.com\",\n \"addresses\": [\n {\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 }\n ],\n \"contacts\": [\n {\n \"reference_id\": \"CUS123\",\n \"first_name\": \"John\",\n \"last_name\": \"Doe\",\n \"email\": \"john.doe@example.com\",\n \"phone\": \"+14155552671\",\n \"designation\": \"Sales Manager\",\n \"is_default\": true,\n \"attributes\": [\n {\n \"name\": \"1234567890\",\n \"value\": \"red\"\n }\n ]\n }\n ],\n \"attributes\": [\n {\n \"name\": \"1234567890\",\n \"value\": \"red\"\n }\n ],\n \"tax_rate\": 0,\n \"customer_type\": \"retail\"\n}"
response = http.request(request)
puts response.read_body{
"data": {
"id": "01f5d171-d3e3-4b2b-bd57-0727194b5bed",
"reference_id": "1234567890",
"display_id": "WC_1234567890",
"name": "Customer Name",
"display_name": "Customer Display Name",
"first_name": "John",
"last_name": "Doe",
"phone": "+14155552671",
"email": "john.doe@example.com",
"freight_term": "Cust. Pickup",
"shipping_method": "DHL",
"payment_mode": "AMEX",
"payment_term": "NET30",
"assigned_sales_reps": [
{
"id": "01f5d171-d3e3-4b2b-bd57-0727194b5bed",
"email": "john.doe@example.com",
"first_name": "John",
"last_name": "Doe",
"phone": "+14155552671",
"department": "Sales",
"status": "active",
"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"
}
],
"assigned_price_list": {
"id": "0c05a9a7-84ed-46f0-819b-653545730920",
"name": "Price List 1",
"status": "active",
"reference_id": "PRC-20250101",
"description": "Price List 1 Description",
"created_at": "2025-01-01T00:00:00Z",
"updated_at": "2025-01-01T00:00:00Z"
},
"addresses": [
{
"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"
}
],
"contacts": [
{
"id": "0c05a9a7-84ed-46f0-819b-653545730920",
"reference_id": "CUS123",
"first_name": "John",
"last_name": "Doe",
"email": "john.doe@example.com",
"phone": "+14155552671",
"designation": "Sales Manager",
"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"
}
],
"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"
}
],
"tax_rate": 0,
"customer_type": "customer",
"status": "active",
"source": "openapi",
"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
Body
application/json
request
Maximum string length:
255Example:
"CUS123"
Minimum array length:
1Maximum string length:
255Example:
"Company Name"
Maximum string length:
255Example:
"Customer Display Name"
Display ID; generated by system if not provided
Maximum string length:
255Example:
"1234567890"
Maximum string length:
255Maximum string length:
255Maximum string length:
255Maximum string length:
255Maximum string length:
255Example:
"John"
Maximum string length:
255Example:
"Doe"
E.164 format
Example:
"+14155552671"
Example:
"john.doe@example.com"
Show child attributes
Show child attributes
Show child attributes
Show child attributes
Show child attributes
Show child attributes
Example:
0
Example:
"retail"
Response
Created
Show child attributes
Show child attributes
Was this page helpful?
⌘I
