Create Customer
curl --request POST \
--url https://{primary_domain}/api/public/v2.0/customers \
--header 'Content-Type: application/json' \
--header 'X-Access-Key-Id: <api-key>' \
--header 'X-Access-Key-Secret: <api-key>' \
--data '
{
"first_name": "<string>",
"middle_name": "<string>",
"last_name": "<string>",
"email": "jsmith@example.com",
"contact_number": "<string>",
"address": {
"line_1": "<string>",
"line_2": "<string>",
"city": "<string>",
"region": "<string>",
"region_code": "<string>",
"country": "<string>",
"country_code": "<string>",
"postal_code": "<string>"
}
}
'import requests
url = "https://{primary_domain}/api/public/v2.0/customers"
payload = {
"first_name": "<string>",
"middle_name": "<string>",
"last_name": "<string>",
"email": "jsmith@example.com",
"contact_number": "<string>",
"address": {
"line_1": "<string>",
"line_2": "<string>",
"city": "<string>",
"region": "<string>",
"region_code": "<string>",
"country": "<string>",
"country_code": "<string>",
"postal_code": "<string>"
}
}
headers = {
"X-Access-Key-Id": "<api-key>",
"X-Access-Key-Secret": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {
'X-Access-Key-Id': '<api-key>',
'X-Access-Key-Secret': '<api-key>',
'Content-Type': 'application/json'
},
body: JSON.stringify({
first_name: '<string>',
middle_name: '<string>',
last_name: '<string>',
email: 'jsmith@example.com',
contact_number: '<string>',
address: {
line_1: '<string>',
line_2: '<string>',
city: '<string>',
region: '<string>',
region_code: '<string>',
country: '<string>',
country_code: '<string>',
postal_code: '<string>'
}
})
};
fetch('https://{primary_domain}/api/public/v2.0/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://{primary_domain}/api/public/v2.0/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([
'first_name' => '<string>',
'middle_name' => '<string>',
'last_name' => '<string>',
'email' => 'jsmith@example.com',
'contact_number' => '<string>',
'address' => [
'line_1' => '<string>',
'line_2' => '<string>',
'city' => '<string>',
'region' => '<string>',
'region_code' => '<string>',
'country' => '<string>',
'country_code' => '<string>',
'postal_code' => '<string>'
]
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"X-Access-Key-Id: <api-key>",
"X-Access-Key-Secret: <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://{primary_domain}/api/public/v2.0/customers"
payload := strings.NewReader("{\n \"first_name\": \"<string>\",\n \"middle_name\": \"<string>\",\n \"last_name\": \"<string>\",\n \"email\": \"jsmith@example.com\",\n \"contact_number\": \"<string>\",\n \"address\": {\n \"line_1\": \"<string>\",\n \"line_2\": \"<string>\",\n \"city\": \"<string>\",\n \"region\": \"<string>\",\n \"region_code\": \"<string>\",\n \"country\": \"<string>\",\n \"country_code\": \"<string>\",\n \"postal_code\": \"<string>\"\n }\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("X-Access-Key-Id", "<api-key>")
req.Header.Add("X-Access-Key-Secret", "<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://{primary_domain}/api/public/v2.0/customers")
.header("X-Access-Key-Id", "<api-key>")
.header("X-Access-Key-Secret", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"first_name\": \"<string>\",\n \"middle_name\": \"<string>\",\n \"last_name\": \"<string>\",\n \"email\": \"jsmith@example.com\",\n \"contact_number\": \"<string>\",\n \"address\": {\n \"line_1\": \"<string>\",\n \"line_2\": \"<string>\",\n \"city\": \"<string>\",\n \"region\": \"<string>\",\n \"region_code\": \"<string>\",\n \"country\": \"<string>\",\n \"country_code\": \"<string>\",\n \"postal_code\": \"<string>\"\n }\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://{primary_domain}/api/public/v2.0/customers")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["X-Access-Key-Id"] = '<api-key>'
request["X-Access-Key-Secret"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"first_name\": \"<string>\",\n \"middle_name\": \"<string>\",\n \"last_name\": \"<string>\",\n \"email\": \"jsmith@example.com\",\n \"contact_number\": \"<string>\",\n \"address\": {\n \"line_1\": \"<string>\",\n \"line_2\": \"<string>\",\n \"city\": \"<string>\",\n \"region\": \"<string>\",\n \"region_code\": \"<string>\",\n \"country\": \"<string>\",\n \"country_code\": \"<string>\",\n \"postal_code\": \"<string>\"\n }\n}"
response = http.request(request)
puts response.read_body{
"message": "<string>",
"data": {
"id": 123,
"first_name": "<string>",
"middle_name": "<string>",
"last_name": "<string>",
"email": "jsmith@example.com",
"contact_number": "<string>",
"address": {
"line_1": "<string>",
"line_2": "<string>",
"city": "<string>",
"region": "<string>",
"region_code": "<string>",
"country": "<string>",
"country_code": "<string>",
"postal_code": "<string>"
},
"created_at": "2023-11-07T05:31:56Z",
"updated_at": "2023-11-07T05:31:56Z",
"name": "<string>",
"deleted_at": "2023-11-07T05:31:56Z"
}
}{
"message": "<string>",
"errors": {
"attribute": [
"The {attribute} field is required."
]
}
}"Invalid or missing access key.""Too many requests.""An unexpected error occurred."Customers
Create Customer
Required permissions: customers.create.*
POST
/
customers
Create Customer
curl --request POST \
--url https://{primary_domain}/api/public/v2.0/customers \
--header 'Content-Type: application/json' \
--header 'X-Access-Key-Id: <api-key>' \
--header 'X-Access-Key-Secret: <api-key>' \
--data '
{
"first_name": "<string>",
"middle_name": "<string>",
"last_name": "<string>",
"email": "jsmith@example.com",
"contact_number": "<string>",
"address": {
"line_1": "<string>",
"line_2": "<string>",
"city": "<string>",
"region": "<string>",
"region_code": "<string>",
"country": "<string>",
"country_code": "<string>",
"postal_code": "<string>"
}
}
'import requests
url = "https://{primary_domain}/api/public/v2.0/customers"
payload = {
"first_name": "<string>",
"middle_name": "<string>",
"last_name": "<string>",
"email": "jsmith@example.com",
"contact_number": "<string>",
"address": {
"line_1": "<string>",
"line_2": "<string>",
"city": "<string>",
"region": "<string>",
"region_code": "<string>",
"country": "<string>",
"country_code": "<string>",
"postal_code": "<string>"
}
}
headers = {
"X-Access-Key-Id": "<api-key>",
"X-Access-Key-Secret": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {
'X-Access-Key-Id': '<api-key>',
'X-Access-Key-Secret': '<api-key>',
'Content-Type': 'application/json'
},
body: JSON.stringify({
first_name: '<string>',
middle_name: '<string>',
last_name: '<string>',
email: 'jsmith@example.com',
contact_number: '<string>',
address: {
line_1: '<string>',
line_2: '<string>',
city: '<string>',
region: '<string>',
region_code: '<string>',
country: '<string>',
country_code: '<string>',
postal_code: '<string>'
}
})
};
fetch('https://{primary_domain}/api/public/v2.0/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://{primary_domain}/api/public/v2.0/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([
'first_name' => '<string>',
'middle_name' => '<string>',
'last_name' => '<string>',
'email' => 'jsmith@example.com',
'contact_number' => '<string>',
'address' => [
'line_1' => '<string>',
'line_2' => '<string>',
'city' => '<string>',
'region' => '<string>',
'region_code' => '<string>',
'country' => '<string>',
'country_code' => '<string>',
'postal_code' => '<string>'
]
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"X-Access-Key-Id: <api-key>",
"X-Access-Key-Secret: <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://{primary_domain}/api/public/v2.0/customers"
payload := strings.NewReader("{\n \"first_name\": \"<string>\",\n \"middle_name\": \"<string>\",\n \"last_name\": \"<string>\",\n \"email\": \"jsmith@example.com\",\n \"contact_number\": \"<string>\",\n \"address\": {\n \"line_1\": \"<string>\",\n \"line_2\": \"<string>\",\n \"city\": \"<string>\",\n \"region\": \"<string>\",\n \"region_code\": \"<string>\",\n \"country\": \"<string>\",\n \"country_code\": \"<string>\",\n \"postal_code\": \"<string>\"\n }\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("X-Access-Key-Id", "<api-key>")
req.Header.Add("X-Access-Key-Secret", "<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://{primary_domain}/api/public/v2.0/customers")
.header("X-Access-Key-Id", "<api-key>")
.header("X-Access-Key-Secret", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"first_name\": \"<string>\",\n \"middle_name\": \"<string>\",\n \"last_name\": \"<string>\",\n \"email\": \"jsmith@example.com\",\n \"contact_number\": \"<string>\",\n \"address\": {\n \"line_1\": \"<string>\",\n \"line_2\": \"<string>\",\n \"city\": \"<string>\",\n \"region\": \"<string>\",\n \"region_code\": \"<string>\",\n \"country\": \"<string>\",\n \"country_code\": \"<string>\",\n \"postal_code\": \"<string>\"\n }\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://{primary_domain}/api/public/v2.0/customers")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["X-Access-Key-Id"] = '<api-key>'
request["X-Access-Key-Secret"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"first_name\": \"<string>\",\n \"middle_name\": \"<string>\",\n \"last_name\": \"<string>\",\n \"email\": \"jsmith@example.com\",\n \"contact_number\": \"<string>\",\n \"address\": {\n \"line_1\": \"<string>\",\n \"line_2\": \"<string>\",\n \"city\": \"<string>\",\n \"region\": \"<string>\",\n \"region_code\": \"<string>\",\n \"country\": \"<string>\",\n \"country_code\": \"<string>\",\n \"postal_code\": \"<string>\"\n }\n}"
response = http.request(request)
puts response.read_body{
"message": "<string>",
"data": {
"id": 123,
"first_name": "<string>",
"middle_name": "<string>",
"last_name": "<string>",
"email": "jsmith@example.com",
"contact_number": "<string>",
"address": {
"line_1": "<string>",
"line_2": "<string>",
"city": "<string>",
"region": "<string>",
"region_code": "<string>",
"country": "<string>",
"country_code": "<string>",
"postal_code": "<string>"
},
"created_at": "2023-11-07T05:31:56Z",
"updated_at": "2023-11-07T05:31:56Z",
"name": "<string>",
"deleted_at": "2023-11-07T05:31:56Z"
}
}{
"message": "<string>",
"errors": {
"attribute": [
"The {attribute} field is required."
]
}
}"Invalid or missing access key.""Too many requests.""An unexpected error occurred."Body
application/json
Maximum string length:
255Maximum string length:
255Maximum string length:
255Maximum string length:
255In E.164 format.
Show child attributes
Show child attributes
⌘I