Envoyer un test
curl --request POST \
--url https://mercy-pay.com/api/v1/webhook_endpoints/{id}/test \
--header 'Authorization: Bearer <token>'<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://mercy-pay.com/api/v1/webhook_endpoints/{id}/test",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}const options = {method: 'POST', headers: {Authorization: 'Bearer <token>'}};
fetch('https://mercy-pay.com/api/v1/webhook_endpoints/{id}/test', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));import requests
url = "https://mercy-pay.com/api/v1/webhook_endpoints/{id}/test"
headers = {"Authorization": "Bearer <token>"}
response = requests.post(url, headers=headers)
print(response.text){
"data": {
"id": "evt_01JC9B7K2M4N6P8Q0R2S4T6V8W",
"object": "event",
"livemode": false,
"created": "2026-11-08T13:20:00+00:00",
"type": "webhook.test",
"data": {
"message": "Événement de test envoyé depuis Mercy Pay."
}
}
}{
"error": {
"type": "authentication_error",
"code": "api_key_invalid",
"message": "Clé API invalide.",
"param": null,
"doc_url": "https://docs.mercy-pay.com/developers/errors#api_key_invalid",
"request_id": "req_01jc8x4m2v7t9qk3n5w6y8z0ab"
}
}{
"error": {
"type": "invalid_request_error",
"code": "resource_not_found",
"message": "Ressource introuvable.",
"param": null,
"doc_url": "https://docs.mercy-pay.com/developers/errors#resource_not_found",
"request_id": "req_01jc8x4m2v7t9qk3n5w6y8z0ab"
}
}{
"error": {
"type": "invalid_request_error",
"code": "conflict",
"message": "Cette ressource est utilisée : archivez-la.",
"param": null,
"doc_url": "https://docs.mercy-pay.com/developers/errors#conflict",
"request_id": "req_01jc8x4m2v7t9qk3n5w6y8z0ab"
}
}{
"error": {
"type": "rate_limit_error",
"code": "rate_limited",
"message": "Trop de requêtes.",
"param": null,
"doc_url": "https://docs.mercy-pay.com/developers/errors#rate_limited",
"request_id": "req_01jc8x4m2v7t9qk3n5w6y8z0ab"
}
}Envoyer un test
Envoie un événement webhook.test à cet endpoint seulement, pour vérifier que votre serveur reçoit et vérifie les webhooks. Un endpoint désactivé renvoie 409.
POST
/
api
/
v1
/
webhook_endpoints
/
{id}
/
test
Envoyer un test
curl --request POST \
--url https://mercy-pay.com/api/v1/webhook_endpoints/{id}/test \
--header 'Authorization: Bearer <token>'<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://mercy-pay.com/api/v1/webhook_endpoints/{id}/test",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}const options = {method: 'POST', headers: {Authorization: 'Bearer <token>'}};
fetch('https://mercy-pay.com/api/v1/webhook_endpoints/{id}/test', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));import requests
url = "https://mercy-pay.com/api/v1/webhook_endpoints/{id}/test"
headers = {"Authorization": "Bearer <token>"}
response = requests.post(url, headers=headers)
print(response.text){
"data": {
"id": "evt_01JC9B7K2M4N6P8Q0R2S4T6V8W",
"object": "event",
"livemode": false,
"created": "2026-11-08T13:20:00+00:00",
"type": "webhook.test",
"data": {
"message": "Événement de test envoyé depuis Mercy Pay."
}
}
}{
"error": {
"type": "authentication_error",
"code": "api_key_invalid",
"message": "Clé API invalide.",
"param": null,
"doc_url": "https://docs.mercy-pay.com/developers/errors#api_key_invalid",
"request_id": "req_01jc8x4m2v7t9qk3n5w6y8z0ab"
}
}{
"error": {
"type": "invalid_request_error",
"code": "resource_not_found",
"message": "Ressource introuvable.",
"param": null,
"doc_url": "https://docs.mercy-pay.com/developers/errors#resource_not_found",
"request_id": "req_01jc8x4m2v7t9qk3n5w6y8z0ab"
}
}{
"error": {
"type": "invalid_request_error",
"code": "conflict",
"message": "Cette ressource est utilisée : archivez-la.",
"param": null,
"doc_url": "https://docs.mercy-pay.com/developers/errors#conflict",
"request_id": "req_01jc8x4m2v7t9qk3n5w6y8z0ab"
}
}{
"error": {
"type": "rate_limit_error",
"code": "rate_limited",
"message": "Trop de requêtes.",
"param": null,
"doc_url": "https://docs.mercy-pay.com/developers/errors#rate_limited",
"request_id": "req_01jc8x4m2v7t9qk3n5w6y8z0ab"
}
}Authorizations
Response
L'événement de test envoyé