curl -X POST "https://api-sandbox.whitelabel.com/v1/smart-support/external/payments" \
-H "Content-Type: application/json" \
-H "public-api-key: <public-api-key>" \
-H "private-secret-key: <private-secret-key>" \
-d '{
"customer": {
"full_name": "Jane Doe",
"phone_number": "+573001234567",
"email": "jane.doe@example.com",
"country_code": "CO",
"language": "es"
},
"session": {
"abandonment_timestamp": "2025-05-13T22:45:00Z",
"flow_stage": "checkout",
"platform": "web",
"session_id": "sess_abc123xyz"
},
"cart": {
"total_value": 149.99,
"currency": "COP",
"items": [
{
"name": "Wireless Headphones",
"sku": "WH-1000XM5",
"quantity": 1,
"price": 149.99
}
]
},
"engagement": {
"preferred_channel": "auto",
"reason": "user_abandoned_checkout",
"metadata": {
"utm_campaign": "spring_sale",
"last_clicked_button": "Proceed to Payment"
}
}
}' const response = await fetch ( `https://api-sandbox.whitelabel.com/v1/smart-support/external/payments` , {
method: 'POST' ,
headers: { 'Content-Type' : 'application/json' , 'public-api-key' : '<public-api-key>' , 'private-secret-key' : '<private-secret-key>' },
body: JSON . stringify ({
"customer" : {
"full_name" : "Jane Doe" ,
"phone_number" : "+573001234567" ,
"email" : "jane.doe@example.com" ,
"country_code" : "CO" ,
"language" : "es"
},
"session" : {
"abandonment_timestamp" : "2025-05-13T22:45:00Z" ,
"flow_stage" : "checkout" ,
"platform" : "web" ,
"session_id" : "sess_abc123xyz"
},
"cart" : {
"total_value" : 149.99 ,
"currency" : "COP" ,
"items" : [
{
"name" : "Wireless Headphones" ,
"sku" : "WH-1000XM5" ,
"quantity" : 1 ,
"price" : 149.99
}
]
},
"engagement" : {
"preferred_channel" : "auto" ,
"reason" : "user_abandoned_checkout" ,
"metadata" : {
"utm_campaign" : "spring_sale" ,
"last_clicked_button" : "Proceed to Payment"
}
}
})
});
const data = await response. json (); import requests
response = requests.request(
"POST" ,
"https://api-sandbox.whitelabel.com/v1/smart-support/external/payments" ,
headers = { "public-api-key" : "<public-api-key>" , "private-secret-key" : "<private-secret-key>" },
json = {
"customer" : {
"full_name" : "Jane Doe" ,
"phone_number" : "+573001234567" ,
"email" : "jane.doe@example.com" ,
"country_code" : "CO" ,
"language" : "es"
},
"session" : {
"abandonment_timestamp" : "2025-05-13T22:45:00Z" ,
"flow_stage" : "checkout" ,
"platform" : "web" ,
"session_id" : "sess_abc123xyz"
},
"cart" : {
"total_value" : 149.99 ,
"currency" : "COP" ,
"items" : [
{
"name" : "Wireless Headphones" ,
"sku" : "WH-1000XM5" ,
"quantity" : 1 ,
"price" : 149.99
}
]
},
"engagement" : {
"preferred_channel" : "auto" ,
"reason" : "user_abandoned_checkout" ,
"metadata" : {
"utm_campaign" : "spring_sale" ,
"last_clicked_button" : "Proceed to Payment"
}
}
},
)
data = response.json() <? php
$ch = curl_init ();
curl_setopt ($ch, CURLOPT_URL , "https://api-sandbox.whitelabel.com/v1/smart-support/external/payments" );
curl_setopt ($ch, CURLOPT_RETURNTRANSFER , true );
curl_setopt ($ch, CURLOPT_CUSTOMREQUEST , "POST" );
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 , '{
"customer": {
"full_name": "Jane Doe",
"phone_number": "+573001234567",
"email": "jane.doe@example.com",
"country_code": "CO",
"language": "es"
},
"session": {
"abandonment_timestamp": "2025-05-13T22:45:00Z",
"flow_stage": "checkout",
"platform": "web",
"session_id": "sess_abc123xyz"
},
"cart": {
"total_value": 149.99,
"currency": "COP",
"items": [
{
"name": "Wireless Headphones",
"sku": "WH-1000XM5",
"quantity": 1,
"price": 149.99
}
]
},
"engagement": {
"preferred_channel": "auto",
"reason": "user_abandoned_checkout",
"metadata": {
"utm_campaign": "spring_sale",
"last_clicked_button": "Proceed to Payment"
}
}
}' );
$response = curl_exec ($ch);
curl_close ($ch); package main
import (
" fmt "
" io "
" net/http "
" strings "
)
func main () {
req, _ := http. NewRequest ( "POST" , "https://api-sandbox.whitelabel.com/v1/smart-support/external/payments" , strings. NewReader ( `{
"customer": {
"full_name": "Jane Doe",
"phone_number": "+573001234567",
"email": "jane.doe@example.com",
"country_code": "CO",
"language": "es"
},
"session": {
"abandonment_timestamp": "2025-05-13T22:45:00Z",
"flow_stage": "checkout",
"platform": "web",
"session_id": "sess_abc123xyz"
},
"cart": {
"total_value": 149.99,
"currency": "COP",
"items": [
{
"name": "Wireless Headphones",
"sku": "WH-1000XM5",
"quantity": 1,
"price": 149.99
}
]
},
"engagement": {
"preferred_channel": "auto",
"reason": "user_abandoned_checkout",
"metadata": {
"utm_campaign": "spring_sale",
"last_clicked_button": "Proceed to Payment"
}
}
}` ))
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/smart-support/external/payments" ))
. header ( "Content-Type" , "application/json" )
. header ( "public-api-key" , "<public-api-key>" )
. header ( "private-secret-key" , "<private-secret-key>" )
. method ( "POST" , HttpRequest.BodyPublishers. ofString ( "{ \n \" customer \" : { \n \" full_name \" : \" Jane Doe \" , \n \" phone_number \" : \" +573001234567 \" , \n \" email \" : \" jane.doe@example.com \" , \n \" country_code \" : \" CO \" , \n \" language \" : \" es \"\n }, \n \" session \" : { \n \" abandonment_timestamp \" : \" 2025-05-13T22:45:00Z \" , \n \" flow_stage \" : \" checkout \" , \n \" platform \" : \" web \" , \n \" session_id \" : \" sess_abc123xyz \"\n }, \n \" cart \" : { \n \" total_value \" : 149.99, \n \" currency \" : \" COP \" , \n \" items \" : [ \n { \n \" name \" : \" Wireless Headphones \" , \n \" sku \" : \" WH-1000XM5 \" , \n \" quantity \" : 1, \n \" price \" : 149.99 \n } \n ] \n }, \n \" engagement \" : { \n \" preferred_channel \" : \" auto \" , \n \" reason \" : \" user_abandoned_checkout \" , \n \" metadata \" : { \n \" utm_campaign \" : \" spring_sale \" , \n \" last_clicked_button \" : \" Proceed to Payment \"\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/smart-support/external/payments" )
http = Net :: HTTP . new (uri. host , uri. port )
http. use_ssl = uri. scheme == "https"
request = Net :: HTTP :: Post . new (uri)
request[ "Content-Type" ] = "application/json"
request[ "public-api-key" ] = "<public-api-key>"
request[ "private-secret-key" ] = "<private-secret-key>"
request. body = "{ \n \" customer \" : { \n \" full_name \" : \" Jane Doe \" , \n \" phone_number \" : \" +573001234567 \" , \n \" email \" : \" jane.doe@example.com \" , \n \" country_code \" : \" CO \" , \n \" language \" : \" es \"\n }, \n \" session \" : { \n \" abandonment_timestamp \" : \" 2025-05-13T22:45:00Z \" , \n \" flow_stage \" : \" checkout \" , \n \" platform \" : \" web \" , \n \" session_id \" : \" sess_abc123xyz \"\n }, \n \" cart \" : { \n \" total_value \" : 149.99, \n \" currency \" : \" COP \" , \n \" items \" : [ \n { \n \" name \" : \" Wireless Headphones \" , \n \" sku \" : \" WH-1000XM5 \" , \n \" quantity \" : 1, \n \" price \" : 149.99 \n } \n ] \n }, \n \" engagement \" : { \n \" preferred_channel \" : \" auto \" , \n \" reason \" : \" user_abandoned_checkout \" , \n \" metadata \" : { \n \" utm_campaign \" : \" spring_sale \" , \n \" last_clicked_button \" : \" Proceed to Payment \"\n } \n } \n }"
response = http. request (request)
puts response. body ⧉