v1 (obsolète)
Configurer votre configuration
Configure webhook URL
POST
/
v1
/
configuration
Setting Your Configuration
curl --request POST \
--url https://sandbox.gateway.sezzle.com/v1/configuration \
--header 'Authorization: <api-key>' \
--header 'Content-Type: application/json' \
--data '
{
"webhook_url": "https://yourdomain.com/webhook"
}
'import requests
url = "https://sandbox.gateway.sezzle.com/v1/configuration"
payload = { "webhook_url": "https://yourdomain.com/webhook" }
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({webhook_url: 'https://yourdomain.com/webhook'})
};
fetch('https://sandbox.gateway.sezzle.com/v1/configuration', 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/v1/configuration",
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([
'webhook_url' => 'https://yourdomain.com/webhook'
]),
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/v1/configuration"
payload := strings.NewReader("{\n \"webhook_url\": \"https://yourdomain.com/webhook\"\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/v1/configuration")
.header("Authorization", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"webhook_url\": \"https://yourdomain.com/webhook\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://sandbox.gateway.sezzle.com/v1/configuration")
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 \"webhook_url\": \"https://yourdomain.com/webhook\"\n}"
response = http.request(request)
puts response.read_body{
"status": 400,
"id": "bad_request",
"message": "bad request"
}{
"status": 401,
"id": "unauthorized",
"message": "authorization not accepted"
}{
"status": 404,
"id": "record_not_found",
"message": "not found"
}{
"status": 422,
"id": "invalid",
"message": "Unprocessable entity"
}Vous consultez la Version 1 de l’API Sezzle. Découvrez la version actuelle!
Webhooks
Webhooks de commande
- Sezzle gère la majeure partie du processus de paiement du consommateur sur ses pages, en utilisant des webhooks pour notifier votre système à propos de :
- Mises à jour de la commande
- Complétions
- Remboursements
- Utilisez les instructions de cette page pour vous abonner aux Webhooks
- Lorsqu’un événement webhook se produit, Sezzle enverra l’objet Webhook ci-dessous à l’URL fournie dans la configuration
Objet Webhook de commande
- Modèle
- Exemple
- Options
{
"time": string,
"uuid": string,
"type": string,
"event": string,
"object_uuid": string,
"refund_id": string,
"refund_amount": {
"amount_in_cents": number,
"currency": string
}
}
{
"time": "2017-10-19T00:33:10.548372055Z",
"uuid": "02c5a2a0-8394-4b45-80b3-52d40c494322",
"type": "order_update",
"event": "order_complete",
"object_uuid": "Ref123456789",
"refund_id": "szl-a0293Pn-3948-80b3-ao34JAia39zQ",
"refund_amount": {
"amount_in_cents": 500,
"currency": "USD"
}
}
L’heure (UTC) à laquelle le Webhook a été généré.
Un identifiant unique pour le webhook.
La catégorie de haut niveau.Options disponibles :
order_update (bientôt disponible)L’identifiant de la commande/du paiement.Options disponibles :
order_complete, order_refundL’identifiant de la commande/du paiement. Pour les webhooks de mise à jour de commande, le
object_uuid retourné est l’identifiant de référence fourni lors de la création de la commande par le marchandIdentifiant unique pour un remboursement. Inclus si l’événement webhook est order_refund
Précédent
Créer un paiementInitiate a Sezzle session with shopper order details, redirect links, and capture settings
Suivant
⌘I
Setting Your Configuration
curl --request POST \
--url https://sandbox.gateway.sezzle.com/v1/configuration \
--header 'Authorization: <api-key>' \
--header 'Content-Type: application/json' \
--data '
{
"webhook_url": "https://yourdomain.com/webhook"
}
'import requests
url = "https://sandbox.gateway.sezzle.com/v1/configuration"
payload = { "webhook_url": "https://yourdomain.com/webhook" }
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({webhook_url: 'https://yourdomain.com/webhook'})
};
fetch('https://sandbox.gateway.sezzle.com/v1/configuration', 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/v1/configuration",
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([
'webhook_url' => 'https://yourdomain.com/webhook'
]),
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/v1/configuration"
payload := strings.NewReader("{\n \"webhook_url\": \"https://yourdomain.com/webhook\"\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/v1/configuration")
.header("Authorization", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"webhook_url\": \"https://yourdomain.com/webhook\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://sandbox.gateway.sezzle.com/v1/configuration")
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 \"webhook_url\": \"https://yourdomain.com/webhook\"\n}"
response = http.request(request)
puts response.read_body{
"status": 400,
"id": "bad_request",
"message": "bad request"
}{
"status": 401,
"id": "unauthorized",
"message": "authorization not accepted"
}{
"status": 404,
"id": "record_not_found",
"message": "not found"
}{
"status": 422,
"id": "invalid",
"message": "Unprocessable entity"
}