curl -X POST "https://api-sandbox.whitelabel.com/v1/customers/sessions" \
-H "Content-Type: application/json" \
-H "public-api-key: <public-api-key>" \
-H "private-secret-key: <private-secret-key>" \
-d '{
"account_id": "string",
"country": "AR",
"customer_id": "string",
"callback_url": "string",
"checkout_id": "string"
}' const response = await fetch ( `https://api-sandbox.whitelabel.com/v1/customers/sessions` , {
method: 'POST' ,
headers: { 'Content-Type' : 'application/json' , 'public-api-key' : '<public-api-key>' , 'private-secret-key' : '<private-secret-key>' },
body: JSON . stringify ({
"account_id" : "string" ,
"country" : "AR" ,
"customer_id" : "string" ,
"callback_url" : "string" ,
"checkout_id" : "string"
})
});
const data = await response. json (); import requests
response = requests.request(
"POST" ,
"https://api-sandbox.whitelabel.com/v1/customers/sessions" ,
headers = { "public-api-key" : "<public-api-key>" , "private-secret-key" : "<private-secret-key>" },
json = {
"account_id" : "string" ,
"country" : "AR" ,
"customer_id" : "string" ,
"callback_url" : "string" ,
"checkout_id" : "string"
},
)
data = response.json() <? php
$ch = curl_init ();
curl_setopt ($ch, CURLOPT_URL , "https://api-sandbox.whitelabel.com/v1/customers/sessions" );
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 , '{
"account_id": "string",
"country": "AR",
"customer_id": "string",
"callback_url": "string",
"checkout_id": "string"
}' );
$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/customers/sessions" , strings. NewReader ( `{
"account_id": "string",
"country": "AR",
"customer_id": "string",
"callback_url": "string",
"checkout_id": "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/sessions" ))
. 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 \" account_id \" : \" string \" , \n \" country \" : \" AR \" , \n \" customer_id \" : \" string \" , \n \" callback_url \" : \" string \" , \n \" checkout_id \" : \" string \"\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/sessions" )
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 \" account_id \" : \" string \" , \n \" country \" : \" AR \" , \n \" customer_id \" : \" string \" , \n \" callback_url \" : \" string \" , \n \" checkout_id \" : \" string \"\n }"
response = http. request (request)
puts response. body ⧉