Webhooks
Mettre à jour le webhook
Update an existing webhook configuration (URL and/or events)
PATCH
/
v2
/
webhooks
/
{webhooks_uuid}
Update webhook
curl --request PATCH \
--url https://sandbox.gateway.sezzle.com/v2/webhooks/{webhooks_uuid} \
--header 'Authorization: <api-key>' \
--header 'Content-Type: application/json' \
--data '
{
"url": "https://example.com/webhooks-updated",
"events": [
"order.captured",
"order.refunded"
]
}
'import requests
url = "https://sandbox.gateway.sezzle.com/v2/webhooks/{webhooks_uuid}"
payload = {
"url": "https://example.com/webhooks-updated",
"events": ["order.captured", "order.refunded"]
}
headers = {
"Authorization": "<api-key>",
"Content-Type": "application/json"
}
response = requests.patch(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PATCH',
headers: {Authorization: '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
url: 'https://example.com/webhooks-updated',
events: ['order.captured', 'order.refunded']
})
};
fetch('https://sandbox.gateway.sezzle.com/v2/webhooks/{webhooks_uuid}', 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://sandbox.gateway.sezzle.com/v2/webhooks/{webhooks_uuid}",
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([
'url' => 'https://example.com/webhooks-updated',
'events' => [
'order.captured',
'order.refunded'
]
]),
CURLOPT_HTTPHEADER => [
"Authorization: <api-key>",
"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://sandbox.gateway.sezzle.com/v2/webhooks/{webhooks_uuid}"
payload := strings.NewReader("{\n \"url\": \"https://example.com/webhooks-updated\",\n \"events\": [\n \"order.captured\",\n \"order.refunded\"\n ]\n}")
req, _ := http.NewRequest("PATCH", url, payload)
req.Header.Add("Authorization", "<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.patch("https://sandbox.gateway.sezzle.com/v2/webhooks/{webhooks_uuid}")
.header("Authorization", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"url\": \"https://example.com/webhooks-updated\",\n \"events\": [\n \"order.captured\",\n \"order.refunded\"\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://sandbox.gateway.sezzle.com/v2/webhooks/{webhooks_uuid}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Patch.new(url)
request["Authorization"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"url\": \"https://example.com/webhooks-updated\",\n \"events\": [\n \"order.captured\",\n \"order.refunded\"\n ]\n}"
response = http.request(request)
puts response.read_body{
"uuid": "747cf28a-bb5c-46a8-a288-d9b006fd6113",
"links": [
{
"href": "https://sandbox.gateway.sezzle.com/v2/webhooks",
"rel": "create",
"method": "POST"
},
{
"href": "https://sandbox.gateway.sezzle.com/v2/webhooks",
"rel": "list",
"method": "GET"
},
{
"href": "https://sandbox.gateway.sezzle.com/v2/webhooks/747cf28a-bb5c-46a8-a288-d9b006fd6113",
"rel": "self",
"method": "GET"
},
{
"href": "https://sandbox.gateway.sezzle.com/v2/webhooks/747cf28a-bb5c-46a8-a288-d9b006fd6113",
"rel": "self",
"method": "PATCH"
},
{
"href": "https://sandbox.gateway.sezzle.com/v2/webhooks/747cf28a-bb5c-46a8-a288-d9b006fd6113",
"rel": "self",
"method": "DELETE"
}
]
}[
{
"code": "bad_request",
"message": "bad request"
}
][
{
"code": "unauthorized",
"message": "authorization not accepted"
}
][
{
"code": "record_not_found",
"message": "not found"
}
][
{
"code": "invalid",
"message": "Unprocessable entity"
}
]Utilisez ce endpoint pour mettre à jour une configuration de webhook existante. Vous pouvez modifier à la fois l’URL du webhook et les événements auxquels vous êtes abonné.
Événements Webhook valides
Nous acceptons les événements Webhook suivants| Événement | Déclencheur |
|---|---|
customer.tokenized | Un client est tokenisé |
order.authorized | Une commande est autorisée par Sezzle |
order.captured | Une commande est capturée par Sezzle |
order.refunded | Une commande est remboursée par Sezzle |
dispute.merchant_input_requested | Un litige est déposé par un acheteur et la contribution du marchand est requise |
dispute.deadline_approaching | Un litige est passé en avis final par Sezzle |
dispute.closed.customer_win | L’acheteur remporte le litige et la commande est remboursée |
dispute.closed.merchant_win | Le marchand remporte le litige et celui-ci est résolu en sa faveur |
dispute.closed.neutral | Aucun gagnant clair n’est déterminé et le litige est résolu de manière neutre |
Remarques
- Les deux champs
urleteventssont requis dans le corps de la requête - L’URL du webhook doit être unique par marchand - vous ne pouvez pas mettre à jour vers une URL déjà utilisée par un autre webhook
- Si l’UUID du webhook n’est pas trouvé, une erreur 404 sera renvoyée
- Les abonnements aux événements sont entièrement remplacés - spécifiez tous les événements que vous souhaitez recevoir, pas seulement les modifications
Autorisations
The authentication token generated from providing API Keys to Sezzle Gateway
Paramètres de chemin
The webhook UUID to be updated
Corps
application/json
The URL you are using to receive webhooks
An array of webhook events you wish to subscribe to
Options disponibles:
customer.tokenized, order.authorized, order.captured, order.refunded, dispute.merchant_input_requested, dispute.deadline_approaching, dispute.closed.customer_win, dispute.closed.merchant_win, dispute.closed.neutral Réponse
Successful Operation
The unique identifier for this response
Available API links prefilled with UUID with accompanying method
Hide child attributes
Hide child attributes
The fully qualified URL for the API endpoint
The relationship type indicating the purpose of this link (e.g., 'self' for the current resource, 'create' for creating a new resource, 'list' for listing resources)
Options disponibles:
self, capture, checkout, create, customer, list, order, preapprove, refund, release, session The HTTP method to use when calling this API endpoint
Options disponibles:
GET, POST, PATCH, DELETE Précédent
Déclencher un webhook de testTrigger a test event to mimic a webhook event at a given URL.
Suivant
⌘I
Update webhook
curl --request PATCH \
--url https://sandbox.gateway.sezzle.com/v2/webhooks/{webhooks_uuid} \
--header 'Authorization: <api-key>' \
--header 'Content-Type: application/json' \
--data '
{
"url": "https://example.com/webhooks-updated",
"events": [
"order.captured",
"order.refunded"
]
}
'import requests
url = "https://sandbox.gateway.sezzle.com/v2/webhooks/{webhooks_uuid}"
payload = {
"url": "https://example.com/webhooks-updated",
"events": ["order.captured", "order.refunded"]
}
headers = {
"Authorization": "<api-key>",
"Content-Type": "application/json"
}
response = requests.patch(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PATCH',
headers: {Authorization: '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
url: 'https://example.com/webhooks-updated',
events: ['order.captured', 'order.refunded']
})
};
fetch('https://sandbox.gateway.sezzle.com/v2/webhooks/{webhooks_uuid}', 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://sandbox.gateway.sezzle.com/v2/webhooks/{webhooks_uuid}",
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([
'url' => 'https://example.com/webhooks-updated',
'events' => [
'order.captured',
'order.refunded'
]
]),
CURLOPT_HTTPHEADER => [
"Authorization: <api-key>",
"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://sandbox.gateway.sezzle.com/v2/webhooks/{webhooks_uuid}"
payload := strings.NewReader("{\n \"url\": \"https://example.com/webhooks-updated\",\n \"events\": [\n \"order.captured\",\n \"order.refunded\"\n ]\n}")
req, _ := http.NewRequest("PATCH", url, payload)
req.Header.Add("Authorization", "<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.patch("https://sandbox.gateway.sezzle.com/v2/webhooks/{webhooks_uuid}")
.header("Authorization", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"url\": \"https://example.com/webhooks-updated\",\n \"events\": [\n \"order.captured\",\n \"order.refunded\"\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://sandbox.gateway.sezzle.com/v2/webhooks/{webhooks_uuid}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Patch.new(url)
request["Authorization"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"url\": \"https://example.com/webhooks-updated\",\n \"events\": [\n \"order.captured\",\n \"order.refunded\"\n ]\n}"
response = http.request(request)
puts response.read_body{
"uuid": "747cf28a-bb5c-46a8-a288-d9b006fd6113",
"links": [
{
"href": "https://sandbox.gateway.sezzle.com/v2/webhooks",
"rel": "create",
"method": "POST"
},
{
"href": "https://sandbox.gateway.sezzle.com/v2/webhooks",
"rel": "list",
"method": "GET"
},
{
"href": "https://sandbox.gateway.sezzle.com/v2/webhooks/747cf28a-bb5c-46a8-a288-d9b006fd6113",
"rel": "self",
"method": "GET"
},
{
"href": "https://sandbox.gateway.sezzle.com/v2/webhooks/747cf28a-bb5c-46a8-a288-d9b006fd6113",
"rel": "self",
"method": "PATCH"
},
{
"href": "https://sandbox.gateway.sezzle.com/v2/webhooks/747cf28a-bb5c-46a8-a288-d9b006fd6113",
"rel": "self",
"method": "DELETE"
}
]
}[
{
"code": "bad_request",
"message": "bad request"
}
][
{
"code": "unauthorized",
"message": "authorization not accepted"
}
][
{
"code": "record_not_found",
"message": "not found"
}
][
{
"code": "invalid",
"message": "Unprocessable entity"
}
]