AI Caller
Declined Payment Calls
Initiates bulk AI calls and WhatsApp messages to recover customers with declined payments
POST
/
smart-support
/
external
/
payments
/
recover
Copy of Declined Payment Calls
curl --request POST \
--url https://api-sandbox.y.uno/v1/smart-support/external/payments/recover \
--header 'Content-Type: application/json' \
--header 'private-secret-key: <api-key>' \
--header 'public-api-key: <api-key>' \
--data '
{
"settings": {
"contact_details": {
"channel": "PHONE_CALL",
"initial_template_message": {
"id": "HX8e7ac569f40a064c71a37e5d672bb9123",
"variables": {
"name": "Maria",
"amount": "$10.0000"
}
},
"pdf_template": {
"id": "ede0d2da-138d-441b-8101-85e2d21af8b9",
"variables": {
"seller_name": "RAPPI",
"merchant_order_id": "MX_Verification_50708779"
}
},
"payment_methods": {
"available": [
"MERCADO_PAGO",
"NEQUI"
]
}
}
},
"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": "MX_Verification_50708779",
"country": "CO",
"description": "Purchase in McDonalds",
"created_at": "2022-05-09T20:46:54.786342Z",
"declined_reason": "insufficient funds",
"payment_method": {
"type": "Credit Card",
"detail": {
"card_data": {
"iin": "636318",
"lfd": "2671",
"type": "CREDIT",
"issuer": "SCOTIABANK",
"expiration_year": 2030,
"expiration_month": 12
}
}
},
"amount": {
"currency": "COP",
"value": 27000
},
"customer_payer": {
"first_name": "Pepito",
"last_name": "Perez",
"phone": {
"country_code": "57",
"number": "3132450765"
}
}
}
}
}
'import requests
url = "https://api-sandbox.y.uno/v1/smart-support/external/payments/recover"
payload = {
"settings": { "contact_details": {
"channel": "PHONE_CALL",
"initial_template_message": {
"id": "HX8e7ac569f40a064c71a37e5d672bb9123",
"variables": {
"name": "Maria",
"amount": "$10.0000"
}
},
"pdf_template": {
"id": "ede0d2da-138d-441b-8101-85e2d21af8b9",
"variables": {
"seller_name": "RAPPI",
"merchant_order_id": "MX_Verification_50708779"
}
},
"payment_methods": { "available": ["MERCADO_PAGO", "NEQUI"] }
} },
"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": "MX_Verification_50708779",
"country": "CO",
"description": "Purchase in McDonalds",
"created_at": "2022-05-09T20:46:54.786342Z",
"declined_reason": "insufficient funds",
"payment_method": {
"type": "Credit Card",
"detail": { "card_data": {
"iin": "636318",
"lfd": "2671",
"type": "CREDIT",
"issuer": "SCOTIABANK",
"expiration_year": 2030,
"expiration_month": 12
} }
},
"amount": {
"currency": "COP",
"value": 27000
},
"customer_payer": {
"first_name": "Pepito",
"last_name": "Perez",
"phone": {
"country_code": "57",
"number": "3132450765"
}
}
}
}
}
headers = {
"public-api-key": "<api-key>",
"private-secret-key": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {
'public-api-key': '<api-key>',
'private-secret-key': '<api-key>',
'Content-Type': 'application/json'
},
body: JSON.stringify({
settings: {
contact_details: {
channel: 'PHONE_CALL',
initial_template_message: {
id: 'HX8e7ac569f40a064c71a37e5d672bb9123',
variables: {name: 'Maria', amount: '$10.0000'}
},
pdf_template: {
id: 'ede0d2da-138d-441b-8101-85e2d21af8b9',
variables: {seller_name: 'RAPPI', merchant_order_id: 'MX_Verification_50708779'}
},
payment_methods: {available: ['MERCADO_PAGO', 'NEQUI']}
}
},
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: 'MX_Verification_50708779',
country: 'CO',
description: 'Purchase in McDonalds',
created_at: '2022-05-09T20:46:54.786342Z',
declined_reason: 'insufficient funds',
payment_method: {
type: 'Credit Card',
detail: {
card_data: {
iin: '636318',
lfd: '2671',
type: 'CREDIT',
issuer: 'SCOTIABANK',
expiration_year: 2030,
expiration_month: 12
}
}
},
amount: {currency: 'COP', value: 27000},
customer_payer: {
first_name: 'Pepito',
last_name: 'Perez',
phone: {country_code: '57', number: '3132450765'}
}
}
}
})
};
fetch('https://api-sandbox.y.uno/v1/smart-support/external/payments/recover', 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://api-sandbox.y.uno/v1/smart-support/external/payments/recover",
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([
'settings' => [
'contact_details' => [
'channel' => 'PHONE_CALL',
'initial_template_message' => [
'id' => 'HX8e7ac569f40a064c71a37e5d672bb9123',
'variables' => [
'name' => 'Maria',
'amount' => '$10.0000'
]
],
'pdf_template' => [
'id' => 'ede0d2da-138d-441b-8101-85e2d21af8b9',
'variables' => [
'seller_name' => 'RAPPI',
'merchant_order_id' => 'MX_Verification_50708779'
]
],
'payment_methods' => [
'available' => [
'MERCADO_PAGO',
'NEQUI'
]
]
]
],
'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' => 'MX_Verification_50708779',
'country' => 'CO',
'description' => 'Purchase in McDonalds',
'created_at' => '2022-05-09T20:46:54.786342Z',
'declined_reason' => 'insufficient funds',
'payment_method' => [
'type' => 'Credit Card',
'detail' => [
'card_data' => [
'iin' => '636318',
'lfd' => '2671',
'type' => 'CREDIT',
'issuer' => 'SCOTIABANK',
'expiration_year' => 2030,
'expiration_month' => 12
]
]
],
'amount' => [
'currency' => 'COP',
'value' => 27000
],
'customer_payer' => [
'first_name' => 'Pepito',
'last_name' => 'Perez',
'phone' => [
'country_code' => '57',
'number' => '3132450765'
]
]
]
]
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"private-secret-key: <api-key>",
"public-api-key: <api-key>"
],
]);
$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://api-sandbox.y.uno/v1/smart-support/external/payments/recover"
payload := strings.NewReader("{\n \"settings\": {\n \"contact_details\": {\n \"channel\": \"PHONE_CALL\",\n \"initial_template_message\": {\n \"id\": \"HX8e7ac569f40a064c71a37e5d672bb9123\",\n \"variables\": {\n \"name\": \"Maria\",\n \"amount\": \"$10.0000\"\n }\n },\n \"pdf_template\": {\n \"id\": \"ede0d2da-138d-441b-8101-85e2d21af8b9\",\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 ]\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\": \"MX_Verification_50708779\",\n \"country\": \"CO\",\n \"description\": \"Purchase in McDonalds\",\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 \"iin\": \"636318\",\n \"lfd\": \"2671\",\n \"type\": \"CREDIT\",\n \"issuer\": \"SCOTIABANK\",\n \"expiration_year\": 2030,\n \"expiration_month\": 12\n }\n }\n },\n \"amount\": {\n \"currency\": \"COP\",\n \"value\": 27000\n },\n \"customer_payer\": {\n \"first_name\": \"Pepito\",\n \"last_name\": \"Perez\",\n \"phone\": {\n \"country_code\": \"57\",\n \"number\": \"3132450765\"\n }\n }\n }\n }\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("public-api-key", "<api-key>")
req.Header.Add("private-secret-key", "<api-key>")
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://api-sandbox.y.uno/v1/smart-support/external/payments/recover")
.header("public-api-key", "<api-key>")
.header("private-secret-key", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"settings\": {\n \"contact_details\": {\n \"channel\": \"PHONE_CALL\",\n \"initial_template_message\": {\n \"id\": \"HX8e7ac569f40a064c71a37e5d672bb9123\",\n \"variables\": {\n \"name\": \"Maria\",\n \"amount\": \"$10.0000\"\n }\n },\n \"pdf_template\": {\n \"id\": \"ede0d2da-138d-441b-8101-85e2d21af8b9\",\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 ]\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\": \"MX_Verification_50708779\",\n \"country\": \"CO\",\n \"description\": \"Purchase in McDonalds\",\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 \"iin\": \"636318\",\n \"lfd\": \"2671\",\n \"type\": \"CREDIT\",\n \"issuer\": \"SCOTIABANK\",\n \"expiration_year\": 2030,\n \"expiration_month\": 12\n }\n }\n },\n \"amount\": {\n \"currency\": \"COP\",\n \"value\": 27000\n },\n \"customer_payer\": {\n \"first_name\": \"Pepito\",\n \"last_name\": \"Perez\",\n \"phone\": {\n \"country_code\": \"57\",\n \"number\": \"3132450765\"\n }\n }\n }\n }\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api-sandbox.y.uno/v1/smart-support/external/payments/recover")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["public-api-key"] = '<api-key>'
request["private-secret-key"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"settings\": {\n \"contact_details\": {\n \"channel\": \"PHONE_CALL\",\n \"initial_template_message\": {\n \"id\": \"HX8e7ac569f40a064c71a37e5d672bb9123\",\n \"variables\": {\n \"name\": \"Maria\",\n \"amount\": \"$10.0000\"\n }\n },\n \"pdf_template\": {\n \"id\": \"ede0d2da-138d-441b-8101-85e2d21af8b9\",\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 ]\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\": \"MX_Verification_50708779\",\n \"country\": \"CO\",\n \"description\": \"Purchase in McDonalds\",\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 \"iin\": \"636318\",\n \"lfd\": \"2671\",\n \"type\": \"CREDIT\",\n \"issuer\": \"SCOTIABANK\",\n \"expiration_year\": 2030,\n \"expiration_month\": 12\n }\n }\n },\n \"amount\": {\n \"currency\": \"COP\",\n \"value\": 27000\n },\n \"customer_payer\": {\n \"first_name\": \"Pepito\",\n \"last_name\": \"Perez\",\n \"phone\": {\n \"country_code\": \"57\",\n \"number\": \"3132450765\"\n }\n }\n }\n }\n}"
response = http.request(request)
puts response.read_body{
"id": "7c3a9c6e-9bf0-4c2c-9f67-752b16ba5dd5",
"message": "Communication processed successfully"
}{
"message": "Missing customer_payer.first_name required field"
}{
"message": "Internal error"
}This endpoint allows you to initiate large-scale processing of calls and WhatsApp messages related to declined payments. To use the endpoint, you have to provide an object containing detailed information about the declined payment.
Authorizations
Example: <Your public-api-key>
Example: <Your private-secret-key>
Body
application/json
Was this page helpful?
Previous
Initiate Recovery Outreach for Abandoned User FlowsNotifies Yuno's recovery agent to contact a customer who abandoned checkout before completing payment
Next
⌘I
Copy of Declined Payment Calls
curl --request POST \
--url https://api-sandbox.y.uno/v1/smart-support/external/payments/recover \
--header 'Content-Type: application/json' \
--header 'private-secret-key: <api-key>' \
--header 'public-api-key: <api-key>' \
--data '
{
"settings": {
"contact_details": {
"channel": "PHONE_CALL",
"initial_template_message": {
"id": "HX8e7ac569f40a064c71a37e5d672bb9123",
"variables": {
"name": "Maria",
"amount": "$10.0000"
}
},
"pdf_template": {
"id": "ede0d2da-138d-441b-8101-85e2d21af8b9",
"variables": {
"seller_name": "RAPPI",
"merchant_order_id": "MX_Verification_50708779"
}
},
"payment_methods": {
"available": [
"MERCADO_PAGO",
"NEQUI"
]
}
}
},
"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": "MX_Verification_50708779",
"country": "CO",
"description": "Purchase in McDonalds",
"created_at": "2022-05-09T20:46:54.786342Z",
"declined_reason": "insufficient funds",
"payment_method": {
"type": "Credit Card",
"detail": {
"card_data": {
"iin": "636318",
"lfd": "2671",
"type": "CREDIT",
"issuer": "SCOTIABANK",
"expiration_year": 2030,
"expiration_month": 12
}
}
},
"amount": {
"currency": "COP",
"value": 27000
},
"customer_payer": {
"first_name": "Pepito",
"last_name": "Perez",
"phone": {
"country_code": "57",
"number": "3132450765"
}
}
}
}
}
'import requests
url = "https://api-sandbox.y.uno/v1/smart-support/external/payments/recover"
payload = {
"settings": { "contact_details": {
"channel": "PHONE_CALL",
"initial_template_message": {
"id": "HX8e7ac569f40a064c71a37e5d672bb9123",
"variables": {
"name": "Maria",
"amount": "$10.0000"
}
},
"pdf_template": {
"id": "ede0d2da-138d-441b-8101-85e2d21af8b9",
"variables": {
"seller_name": "RAPPI",
"merchant_order_id": "MX_Verification_50708779"
}
},
"payment_methods": { "available": ["MERCADO_PAGO", "NEQUI"] }
} },
"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": "MX_Verification_50708779",
"country": "CO",
"description": "Purchase in McDonalds",
"created_at": "2022-05-09T20:46:54.786342Z",
"declined_reason": "insufficient funds",
"payment_method": {
"type": "Credit Card",
"detail": { "card_data": {
"iin": "636318",
"lfd": "2671",
"type": "CREDIT",
"issuer": "SCOTIABANK",
"expiration_year": 2030,
"expiration_month": 12
} }
},
"amount": {
"currency": "COP",
"value": 27000
},
"customer_payer": {
"first_name": "Pepito",
"last_name": "Perez",
"phone": {
"country_code": "57",
"number": "3132450765"
}
}
}
}
}
headers = {
"public-api-key": "<api-key>",
"private-secret-key": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {
'public-api-key': '<api-key>',
'private-secret-key': '<api-key>',
'Content-Type': 'application/json'
},
body: JSON.stringify({
settings: {
contact_details: {
channel: 'PHONE_CALL',
initial_template_message: {
id: 'HX8e7ac569f40a064c71a37e5d672bb9123',
variables: {name: 'Maria', amount: '$10.0000'}
},
pdf_template: {
id: 'ede0d2da-138d-441b-8101-85e2d21af8b9',
variables: {seller_name: 'RAPPI', merchant_order_id: 'MX_Verification_50708779'}
},
payment_methods: {available: ['MERCADO_PAGO', 'NEQUI']}
}
},
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: 'MX_Verification_50708779',
country: 'CO',
description: 'Purchase in McDonalds',
created_at: '2022-05-09T20:46:54.786342Z',
declined_reason: 'insufficient funds',
payment_method: {
type: 'Credit Card',
detail: {
card_data: {
iin: '636318',
lfd: '2671',
type: 'CREDIT',
issuer: 'SCOTIABANK',
expiration_year: 2030,
expiration_month: 12
}
}
},
amount: {currency: 'COP', value: 27000},
customer_payer: {
first_name: 'Pepito',
last_name: 'Perez',
phone: {country_code: '57', number: '3132450765'}
}
}
}
})
};
fetch('https://api-sandbox.y.uno/v1/smart-support/external/payments/recover', 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://api-sandbox.y.uno/v1/smart-support/external/payments/recover",
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([
'settings' => [
'contact_details' => [
'channel' => 'PHONE_CALL',
'initial_template_message' => [
'id' => 'HX8e7ac569f40a064c71a37e5d672bb9123',
'variables' => [
'name' => 'Maria',
'amount' => '$10.0000'
]
],
'pdf_template' => [
'id' => 'ede0d2da-138d-441b-8101-85e2d21af8b9',
'variables' => [
'seller_name' => 'RAPPI',
'merchant_order_id' => 'MX_Verification_50708779'
]
],
'payment_methods' => [
'available' => [
'MERCADO_PAGO',
'NEQUI'
]
]
]
],
'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' => 'MX_Verification_50708779',
'country' => 'CO',
'description' => 'Purchase in McDonalds',
'created_at' => '2022-05-09T20:46:54.786342Z',
'declined_reason' => 'insufficient funds',
'payment_method' => [
'type' => 'Credit Card',
'detail' => [
'card_data' => [
'iin' => '636318',
'lfd' => '2671',
'type' => 'CREDIT',
'issuer' => 'SCOTIABANK',
'expiration_year' => 2030,
'expiration_month' => 12
]
]
],
'amount' => [
'currency' => 'COP',
'value' => 27000
],
'customer_payer' => [
'first_name' => 'Pepito',
'last_name' => 'Perez',
'phone' => [
'country_code' => '57',
'number' => '3132450765'
]
]
]
]
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"private-secret-key: <api-key>",
"public-api-key: <api-key>"
],
]);
$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://api-sandbox.y.uno/v1/smart-support/external/payments/recover"
payload := strings.NewReader("{\n \"settings\": {\n \"contact_details\": {\n \"channel\": \"PHONE_CALL\",\n \"initial_template_message\": {\n \"id\": \"HX8e7ac569f40a064c71a37e5d672bb9123\",\n \"variables\": {\n \"name\": \"Maria\",\n \"amount\": \"$10.0000\"\n }\n },\n \"pdf_template\": {\n \"id\": \"ede0d2da-138d-441b-8101-85e2d21af8b9\",\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 ]\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\": \"MX_Verification_50708779\",\n \"country\": \"CO\",\n \"description\": \"Purchase in McDonalds\",\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 \"iin\": \"636318\",\n \"lfd\": \"2671\",\n \"type\": \"CREDIT\",\n \"issuer\": \"SCOTIABANK\",\n \"expiration_year\": 2030,\n \"expiration_month\": 12\n }\n }\n },\n \"amount\": {\n \"currency\": \"COP\",\n \"value\": 27000\n },\n \"customer_payer\": {\n \"first_name\": \"Pepito\",\n \"last_name\": \"Perez\",\n \"phone\": {\n \"country_code\": \"57\",\n \"number\": \"3132450765\"\n }\n }\n }\n }\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("public-api-key", "<api-key>")
req.Header.Add("private-secret-key", "<api-key>")
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://api-sandbox.y.uno/v1/smart-support/external/payments/recover")
.header("public-api-key", "<api-key>")
.header("private-secret-key", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"settings\": {\n \"contact_details\": {\n \"channel\": \"PHONE_CALL\",\n \"initial_template_message\": {\n \"id\": \"HX8e7ac569f40a064c71a37e5d672bb9123\",\n \"variables\": {\n \"name\": \"Maria\",\n \"amount\": \"$10.0000\"\n }\n },\n \"pdf_template\": {\n \"id\": \"ede0d2da-138d-441b-8101-85e2d21af8b9\",\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 ]\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\": \"MX_Verification_50708779\",\n \"country\": \"CO\",\n \"description\": \"Purchase in McDonalds\",\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 \"iin\": \"636318\",\n \"lfd\": \"2671\",\n \"type\": \"CREDIT\",\n \"issuer\": \"SCOTIABANK\",\n \"expiration_year\": 2030,\n \"expiration_month\": 12\n }\n }\n },\n \"amount\": {\n \"currency\": \"COP\",\n \"value\": 27000\n },\n \"customer_payer\": {\n \"first_name\": \"Pepito\",\n \"last_name\": \"Perez\",\n \"phone\": {\n \"country_code\": \"57\",\n \"number\": \"3132450765\"\n }\n }\n }\n }\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api-sandbox.y.uno/v1/smart-support/external/payments/recover")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["public-api-key"] = '<api-key>'
request["private-secret-key"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"settings\": {\n \"contact_details\": {\n \"channel\": \"PHONE_CALL\",\n \"initial_template_message\": {\n \"id\": \"HX8e7ac569f40a064c71a37e5d672bb9123\",\n \"variables\": {\n \"name\": \"Maria\",\n \"amount\": \"$10.0000\"\n }\n },\n \"pdf_template\": {\n \"id\": \"ede0d2da-138d-441b-8101-85e2d21af8b9\",\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 ]\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\": \"MX_Verification_50708779\",\n \"country\": \"CO\",\n \"description\": \"Purchase in McDonalds\",\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 \"iin\": \"636318\",\n \"lfd\": \"2671\",\n \"type\": \"CREDIT\",\n \"issuer\": \"SCOTIABANK\",\n \"expiration_year\": 2030,\n \"expiration_month\": 12\n }\n }\n },\n \"amount\": {\n \"currency\": \"COP\",\n \"value\": 27000\n },\n \"customer_payer\": {\n \"first_name\": \"Pepito\",\n \"last_name\": \"Perez\",\n \"phone\": {\n \"country_code\": \"57\",\n \"number\": \"3132450765\"\n }\n }\n }\n }\n}"
response = http.request(request)
puts response.read_body{
"id": "7c3a9c6e-9bf0-4c2c-9f67-752b16ba5dd5",
"message": "Communication processed successfully"
}{
"message": "Missing customer_payer.first_name required field"
}{
"message": "Internal error"
}