Create a customer
curl --request POST \
--url https://api.hit-pay.com/v1/customers \
--header 'Content-Type: application/json' \
--header 'X-BUSINESS-API-KEY: <x-business-api-key>' \
--data '
{
"email": "[email protected]",
"phone_number": "<string>",
"name": "<string>",
"phone_number_country_code": "<string>",
"remark": "<string>",
"birth_date": "2023-12-25",
"gender": "<string>"
}
'import requests
url = "https://api.hit-pay.com/v1/customers"
payload = {
"email": "[email protected]",
"phone_number": "<string>",
"name": "<string>",
"phone_number_country_code": "<string>",
"remark": "<string>",
"birth_date": "2023-12-25",
"gender": "<string>"
}
headers = {
"X-BUSINESS-API-KEY": "<x-business-api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {
'X-BUSINESS-API-KEY': '<x-business-api-key>',
'Content-Type': 'application/json'
},
body: JSON.stringify({
email: '[email protected]',
phone_number: '<string>',
name: '<string>',
phone_number_country_code: '<string>',
remark: '<string>',
birth_date: '2023-12-25',
gender: '<string>'
})
};
fetch('https://api.hit-pay.com/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_URL => "https://api.hit-pay.com/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([
'email' => '[email protected]',
'phone_number' => '<string>',
'name' => '<string>',
'phone_number_country_code' => '<string>',
'remark' => '<string>',
'birth_date' => '2023-12-25',
'gender' => '<string>'
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"X-BUSINESS-API-KEY: <x-business-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.hit-pay.com/v1/customers"
payload := strings.NewReader("{\n \"email\": \"[email protected]\",\n \"phone_number\": \"<string>\",\n \"name\": \"<string>\",\n \"phone_number_country_code\": \"<string>\",\n \"remark\": \"<string>\",\n \"birth_date\": \"2023-12-25\",\n \"gender\": \"<string>\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("X-BUSINESS-API-KEY", "<x-business-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.hit-pay.com/v1/customers")
.header("X-BUSINESS-API-KEY", "<x-business-api-key>")
.header("Content-Type", "application/json")
.body("{\n \"email\": \"[email protected]\",\n \"phone_number\": \"<string>\",\n \"name\": \"<string>\",\n \"phone_number_country_code\": \"<string>\",\n \"remark\": \"<string>\",\n \"birth_date\": \"2023-12-25\",\n \"gender\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.hit-pay.com/v1/customers")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["X-BUSINESS-API-KEY"] = '<x-business-api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"email\": \"[email protected]\",\n \"phone_number\": \"<string>\",\n \"name\": \"<string>\",\n \"phone_number_country_code\": \"<string>\",\n \"remark\": \"<string>\",\n \"birth_date\": \"2023-12-25\",\n \"gender\": \"<string>\"\n}"
response = http.request(request)
puts response.read_body{
"id": "9b2ada28-be3c-47ab-883f-ba72e5d8305d",
"name": "John Doe",
"birth_date": "<string>",
"email": "<string>",
"phone_number": "<string>",
"address": {
"city": "<string>",
"state": "<string>",
"street": "<string>",
"postal_code": "<string>",
"country": "<string>"
},
"gender": "<string>",
"remark": "<string>",
"phone_number_country_code": "<string>",
"created_at": "2024-01-24T16:05:10+08:00",
"updated_at": "2024-01-24T16:05:10+08:00"
}Customers
Create Customer
Create a new customer record with name, email, and phone
POST
/
v1
/
customers
Create a customer
curl --request POST \
--url https://api.hit-pay.com/v1/customers \
--header 'Content-Type: application/json' \
--header 'X-BUSINESS-API-KEY: <x-business-api-key>' \
--data '
{
"email": "[email protected]",
"phone_number": "<string>",
"name": "<string>",
"phone_number_country_code": "<string>",
"remark": "<string>",
"birth_date": "2023-12-25",
"gender": "<string>"
}
'import requests
url = "https://api.hit-pay.com/v1/customers"
payload = {
"email": "[email protected]",
"phone_number": "<string>",
"name": "<string>",
"phone_number_country_code": "<string>",
"remark": "<string>",
"birth_date": "2023-12-25",
"gender": "<string>"
}
headers = {
"X-BUSINESS-API-KEY": "<x-business-api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {
'X-BUSINESS-API-KEY': '<x-business-api-key>',
'Content-Type': 'application/json'
},
body: JSON.stringify({
email: '[email protected]',
phone_number: '<string>',
name: '<string>',
phone_number_country_code: '<string>',
remark: '<string>',
birth_date: '2023-12-25',
gender: '<string>'
})
};
fetch('https://api.hit-pay.com/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_URL => "https://api.hit-pay.com/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([
'email' => '[email protected]',
'phone_number' => '<string>',
'name' => '<string>',
'phone_number_country_code' => '<string>',
'remark' => '<string>',
'birth_date' => '2023-12-25',
'gender' => '<string>'
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"X-BUSINESS-API-KEY: <x-business-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.hit-pay.com/v1/customers"
payload := strings.NewReader("{\n \"email\": \"[email protected]\",\n \"phone_number\": \"<string>\",\n \"name\": \"<string>\",\n \"phone_number_country_code\": \"<string>\",\n \"remark\": \"<string>\",\n \"birth_date\": \"2023-12-25\",\n \"gender\": \"<string>\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("X-BUSINESS-API-KEY", "<x-business-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.hit-pay.com/v1/customers")
.header("X-BUSINESS-API-KEY", "<x-business-api-key>")
.header("Content-Type", "application/json")
.body("{\n \"email\": \"[email protected]\",\n \"phone_number\": \"<string>\",\n \"name\": \"<string>\",\n \"phone_number_country_code\": \"<string>\",\n \"remark\": \"<string>\",\n \"birth_date\": \"2023-12-25\",\n \"gender\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.hit-pay.com/v1/customers")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["X-BUSINESS-API-KEY"] = '<x-business-api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"email\": \"[email protected]\",\n \"phone_number\": \"<string>\",\n \"name\": \"<string>\",\n \"phone_number_country_code\": \"<string>\",\n \"remark\": \"<string>\",\n \"birth_date\": \"2023-12-25\",\n \"gender\": \"<string>\"\n}"
response = http.request(request)
puts response.read_body{
"id": "9b2ada28-be3c-47ab-883f-ba72e5d8305d",
"name": "John Doe",
"birth_date": "<string>",
"email": "<string>",
"phone_number": "<string>",
"address": {
"city": "<string>",
"state": "<string>",
"street": "<string>",
"postal_code": "<string>",
"country": "<string>"
},
"gender": "<string>",
"remark": "<string>",
"phone_number_country_code": "<string>",
"created_at": "2024-01-24T16:05:10+08:00",
"updated_at": "2024-01-24T16:05:10+08:00"
}Headers
Example:
"b286daabf9921b5a01a4621f026c111e046f8911feba212996c92159b98427d"
Body
application/json
The email of the customer
The phone number of the customer
The name of the customer
Example:
"John Doe"
The country code of the phone number
The remark of the customer
Maximum string length:
255The birth date of the customer
The gender of the customer
Show child attributes
Show child attributes
Response
201 - application/json
201
Last modified on February 25, 2026
Was this page helpful?
⌘I