Créer un paiement
Initiate a Sezzle session with shopper order details, redirect links, and capture settings
curl --request POST \
--url https://sandbox.gateway.sezzle.com/v1/checkouts \
--header 'Authorization: <api-key>' \
--header 'Content-Type: application/json' \
--data '
{
"amount_in_cents": 12999,
"currency_code": "USD",
"order_reference_id": "ord_12345",
"order_description": "Some description",
"checkout_cancel_url": "https://sezzle.com/cart",
"checkout_complete_url": "https://sezzle.com/complete",
"customer_details": {
"first_name": "John",
"last_name": "Doe",
"email": "john.doe@sezzle.com",
"phone": "8885401867"
},
"billing_address": {
"name": "John Doe",
"street": "123 W Lake St",
"street2": "Unit 104",
"city": "Minneapolis",
"state": "MN",
"postal_code": "55408",
"country_code": "US",
"phone_number": "8885401867"
},
"shipping_address": {
"name": "John Doe",
"street": "123 W Lake St",
"street2": "Unit 104",
"city": "Minneapolis",
"state": "MN",
"postal_code": "55408",
"country_code": "US",
"phone_number": "8885401867"
},
"requires_shipping_info": false,
"items": [
{
"name": "widget",
"sku": "sku123456",
"quantity": 1,
"price": {
"amount_in_cents": 1000,
"currency": "USD"
}
}
],
"discounts": [
{
"name": "20% off",
"amount": {
"amount_in_cents": 1000,
"currency": "USD"
}
}
],
"tax_amount": {
"amount_in_cents": 1000,
"currency": "USD"
},
"shipping_amount": {
"amount_in_cents": 1000,
"currency": "USD"
},
"metadata": {
"location_id": "123",
"store_name": "Downtown Minneapolis",
"store_manager": "Jane Doe"
},
"merchant_completes": true
}
'import requests
url = "https://sandbox.gateway.sezzle.com/v1/checkouts"
payload = {
"amount_in_cents": 12999,
"currency_code": "USD",
"order_reference_id": "ord_12345",
"order_description": "Some description",
"checkout_cancel_url": "https://sezzle.com/cart",
"checkout_complete_url": "https://sezzle.com/complete",
"customer_details": {
"first_name": "John",
"last_name": "Doe",
"email": "john.doe@sezzle.com",
"phone": "8885401867"
},
"billing_address": {
"name": "John Doe",
"street": "123 W Lake St",
"street2": "Unit 104",
"city": "Minneapolis",
"state": "MN",
"postal_code": "55408",
"country_code": "US",
"phone_number": "8885401867"
},
"shipping_address": {
"name": "John Doe",
"street": "123 W Lake St",
"street2": "Unit 104",
"city": "Minneapolis",
"state": "MN",
"postal_code": "55408",
"country_code": "US",
"phone_number": "8885401867"
},
"requires_shipping_info": False,
"items": [
{
"name": "widget",
"sku": "sku123456",
"quantity": 1,
"price": {
"amount_in_cents": 1000,
"currency": "USD"
}
}
],
"discounts": [
{
"name": "20% off",
"amount": {
"amount_in_cents": 1000,
"currency": "USD"
}
}
],
"tax_amount": {
"amount_in_cents": 1000,
"currency": "USD"
},
"shipping_amount": {
"amount_in_cents": 1000,
"currency": "USD"
},
"metadata": {
"location_id": "123",
"store_name": "Downtown Minneapolis",
"store_manager": "Jane Doe"
},
"merchant_completes": True
}
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: 12999,
currency_code: 'USD',
order_reference_id: 'ord_12345',
order_description: 'Some description',
checkout_cancel_url: 'https://sezzle.com/cart',
checkout_complete_url: 'https://sezzle.com/complete',
customer_details: {
first_name: 'John',
last_name: 'Doe',
email: 'john.doe@sezzle.com',
phone: '8885401867'
},
billing_address: {
name: 'John Doe',
street: '123 W Lake St',
street2: 'Unit 104',
city: 'Minneapolis',
state: 'MN',
postal_code: '55408',
country_code: 'US',
phone_number: '8885401867'
},
shipping_address: {
name: 'John Doe',
street: '123 W Lake St',
street2: 'Unit 104',
city: 'Minneapolis',
state: 'MN',
postal_code: '55408',
country_code: 'US',
phone_number: '8885401867'
},
requires_shipping_info: false,
items: [
{
name: 'widget',
sku: 'sku123456',
quantity: 1,
price: {amount_in_cents: 1000, currency: 'USD'}
}
],
discounts: [{name: '20% off', amount: {amount_in_cents: 1000, currency: 'USD'}}],
tax_amount: {amount_in_cents: 1000, currency: 'USD'},
shipping_amount: {amount_in_cents: 1000, currency: 'USD'},
metadata: {
location_id: '123',
store_name: 'Downtown Minneapolis',
store_manager: 'Jane Doe'
},
merchant_completes: true
})
};
fetch('https://sandbox.gateway.sezzle.com/v1/checkouts', 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/checkouts",
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' => 12999,
'currency_code' => 'USD',
'order_reference_id' => 'ord_12345',
'order_description' => 'Some description',
'checkout_cancel_url' => 'https://sezzle.com/cart',
'checkout_complete_url' => 'https://sezzle.com/complete',
'customer_details' => [
'first_name' => 'John',
'last_name' => 'Doe',
'email' => 'john.doe@sezzle.com',
'phone' => '8885401867'
],
'billing_address' => [
'name' => 'John Doe',
'street' => '123 W Lake St',
'street2' => 'Unit 104',
'city' => 'Minneapolis',
'state' => 'MN',
'postal_code' => '55408',
'country_code' => 'US',
'phone_number' => '8885401867'
],
'shipping_address' => [
'name' => 'John Doe',
'street' => '123 W Lake St',
'street2' => 'Unit 104',
'city' => 'Minneapolis',
'state' => 'MN',
'postal_code' => '55408',
'country_code' => 'US',
'phone_number' => '8885401867'
],
'requires_shipping_info' => false,
'items' => [
[
'name' => 'widget',
'sku' => 'sku123456',
'quantity' => 1,
'price' => [
'amount_in_cents' => 1000,
'currency' => 'USD'
]
]
],
'discounts' => [
[
'name' => '20% off',
'amount' => [
'amount_in_cents' => 1000,
'currency' => 'USD'
]
]
],
'tax_amount' => [
'amount_in_cents' => 1000,
'currency' => 'USD'
],
'shipping_amount' => [
'amount_in_cents' => 1000,
'currency' => 'USD'
],
'metadata' => [
'location_id' => '123',
'store_name' => 'Downtown Minneapolis',
'store_manager' => 'Jane Doe'
],
'merchant_completes' => true
]),
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/checkouts"
payload := strings.NewReader("{\n \"amount_in_cents\": 12999,\n \"currency_code\": \"USD\",\n \"order_reference_id\": \"ord_12345\",\n \"order_description\": \"Some description\",\n \"checkout_cancel_url\": \"https://sezzle.com/cart\",\n \"checkout_complete_url\": \"https://sezzle.com/complete\",\n \"customer_details\": {\n \"first_name\": \"John\",\n \"last_name\": \"Doe\",\n \"email\": \"john.doe@sezzle.com\",\n \"phone\": \"8885401867\"\n },\n \"billing_address\": {\n \"name\": \"John Doe\",\n \"street\": \"123 W Lake St\",\n \"street2\": \"Unit 104\",\n \"city\": \"Minneapolis\",\n \"state\": \"MN\",\n \"postal_code\": \"55408\",\n \"country_code\": \"US\",\n \"phone_number\": \"8885401867\"\n },\n \"shipping_address\": {\n \"name\": \"John Doe\",\n \"street\": \"123 W Lake St\",\n \"street2\": \"Unit 104\",\n \"city\": \"Minneapolis\",\n \"state\": \"MN\",\n \"postal_code\": \"55408\",\n \"country_code\": \"US\",\n \"phone_number\": \"8885401867\"\n },\n \"requires_shipping_info\": false,\n \"items\": [\n {\n \"name\": \"widget\",\n \"sku\": \"sku123456\",\n \"quantity\": 1,\n \"price\": {\n \"amount_in_cents\": 1000,\n \"currency\": \"USD\"\n }\n }\n ],\n \"discounts\": [\n {\n \"name\": \"20% off\",\n \"amount\": {\n \"amount_in_cents\": 1000,\n \"currency\": \"USD\"\n }\n }\n ],\n \"tax_amount\": {\n \"amount_in_cents\": 1000,\n \"currency\": \"USD\"\n },\n \"shipping_amount\": {\n \"amount_in_cents\": 1000,\n \"currency\": \"USD\"\n },\n \"metadata\": {\n \"location_id\": \"123\",\n \"store_name\": \"Downtown Minneapolis\",\n \"store_manager\": \"Jane Doe\"\n },\n \"merchant_completes\": true\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/checkouts")
.header("Authorization", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"amount_in_cents\": 12999,\n \"currency_code\": \"USD\",\n \"order_reference_id\": \"ord_12345\",\n \"order_description\": \"Some description\",\n \"checkout_cancel_url\": \"https://sezzle.com/cart\",\n \"checkout_complete_url\": \"https://sezzle.com/complete\",\n \"customer_details\": {\n \"first_name\": \"John\",\n \"last_name\": \"Doe\",\n \"email\": \"john.doe@sezzle.com\",\n \"phone\": \"8885401867\"\n },\n \"billing_address\": {\n \"name\": \"John Doe\",\n \"street\": \"123 W Lake St\",\n \"street2\": \"Unit 104\",\n \"city\": \"Minneapolis\",\n \"state\": \"MN\",\n \"postal_code\": \"55408\",\n \"country_code\": \"US\",\n \"phone_number\": \"8885401867\"\n },\n \"shipping_address\": {\n \"name\": \"John Doe\",\n \"street\": \"123 W Lake St\",\n \"street2\": \"Unit 104\",\n \"city\": \"Minneapolis\",\n \"state\": \"MN\",\n \"postal_code\": \"55408\",\n \"country_code\": \"US\",\n \"phone_number\": \"8885401867\"\n },\n \"requires_shipping_info\": false,\n \"items\": [\n {\n \"name\": \"widget\",\n \"sku\": \"sku123456\",\n \"quantity\": 1,\n \"price\": {\n \"amount_in_cents\": 1000,\n \"currency\": \"USD\"\n }\n }\n ],\n \"discounts\": [\n {\n \"name\": \"20% off\",\n \"amount\": {\n \"amount_in_cents\": 1000,\n \"currency\": \"USD\"\n }\n }\n ],\n \"tax_amount\": {\n \"amount_in_cents\": 1000,\n \"currency\": \"USD\"\n },\n \"shipping_amount\": {\n \"amount_in_cents\": 1000,\n \"currency\": \"USD\"\n },\n \"metadata\": {\n \"location_id\": \"123\",\n \"store_name\": \"Downtown Minneapolis\",\n \"store_manager\": \"Jane Doe\"\n },\n \"merchant_completes\": true\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://sandbox.gateway.sezzle.com/v1/checkouts")
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\": 12999,\n \"currency_code\": \"USD\",\n \"order_reference_id\": \"ord_12345\",\n \"order_description\": \"Some description\",\n \"checkout_cancel_url\": \"https://sezzle.com/cart\",\n \"checkout_complete_url\": \"https://sezzle.com/complete\",\n \"customer_details\": {\n \"first_name\": \"John\",\n \"last_name\": \"Doe\",\n \"email\": \"john.doe@sezzle.com\",\n \"phone\": \"8885401867\"\n },\n \"billing_address\": {\n \"name\": \"John Doe\",\n \"street\": \"123 W Lake St\",\n \"street2\": \"Unit 104\",\n \"city\": \"Minneapolis\",\n \"state\": \"MN\",\n \"postal_code\": \"55408\",\n \"country_code\": \"US\",\n \"phone_number\": \"8885401867\"\n },\n \"shipping_address\": {\n \"name\": \"John Doe\",\n \"street\": \"123 W Lake St\",\n \"street2\": \"Unit 104\",\n \"city\": \"Minneapolis\",\n \"state\": \"MN\",\n \"postal_code\": \"55408\",\n \"country_code\": \"US\",\n \"phone_number\": \"8885401867\"\n },\n \"requires_shipping_info\": false,\n \"items\": [\n {\n \"name\": \"widget\",\n \"sku\": \"sku123456\",\n \"quantity\": 1,\n \"price\": {\n \"amount_in_cents\": 1000,\n \"currency\": \"USD\"\n }\n }\n ],\n \"discounts\": [\n {\n \"name\": \"20% off\",\n \"amount\": {\n \"amount_in_cents\": 1000,\n \"currency\": \"USD\"\n }\n }\n ],\n \"tax_amount\": {\n \"amount_in_cents\": 1000,\n \"currency\": \"USD\"\n },\n \"shipping_amount\": {\n \"amount_in_cents\": 1000,\n \"currency\": \"USD\"\n },\n \"metadata\": {\n \"location_id\": \"123\",\n \"store_name\": \"Downtown Minneapolis\",\n \"store_manager\": \"Jane Doe\"\n },\n \"merchant_completes\": true\n}"
response = http.request(request)
puts response.read_body{
"checkout_uuid": "9dcb4d9f-ac09-4578-abf8-611128903611",
"checkout_url": "https://sandbox.checkout.sezzle.com?id=9dcb4d9f-ac09-4578-abf8-611128903611"
}{
"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"
}Autorisations
The authentication token generated from providing API Keys to Sezzle Gateway
Corps
The total order amount in cents, which must be at least 100 which is $1.00. Please note your merchant configuration might have a higher minimum.
The 3 character currency code as defined by ISO 4217
Your reference ID for this order (must contain only alphanumeric characters, dashes (-), and underscores (_))
A user-facing description for this checkout
The HTTP request information used to redirect the customer in the case of a cancellation
The HTTP request information used to redirect the customer upon completion of the session
Customer details for this session. To optimize checkout and boost conversion, it is recommended to include as much customer information as possible.
The customer's billing address
Hide child attributes
Hide child attributes
The name on the address
The street and number of the address
The apt or unit
The city
The 2 character state code
The postal delivery code
The 2 character country code
The phone number at the delivery location
The customer's shipping address
Hide child attributes
Hide child attributes
The name on the address
The street and number of the address
The apt or unit
The city
The 2 character state code
The postal delivery code
The 2 character country code
The phone number at the delivery location
Flag to indicate if you would like us to collect shipping information for this checkout from the customer. If omitted, defaults to false.
The items being purchased
Hide child attributes
Hide child attributes
The name of the item
The sku identifier
The quantity purchased
The category path where the product is located. Use > only as the category delimiter, not as part of a product or category name. Example: Camping Gear & Supplies > Tents & Shelters.
The discounts applied to this order. Must be included in total
If your checkout flow requires the user to confirm their checkout on your site after being approved by Sezzle, use true to only authorize the payment. If you prefer the checkout be captured immediately, use false. Defaults to false.
A Notification object for sending checkout URL to the customer
Hide child attributes
Hide child attributes
The SMS phone number of the notification
The email address of the notification
The 2-character ISO 639 langauge code of the notification. Acceptable values are en and fr-CA. Will default to English if not provided.
en, fr-CA Localizes the checkout. Defaults to en-US.
en-US, en-CA, fr-CA curl --request POST \
--url https://sandbox.gateway.sezzle.com/v1/checkouts \
--header 'Authorization: <api-key>' \
--header 'Content-Type: application/json' \
--data '
{
"amount_in_cents": 12999,
"currency_code": "USD",
"order_reference_id": "ord_12345",
"order_description": "Some description",
"checkout_cancel_url": "https://sezzle.com/cart",
"checkout_complete_url": "https://sezzle.com/complete",
"customer_details": {
"first_name": "John",
"last_name": "Doe",
"email": "john.doe@sezzle.com",
"phone": "8885401867"
},
"billing_address": {
"name": "John Doe",
"street": "123 W Lake St",
"street2": "Unit 104",
"city": "Minneapolis",
"state": "MN",
"postal_code": "55408",
"country_code": "US",
"phone_number": "8885401867"
},
"shipping_address": {
"name": "John Doe",
"street": "123 W Lake St",
"street2": "Unit 104",
"city": "Minneapolis",
"state": "MN",
"postal_code": "55408",
"country_code": "US",
"phone_number": "8885401867"
},
"requires_shipping_info": false,
"items": [
{
"name": "widget",
"sku": "sku123456",
"quantity": 1,
"price": {
"amount_in_cents": 1000,
"currency": "USD"
}
}
],
"discounts": [
{
"name": "20% off",
"amount": {
"amount_in_cents": 1000,
"currency": "USD"
}
}
],
"tax_amount": {
"amount_in_cents": 1000,
"currency": "USD"
},
"shipping_amount": {
"amount_in_cents": 1000,
"currency": "USD"
},
"metadata": {
"location_id": "123",
"store_name": "Downtown Minneapolis",
"store_manager": "Jane Doe"
},
"merchant_completes": true
}
'import requests
url = "https://sandbox.gateway.sezzle.com/v1/checkouts"
payload = {
"amount_in_cents": 12999,
"currency_code": "USD",
"order_reference_id": "ord_12345",
"order_description": "Some description",
"checkout_cancel_url": "https://sezzle.com/cart",
"checkout_complete_url": "https://sezzle.com/complete",
"customer_details": {
"first_name": "John",
"last_name": "Doe",
"email": "john.doe@sezzle.com",
"phone": "8885401867"
},
"billing_address": {
"name": "John Doe",
"street": "123 W Lake St",
"street2": "Unit 104",
"city": "Minneapolis",
"state": "MN",
"postal_code": "55408",
"country_code": "US",
"phone_number": "8885401867"
},
"shipping_address": {
"name": "John Doe",
"street": "123 W Lake St",
"street2": "Unit 104",
"city": "Minneapolis",
"state": "MN",
"postal_code": "55408",
"country_code": "US",
"phone_number": "8885401867"
},
"requires_shipping_info": False,
"items": [
{
"name": "widget",
"sku": "sku123456",
"quantity": 1,
"price": {
"amount_in_cents": 1000,
"currency": "USD"
}
}
],
"discounts": [
{
"name": "20% off",
"amount": {
"amount_in_cents": 1000,
"currency": "USD"
}
}
],
"tax_amount": {
"amount_in_cents": 1000,
"currency": "USD"
},
"shipping_amount": {
"amount_in_cents": 1000,
"currency": "USD"
},
"metadata": {
"location_id": "123",
"store_name": "Downtown Minneapolis",
"store_manager": "Jane Doe"
},
"merchant_completes": True
}
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: 12999,
currency_code: 'USD',
order_reference_id: 'ord_12345',
order_description: 'Some description',
checkout_cancel_url: 'https://sezzle.com/cart',
checkout_complete_url: 'https://sezzle.com/complete',
customer_details: {
first_name: 'John',
last_name: 'Doe',
email: 'john.doe@sezzle.com',
phone: '8885401867'
},
billing_address: {
name: 'John Doe',
street: '123 W Lake St',
street2: 'Unit 104',
city: 'Minneapolis',
state: 'MN',
postal_code: '55408',
country_code: 'US',
phone_number: '8885401867'
},
shipping_address: {
name: 'John Doe',
street: '123 W Lake St',
street2: 'Unit 104',
city: 'Minneapolis',
state: 'MN',
postal_code: '55408',
country_code: 'US',
phone_number: '8885401867'
},
requires_shipping_info: false,
items: [
{
name: 'widget',
sku: 'sku123456',
quantity: 1,
price: {amount_in_cents: 1000, currency: 'USD'}
}
],
discounts: [{name: '20% off', amount: {amount_in_cents: 1000, currency: 'USD'}}],
tax_amount: {amount_in_cents: 1000, currency: 'USD'},
shipping_amount: {amount_in_cents: 1000, currency: 'USD'},
metadata: {
location_id: '123',
store_name: 'Downtown Minneapolis',
store_manager: 'Jane Doe'
},
merchant_completes: true
})
};
fetch('https://sandbox.gateway.sezzle.com/v1/checkouts', 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/checkouts",
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' => 12999,
'currency_code' => 'USD',
'order_reference_id' => 'ord_12345',
'order_description' => 'Some description',
'checkout_cancel_url' => 'https://sezzle.com/cart',
'checkout_complete_url' => 'https://sezzle.com/complete',
'customer_details' => [
'first_name' => 'John',
'last_name' => 'Doe',
'email' => 'john.doe@sezzle.com',
'phone' => '8885401867'
],
'billing_address' => [
'name' => 'John Doe',
'street' => '123 W Lake St',
'street2' => 'Unit 104',
'city' => 'Minneapolis',
'state' => 'MN',
'postal_code' => '55408',
'country_code' => 'US',
'phone_number' => '8885401867'
],
'shipping_address' => [
'name' => 'John Doe',
'street' => '123 W Lake St',
'street2' => 'Unit 104',
'city' => 'Minneapolis',
'state' => 'MN',
'postal_code' => '55408',
'country_code' => 'US',
'phone_number' => '8885401867'
],
'requires_shipping_info' => false,
'items' => [
[
'name' => 'widget',
'sku' => 'sku123456',
'quantity' => 1,
'price' => [
'amount_in_cents' => 1000,
'currency' => 'USD'
]
]
],
'discounts' => [
[
'name' => '20% off',
'amount' => [
'amount_in_cents' => 1000,
'currency' => 'USD'
]
]
],
'tax_amount' => [
'amount_in_cents' => 1000,
'currency' => 'USD'
],
'shipping_amount' => [
'amount_in_cents' => 1000,
'currency' => 'USD'
],
'metadata' => [
'location_id' => '123',
'store_name' => 'Downtown Minneapolis',
'store_manager' => 'Jane Doe'
],
'merchant_completes' => true
]),
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/checkouts"
payload := strings.NewReader("{\n \"amount_in_cents\": 12999,\n \"currency_code\": \"USD\",\n \"order_reference_id\": \"ord_12345\",\n \"order_description\": \"Some description\",\n \"checkout_cancel_url\": \"https://sezzle.com/cart\",\n \"checkout_complete_url\": \"https://sezzle.com/complete\",\n \"customer_details\": {\n \"first_name\": \"John\",\n \"last_name\": \"Doe\",\n \"email\": \"john.doe@sezzle.com\",\n \"phone\": \"8885401867\"\n },\n \"billing_address\": {\n \"name\": \"John Doe\",\n \"street\": \"123 W Lake St\",\n \"street2\": \"Unit 104\",\n \"city\": \"Minneapolis\",\n \"state\": \"MN\",\n \"postal_code\": \"55408\",\n \"country_code\": \"US\",\n \"phone_number\": \"8885401867\"\n },\n \"shipping_address\": {\n \"name\": \"John Doe\",\n \"street\": \"123 W Lake St\",\n \"street2\": \"Unit 104\",\n \"city\": \"Minneapolis\",\n \"state\": \"MN\",\n \"postal_code\": \"55408\",\n \"country_code\": \"US\",\n \"phone_number\": \"8885401867\"\n },\n \"requires_shipping_info\": false,\n \"items\": [\n {\n \"name\": \"widget\",\n \"sku\": \"sku123456\",\n \"quantity\": 1,\n \"price\": {\n \"amount_in_cents\": 1000,\n \"currency\": \"USD\"\n }\n }\n ],\n \"discounts\": [\n {\n \"name\": \"20% off\",\n \"amount\": {\n \"amount_in_cents\": 1000,\n \"currency\": \"USD\"\n }\n }\n ],\n \"tax_amount\": {\n \"amount_in_cents\": 1000,\n \"currency\": \"USD\"\n },\n \"shipping_amount\": {\n \"amount_in_cents\": 1000,\n \"currency\": \"USD\"\n },\n \"metadata\": {\n \"location_id\": \"123\",\n \"store_name\": \"Downtown Minneapolis\",\n \"store_manager\": \"Jane Doe\"\n },\n \"merchant_completes\": true\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/checkouts")
.header("Authorization", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"amount_in_cents\": 12999,\n \"currency_code\": \"USD\",\n \"order_reference_id\": \"ord_12345\",\n \"order_description\": \"Some description\",\n \"checkout_cancel_url\": \"https://sezzle.com/cart\",\n \"checkout_complete_url\": \"https://sezzle.com/complete\",\n \"customer_details\": {\n \"first_name\": \"John\",\n \"last_name\": \"Doe\",\n \"email\": \"john.doe@sezzle.com\",\n \"phone\": \"8885401867\"\n },\n \"billing_address\": {\n \"name\": \"John Doe\",\n \"street\": \"123 W Lake St\",\n \"street2\": \"Unit 104\",\n \"city\": \"Minneapolis\",\n \"state\": \"MN\",\n \"postal_code\": \"55408\",\n \"country_code\": \"US\",\n \"phone_number\": \"8885401867\"\n },\n \"shipping_address\": {\n \"name\": \"John Doe\",\n \"street\": \"123 W Lake St\",\n \"street2\": \"Unit 104\",\n \"city\": \"Minneapolis\",\n \"state\": \"MN\",\n \"postal_code\": \"55408\",\n \"country_code\": \"US\",\n \"phone_number\": \"8885401867\"\n },\n \"requires_shipping_info\": false,\n \"items\": [\n {\n \"name\": \"widget\",\n \"sku\": \"sku123456\",\n \"quantity\": 1,\n \"price\": {\n \"amount_in_cents\": 1000,\n \"currency\": \"USD\"\n }\n }\n ],\n \"discounts\": [\n {\n \"name\": \"20% off\",\n \"amount\": {\n \"amount_in_cents\": 1000,\n \"currency\": \"USD\"\n }\n }\n ],\n \"tax_amount\": {\n \"amount_in_cents\": 1000,\n \"currency\": \"USD\"\n },\n \"shipping_amount\": {\n \"amount_in_cents\": 1000,\n \"currency\": \"USD\"\n },\n \"metadata\": {\n \"location_id\": \"123\",\n \"store_name\": \"Downtown Minneapolis\",\n \"store_manager\": \"Jane Doe\"\n },\n \"merchant_completes\": true\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://sandbox.gateway.sezzle.com/v1/checkouts")
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\": 12999,\n \"currency_code\": \"USD\",\n \"order_reference_id\": \"ord_12345\",\n \"order_description\": \"Some description\",\n \"checkout_cancel_url\": \"https://sezzle.com/cart\",\n \"checkout_complete_url\": \"https://sezzle.com/complete\",\n \"customer_details\": {\n \"first_name\": \"John\",\n \"last_name\": \"Doe\",\n \"email\": \"john.doe@sezzle.com\",\n \"phone\": \"8885401867\"\n },\n \"billing_address\": {\n \"name\": \"John Doe\",\n \"street\": \"123 W Lake St\",\n \"street2\": \"Unit 104\",\n \"city\": \"Minneapolis\",\n \"state\": \"MN\",\n \"postal_code\": \"55408\",\n \"country_code\": \"US\",\n \"phone_number\": \"8885401867\"\n },\n \"shipping_address\": {\n \"name\": \"John Doe\",\n \"street\": \"123 W Lake St\",\n \"street2\": \"Unit 104\",\n \"city\": \"Minneapolis\",\n \"state\": \"MN\",\n \"postal_code\": \"55408\",\n \"country_code\": \"US\",\n \"phone_number\": \"8885401867\"\n },\n \"requires_shipping_info\": false,\n \"items\": [\n {\n \"name\": \"widget\",\n \"sku\": \"sku123456\",\n \"quantity\": 1,\n \"price\": {\n \"amount_in_cents\": 1000,\n \"currency\": \"USD\"\n }\n }\n ],\n \"discounts\": [\n {\n \"name\": \"20% off\",\n \"amount\": {\n \"amount_in_cents\": 1000,\n \"currency\": \"USD\"\n }\n }\n ],\n \"tax_amount\": {\n \"amount_in_cents\": 1000,\n \"currency\": \"USD\"\n },\n \"shipping_amount\": {\n \"amount_in_cents\": 1000,\n \"currency\": \"USD\"\n },\n \"metadata\": {\n \"location_id\": \"123\",\n \"store_name\": \"Downtown Minneapolis\",\n \"store_manager\": \"Jane Doe\"\n },\n \"merchant_completes\": true\n}"
response = http.request(request)
puts response.read_body{
"checkout_uuid": "9dcb4d9f-ac09-4578-abf8-611128903611",
"checkout_url": "https://sandbox.checkout.sezzle.com?id=9dcb4d9f-ac09-4578-abf8-611128903611"
}{
"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"
}