Customer tokenization
Customer tokenization is akin to adding Sezzle as a payment method on file with the merchant, thus allowing the merchant to use Sezzle as a payment method for future orders (without customer interaction). A primary use case for customer tokenization is subscriptions. For example, a merchant may choose to tokenize a customer in order to charge by Sezzle on a semi-annual basis.
A typical process of tokenizing a customer in Sezzle might be, a user is signed into the merchant site and the user wants to add Sezzle as a stored payment method. The merchant can start a session with Sezzle and assign the session UUID to the known user. The merchant will redirect the user to Sezzle and the user can agree to accept tokenization. Once the user accepts, Sezzle will redirect the user back to the merchant site and also append a unique customer UUID to the merchant URL, thus allowing the merchant to assign this customer UUID to the user that started the session. The customer UUID can now be used to create an order by customer directly with Sezzle. Orders created by customer are treated the same as orders created by completing a Sezzle checkout.
Tokenization is not required and only necessary if the merchant has a need to charge by Sezzle outside of a typical checkout process. Sezzle recommends tokenization on an as-needed basis.
- Merchant starts a session by calling
/v2/session
with customer tokenize oftrue
. Including customer information is optional, but it can expedite the registration process for new Sezzle users. - Sezzle returns the session
tokenize
token and an approval URL. - Merchant redirects customer to the Sezzle approval URL.
- Customer can agree (or disagree) to allow future Sezzle transactions by the merchant and is redirected to the session complete URL. If the customer agrees to be tokenized, Sezzle will add a query parameter to the complete URL named
customer-uuid
, allowing the merchant to get the UUID of the customer. Alternatively, the merchant can call/v2/token
with the sessiontokenize.token
to get the UUID of the customer. - Merchant can subsequently charge the customer by calling
/v2/customer/{customer_uuid}/order
to create an order. If successful and the authorization is approved, the merchant can use the/v2/order
endpoints to release, capture, or refund the order.
The merchant also has the option to create an order and tokenize the customer in a single session. In this instance, the merchant should redirect the customer to the order checkout URL. During checkout, the customer can agree to allow future Sezzle transactions by the merchant (i.e. accept tokenization). If the customer agrees to be tokenized, Sezzle will add a query parameter to the complete URL named customer-uuid
.
Note: Sezzle returns both a checkout URL and an approval URL on a create session that includes both tokenization and an order. If the customer does not agree to be tokenized during checkout, the merchant can use the approval URL at a later time.
Customers
Use the customers endpoints to get a list of customers, get details on an existing customer, delete a customer, preapprove an amount for the customer, or create an order for a customer.
Customers are only those Sezzle users that have agreed to be tokenized by the merchant. A customer is unique to a merchant. This API does not include all Sezzle users.