Définir l'URL de webhook
curl --request PATCH \
--url https://apidjonanko.tech/web-merchant/set-webhook-url \
--header 'Content-Type: application/json' \
--header 'authenticationtoken: <api-key>' \
--data '
{
"reference": "beautyshop",
"webhookUrl": "https://example.com/webhooks/djonanko"
}
'const options = {
method: 'PATCH',
headers: {authenticationtoken: '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({reference: 'beautyshop', webhookUrl: 'https://example.com/webhooks/djonanko'})
};
fetch('https://apidjonanko.tech/web-merchant/set-webhook-url', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));import requests
url = "https://apidjonanko.tech/web-merchant/set-webhook-url"
payload = {
"reference": "beautyshop",
"webhookUrl": "https://example.com/webhooks/djonanko"
}
headers = {
"authenticationtoken": "<api-key>",
"Content-Type": "application/json"
}
response = requests.patch(url, json=payload, headers=headers)
print(response.text)<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://apidjonanko.tech/web-merchant/set-webhook-url",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PATCH",
CURLOPT_POSTFIELDS => json_encode([
'reference' => 'beautyshop',
'webhookUrl' => 'https://example.com/webhooks/djonanko'
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"authenticationtoken: <api-key>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}{
"message": "Webhook URL updated successfully"
}{
"statusCode": 401,
"message": "Invalid API credentials",
"error": "Unauthorized"
}Webhooks
Définir l'URL de webhook
Enregistre l’URL HTTPS sur laquelle Djonanko enverra les notifications de paiement.
L’URL ne doit pas être protégée par une authentification et doit répondre 2xx rapidement.
PATCH
/
web-merchant
/
set-webhook-url
Définir l'URL de webhook
curl --request PATCH \
--url https://apidjonanko.tech/web-merchant/set-webhook-url \
--header 'Content-Type: application/json' \
--header 'authenticationtoken: <api-key>' \
--data '
{
"reference": "beautyshop",
"webhookUrl": "https://example.com/webhooks/djonanko"
}
'const options = {
method: 'PATCH',
headers: {authenticationtoken: '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({reference: 'beautyshop', webhookUrl: 'https://example.com/webhooks/djonanko'})
};
fetch('https://apidjonanko.tech/web-merchant/set-webhook-url', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));import requests
url = "https://apidjonanko.tech/web-merchant/set-webhook-url"
payload = {
"reference": "beautyshop",
"webhookUrl": "https://example.com/webhooks/djonanko"
}
headers = {
"authenticationtoken": "<api-key>",
"Content-Type": "application/json"
}
response = requests.patch(url, json=payload, headers=headers)
print(response.text)<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://apidjonanko.tech/web-merchant/set-webhook-url",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PATCH",
CURLOPT_POSTFIELDS => json_encode([
'reference' => 'beautyshop',
'webhookUrl' => 'https://example.com/webhooks/djonanko'
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"authenticationtoken: <api-key>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}{
"message": "Webhook URL updated successfully"
}{
"statusCode": 401,
"message": "Invalid API credentials",
"error": "Unauthorized"
}Authorizations
JWT obtenu via POST /user/login-merchant. À passer tel quel, sans préfixe Bearer.
Body
application/json
Response
URL enregistrée.
Example:
"Webhook URL updated successfully"
