Créer un point de réception
curl --request POST \
--url https://api.saspay.me/api/v1/merchant-webhooks/ \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"url": "https://exemple.com/webhooks/saspay",
"description": "Notifications production",
"environment": "LIVE"
}
'import requests
url = "https://api.saspay.me/api/v1/merchant-webhooks/"
payload = {
"url": "https://exemple.com/webhooks/saspay",
"description": "Notifications production",
"environment": "LIVE"
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
url: 'https://exemple.com/webhooks/saspay',
description: 'Notifications production',
environment: 'LIVE'
})
};
fetch('https://api.saspay.me/api/v1/merchant-webhooks/', 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.saspay.me/api/v1/merchant-webhooks/",
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([
'url' => 'https://exemple.com/webhooks/saspay',
'description' => 'Notifications production',
'environment' => 'LIVE'
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$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.saspay.me/api/v1/merchant-webhooks/"
payload := strings.NewReader("{\n \"url\": \"https://exemple.com/webhooks/saspay\",\n \"description\": \"Notifications production\",\n \"environment\": \"LIVE\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
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.saspay.me/api/v1/merchant-webhooks/")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"url\": \"https://exemple.com/webhooks/saspay\",\n \"description\": \"Notifications production\",\n \"environment\": \"LIVE\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.saspay.me/api/v1/merchant-webhooks/")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"url\": \"https://exemple.com/webhooks/saspay\",\n \"description\": \"Notifications production\",\n \"environment\": \"LIVE\"\n}"
response = http.request(request)
puts response.read_body{
"id": "c1d2e3f4-1111-2222-3333-444455556666",
"merchant": "8a1f5c3e-0000-1111-2222-333344445555",
"url": "https://exemple.com/webhooks/saspay",
"description": "Notifications production",
"environment": "LIVE",
"is_active": true,
"created_by_member": null,
"created_at": "2026-08-01T09:00:00Z",
"updated_at": "2026-08-01T09:00:00Z"
}Webhooks
Créer un point de réception
Enregistre une URL qui recevra vos events, avec génération automatique du secret si omis
POST
/
merchant-webhooks
/
Créer un point de réception
curl --request POST \
--url https://api.saspay.me/api/v1/merchant-webhooks/ \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"url": "https://exemple.com/webhooks/saspay",
"description": "Notifications production",
"environment": "LIVE"
}
'import requests
url = "https://api.saspay.me/api/v1/merchant-webhooks/"
payload = {
"url": "https://exemple.com/webhooks/saspay",
"description": "Notifications production",
"environment": "LIVE"
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
url: 'https://exemple.com/webhooks/saspay',
description: 'Notifications production',
environment: 'LIVE'
})
};
fetch('https://api.saspay.me/api/v1/merchant-webhooks/', 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.saspay.me/api/v1/merchant-webhooks/",
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([
'url' => 'https://exemple.com/webhooks/saspay',
'description' => 'Notifications production',
'environment' => 'LIVE'
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$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.saspay.me/api/v1/merchant-webhooks/"
payload := strings.NewReader("{\n \"url\": \"https://exemple.com/webhooks/saspay\",\n \"description\": \"Notifications production\",\n \"environment\": \"LIVE\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
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.saspay.me/api/v1/merchant-webhooks/")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"url\": \"https://exemple.com/webhooks/saspay\",\n \"description\": \"Notifications production\",\n \"environment\": \"LIVE\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.saspay.me/api/v1/merchant-webhooks/")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"url\": \"https://exemple.com/webhooks/saspay\",\n \"description\": \"Notifications production\",\n \"environment\": \"LIVE\"\n}"
response = http.request(request)
puts response.read_body{
"id": "c1d2e3f4-1111-2222-3333-444455556666",
"merchant": "8a1f5c3e-0000-1111-2222-333344445555",
"url": "https://exemple.com/webhooks/saspay",
"description": "Notifications production",
"environment": "LIVE",
"is_active": true,
"created_by_member": null,
"created_at": "2026-08-01T09:00:00Z",
"updated_at": "2026-08-01T09:00:00Z"
}Si vous ne fournissez pas
signing_secret, SasPay en génère automatiquement un côté serveur — jamais vide. Il n’est jamais renvoyé en lecture après coup : notez-le précieusement dans cette réponse. Voir la section sécurité de Webhooks.Authorizations
Clé API secrète du marchand — header Authorization: Bearer sk_live_xxx (ou sk_test_xxx en environnement de test).
Body
application/json
Response
201 - application/json
Webhook créé
⌘I