Create Customer
curl --request POST \
--url https://service-sandbox.tazapay.com/v3/customer \
--header 'Authorization: Basic <encoded-value>' \
--header 'Content-Type: application/json' \
--data '
{
"name": "Andrew Robin",
"country": "US",
"email": "andrew.robin@example.com"
}
'import requests
url = "https://service-sandbox.tazapay.com/v3/customer"
payload = {
"name": "Andrew Robin",
"country": "US",
"email": "andrew.robin@example.com"
}
headers = {
"Authorization": "Basic <encoded-value>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Basic <encoded-value>', 'Content-Type': 'application/json'},
body: JSON.stringify({name: 'Andrew Robin', country: 'US', email: 'andrew.robin@example.com'})
};
fetch('https://service-sandbox.tazapay.com/v3/customer', 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://service-sandbox.tazapay.com/v3/customer",
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' => 'Andrew Robin',
'country' => 'US',
'email' => 'andrew.robin@example.com'
]),
CURLOPT_HTTPHEADER => [
"Authorization: Basic <encoded-value>",
"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 := "https://service-sandbox.tazapay.com/v3/customer"
payload := strings.NewReader("{\n \"name\": \"Andrew Robin\",\n \"country\": \"US\",\n \"email\": \"andrew.robin@example.com\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Basic <encoded-value>")
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://service-sandbox.tazapay.com/v3/customer")
.header("Authorization", "Basic <encoded-value>")
.header("Content-Type", "application/json")
.body("{\n \"name\": \"Andrew Robin\",\n \"country\": \"US\",\n \"email\": \"andrew.robin@example.com\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://service-sandbox.tazapay.com/v3/customer")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Basic <encoded-value>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"name\": \"Andrew Robin\",\n \"country\": \"US\",\n \"email\": \"andrew.robin@example.com\"\n}"
response = http.request(request)
puts response.read_body{
"status": "success",
"message": "customer created successfully",
"data": {
"id": "cus_abc123xyz456",
"object": "customer",
"created_at": "2025-10-13T14:30:00Z",
"name": "Andrew Robin",
"email": "andrew.robin@example.com",
"country": "US",
"phone": {
"calling_code": "1",
"number": "2025550183"
},
"billing_address": [
{
"name": "Andrew Robin",
"address": {
"line1": "123 Main Street",
"line2": "Apt 45B",
"city": "New York",
"state": "NY",
"country": "US",
"postal_code": "10001"
},
"phone": {
"calling_code": "1",
"number": "2125550199"
}
}
],
"shipping_address": [
{
"name": "Andrew Robin",
"address": {
"line1": "789 Broadway Avenue",
"line2": "Suite 500",
"city": "New York",
"state": "NY",
"country": "US",
"postal_code": "10003"
},
"phone": {
"calling_code": "1",
"number": "9175550132"
}
}
],
"metadata": {
"customer_type": "premium",
"preferred_language": "en",
"referral_code": "REF2025ABC"
}
}
}Customer
Create Customer
POST
/
v3
/
customer
Create Customer
curl --request POST \
--url https://service-sandbox.tazapay.com/v3/customer \
--header 'Authorization: Basic <encoded-value>' \
--header 'Content-Type: application/json' \
--data '
{
"name": "Andrew Robin",
"country": "US",
"email": "andrew.robin@example.com"
}
'import requests
url = "https://service-sandbox.tazapay.com/v3/customer"
payload = {
"name": "Andrew Robin",
"country": "US",
"email": "andrew.robin@example.com"
}
headers = {
"Authorization": "Basic <encoded-value>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Basic <encoded-value>', 'Content-Type': 'application/json'},
body: JSON.stringify({name: 'Andrew Robin', country: 'US', email: 'andrew.robin@example.com'})
};
fetch('https://service-sandbox.tazapay.com/v3/customer', 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://service-sandbox.tazapay.com/v3/customer",
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' => 'Andrew Robin',
'country' => 'US',
'email' => 'andrew.robin@example.com'
]),
CURLOPT_HTTPHEADER => [
"Authorization: Basic <encoded-value>",
"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 := "https://service-sandbox.tazapay.com/v3/customer"
payload := strings.NewReader("{\n \"name\": \"Andrew Robin\",\n \"country\": \"US\",\n \"email\": \"andrew.robin@example.com\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Basic <encoded-value>")
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://service-sandbox.tazapay.com/v3/customer")
.header("Authorization", "Basic <encoded-value>")
.header("Content-Type", "application/json")
.body("{\n \"name\": \"Andrew Robin\",\n \"country\": \"US\",\n \"email\": \"andrew.robin@example.com\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://service-sandbox.tazapay.com/v3/customer")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Basic <encoded-value>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"name\": \"Andrew Robin\",\n \"country\": \"US\",\n \"email\": \"andrew.robin@example.com\"\n}"
response = http.request(request)
puts response.read_body{
"status": "success",
"message": "customer created successfully",
"data": {
"id": "cus_abc123xyz456",
"object": "customer",
"created_at": "2025-10-13T14:30:00Z",
"name": "Andrew Robin",
"email": "andrew.robin@example.com",
"country": "US",
"phone": {
"calling_code": "1",
"number": "2025550183"
},
"billing_address": [
{
"name": "Andrew Robin",
"address": {
"line1": "123 Main Street",
"line2": "Apt 45B",
"city": "New York",
"state": "NY",
"country": "US",
"postal_code": "10001"
},
"phone": {
"calling_code": "1",
"number": "2125550199"
}
}
],
"shipping_address": [
{
"name": "Andrew Robin",
"address": {
"line1": "789 Broadway Avenue",
"line2": "Suite 500",
"city": "New York",
"state": "NY",
"country": "US",
"postal_code": "10003"
},
"phone": {
"calling_code": "1",
"number": "9175550132"
}
}
],
"metadata": {
"customer_type": "premium",
"preferred_language": "en",
"referral_code": "REF2025ABC"
}
}
}Authorizations
Basic authentication header of the form Basic <encoded-value>, where <encoded-value> is the base64-encoded string username:password.
Body
application/json
Customer's name
Customer's email address
Customer's country. ISO 3166 standard alpha-2 code. eg: SG, IN, US, etc.
The unique reference_id on your system representing the customer
Phone contact details
Show child attributes
Show child attributes
Customer's billing details
Show child attributes
Show child attributes
Customer's shipping details
Show child attributes
Show child attributes
Set of key-value pairs that can be attached to the object (JSON string format)
Example:
"{\"key1\": \"value1\", \"key2\": \"value2\"}"
Was this page helpful?
⌘I