curl -X PATCH "https://api-sandbox.whitelabel.com/v1/customers/<id>" \
-H "Content-Type: application/json" \
-H "public-api-key: <public-api-key>" \
-H "private-secret-key: <private-secret-key>" \
-d '{
"merchant_customer_id": "string",
"merchant_customer_created_at": "1970-01-01T00:00:00.000Z",
"first_name": "string",
"last_name": "string",
"gender": "string",
"date_of_birth": "string",
"email": "string",
"nationality": "AF",
"country": "AF",
"document": {
"document_number": "string",
"document_type": "string"
},
"phone": {
"country_code": "string",
"number": "string"
},
"billing_address": {
"address_line_1": "string",
"address_line_2": "string",
"city": "string",
"country": "AF",
"state": "string",
"zip_code": "string",
"neighborhood": "string"
},
"shipping_address": {
"address_line_1": "string",
"address_line_2": "string",
"city": "string",
"country": "AF",
"state": "string",
"zip_code": "string",
"neighborhood": "string"
},
"metadata": [
{
"key": "string",
"value": "string"
}
]
}' const response = await fetch ( `https://api-sandbox.whitelabel.com/v1/customers/${ id }` , {
method: 'PATCH' ,
headers: { 'Content-Type' : 'application/json' , 'public-api-key' : '<public-api-key>' , 'private-secret-key' : '<private-secret-key>' },
body: JSON . stringify ({
"merchant_customer_id" : "string" ,
"merchant_customer_created_at" : "1970-01-01T00:00:00.000Z" ,
"first_name" : "string" ,
"last_name" : "string" ,
"gender" : "string" ,
"date_of_birth" : "string" ,
"email" : "string" ,
"nationality" : "AF" ,
"country" : "AF" ,
"document" : {
"document_number" : "string" ,
"document_type" : "string"
},
"phone" : {
"country_code" : "string" ,
"number" : "string"
},
"billing_address" : {
"address_line_1" : "string" ,
"address_line_2" : "string" ,
"city" : "string" ,
"country" : "AF" ,
"state" : "string" ,
"zip_code" : "string" ,
"neighborhood" : "string"
},
"shipping_address" : {
"address_line_1" : "string" ,
"address_line_2" : "string" ,
"city" : "string" ,
"country" : "AF" ,
"state" : "string" ,
"zip_code" : "string" ,
"neighborhood" : "string"
},
"metadata" : [
{
"key" : "string" ,
"value" : "string"
}
]
})
});
const data = await response. json (); import requests
response = requests.request(
"PATCH" ,
"https://api-sandbox.whitelabel.com/v1/customers/ {id} " ,
headers = { "public-api-key" : "<public-api-key>" , "private-secret-key" : "<private-secret-key>" },
json = {
"merchant_customer_id" : "string" ,
"merchant_customer_created_at" : "1970-01-01T00:00:00.000Z" ,
"first_name" : "string" ,
"last_name" : "string" ,
"gender" : "string" ,
"date_of_birth" : "string" ,
"email" : "string" ,
"nationality" : "AF" ,
"country" : "AF" ,
"document" : {
"document_number" : "string" ,
"document_type" : "string"
},
"phone" : {
"country_code" : "string" ,
"number" : "string"
},
"billing_address" : {
"address_line_1" : "string" ,
"address_line_2" : "string" ,
"city" : "string" ,
"country" : "AF" ,
"state" : "string" ,
"zip_code" : "string" ,
"neighborhood" : "string"
},
"shipping_address" : {
"address_line_1" : "string" ,
"address_line_2" : "string" ,
"city" : "string" ,
"country" : "AF" ,
"state" : "string" ,
"zip_code" : "string" ,
"neighborhood" : "string"
},
"metadata" : [
{
"key" : "string" ,
"value" : "string"
}
]
},
)
data = response.json() <? php
$ch = curl_init ();
curl_setopt ($ch, CURLOPT_URL , "https://api-sandbox.whitelabel.com/v1/customers/<id>" );
curl_setopt ($ch, CURLOPT_RETURNTRANSFER , true );
curl_setopt ($ch, CURLOPT_CUSTOMREQUEST , "PATCH" );
curl_setopt ($ch, CURLOPT_HTTPHEADER , [ "Content-Type: application/json" , "public-api-key: <public-api-key>" , "private-secret-key: <private-secret-key>" ]);
curl_setopt ($ch, CURLOPT_POSTFIELDS , '{
"merchant_customer_id": "string",
"merchant_customer_created_at": "1970-01-01T00:00:00.000Z",
"first_name": "string",
"last_name": "string",
"gender": "string",
"date_of_birth": "string",
"email": "string",
"nationality": "AF",
"country": "AF",
"document": {
"document_number": "string",
"document_type": "string"
},
"phone": {
"country_code": "string",
"number": "string"
},
"billing_address": {
"address_line_1": "string",
"address_line_2": "string",
"city": "string",
"country": "AF",
"state": "string",
"zip_code": "string",
"neighborhood": "string"
},
"shipping_address": {
"address_line_1": "string",
"address_line_2": "string",
"city": "string",
"country": "AF",
"state": "string",
"zip_code": "string",
"neighborhood": "string"
},
"metadata": [
{
"key": "string",
"value": "string"
}
]
}' );
$response = curl_exec ($ch);
curl_close ($ch); package main
import (
" fmt "
" io "
" net/http "
" strings "
)
func main () {
req, _ := http. NewRequest ( "PATCH" , "https://api-sandbox.whitelabel.com/v1/customers/<id>" , strings. NewReader ( `{
"merchant_customer_id": "string",
"merchant_customer_created_at": "1970-01-01T00:00:00.000Z",
"first_name": "string",
"last_name": "string",
"gender": "string",
"date_of_birth": "string",
"email": "string",
"nationality": "AF",
"country": "AF",
"document": {
"document_number": "string",
"document_type": "string"
},
"phone": {
"country_code": "string",
"number": "string"
},
"billing_address": {
"address_line_1": "string",
"address_line_2": "string",
"city": "string",
"country": "AF",
"state": "string",
"zip_code": "string",
"neighborhood": "string"
},
"shipping_address": {
"address_line_1": "string",
"address_line_2": "string",
"city": "string",
"country": "AF",
"state": "string",
"zip_code": "string",
"neighborhood": "string"
},
"metadata": [
{
"key": "string",
"value": "string"
}
]
}` ))
req.Header. Set ( "Content-Type" , "application/json" )
req.Header. Set ( "public-api-key" , "<public-api-key>" )
req.Header. Set ( "private-secret-key" , "<private-secret-key>" )
resp, err := http.DefaultClient. Do (req)
if err != nil {
panic (err)
}
defer resp.Body. Close ()
data, _ := io. ReadAll (resp.Body)
fmt. Println ( string (data))
} HttpClient client = HttpClient. newHttpClient ();
HttpRequest request = HttpRequest. newBuilder ()
. uri (URI. create ( "https://api-sandbox.whitelabel.com/v1/customers/<id>" ))
. header ( "Content-Type" , "application/json" )
. header ( "public-api-key" , "<public-api-key>" )
. header ( "private-secret-key" , "<private-secret-key>" )
. method ( "PATCH" , HttpRequest.BodyPublishers. ofString ( "{ \n \" merchant_customer_id \" : \" string \" , \n \" merchant_customer_created_at \" : \" 1970-01-01T00:00:00.000Z \" , \n \" first_name \" : \" string \" , \n \" last_name \" : \" string \" , \n \" gender \" : \" string \" , \n \" date_of_birth \" : \" string \" , \n \" email \" : \" string \" , \n \" nationality \" : \" AF \" , \n \" country \" : \" AF \" , \n \" document \" : { \n \" document_number \" : \" string \" , \n \" document_type \" : \" string \"\n }, \n \" phone \" : { \n \" country_code \" : \" string \" , \n \" number \" : \" string \"\n }, \n \" billing_address \" : { \n \" address_line_1 \" : \" string \" , \n \" address_line_2 \" : \" string \" , \n \" city \" : \" string \" , \n \" country \" : \" AF \" , \n \" state \" : \" string \" , \n \" zip_code \" : \" string \" , \n \" neighborhood \" : \" string \"\n }, \n \" shipping_address \" : { \n \" address_line_1 \" : \" string \" , \n \" address_line_2 \" : \" string \" , \n \" city \" : \" string \" , \n \" country \" : \" AF \" , \n \" state \" : \" string \" , \n \" zip_code \" : \" string \" , \n \" neighborhood \" : \" string \"\n }, \n \" metadata \" : [ \n { \n \" key \" : \" string \" , \n \" value \" : \" string \"\n } \n ] \n }" ))
. build ();
HttpResponse < String > response = client. send (request, HttpResponse.BodyHandlers. ofString ());
System.out. println (response. body ()); require "net/http"
require "uri"
uri = URI ( "https://api-sandbox.whitelabel.com/v1/customers/<id>" )
http = Net :: HTTP . new (uri. host , uri. port )
http. use_ssl = uri. scheme == "https"
request = Net :: HTTP :: Patch . new (uri)
request[ "Content-Type" ] = "application/json"
request[ "public-api-key" ] = "<public-api-key>"
request[ "private-secret-key" ] = "<private-secret-key>"
request. body = "{ \n \" merchant_customer_id \" : \" string \" , \n \" merchant_customer_created_at \" : \" 1970-01-01T00:00:00.000Z \" , \n \" first_name \" : \" string \" , \n \" last_name \" : \" string \" , \n \" gender \" : \" string \" , \n \" date_of_birth \" : \" string \" , \n \" email \" : \" string \" , \n \" nationality \" : \" AF \" , \n \" country \" : \" AF \" , \n \" document \" : { \n \" document_number \" : \" string \" , \n \" document_type \" : \" string \"\n }, \n \" phone \" : { \n \" country_code \" : \" string \" , \n \" number \" : \" string \"\n }, \n \" billing_address \" : { \n \" address_line_1 \" : \" string \" , \n \" address_line_2 \" : \" string \" , \n \" city \" : \" string \" , \n \" country \" : \" AF \" , \n \" state \" : \" string \" , \n \" zip_code \" : \" string \" , \n \" neighborhood \" : \" string \"\n }, \n \" shipping_address \" : { \n \" address_line_1 \" : \" string \" , \n \" address_line_2 \" : \" string \" , \n \" city \" : \" string \" , \n \" country \" : \" AF \" , \n \" state \" : \" string \" , \n \" zip_code \" : \" string \" , \n \" neighborhood \" : \" string \"\n }, \n \" metadata \" : [ \n { \n \" key \" : \" string \" , \n \" value \" : \" string \"\n } \n ] \n }"
response = http. request (request)
puts response. body ⧉