Create Customer
curl --request POST \
--url https://{api}.subotiz.com/api/v1/front/customer/create \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--header 'Request-Id: <request-id>' \
--data '
{
"email": "<string>",
"phone": "<string>",
"name": "<string>",
"address": {
"line1": "<string>",
"line2": "<string>",
"city": "<string>",
"province": "<string>",
"postal_code": "<string>",
"country": "<string>"
},
"metadata": {},
"payer_id": "<string>",
"email_subscription": 123
}
'const options = {
method: 'POST',
headers: {
'Request-Id': '<request-id>',
Authorization: 'Bearer <token>',
'Content-Type': 'application/json'
},
body: JSON.stringify({
email: '<string>',
phone: '<string>',
name: '<string>',
address: {
line1: '<string>',
line2: '<string>',
city: '<string>',
province: '<string>',
postal_code: '<string>',
country: '<string>'
},
metadata: {},
payer_id: '<string>',
email_subscription: 123
})
};
fetch('https://{api}.subotiz.com/api/v1/front/customer/create', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));import requests
url = "https://{api}.subotiz.com/api/v1/front/customer/create"
payload = {
"email": "<string>",
"phone": "<string>",
"name": "<string>",
"address": {
"line1": "<string>",
"line2": "<string>",
"city": "<string>",
"province": "<string>",
"postal_code": "<string>",
"country": "<string>"
},
"metadata": {},
"payer_id": "<string>",
"email_subscription": 123
}
headers = {
"Request-Id": "<request-id>",
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://{api}.subotiz.com/api/v1/front/customer/create",
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([
'email' => '<string>',
'phone' => '<string>',
'name' => '<string>',
'address' => [
'line1' => '<string>',
'line2' => '<string>',
'city' => '<string>',
'province' => '<string>',
'postal_code' => '<string>',
'country' => '<string>'
],
'metadata' => [
],
'payer_id' => '<string>',
'email_subscription' => 123
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json",
"Request-Id: <request-id>"
],
]);
$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}.subotiz.com/api/v1/front/customer/create"
payload := strings.NewReader("{\n \"email\": \"<string>\",\n \"phone\": \"<string>\",\n \"name\": \"<string>\",\n \"address\": {\n \"line1\": \"<string>\",\n \"line2\": \"<string>\",\n \"city\": \"<string>\",\n \"province\": \"<string>\",\n \"postal_code\": \"<string>\",\n \"country\": \"<string>\"\n },\n \"metadata\": {},\n \"payer_id\": \"<string>\",\n \"email_subscription\": 123\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Request-Id", "<request-id>")
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("https://{api}.subotiz.com/api/v1/front/customer/create")
.header("Request-Id", "<request-id>")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"email\": \"<string>\",\n \"phone\": \"<string>\",\n \"name\": \"<string>\",\n \"address\": {\n \"line1\": \"<string>\",\n \"line2\": \"<string>\",\n \"city\": \"<string>\",\n \"province\": \"<string>\",\n \"postal_code\": \"<string>\",\n \"country\": \"<string>\"\n },\n \"metadata\": {},\n \"payer_id\": \"<string>\",\n \"email_subscription\": 123\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://{api}.subotiz.com/api/v1/front/customer/create")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Request-Id"] = '<request-id>'
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"email\": \"<string>\",\n \"phone\": \"<string>\",\n \"name\": \"<string>\",\n \"address\": {\n \"line1\": \"<string>\",\n \"line2\": \"<string>\",\n \"city\": \"<string>\",\n \"province\": \"<string>\",\n \"postal_code\": \"<string>\",\n \"country\": \"<string>\"\n },\n \"metadata\": {},\n \"payer_id\": \"<string>\",\n \"email_subscription\": 123\n}"
response = http.request(request)
puts response.read_body{
"code": "<string>",
"message": "<string>",
"data": {
"customer_id": "<string>"
}
}Customer
Create Customer
Create Customer
POST
/
api
/
v1
/
front
/
customer
/
create
Create Customer
curl --request POST \
--url https://{api}.subotiz.com/api/v1/front/customer/create \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--header 'Request-Id: <request-id>' \
--data '
{
"email": "<string>",
"phone": "<string>",
"name": "<string>",
"address": {
"line1": "<string>",
"line2": "<string>",
"city": "<string>",
"province": "<string>",
"postal_code": "<string>",
"country": "<string>"
},
"metadata": {},
"payer_id": "<string>",
"email_subscription": 123
}
'const options = {
method: 'POST',
headers: {
'Request-Id': '<request-id>',
Authorization: 'Bearer <token>',
'Content-Type': 'application/json'
},
body: JSON.stringify({
email: '<string>',
phone: '<string>',
name: '<string>',
address: {
line1: '<string>',
line2: '<string>',
city: '<string>',
province: '<string>',
postal_code: '<string>',
country: '<string>'
},
metadata: {},
payer_id: '<string>',
email_subscription: 123
})
};
fetch('https://{api}.subotiz.com/api/v1/front/customer/create', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));import requests
url = "https://{api}.subotiz.com/api/v1/front/customer/create"
payload = {
"email": "<string>",
"phone": "<string>",
"name": "<string>",
"address": {
"line1": "<string>",
"line2": "<string>",
"city": "<string>",
"province": "<string>",
"postal_code": "<string>",
"country": "<string>"
},
"metadata": {},
"payer_id": "<string>",
"email_subscription": 123
}
headers = {
"Request-Id": "<request-id>",
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://{api}.subotiz.com/api/v1/front/customer/create",
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([
'email' => '<string>',
'phone' => '<string>',
'name' => '<string>',
'address' => [
'line1' => '<string>',
'line2' => '<string>',
'city' => '<string>',
'province' => '<string>',
'postal_code' => '<string>',
'country' => '<string>'
],
'metadata' => [
],
'payer_id' => '<string>',
'email_subscription' => 123
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json",
"Request-Id: <request-id>"
],
]);
$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}.subotiz.com/api/v1/front/customer/create"
payload := strings.NewReader("{\n \"email\": \"<string>\",\n \"phone\": \"<string>\",\n \"name\": \"<string>\",\n \"address\": {\n \"line1\": \"<string>\",\n \"line2\": \"<string>\",\n \"city\": \"<string>\",\n \"province\": \"<string>\",\n \"postal_code\": \"<string>\",\n \"country\": \"<string>\"\n },\n \"metadata\": {},\n \"payer_id\": \"<string>\",\n \"email_subscription\": 123\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Request-Id", "<request-id>")
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("https://{api}.subotiz.com/api/v1/front/customer/create")
.header("Request-Id", "<request-id>")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"email\": \"<string>\",\n \"phone\": \"<string>\",\n \"name\": \"<string>\",\n \"address\": {\n \"line1\": \"<string>\",\n \"line2\": \"<string>\",\n \"city\": \"<string>\",\n \"province\": \"<string>\",\n \"postal_code\": \"<string>\",\n \"country\": \"<string>\"\n },\n \"metadata\": {},\n \"payer_id\": \"<string>\",\n \"email_subscription\": 123\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://{api}.subotiz.com/api/v1/front/customer/create")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Request-Id"] = '<request-id>'
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"email\": \"<string>\",\n \"phone\": \"<string>\",\n \"name\": \"<string>\",\n \"address\": {\n \"line1\": \"<string>\",\n \"line2\": \"<string>\",\n \"city\": \"<string>\",\n \"province\": \"<string>\",\n \"postal_code\": \"<string>\",\n \"country\": \"<string>\"\n },\n \"metadata\": {},\n \"payer_id\": \"<string>\",\n \"email_subscription\": 123\n}"
response = http.request(request)
puts response.read_body{
"code": "<string>",
"message": "<string>",
"data": {
"customer_id": "<string>"
}
}Authorizations
Bearer API Key authentication. Format: Authorization: Bearer {your_api_key}
Headers
The unique identifier of the request
Body
application/json
Customer email, mutually exclusive with payer_id
Customer phone number
Customer name
Customer address
Show child attributes
Show child attributes
A set of key-value pairs that can be attached to an object, allowing you to store additional information in a structured format.
Third-party customer ID
Whether to subscribe to marketing email notifications
- 1: Do not subscribe
- 2: Subscribe
Was this page helpful?
⌘I