Clients
Préapprouver un montant par client
Verify tokenized customer will be approved for the amount of the order prior to order creation. This API does not authorize the amount nor does it hold the amount for a future order. Also, you are not required to use this API before creating a customer order. An example use-case is to verify approval status ahead of subscription payment due date, and to contact the customer in advance to avoid failed payment.
POST
/
v2
/
customer
/
{customer_uuid}
/
preapprove
Preapprove amount by customer
curl --request POST \
--url https://sandbox.gateway.sezzle.com/v2/customer/{customer_uuid}/preapprove \
--header 'Authorization: <api-key>' \
--header 'Content-Type: application/json' \
--data '
{
"amount_in_cents": 5000,
"currency": "USD"
}
'import requests
url = "https://sandbox.gateway.sezzle.com/v2/customer/{customer_uuid}/preapprove"
payload = {
"amount_in_cents": 5000,
"currency": "USD"
}
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({amount_in_cents: 5000, currency: 'USD'})
};
fetch('https://sandbox.gateway.sezzle.com/v2/customer/{customer_uuid}/preapprove', 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/customer/{customer_uuid}/preapprove",
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([
'amount_in_cents' => 5000,
'currency' => 'USD'
]),
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/customer/{customer_uuid}/preapprove"
payload := strings.NewReader("{\n \"amount_in_cents\": 5000,\n \"currency\": \"USD\"\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/customer/{customer_uuid}/preapprove")
.header("Authorization", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"amount_in_cents\": 5000,\n \"currency\": \"USD\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://sandbox.gateway.sezzle.com/v2/customer/{customer_uuid}/preapprove")
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 \"amount_in_cents\": 5000,\n \"currency\": \"USD\"\n}"
response = http.request(request)
puts response.read_body{
"uuid": "6c9db5d4-d09a-4224-860a-b5438ac32ca8",
"approved": true
}[
{
"code": "bad_request",
"message": "bad request"
}
][
{
"code": "unauthorized",
"message": "authorization not accepted"
}
][
{
"code": "record_not_found",
"message": "not found"
}
][
{
"code": "invalid",
"message": "Unprocessable entity"
}
]Autorisations
The authentication token generated from providing API Keys to Sezzle Gateway
Paramètres de chemin
The Customer UUID to preapprove
Corps
application/json
The order amount to verify preapproval
⌘I
Preapprove amount by customer
curl --request POST \
--url https://sandbox.gateway.sezzle.com/v2/customer/{customer_uuid}/preapprove \
--header 'Authorization: <api-key>' \
--header 'Content-Type: application/json' \
--data '
{
"amount_in_cents": 5000,
"currency": "USD"
}
'import requests
url = "https://sandbox.gateway.sezzle.com/v2/customer/{customer_uuid}/preapprove"
payload = {
"amount_in_cents": 5000,
"currency": "USD"
}
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({amount_in_cents: 5000, currency: 'USD'})
};
fetch('https://sandbox.gateway.sezzle.com/v2/customer/{customer_uuid}/preapprove', 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/customer/{customer_uuid}/preapprove",
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([
'amount_in_cents' => 5000,
'currency' => 'USD'
]),
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/customer/{customer_uuid}/preapprove"
payload := strings.NewReader("{\n \"amount_in_cents\": 5000,\n \"currency\": \"USD\"\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/customer/{customer_uuid}/preapprove")
.header("Authorization", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"amount_in_cents\": 5000,\n \"currency\": \"USD\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://sandbox.gateway.sezzle.com/v2/customer/{customer_uuid}/preapprove")
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 \"amount_in_cents\": 5000,\n \"currency\": \"USD\"\n}"
response = http.request(request)
puts response.read_body{
"uuid": "6c9db5d4-d09a-4224-860a-b5438ac32ca8",
"approved": true
}[
{
"code": "bad_request",
"message": "bad request"
}
][
{
"code": "unauthorized",
"message": "authorization not accepted"
}
][
{
"code": "record_not_found",
"message": "not found"
}
][
{
"code": "invalid",
"message": "Unprocessable entity"
}
]