Webhooks
Trigger a test webhook
Trigger a test event to mimic a webhook event at a given URL.
POST
/
v2
/
webhooks
/
test
Trigger a test webhook
curl --request POST \
--url https://sandbox.gateway.sezzle.com/v2/webhooks/test \
--header 'Authorization: <api-key>' \
--header 'Content-Type: application/json' \
--data '
{
"event": "order.authorized",
"url": "https://example.com/webhooks"
}
'import requests
url = "https://sandbox.gateway.sezzle.com/v2/webhooks/test"
payload = {
"event": "order.authorized",
"url": "https://example.com/webhooks"
}
headers = {
"Authorization": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({event: 'order.authorized', url: 'https://example.com/webhooks'})
};
fetch('https://sandbox.gateway.sezzle.com/v2/webhooks/test', 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/test",
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([
'event' => 'order.authorized',
'url' => 'https://example.com/webhooks'
]),
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/test"
payload := strings.NewReader("{\n \"event\": \"order.authorized\",\n \"url\": \"https://example.com/webhooks\"\n}")
req, _ := http.NewRequest("POST", 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.post("https://sandbox.gateway.sezzle.com/v2/webhooks/test")
.header("Authorization", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"event\": \"order.authorized\",\n \"url\": \"https://example.com/webhooks\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://sandbox.gateway.sezzle.com/v2/webhooks/test")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"event\": \"order.authorized\",\n \"url\": \"https://example.com/webhooks\"\n}"
response = http.request(request)
puts response.read_body[
{
"code": "bad_request",
"message": "bad request"
}
][
{
"code": "unauthorized",
"message": "authorization not accepted"
}
][
{
"code": "record_not_found",
"message": "not found"
}
][
{
"code": "invalid",
"message": "Unprocessable entity"
}
]Valid Webhook Events
We accept the following Webhook events| Event | Trigger |
|---|---|
customer.tokenized | A customer is tokenized |
order.authorized | An order is authorized by Sezzle |
order.captured | An order is captured by Sezzle |
order.refunded | An order is refunded by Sezzle |
dispute.merchant_input_requested | A dispute is filed by a shopper and merchant input is required |
dispute.deadline_approaching | A dispute is moved to final notice by Sezzle |
dispute.closed.customer_win | The shopper wins the dispute and the order is refunded |
dispute.closed.merchant_win | The merchant wins the dispute and it is resolved in their favor |
dispute.closed.neutral | No clear winner is determined and the dispute is resolved neutrally |
Authorizations
The authentication token generated from providing API Keys to Sezzle Gateway
Body
application/json
One of the Valid Webhook Events
Available options:
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 A url to receive the test webhook. If omitted, the test webhook is sent to all urls subscribed to that event.
Response
Status Created
⌘I
Trigger a test webhook
curl --request POST \
--url https://sandbox.gateway.sezzle.com/v2/webhooks/test \
--header 'Authorization: <api-key>' \
--header 'Content-Type: application/json' \
--data '
{
"event": "order.authorized",
"url": "https://example.com/webhooks"
}
'import requests
url = "https://sandbox.gateway.sezzle.com/v2/webhooks/test"
payload = {
"event": "order.authorized",
"url": "https://example.com/webhooks"
}
headers = {
"Authorization": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({event: 'order.authorized', url: 'https://example.com/webhooks'})
};
fetch('https://sandbox.gateway.sezzle.com/v2/webhooks/test', 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/test",
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([
'event' => 'order.authorized',
'url' => 'https://example.com/webhooks'
]),
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/test"
payload := strings.NewReader("{\n \"event\": \"order.authorized\",\n \"url\": \"https://example.com/webhooks\"\n}")
req, _ := http.NewRequest("POST", 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.post("https://sandbox.gateway.sezzle.com/v2/webhooks/test")
.header("Authorization", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"event\": \"order.authorized\",\n \"url\": \"https://example.com/webhooks\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://sandbox.gateway.sezzle.com/v2/webhooks/test")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"event\": \"order.authorized\",\n \"url\": \"https://example.com/webhooks\"\n}"
response = http.request(request)
puts response.read_body[
{
"code": "bad_request",
"message": "bad request"
}
][
{
"code": "unauthorized",
"message": "authorization not accepted"
}
][
{
"code": "record_not_found",
"message": "not found"
}
][
{
"code": "invalid",
"message": "Unprocessable entity"
}
]