Add Billing/Shipping
curl --request POST \
--url https://service-sandbox.tazapay.com/v3/customer/{id}/{type} \
--header 'Authorization: Basic <encoded-value>' \
--header 'Content-Type: application/json' \
--data '
{
"billing": {
"name": "Andrew Robin",
"address": {
"line1": "29-35",
"line2": "9th Ave",
"city": "New York",
"state": "New York",
"country": "US",
"postal_code": "10014"
},
"phone": {
"calling_code": "1",
"number": "9876543214"
}
},
"shipping": {
"name": "Andrew Robin",
"address": {
"line1": "1000",
"line2": "5th Ave",
"city": "New York",
"state": "New York",
"country": "US",
"postal_code": "10028"
},
"phone": {
"calling_code": "1",
"number": "9876543214"
}
}
}
'import requests
url = "https://service-sandbox.tazapay.com/v3/customer/{id}/{type}"
payload = {
"billing": {
"name": "Andrew Robin",
"address": {
"line1": "29-35",
"line2": "9th Ave",
"city": "New York",
"state": "New York",
"country": "US",
"postal_code": "10014"
},
"phone": {
"calling_code": "1",
"number": "9876543214"
}
},
"shipping": {
"name": "Andrew Robin",
"address": {
"line1": "1000",
"line2": "5th Ave",
"city": "New York",
"state": "New York",
"country": "US",
"postal_code": "10028"
},
"phone": {
"calling_code": "1",
"number": "9876543214"
}
}
}
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({
billing: {
name: 'Andrew Robin',
address: {
line1: '29-35',
line2: '9th Ave',
city: 'New York',
state: 'New York',
country: 'US',
postal_code: '10014'
},
phone: {calling_code: '1', number: '9876543214'}
},
shipping: {
name: 'Andrew Robin',
address: {
line1: '1000',
line2: '5th Ave',
city: 'New York',
state: 'New York',
country: 'US',
postal_code: '10028'
},
phone: {calling_code: '1', number: '9876543214'}
}
})
};
fetch('https://service-sandbox.tazapay.com/v3/customer/{id}/{type}', 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/{id}/{type}",
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([
'billing' => [
'name' => 'Andrew Robin',
'address' => [
'line1' => '29-35',
'line2' => '9th Ave',
'city' => 'New York',
'state' => 'New York',
'country' => 'US',
'postal_code' => '10014'
],
'phone' => [
'calling_code' => '1',
'number' => '9876543214'
]
],
'shipping' => [
'name' => 'Andrew Robin',
'address' => [
'line1' => '1000',
'line2' => '5th Ave',
'city' => 'New York',
'state' => 'New York',
'country' => 'US',
'postal_code' => '10028'
],
'phone' => [
'calling_code' => '1',
'number' => '9876543214'
]
]
]),
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/{id}/{type}"
payload := strings.NewReader("{\n \"billing\": {\n \"name\": \"Andrew Robin\",\n \"address\": {\n \"line1\": \"29-35\",\n \"line2\": \"9th Ave\",\n \"city\": \"New York\",\n \"state\": \"New York\",\n \"country\": \"US\",\n \"postal_code\": \"10014\"\n },\n \"phone\": {\n \"calling_code\": \"1\",\n \"number\": \"9876543214\"\n }\n },\n \"shipping\": {\n \"name\": \"Andrew Robin\",\n \"address\": {\n \"line1\": \"1000\",\n \"line2\": \"5th Ave\",\n \"city\": \"New York\",\n \"state\": \"New York\",\n \"country\": \"US\",\n \"postal_code\": \"10028\"\n },\n \"phone\": {\n \"calling_code\": \"1\",\n \"number\": \"9876543214\"\n }\n }\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/{id}/{type}")
.header("Authorization", "Basic <encoded-value>")
.header("Content-Type", "application/json")
.body("{\n \"billing\": {\n \"name\": \"Andrew Robin\",\n \"address\": {\n \"line1\": \"29-35\",\n \"line2\": \"9th Ave\",\n \"city\": \"New York\",\n \"state\": \"New York\",\n \"country\": \"US\",\n \"postal_code\": \"10014\"\n },\n \"phone\": {\n \"calling_code\": \"1\",\n \"number\": \"9876543214\"\n }\n },\n \"shipping\": {\n \"name\": \"Andrew Robin\",\n \"address\": {\n \"line1\": \"1000\",\n \"line2\": \"5th Ave\",\n \"city\": \"New York\",\n \"state\": \"New York\",\n \"country\": \"US\",\n \"postal_code\": \"10028\"\n },\n \"phone\": {\n \"calling_code\": \"1\",\n \"number\": \"9876543214\"\n }\n }\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://service-sandbox.tazapay.com/v3/customer/{id}/{type}")
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 \"billing\": {\n \"name\": \"Andrew Robin\",\n \"address\": {\n \"line1\": \"29-35\",\n \"line2\": \"9th Ave\",\n \"city\": \"New York\",\n \"state\": \"New York\",\n \"country\": \"US\",\n \"postal_code\": \"10014\"\n },\n \"phone\": {\n \"calling_code\": \"1\",\n \"number\": \"9876543214\"\n }\n },\n \"shipping\": {\n \"name\": \"Andrew Robin\",\n \"address\": {\n \"line1\": \"1000\",\n \"line2\": \"5th Ave\",\n \"city\": \"New York\",\n \"state\": \"New York\",\n \"country\": \"US\",\n \"postal_code\": \"10028\"\n },\n \"phone\": {\n \"calling_code\": \"1\",\n \"number\": \"9876543214\"\n }\n }\n}"
response = http.request(request)
puts response.read_body{
"status": "success",
"message": "",
"data": {
"address_id": "cad_d3rmr3k5rcmatbpls98g",
"message": "Successfully added the customer billing address"
}
}Customer
Add Billing/Shipping
This endpoint adds billing/shipping details to an already existing customer object
POST
/
v3
/
customer
/
{id}
/
{type}
Add Billing/Shipping
curl --request POST \
--url https://service-sandbox.tazapay.com/v3/customer/{id}/{type} \
--header 'Authorization: Basic <encoded-value>' \
--header 'Content-Type: application/json' \
--data '
{
"billing": {
"name": "Andrew Robin",
"address": {
"line1": "29-35",
"line2": "9th Ave",
"city": "New York",
"state": "New York",
"country": "US",
"postal_code": "10014"
},
"phone": {
"calling_code": "1",
"number": "9876543214"
}
},
"shipping": {
"name": "Andrew Robin",
"address": {
"line1": "1000",
"line2": "5th Ave",
"city": "New York",
"state": "New York",
"country": "US",
"postal_code": "10028"
},
"phone": {
"calling_code": "1",
"number": "9876543214"
}
}
}
'import requests
url = "https://service-sandbox.tazapay.com/v3/customer/{id}/{type}"
payload = {
"billing": {
"name": "Andrew Robin",
"address": {
"line1": "29-35",
"line2": "9th Ave",
"city": "New York",
"state": "New York",
"country": "US",
"postal_code": "10014"
},
"phone": {
"calling_code": "1",
"number": "9876543214"
}
},
"shipping": {
"name": "Andrew Robin",
"address": {
"line1": "1000",
"line2": "5th Ave",
"city": "New York",
"state": "New York",
"country": "US",
"postal_code": "10028"
},
"phone": {
"calling_code": "1",
"number": "9876543214"
}
}
}
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({
billing: {
name: 'Andrew Robin',
address: {
line1: '29-35',
line2: '9th Ave',
city: 'New York',
state: 'New York',
country: 'US',
postal_code: '10014'
},
phone: {calling_code: '1', number: '9876543214'}
},
shipping: {
name: 'Andrew Robin',
address: {
line1: '1000',
line2: '5th Ave',
city: 'New York',
state: 'New York',
country: 'US',
postal_code: '10028'
},
phone: {calling_code: '1', number: '9876543214'}
}
})
};
fetch('https://service-sandbox.tazapay.com/v3/customer/{id}/{type}', 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/{id}/{type}",
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([
'billing' => [
'name' => 'Andrew Robin',
'address' => [
'line1' => '29-35',
'line2' => '9th Ave',
'city' => 'New York',
'state' => 'New York',
'country' => 'US',
'postal_code' => '10014'
],
'phone' => [
'calling_code' => '1',
'number' => '9876543214'
]
],
'shipping' => [
'name' => 'Andrew Robin',
'address' => [
'line1' => '1000',
'line2' => '5th Ave',
'city' => 'New York',
'state' => 'New York',
'country' => 'US',
'postal_code' => '10028'
],
'phone' => [
'calling_code' => '1',
'number' => '9876543214'
]
]
]),
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/{id}/{type}"
payload := strings.NewReader("{\n \"billing\": {\n \"name\": \"Andrew Robin\",\n \"address\": {\n \"line1\": \"29-35\",\n \"line2\": \"9th Ave\",\n \"city\": \"New York\",\n \"state\": \"New York\",\n \"country\": \"US\",\n \"postal_code\": \"10014\"\n },\n \"phone\": {\n \"calling_code\": \"1\",\n \"number\": \"9876543214\"\n }\n },\n \"shipping\": {\n \"name\": \"Andrew Robin\",\n \"address\": {\n \"line1\": \"1000\",\n \"line2\": \"5th Ave\",\n \"city\": \"New York\",\n \"state\": \"New York\",\n \"country\": \"US\",\n \"postal_code\": \"10028\"\n },\n \"phone\": {\n \"calling_code\": \"1\",\n \"number\": \"9876543214\"\n }\n }\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/{id}/{type}")
.header("Authorization", "Basic <encoded-value>")
.header("Content-Type", "application/json")
.body("{\n \"billing\": {\n \"name\": \"Andrew Robin\",\n \"address\": {\n \"line1\": \"29-35\",\n \"line2\": \"9th Ave\",\n \"city\": \"New York\",\n \"state\": \"New York\",\n \"country\": \"US\",\n \"postal_code\": \"10014\"\n },\n \"phone\": {\n \"calling_code\": \"1\",\n \"number\": \"9876543214\"\n }\n },\n \"shipping\": {\n \"name\": \"Andrew Robin\",\n \"address\": {\n \"line1\": \"1000\",\n \"line2\": \"5th Ave\",\n \"city\": \"New York\",\n \"state\": \"New York\",\n \"country\": \"US\",\n \"postal_code\": \"10028\"\n },\n \"phone\": {\n \"calling_code\": \"1\",\n \"number\": \"9876543214\"\n }\n }\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://service-sandbox.tazapay.com/v3/customer/{id}/{type}")
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 \"billing\": {\n \"name\": \"Andrew Robin\",\n \"address\": {\n \"line1\": \"29-35\",\n \"line2\": \"9th Ave\",\n \"city\": \"New York\",\n \"state\": \"New York\",\n \"country\": \"US\",\n \"postal_code\": \"10014\"\n },\n \"phone\": {\n \"calling_code\": \"1\",\n \"number\": \"9876543214\"\n }\n },\n \"shipping\": {\n \"name\": \"Andrew Robin\",\n \"address\": {\n \"line1\": \"1000\",\n \"line2\": \"5th Ave\",\n \"city\": \"New York\",\n \"state\": \"New York\",\n \"country\": \"US\",\n \"postal_code\": \"10028\"\n },\n \"phone\": {\n \"calling_code\": \"1\",\n \"number\": \"9876543214\"\n }\n }\n}"
response = http.request(request)
puts response.read_body{
"status": "success",
"message": "",
"data": {
"address_id": "cad_d3rmr3k5rcmatbpls98g",
"message": "Successfully added the customer billing address"
}
}Authorizations
Basic authentication header of the form Basic <encoded-value>, where <encoded-value> is the base64-encoded string username:password.
Path Parameters
ID of an already existing customer object
The type of address you want to add.
Available options:
billing, shipping Body
application/json
Address Details
Show child attributes
Show child attributes
Was this page helpful?
⌘I