curl -X POST "https://api-sandbox.whitelabel.com/v1/smart-support/external/payments/recover" \
-H "Content-Type: application/json" \
-H "public-api-key: <public-api-key>" \
-H "private-secret-key: <private-secret-key>" \
-d '{
"settings": {
"contact_details": {
"channel": "WHATSAPP_MESSAGE",
"initial_template_message": {
"id": "HX8e7ac569f40a064c71a37e5d672bb9123",
"variables": {
"name": "Maria",
"amount": "$10.0000"
}
},
"pdf_template": {
"id": "string",
"variables": {
"seller_name": "RAPPI",
"merchant_order_id": "MX_Verification_50708779"
}
},
"payment_methods": {
"available": [
"MERCADO_PAGO",
"NEQUI",
"CREDIT_CARD"
]
}
}
},
"additional_information": {
"seller_details": {
"name": "RAPPI",
"fallback_instructions": "Go to the application and click on the top right corner to contact a customer support agent.",
"redirection_url": "www.test.com/purchase"
},
"payment": {
"account_id": "e4c03f29-b0f6-403a-8814-9aee1a88d60e",
"id": "f1fbad16-93c1-4335-b735-2b01ec94ea9e",
"merchant_order_id": "ORDER-12345",
"country": "US",
"description": "Online store purchase",
"created_at": "2022-05-09T20:46:54.786342Z",
"declined_reason": "insufficient funds",
"payment_method": {
"type": "Credit Card",
"detail": {
"card_data": {
"expiration_month": 12,
"expiration_year": 2030,
"iin": "411111",
"lfd": "1234",
"issuer": "CHASE",
"type": "CREDIT"
}
}
},
"amount": {
"value": 149.99,
"currency": "USD"
},
"customer_payer": {
"first_name": "John",
"last_name": "Doe",
"phone": {
"country_code": "1",
"number": "5551234567"
}
}
}
}
}' const response = await fetch ( `https://api-sandbox.whitelabel.com/v1/smart-support/external/payments/recover` , {
method: 'POST' ,
headers: { 'Content-Type' : 'application/json' , 'public-api-key' : '<public-api-key>' , 'private-secret-key' : '<private-secret-key>' },
body: JSON . stringify ({
"settings" : {
"contact_details" : {
"channel" : "WHATSAPP_MESSAGE" ,
"initial_template_message" : {
"id" : "HX8e7ac569f40a064c71a37e5d672bb9123" ,
"variables" : {
"name" : "Maria" ,
"amount" : "$10.0000"
}
},
"pdf_template" : {
"id" : "string" ,
"variables" : {
"seller_name" : "RAPPI" ,
"merchant_order_id" : "MX_Verification_50708779"
}
},
"payment_methods" : {
"available" : [
"MERCADO_PAGO" ,
"NEQUI" ,
"CREDIT_CARD"
]
}
}
},
"additional_information" : {
"seller_details" : {
"name" : "RAPPI" ,
"fallback_instructions" : "Go to the application and click on the top right corner to contact a customer support agent." ,
"redirection_url" : "www.test.com/purchase"
},
"payment" : {
"account_id" : "e4c03f29-b0f6-403a-8814-9aee1a88d60e" ,
"id" : "f1fbad16-93c1-4335-b735-2b01ec94ea9e" ,
"merchant_order_id" : "ORDER-12345" ,
"country" : "US" ,
"description" : "Online store purchase" ,
"created_at" : "2022-05-09T20:46:54.786342Z" ,
"declined_reason" : "insufficient funds" ,
"payment_method" : {
"type" : "Credit Card" ,
"detail" : {
"card_data" : {
"expiration_month" : 12 ,
"expiration_year" : 2030 ,
"iin" : "411111" ,
"lfd" : "1234" ,
"issuer" : "CHASE" ,
"type" : "CREDIT"
}
}
},
"amount" : {
"value" : 149.99 ,
"currency" : "USD"
},
"customer_payer" : {
"first_name" : "John" ,
"last_name" : "Doe" ,
"phone" : {
"country_code" : "1" ,
"number" : "5551234567"
}
}
}
}
})
});
const data = await response. json (); import requests
response = requests.request(
"POST" ,
"https://api-sandbox.whitelabel.com/v1/smart-support/external/payments/recover" ,
headers = { "public-api-key" : "<public-api-key>" , "private-secret-key" : "<private-secret-key>" },
json = {
"settings" : {
"contact_details" : {
"channel" : "WHATSAPP_MESSAGE" ,
"initial_template_message" : {
"id" : "HX8e7ac569f40a064c71a37e5d672bb9123" ,
"variables" : {
"name" : "Maria" ,
"amount" : "$10.0000"
}
},
"pdf_template" : {
"id" : "string" ,
"variables" : {
"seller_name" : "RAPPI" ,
"merchant_order_id" : "MX_Verification_50708779"
}
},
"payment_methods" : {
"available" : [
"MERCADO_PAGO" ,
"NEQUI" ,
"CREDIT_CARD"
]
}
}
},
"additional_information" : {
"seller_details" : {
"name" : "RAPPI" ,
"fallback_instructions" : "Go to the application and click on the top right corner to contact a customer support agent." ,
"redirection_url" : "www.test.com/purchase"
},
"payment" : {
"account_id" : "e4c03f29-b0f6-403a-8814-9aee1a88d60e" ,
"id" : "f1fbad16-93c1-4335-b735-2b01ec94ea9e" ,
"merchant_order_id" : "ORDER-12345" ,
"country" : "US" ,
"description" : "Online store purchase" ,
"created_at" : "2022-05-09T20:46:54.786342Z" ,
"declined_reason" : "insufficient funds" ,
"payment_method" : {
"type" : "Credit Card" ,
"detail" : {
"card_data" : {
"expiration_month" : 12 ,
"expiration_year" : 2030 ,
"iin" : "411111" ,
"lfd" : "1234" ,
"issuer" : "CHASE" ,
"type" : "CREDIT"
}
}
},
"amount" : {
"value" : 149.99 ,
"currency" : "USD"
},
"customer_payer" : {
"first_name" : "John" ,
"last_name" : "Doe" ,
"phone" : {
"country_code" : "1" ,
"number" : "5551234567"
}
}
}
}
},
)
data = response.json() <? php
$ch = curl_init ();
curl_setopt ($ch, CURLOPT_URL , "https://api-sandbox.whitelabel.com/v1/smart-support/external/payments/recover" );
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 , '{
"settings": {
"contact_details": {
"channel": "WHATSAPP_MESSAGE",
"initial_template_message": {
"id": "HX8e7ac569f40a064c71a37e5d672bb9123",
"variables": {
"name": "Maria",
"amount": "$10.0000"
}
},
"pdf_template": {
"id": "string",
"variables": {
"seller_name": "RAPPI",
"merchant_order_id": "MX_Verification_50708779"
}
},
"payment_methods": {
"available": [
"MERCADO_PAGO",
"NEQUI",
"CREDIT_CARD"
]
}
}
},
"additional_information": {
"seller_details": {
"name": "RAPPI",
"fallback_instructions": "Go to the application and click on the top right corner to contact a customer support agent.",
"redirection_url": "www.test.com/purchase"
},
"payment": {
"account_id": "e4c03f29-b0f6-403a-8814-9aee1a88d60e",
"id": "f1fbad16-93c1-4335-b735-2b01ec94ea9e",
"merchant_order_id": "ORDER-12345",
"country": "US",
"description": "Online store purchase",
"created_at": "2022-05-09T20:46:54.786342Z",
"declined_reason": "insufficient funds",
"payment_method": {
"type": "Credit Card",
"detail": {
"card_data": {
"expiration_month": 12,
"expiration_year": 2030,
"iin": "411111",
"lfd": "1234",
"issuer": "CHASE",
"type": "CREDIT"
}
}
},
"amount": {
"value": 149.99,
"currency": "USD"
},
"customer_payer": {
"first_name": "John",
"last_name": "Doe",
"phone": {
"country_code": "1",
"number": "5551234567"
}
}
}
}
}' );
$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/recover" , strings. NewReader ( `{
"settings": {
"contact_details": {
"channel": "WHATSAPP_MESSAGE",
"initial_template_message": {
"id": "HX8e7ac569f40a064c71a37e5d672bb9123",
"variables": {
"name": "Maria",
"amount": "$10.0000"
}
},
"pdf_template": {
"id": "string",
"variables": {
"seller_name": "RAPPI",
"merchant_order_id": "MX_Verification_50708779"
}
},
"payment_methods": {
"available": [
"MERCADO_PAGO",
"NEQUI",
"CREDIT_CARD"
]
}
}
},
"additional_information": {
"seller_details": {
"name": "RAPPI",
"fallback_instructions": "Go to the application and click on the top right corner to contact a customer support agent.",
"redirection_url": "www.test.com/purchase"
},
"payment": {
"account_id": "e4c03f29-b0f6-403a-8814-9aee1a88d60e",
"id": "f1fbad16-93c1-4335-b735-2b01ec94ea9e",
"merchant_order_id": "ORDER-12345",
"country": "US",
"description": "Online store purchase",
"created_at": "2022-05-09T20:46:54.786342Z",
"declined_reason": "insufficient funds",
"payment_method": {
"type": "Credit Card",
"detail": {
"card_data": {
"expiration_month": 12,
"expiration_year": 2030,
"iin": "411111",
"lfd": "1234",
"issuer": "CHASE",
"type": "CREDIT"
}
}
},
"amount": {
"value": 149.99,
"currency": "USD"
},
"customer_payer": {
"first_name": "John",
"last_name": "Doe",
"phone": {
"country_code": "1",
"number": "5551234567"
}
}
}
}
}` ))
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/recover" ))
. 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 \" settings \" : { \n \" contact_details \" : { \n \" channel \" : \" WHATSAPP_MESSAGE \" , \n \" initial_template_message \" : { \n \" id \" : \" HX8e7ac569f40a064c71a37e5d672bb9123 \" , \n \" variables \" : { \n \" name \" : \" Maria \" , \n \" amount \" : \" $10.0000 \"\n } \n }, \n \" pdf_template \" : { \n \" id \" : \" string \" , \n \" variables \" : { \n \" seller_name \" : \" RAPPI \" , \n \" merchant_order_id \" : \" MX_Verification_50708779 \"\n } \n }, \n \" payment_methods \" : { \n \" available \" : [ \n \" MERCADO_PAGO \" , \n \" NEQUI \" , \n \" CREDIT_CARD \"\n ] \n } \n } \n }, \n \" additional_information \" : { \n \" seller_details \" : { \n \" name \" : \" RAPPI \" , \n \" fallback_instructions \" : \" Go to the application and click on the top right corner to contact a customer support agent. \" , \n \" redirection_url \" : \" www.test.com/purchase \"\n }, \n \" payment \" : { \n \" account_id \" : \" e4c03f29-b0f6-403a-8814-9aee1a88d60e \" , \n \" id \" : \" f1fbad16-93c1-4335-b735-2b01ec94ea9e \" , \n \" merchant_order_id \" : \" ORDER-12345 \" , \n \" country \" : \" US \" , \n \" description \" : \" Online store purchase \" , \n \" created_at \" : \" 2022-05-09T20:46:54.786342Z \" , \n \" declined_reason \" : \" insufficient funds \" , \n \" payment_method \" : { \n \" type \" : \" Credit Card \" , \n \" detail \" : { \n \" card_data \" : { \n \" expiration_month \" : 12, \n \" expiration_year \" : 2030, \n \" iin \" : \" 411111 \" , \n \" lfd \" : \" 1234 \" , \n \" issuer \" : \" CHASE \" , \n \" type \" : \" CREDIT \"\n } \n } \n }, \n \" amount \" : { \n \" value \" : 149.99, \n \" currency \" : \" USD \"\n }, \n \" customer_payer \" : { \n \" first_name \" : \" John \" , \n \" last_name \" : \" Doe \" , \n \" phone \" : { \n \" country_code \" : \" 1 \" , \n \" number \" : \" 5551234567 \"\n } \n } \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/recover" )
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 \" settings \" : { \n \" contact_details \" : { \n \" channel \" : \" WHATSAPP_MESSAGE \" , \n \" initial_template_message \" : { \n \" id \" : \" HX8e7ac569f40a064c71a37e5d672bb9123 \" , \n \" variables \" : { \n \" name \" : \" Maria \" , \n \" amount \" : \" $10.0000 \"\n } \n }, \n \" pdf_template \" : { \n \" id \" : \" string \" , \n \" variables \" : { \n \" seller_name \" : \" RAPPI \" , \n \" merchant_order_id \" : \" MX_Verification_50708779 \"\n } \n }, \n \" payment_methods \" : { \n \" available \" : [ \n \" MERCADO_PAGO \" , \n \" NEQUI \" , \n \" CREDIT_CARD \"\n ] \n } \n } \n }, \n \" additional_information \" : { \n \" seller_details \" : { \n \" name \" : \" RAPPI \" , \n \" fallback_instructions \" : \" Go to the application and click on the top right corner to contact a customer support agent. \" , \n \" redirection_url \" : \" www.test.com/purchase \"\n }, \n \" payment \" : { \n \" account_id \" : \" e4c03f29-b0f6-403a-8814-9aee1a88d60e \" , \n \" id \" : \" f1fbad16-93c1-4335-b735-2b01ec94ea9e \" , \n \" merchant_order_id \" : \" ORDER-12345 \" , \n \" country \" : \" US \" , \n \" description \" : \" Online store purchase \" , \n \" created_at \" : \" 2022-05-09T20:46:54.786342Z \" , \n \" declined_reason \" : \" insufficient funds \" , \n \" payment_method \" : { \n \" type \" : \" Credit Card \" , \n \" detail \" : { \n \" card_data \" : { \n \" expiration_month \" : 12, \n \" expiration_year \" : 2030, \n \" iin \" : \" 411111 \" , \n \" lfd \" : \" 1234 \" , \n \" issuer \" : \" CHASE \" , \n \" type \" : \" CREDIT \"\n } \n } \n }, \n \" amount \" : { \n \" value \" : 149.99, \n \" currency \" : \" USD \"\n }, \n \" customer_payer \" : { \n \" first_name \" : \" John \" , \n \" last_name \" : \" Doe \" , \n \" phone \" : { \n \" country_code \" : \" 1 \" , \n \" number \" : \" 5551234567 \"\n } \n } \n } \n } \n }"
response = http. request (request)
puts response. body ⧉