Register a webhook
Register your webhook to receive transaction notifications.
URI
POST
https://api.tryduplo.com/v1/merchants/businesses/webhookParameters
Header
Authorization
string
set value to Bearer SECRET_KEY
Body Param
webhook_url
string required
Your webhook url, we would post transaction notifications to this url.
callback_url
string
Your callback url, this is optional.
verify_hash
string required
Your encrypted key, we would send this along with our request and you would use this key to verify that the request to your webhook url is from Duplo.
business_id
string required
Merchant business ID
Sample request
curl --location --request POST 'https://api.tryduplo.com/v1/merchants/businesses/webhook' \
--header 'Authorization: Bearer SECRET_KEY' \
--header 'Content-Type: application/json' \
--data-raw '{
"webhook_url": "https://webhook.site/a1b47ab8-997a-4c2a-83ab-2614e7f",
"verify_hash": "6F4B941015BC08D44FUAMCAJ.948249SJHE",
"business_id": "8edfcc-1e1c-4ad1-9ed8-e870d654",
}'var axios = require('axios');
var data = JSON.stringify({
"webhook_url": "https://webhook.site/a1b47ab8-997a-4c2a-83ab-2614e7f",
"verify_hash": "6F4B941015BC08D44FUAMCAJ.948249SJHE",
"business_id": "8edfcc-1e1c-4ad1-9ed8-e870d654",
});
var config = {
method: 'post',
url: 'https://api.tryduplo.com/v1/merchants/businesses/webhook',
headers: {
'Authorization: Bearer SECRET_KEY',
'Content-Type': 'application/json'
},
data : data
};
axios(config)
.then(function (response) {
console.log(JSON.stringify(response.data));
})
.catch(function (error) {
console.log(error);
});<?php
$curl = curl_init();
curl_setopt_array($curl, array(
CURLOPT_URL => 'https://app-api.tryduplo.com/v1/merchants/businesses/webhook',
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => '',
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 0,
CURLOPT_FOLLOWLOCATION => true,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => 'POST',
CURLOPT_POSTFIELDS =>'{
"webhook_url": "https://webhook.site/a1b47ab8-997a-4c2a-83ab-2614e7f",
"verify_hash": "6F4B941015BC08D44FUAMCAJ.948249SJHE",
"business_id": "8edfcc-1e1c-4ad1-9ed8-e870d654",
}',
CURLOPT_HTTPHEADER => array(
'Authorization: Bearer SECRET_KEY',
'Content-Type: application/json'
),
));
$response = curl_exec($curl);
curl_close($curl);
echo $response;
Duplo Response
{
"data": {
"id": "7ec2ad3a-8d26-4f7f-9396-1cbb495546cd",
"webhook_url": "https://webhook.site/7ab8-997a-4c2a-83ab-2614e7f",
"Callback_url": "https://webhook.site/7ab8-997a-4c2a-83ab-2614e7f",
"verify_hash": "6F4B941015BC08D44FUAMCAJ.948249SJHE",
"services": [
"virtual-account"
],
"created_at": "2021-08-03T12:35:34.184Z",
"update_at": "2021-08-03T12:35:34.188Z",
"business_id": "8edfcc-1e1c-4ad1-9ed8-e870d654"
},
"errors": {},
"message": "Request successful"
}Last updated
Was this helpful?