Create a customer
curl --request POST \
--url http://localhost:4000/api/v1/v1/customers \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"name": "<string>",
"email": "jsmith@example.com",
"country": "<string>",
"totalTransactions": 4503599627370495,
"totalAmountSpent": 1,
"lastActivityDate": "<string>"
}
'import requests
url = "http://localhost:4000/api/v1/v1/customers"
payload = {
"name": "<string>",
"email": "jsmith@example.com",
"country": "<string>",
"totalTransactions": 4503599627370495,
"totalAmountSpent": 1,
"lastActivityDate": "<string>"
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
name: '<string>',
email: 'jsmith@example.com',
country: '<string>',
totalTransactions: 4503599627370495,
totalAmountSpent: 1,
lastActivityDate: '<string>'
})
};
fetch('http://localhost:4000/api/v1/v1/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_PORT => "4000",
CURLOPT_URL => "http://localhost:4000/api/v1/v1/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([
'name' => '<string>',
'email' => 'jsmith@example.com',
'country' => '<string>',
'totalTransactions' => 4503599627370495,
'totalAmountSpent' => 1,
'lastActivityDate' => '<string>'
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"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 := "http://localhost:4000/api/v1/v1/customers"
payload := strings.NewReader("{\n \"name\": \"<string>\",\n \"email\": \"jsmith@example.com\",\n \"country\": \"<string>\",\n \"totalTransactions\": 4503599627370495,\n \"totalAmountSpent\": 1,\n \"lastActivityDate\": \"<string>\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
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("http://localhost:4000/api/v1/v1/customers")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"name\": \"<string>\",\n \"email\": \"jsmith@example.com\",\n \"country\": \"<string>\",\n \"totalTransactions\": 4503599627370495,\n \"totalAmountSpent\": 1,\n \"lastActivityDate\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("http://localhost:4000/api/v1/v1/customers")
http = Net::HTTP.new(url.host, url.port)
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"name\": \"<string>\",\n \"email\": \"jsmith@example.com\",\n \"country\": \"<string>\",\n \"totalTransactions\": 4503599627370495,\n \"totalAmountSpent\": 1,\n \"lastActivityDate\": \"<string>\"\n}"
response = http.request(request)
puts response.read_body{
"id": "<string>",
"name": "<string>",
"email": "jsmith@example.com",
"country": "<string>",
"totalTransactions": 4503599627370495,
"totalAmountSpent": 1,
"lastActivityDate": "<string>",
"status": "active"
}{
"type": "<string>",
"title": "<string>",
"status": 0,
"detail": "<string>",
"code": "validation_failed",
"errors": {},
"traceId": "<string>"
}{
"type": "<string>",
"title": "<string>",
"status": 0,
"detail": "<string>",
"code": "validation_failed",
"errors": {},
"traceId": "<string>"
}{
"type": "<string>",
"title": "<string>",
"status": 0,
"detail": "<string>",
"code": "validation_failed",
"errors": {},
"traceId": "<string>"
}{
"type": "<string>",
"title": "<string>",
"status": 0,
"detail": "<string>",
"code": "validation_failed",
"errors": {},
"traceId": "<string>"
}Customers
Create a customer
Adds one customer. A duplicate email is rejected with conflict rather than merged, so the caller decides what to do with it.
POST
/
v1
/
customers
Create a customer
curl --request POST \
--url http://localhost:4000/api/v1/v1/customers \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"name": "<string>",
"email": "jsmith@example.com",
"country": "<string>",
"totalTransactions": 4503599627370495,
"totalAmountSpent": 1,
"lastActivityDate": "<string>"
}
'import requests
url = "http://localhost:4000/api/v1/v1/customers"
payload = {
"name": "<string>",
"email": "jsmith@example.com",
"country": "<string>",
"totalTransactions": 4503599627370495,
"totalAmountSpent": 1,
"lastActivityDate": "<string>"
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
name: '<string>',
email: 'jsmith@example.com',
country: '<string>',
totalTransactions: 4503599627370495,
totalAmountSpent: 1,
lastActivityDate: '<string>'
})
};
fetch('http://localhost:4000/api/v1/v1/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_PORT => "4000",
CURLOPT_URL => "http://localhost:4000/api/v1/v1/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([
'name' => '<string>',
'email' => 'jsmith@example.com',
'country' => '<string>',
'totalTransactions' => 4503599627370495,
'totalAmountSpent' => 1,
'lastActivityDate' => '<string>'
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"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 := "http://localhost:4000/api/v1/v1/customers"
payload := strings.NewReader("{\n \"name\": \"<string>\",\n \"email\": \"jsmith@example.com\",\n \"country\": \"<string>\",\n \"totalTransactions\": 4503599627370495,\n \"totalAmountSpent\": 1,\n \"lastActivityDate\": \"<string>\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
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("http://localhost:4000/api/v1/v1/customers")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"name\": \"<string>\",\n \"email\": \"jsmith@example.com\",\n \"country\": \"<string>\",\n \"totalTransactions\": 4503599627370495,\n \"totalAmountSpent\": 1,\n \"lastActivityDate\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("http://localhost:4000/api/v1/v1/customers")
http = Net::HTTP.new(url.host, url.port)
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"name\": \"<string>\",\n \"email\": \"jsmith@example.com\",\n \"country\": \"<string>\",\n \"totalTransactions\": 4503599627370495,\n \"totalAmountSpent\": 1,\n \"lastActivityDate\": \"<string>\"\n}"
response = http.request(request)
puts response.read_body{
"id": "<string>",
"name": "<string>",
"email": "jsmith@example.com",
"country": "<string>",
"totalTransactions": 4503599627370495,
"totalAmountSpent": 1,
"lastActivityDate": "<string>",
"status": "active"
}{
"type": "<string>",
"title": "<string>",
"status": 0,
"detail": "<string>",
"code": "validation_failed",
"errors": {},
"traceId": "<string>"
}{
"type": "<string>",
"title": "<string>",
"status": 0,
"detail": "<string>",
"code": "validation_failed",
"errors": {},
"traceId": "<string>"
}{
"type": "<string>",
"title": "<string>",
"status": 0,
"detail": "<string>",
"code": "validation_failed",
"errors": {},
"traceId": "<string>"
}{
"type": "<string>",
"title": "<string>",
"status": 0,
"detail": "<string>",
"code": "validation_failed",
"errors": {},
"traceId": "<string>"
}Authorizations
Access token issued by auth.signIn. Expires; refresh it with auth.refresh.
Body
application/json
Minimum string length:
1Pattern:
^(?!\.)(?!.*\.\.)([A-Za-z0-9_'+\-\.]*)[A-Za-z0-9_+-]@([A-Za-z0-9][A-Za-z0-9\-]*\.)+[A-Za-z]{2,}$Minimum string length:
2Required range:
0 <= x <= 9007199254740991Required range:
x >= 0Minimum string length:
1Available options:
active, inactive, churned Response
OK
Minimum string length:
1Minimum string length:
1Pattern:
^(?!\.)(?!.*\.\.)([A-Za-z0-9_'+\-\.]*)[A-Za-z0-9_+-]@([A-Za-z0-9][A-Za-z0-9\-]*\.)+[A-Za-z]{2,}$Minimum string length:
2Required range:
0 <= x <= 9007199254740991Required range:
x >= 0Minimum string length:
1Available options:
active, inactive, churned Last modified on October 6, 2026