### Manual Integration Quick Start Source: https://docs.sezzle.com/llms-full.txt A quick start guide for manual integration with the Sezzle API. ```APIDOC ## Manual Integration Quick Start Guide 1. **Use API keys to obtain an authentication token** 2. **Create a session with an order object** 3. **Redirect user to Sezzle checkout URL** 4. **User completes Sezzle checkout** 5. **Sezzle redirects user back to merchant complete URL** 6. **Manage the order with the Orders API** 7. **Subscribe to all necessary Webhook Events** ``` -------------------------------- ### Initialize Sezzle Installment Widget (Shopify Example) Source: https://docs.sezzle.com/docs/guides/widgets/checkout-installments Example of initializing the SezzleInstallmentWidget for Shopify. The `platform` option is set to 'shopify'. The `checkoutTotalElemTargetPath` is commented out, indicating it might be auto-detected or not needed for this configuration. ```html
``` -------------------------------- ### Example Sezzle Checkout Initialization and Capture Source: https://docs.sezzle.com/docs/guides/direct/integration This example demonstrates a full checkout flow, including starting the checkout with order details, handling completion by capturing the payment, and logging cancellation or failure events. It requires the `checkoutSdk` to be initialized. ```javascript checkoutSdk.init({ onClick: function () { event.preventDefault(); checkoutSdk.startCheckout({ checkout_payload: { order: { intent: "AUTH", reference_id: "543645yg5tg5675686", description: "sezzle-store - #12749253509255", order_amount: { amount_in_cents: 10000, currency: "USD", }, }, }, }); }, onComplete: function (response) { alert("Completed transaction. Capture started."); checkoutSdk .capturePayment(response.data.order_uuid, { capture_amount: { amount_in_cents: 10000, currency: "USD", }, partial_capture: false, }) .then((r) => { console.log(r); }); }, onCancel: function () { console.log("Checkout cancelled."); }, onFailure: function () { console.log("Checkout failed."); }, }); ``` -------------------------------- ### Installment Plan Example Source: https://docs.sezzle.com/llms-full.txt An example of a JSON response detailing an installment plan with bi-weekly payments. ```json { "schedule": "bi-weekly", "totalInCents": 1000, "installments": [ { "installment": 1, "amountInCents": 250, "dueDate": "2020-10-14" }, { "installment": 2, "amountInCents": 250, "dueDate": "2020-10-28" }, { "installment": 3, "amountInCents": 250, "dueDate": "2020-11-11" }, { "installment": 4, "amountInCents": 250, "dueDate": "2020-11-25" } ] } ``` -------------------------------- ### Sezzle SDK Example Configuration Source: https://docs.sezzle.com/docs/guides/widgets/sdk A practical example of the document.sezzleConfig object, demonstrating how to populate the configuration options for a specific use case. ```javascript document.sezzleConfig = { configGroups: [ { "targetXPath": ".price", "renderToPath": "..", "urlMatch": "product", "theme": "auto", "ignoredPriceElements": ["DEL","STRIKE"], "ignoredFormattedPriceText": ["Subtotal", "Total:", "Sold Out"], "alignment": "inherit", "alignmentSwitchMinWidth": 0, "alignmentSwitchType": "inherit", "containerStyle": { "marginTop": "0px", "marginBottom": "0px", "marginRight": "0px", "marginLeft": "0px" }, "textStyle": { "color": "inherit", "fontFamily": "inherit", "fontSize": "14px", "fontWeight": 500, "lineHeight": "13px", "maxWidth": "480px" }, "logoStyle": { "transform": "scale(1)", "transformOrigin": "center", "margin": "0px" }, "hideClasses": [], "relatedElementActions": [{ "relatedPath": "..", "initialAction": function(r,w){ if(r.className.indexOf('compare') > -1){ w.style.display = "none" } } }] } ], "language": document.querySelector("html").lang || "en", "apDualInstall": false, "klarnaDualInstall": false, "minPrice": 0, "maxPrice": 250000, "observeElements": [ { "eventType": "click", "element": ".options-selector" } ] } ``` -------------------------------- ### Start Checkout with Payload (Example) Source: https://docs.sezzle.com/llms-full.txt Example of initiating a Sezzle checkout with a specific order payload. This includes intent, reference ID, description, and amount. ```javascript checkoutSdk.startCheckout({ checkout_payload: { order: { intent: "AUTH", reference_id: "543645yg5tg5675686", description: "sezzle-store - #12749253509255", order_amount: { amount_in_cents: 10000, currency: "USD", }, }, }, }); ``` -------------------------------- ### Initialize Checkout Object (Example) Source: https://docs.sezzle.com/docs/guides/virtual/automated Example of initializing the Checkout object for a virtual card popup mode in a sandbox environment. ```javascript const checkoutSdk = new Checkout({ mode: "popup", publicKey: "sz_pub_...", apiMode: "sandbox", isVirtualCard: true, }); ``` -------------------------------- ### Direct Integration Quick Start Source: https://docs.sezzle.com/llms-full.txt A step-by-step guide for merchants to quickly integrate with the Sezzle API, covering authentication, session creation, checkout redirection, and order management. ```APIDOC ## Direct Integration Quick Start 1. Use API keys to obtain an [authentication token](./core/authentication/postauthentication) 2. [Create a session](./core/sessions/postv2session) with an [order object](./core/sessions/postv2session#body-order) 3. Redirect user to Sezzle checkout URL 4. User completes Sezzle checkout 5. Sezzle redirects user back to [merchant complete URL](./core/sessions/postv2session#body-complete-url) 6. Manage the order with the [Order API](./core/orders/getv2order) ``` -------------------------------- ### Initialize Checkout with Example Payload Source: https://docs.sezzle.com/docs/guides/virtual/automated This example demonstrates a fully populated checkout payload. It includes sample customer and item details for a transaction. ```javascript checkoutSdk.startCheckout({ checkout_payload: { amount_in_cents: 1000, currency: "USD", merchant_reference_id: "merchant-checkout-id-max-255", customer: { email: "test@test.com", first_name: "John", last_name: "Doe", phone: "0987654321", billing_address_street1: "3432 Terry Lane", billing_address_street2: "12", billing_address_city: "Katy", billing_address_state: "TX", billing_address_postal_code: "77449", billing_address_country_code: "US", }, items: [ { name: "Blue tee", sku: "sku123456", quantity: 1, price: { amount_in_cents: 1000, currency: "USD", }, }, ], }, }); ``` -------------------------------- ### Configure Sezzle Widget Example Source: https://docs.sezzle.com/llms-full.txt Example configuration for the Sezzle widget, setting the target XPath to '#ProductPrice/.money'. ```html ``` -------------------------------- ### Sezzle Widget Example Configuration Source: https://docs.sezzle.com/docs/guides/widgets/static An example demonstrating how to configure the AwesomeSezzle widget with specific values for various options, including amount, theme, and layout settings. ```javascript var renderSezzle = new AwesomeSezzle({ amount: "{{ product.selected_or_first_available_variant.price | money }}", renderElement: "new-sezzle-widget-container-id", numberOfPayments: 5, theme: "light", modalTheme: "color", maxWidth: 400, marginTop: 0, marginBottom: 0, marginLeft: 0, marginRight: 0, alignment: "left", alignmentSwitchMinWidth: 576, alignmentSwitchType: "center", textColor: "#111", fontFamily: "Comfortaa, sans-serif", fontSize: 12, fontWeight: 400, widgetType: "product-page", fixedHeight: 0, logoSize: 1.0, logoStyle: {}, language: "en", parseMode: "default", merchantLocale: "North America", ineligibleWidgetTemplate: "%%logo%% Pay in 4 interest-free payments on purchases $35-$2,500. %%info%%", minPrice: 3500, // Amount in cents maxPrice: 250000, // Amount in cents }); renderSezzle.init(); ``` -------------------------------- ### Initialize Checkout SDK with Example Options Source: https://docs.sezzle.com/llms-full.txt Example of initializing the Checkout SDK with specific configuration values. This demonstrates how to set the mode, public key, API mode, and virtual card status. ```javascript const checkoutSdk = new Checkout({ mode: "popup", publicKey: "sz_pub_...", apiMode: "sandbox", isVirtualCard: true, }); ``` -------------------------------- ### Example Usage of Event Handlers Source: https://docs.sezzle.com/llms-full.txt Demonstrates a practical example of how to implement the event handlers for the Sezzle Checkout SDK. ```APIDOC ## Example: Sezzle Checkout Event Handlers ### Description This example shows how to use the `checkoutSdk.init` method with `onClick`, `onComplete`, `onCancel`, and `onFailure` event handlers. ### Code Example ```javascript checkoutSdk.init({ onClick: function () { event.preventDefault(); checkoutSdk.startCheckout({ checkout_payload: { order: { intent: "AUTH", reference_id: "543645yg5tg5675686", description: "sezzle-store - #12749253509255", order_amount: { amount_in_cents: 10000, currency: "USD", }, }, }, }); }, onComplete: function (response) { alert("Completed transaction. Capture started."); checkoutSdk .capturePayment(response.data.order_uuid, { capture_amount: { amount_in_cents: 10000, currency: "USD", }, partial_capture: false, }) .then((r) => { console.log(r); }); }, onCancel: function () { console.log("Checkout cancelled."); }, onFailure: function () { console.log("Checkout failed."); }, }); ``` ``` -------------------------------- ### Sezzle Configuration Example Source: https://docs.sezzle.com/llms-full.txt An example of a fully configured document.sezzleConfig. This demonstrates how to set specific values for various options to customize the Sezzle widget for a product page. ```html ``` -------------------------------- ### Successful Order Creation Response Example (JSON) Source: https://docs.sezzle.com/docs/api/tokenization/customers/postv2customerorder This example shows a successful response when an order is created via the Sezzle API. It includes the order UUID, relevant links for further actions (GET, PATCH, release, capture, refund), and the order details that were submitted. ```json { "uuid": "6c9db5d4-d09a-4224-860a-b5438ac32ca8", "links": [ { "href": "https://gateway.sezzle.com/v2/order/6c9db5d4-d09a-4224-860a-b5438ac32ca8", "method": "GET", "rel": "self" }, { "href": "https://gateway.sezzle.com/v2/order/6c9db5d4-d09a-4224-860a-b5438ac32ca8", "method": "PATCH", "rel": "self" }, { "href": "https://gateway.sezzle.com/v2/order/6c9db5d4-d09a-4224-860a-b5438ac32ca8/release", "method": "POST", "rel": "release" }, { "href": "https://gateway.sezzle.com/v2/order/6c9db5d4-d09a-4224-860a-b5438ac32ca8/capture", "method": "POST", "rel": "capture" }, { "href": "https://gateway.sezzle.com/v2/order/6c9db5d4-d09a-4224-860a-b5438ac32ca8/refund", "method": "POST", "rel": "refund" } ], "intent": "AUTH", "reference_id": "annual_sub_123", "order_amount": { "amount_in_cents": 5000, "currency": "USD" }, "authorization": { "authorization_amount": { "amount_in_cents": 5000, "currency": "USD" }, "approved": true, "expiration": "2020-04-23T16:13:44Z" } } ``` -------------------------------- ### Initialize Express Checkout (Example) Source: https://docs.sezzle.com/docs/guides/express/express-checkout An example of initializing Express Checkout with specific order details, including items, discounts, metadata, and URLs. This demonstrates a 'multi-step' checkout type. ```javascript checkoutSdk.startCheckout({ checkout_payload: { // "cancel_url":{ // "href": "http://localhost:44300/demo/v2checkout.html" // }, // "complete_url":{ // "href": "http://localhost:44300/demo/v2checkout.html" // }, express_checkout_type: "multi-step", order: { intent: "AUTH", reference_id: "543645yg5tg5675686", description: "sezzle-store - #12749253509255", requires_shipping_info: true, 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", }, }, ], metadata: { location_id: "123", store_name: "Downtown Minneapolis", store_manager: "Jane Doe", }, order_amount: { amount_in_cents: 10000, currency: "USD", }, }, }, }); ``` -------------------------------- ### Sezzle Banner Initialization (Example) Source: https://docs.sezzle.com/docs/guides/home-banner An example of the Sezzle banner initialization with placeholder values for theme and merchant UUID. This demonstrates how to configure the banner for a specific merchant and theme. ```html ``` -------------------------------- ### CDN Integration: Example Snippet Source: https://docs.sezzle.com/docs/guides/home-banner An example of the CDN integration snippet, pre-filled with a sample merchant UUID and theme. This shows a typical configuration for immediate use. ```html ``` -------------------------------- ### Configure Sezzle Checkout Object (Example) Source: https://docs.sezzle.com/docs/guides/direct/integration An example of initializing the Checkout object with 'popup' mode, a sandbox public key, and API version v2. ```javascript const checkoutSdk = new Checkout({ mode: "popup", publicKey: "sz_pub_...", apiMode: "sandbox", apiVersion: "v2", }); ``` -------------------------------- ### Sezzle Widget Example Configuration Source: https://docs.sezzle.com/llms-full.txt An example demonstrating how to configure the AwesomeSezzle widget with specific values for appearance, placement, and payment options. Ensure 'amount' is dynamically set using your platform's templating language. ```html ``` -------------------------------- ### Postman Setup Source: https://docs.sezzle.com/llms-full.txt Instructions on how to set up Postman with the Sezzle Gateway collection for sandbox testing, including downloading Postman and adding the collection. ```APIDOC ## Postman Setup ### Download and Install Postman 1. Go to [postman.com/downloads](https://www.postman.com/downloads) 2. Click `Download the App` 3. When the installation file has finished downloading, click the file to install the application 4. Follow installation prompts on the screen ### Add Sezzle Gateway Collection When installation is complete, follow these steps to add the Sezzle Gateway collection to Postman. 1. [Download the Postman collection](https://god.gw.postman.com/run-collection/9737967-e6ff8257-718a-4206-b6f0-7540e3b97060?action=collection%2Ffork&collection-url=entityId%3D9737967-e6ff8257-718a-4206-b6f0-7540e3b97060%26entityType%3Dcollection%26workspaceId%3Dcf7fd793-2599-4aed-9b55-0871e7b27e1a) 2. In the Web page that opens, select your operating system 3. Click `Open Postman` if prompted 4. In Postman, the Sezzle Gateway collection is now displayed in the Collections tab ``` -------------------------------- ### Shopify Local File Integration: Example Snippet Source: https://docs.sezzle.com/docs/guides/home-banner An example of the template snippet with placeholder values for merchantUUID, theme, and renderToContainer. This demonstrates how to configure the banner for a specific theme and rendering target. ```html {{ "sezzle-home-banner.js" | asset_url | script_tag }} ``` -------------------------------- ### Install Sezzle Static Widget via NPM Source: https://docs.sezzle.com/docs/guides/widgets/static Install the Sezzle static widget package using npm. This is the first step for integrating the widget into your project. ```bash npm install @sezzle/sezzle-static-widget@latest ``` -------------------------------- ### Capture Payment (Example) Source: https://docs.sezzle.com/llms-full.txt Example of capturing a specific amount for an order. This method requires the order UUID and a capture amount payload. ```javascript var payload = { capture_amount: { amount_in_cents: 5000, currency: "USD", }, }; checkout.capturePayment(data.order_uuid, payload); ``` -------------------------------- ### Order Webhook Object Example Source: https://docs.sezzle.com/llms-full.txt This example demonstrates a populated order webhook object for an order completion event. Note that refund-related fields are present but may be null or absent for non-refund events. ```json { "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" } } ``` -------------------------------- ### Checkout Initialization Source: https://docs.sezzle.com/llms-full.txt Initialize the checkout process with various event handlers. The `onClick` handler demonstrates how to start the checkout flow, including adding a `card_response_format` to the payload. ```APIDOC ## checkout.init() ### Description Initializes the Sezzle checkout process with configuration options. ### Method `checkout.init(options)` ### Parameters - **options** (object) - Configuration object for the checkout. - **onClick** (function) - Callback function executed when the checkout button is clicked. It should prevent default behavior and start the checkout. - **onComplete** (function) - Callback function executed upon successful checkout completion. Receives a response object. - **onCancel** (function) - Callback function executed when the checkout is canceled. - **onFailure** (function) - Callback function executed when the checkout fails. ### Request Example ```javascript checkout.init({ onClick: function (event) { event.preventDefault(); checkout.startCheckout({ checkout_payload: { // ... other payload properties "card_response_format": "token" } }); }, onComplete: function (response) { console.log(response.data); }, onCancel: function() { console.log("checkout canceled"); }, onFailure: function() { console.log("checkout failed"); } }) ``` ``` -------------------------------- ### Start Sezzle Checkout with Javascript SDK Source: https://docs.sezzle.com/llms-full.txt Initiates a Sezzle checkout process. Ensure the 'checkout' object is properly initialized before use. ```javascript checkout.startCheckout({ checkout_payload: { "amount_in_cents": 12999, "currency_code": "USD", "order_reference_id": "Ref123456789", "order_description": "Order #1800", } }); ``` -------------------------------- ### Shopify: Install Sezzle Banner from Local File Source: https://docs.sezzle.com/llms-full.txt Integrate the Sezzle banner by first building and uploading the asset as a local file to your Shopify theme. Update the merchantUUID and renderToContainer options as needed. ```html {{ "sezzle-home-banner.js" | asset_url | script_tag }} ``` ```html {{ "sezzle-home-banner.js" | asset_url | script_tag }} ``` -------------------------------- ### Start Sezzle Checkout Flow Source: https://docs.sezzle.com/llms-full.txt Initiates the Sezzle checkout process within the app. Ensure the `completeUrl` and `cancelUrl` Uris match those configured on your server. Use `WEB_VIEW` for in-app checkout or `SYSTEM_BROWSER` to open in Chrome Custom Tabs. ```kotlin SezzleSDK.startCheckout( checkoutUrl = checkoutUrl, completeUrl = Uri.parse("yourapp-sezzle://checkout/done"), cancelUrl = Uri.parse("yourapp-sezzle://checkout/cancelled"), activity = this, listener = checkoutListener, mode = SezzleCheckoutMode.WEB_VIEW // or SYSTEM_BROWSER ) ``` -------------------------------- ### Installment Plan Source: https://docs.sezzle.com/llms-full.txt This function will provide the installment details based on an amount in cents. An existing checkout can be used, or a checkout without any configuration can also be used to quickly get installment details. ```APIDOC ## getInstallmentPlan ### Description Retrieves installment plan details for a given amount. ### Method `checkout.getInstallmentPlan(amountInCents)` ### Parameters #### Path Parameters None #### Query Parameters None #### Request Body None ### Request Example ```javascript const checkout = new Checkout({}); checkout.getInstallmentPlan(1000); ``` ### Response #### Success Response (200) - **schedule** (string) - Payment cadence for installment plan - **totalInCents** (integer) - Total order amount in cents - **installments** (array) - Breakdown of each payment due - **installment** (integer) - Number of installment in series - **amountInCents** (integer) - Installment amount in cents - **dueDate** (string) - Due date of the installment #### Response Example ```json { "schedule": "bi-weekly", "totalInCents": 1000, "installments": [ { "installment": 1, "amountInCents": 250, "dueDate": "2020-10-14" }, { "installment": 2, "amountInCents": 250, "dueDate": "2020-10-28" }, { "installment": 3, "amountInCents": 250, "dueDate": "2020-11-11" }, { "installment": 4, "amountInCents": 250, "dueDate": "2020-11-25" } ] } ``` ``` -------------------------------- ### Get Installment Plan Source: https://docs.sezzle.com/docs/guides/direct/integration Retrieves installment plan details based on a given amount in cents. This can be used with an existing checkout or a new one. ```APIDOC ## Installment Plan ### Description Retrieves installment plan details based on a given amount in cents. This can be used with an existing checkout or a new one. ### Method `checkout.getInstallmentPlan(totalInCents)` ### Parameters #### Path Parameters - **totalInCents** (integer) - Required - Total order amount in cents. ### Response #### Success Response (200) - **schedule** (string) - Payment cadence for installment plan. - **totalInCents** (integer) - Total order amount in cents. - **installments** (array) - Breakdown of each payment due. - **installment** (integer) - Number of installment in series. - **amountInCents** (integer) - Installment amount in cents. - **dueDate** (string) - Due date of the installment. ### Response Example ```json { "schedule": "bi-weekly", "totalInCents": 1000, "installments": [ { "installment": 1, "amountInCents": 250, "dueDate": "2020-10-14" }, { "installment": 2, "amountInCents": 250, "dueDate": "2020-10-28" }, { "installment": 3, "amountInCents": 250, "dueDate": "2020-11-11" }, { "installment": 4, "amountInCents": 250, "dueDate": "2020-11-25" } ] } ``` ``` -------------------------------- ### Get Installment Plan Details Source: https://docs.sezzle.com/docs/guides/direct/integration Retrieve installment plan details for a given amount in cents. This can be done with an existing checkout instance or a new one without configuration. ```javascript const checkout = new Checkout({}); checkout.getInstallmentPlan(1000); ``` -------------------------------- ### Get Interest Account Balance OpenAPI Specification Source: https://docs.sezzle.com/docs/api/core/interest/getv2balance This OpenAPI 3.1.0 specification defines the GET /v2/interest/balance endpoint. It includes details on parameters, responses, and example data for successful operations and various error conditions. ```yaml openapi: 3.1.0 info: title: Sezzle API v2 description: >- This Sezzle API is for merchants who want to accept Sezzle as a payment option termsOfService: https://legal.sezzle.com version: 2.0.0 x-logo: url: https://media.sezzle.com/branding/2.0/png/Logo_WhiteWordmark_500x126.png backgroundColor: '#392558' servers: - url: https://sandbox.gateway.sezzle.com description: development server, usa, ca - url: https://gateway.sezzle.com description: production server, usa, ca security: - Bearer: [] externalDocs: description: Sezzle API guides and tutorials url: https://docs.sezzle.com/sezzle-integration paths: /v2/interest/balance: get: tags: - Reports summary: Interest Account Balance description: >- If you are enrolled in the interest account program, get the current balance on the interest account. Fractions of cents are tracked to properly calculate daily interest accrual even if the interest balance is low. operationId: HandleInterestAccountBalanceRequest parameters: - name: currency-code in: query description: The ISO-4217 currency code of the interest account. schema: type: string responses: '200': description: Successful Operation content: application/json: schema: type: object properties: interest_balance: type: number description: The available interest balance on your account example: interest_balance: 5183.4624 '400': $ref: '#/components/responses/BadRequestV2' example: code: bad_request message: bad request '401': $ref: '#/components/responses/UnauthorizedV2' example: code: UnauthorizedV2 message: authorization not accepted '404': $ref: '#/components/responses/NotFoundV2' example: code: record_not_found message: not found '422': $ref: '#/components/responses/UnprocessableV2' example: code: invalid message: UnprocessableV2 entity components: responses: BadRequestV2: description: Invalid request content: application/json: schema: $ref: '#/components/schemas/ErrorV2' example: code: bad_request message: bad request UnauthorizedV2: description: Unauthorized content: application/json: schema: $ref: '#/components/schemas/ErrorV2' example: code: Unauthorized message: authorization not accepted NotFoundV2: description: The specified resource was not found content: application/json: schema: $ref: '#/components/schemas/ErrorV2' example: code: record_not_found message: not found UnprocessableV2: description: Unable to process the request entity content: application/json: schema: $ref: '#/components/schemas/ErrorV2' example: code: invalid message: Unprocessable entity schemas: ErrorV2: type: object properties: code: type: string description: The general error type message: type: string description: A more specific error message, if available location: type: string description: Where the error occurred debug_uuid: type: string description: The unique identifier assigned to this error for troubleshooting securitySchemes: Bearer: type: apiKey name: Authorization in: header description: >- The authentication token generated from providing API Keys to Sezzle Gateway ``` -------------------------------- ### Initialize Checkout SDK with Template Options Source: https://docs.sezzle.com/llms-full.txt Use this template to initialize the Checkout SDK with placeholder values for configuration. Ensure all required parameters are provided when implementing. ```javascript const checkoutSdk = new Checkout({ mode: string, publicKey: string, apiMode: string, isVirtualCard: boolean, }); ``` -------------------------------- ### Create Session Source: https://docs.sezzle.com/docs/api/core/sessions/postv2session Initiates a new session for a customer checkout or tokenization. This endpoint is crucial for starting any transaction or recurring payment setup with Sezzle. ```APIDOC ## POST /v2/session ### Description Creates a new session for a customer. This session can be used for checkout or for tokenizing a customer for future recurring payments. ### Method POST ### Endpoint /v2/session ### Parameters #### Request Body - **order** (object) - Required - Order details including amount, reference ID, and intent. - **intent** (string) - Required - The intent of the order (e.g., `CAPTURE`, `AUTHORIZE`). - **reference_id** (string) - Required - Merchant-defined ID for the order. - **description** (string) - Required - Description of the order. - **order_amount** (object) - Required - The total amount of the order. - **amount** (integer) - Required - The amount in cents. - **currency** (string) - Required - The currency code (e.g., `USD`). - **metadata** (object) - Optional - Custom data for the checkout. - **items** (array) - Optional - List of items in the order. - **requires_shipping_info** (boolean) - Optional - Whether to collect shipping info. - **discounts** (array) - Optional - Discounts applied to the order. - **tax_amount** (object) - Optional - The tax amount for the order. - **customer** (object) - Optional - Customer details for the session. - **billing_address** (object) - Optional - Customer's billing address. - **street_lines** (array) - Required - Street address lines. - **city** (string) - Required - City. - **state** (string) - Required - State or province. - **postal_code** (string) - Required - Postal code. - **country_code** (string) - Required - Two-letter country code. - **phone** (string) - Optional - Phone number. - **tokenization_required** (boolean) - Optional - Whether tokenization is required for this session. ### Request Example ```json { "order": { "intent": "CAPTURE", "reference_id": "merchant-order-123", "description": "Example Order", "order_amount": { "amount": 10000, "currency": "USD" }, "items": [ { "name": "Example Product", "quantity": 1, "price": { "amount": 10000, "currency": "USD" } } ] }, "customer": { "billing_address": { "street_lines": ["123 Main St"], "city": "Anytown", "state": "CA", "postal_code": "90210", "country_code": "US" } }, "tokenization_required": true } ``` ### Response #### Success Response (200) - **uuid** (string) - The unique identifier for this session. - **links** (array) - Available API links. #### Response Example ```json { "uuid": "sess_abc123xyz", "links": [ { "href": "https://sandbox.sezzle.com/checkout/sess_abc123xyz", "rel": "checkout_url" } ] } ``` ``` -------------------------------- ### startCheckout Method Source: https://docs.sezzle.com/llms-full.txt Initiates the checkout process with the provided checkout payload. The payload includes details about the order amount, currency, merchant reference ID, customer information, and items being purchased. ```APIDOC ## startCheckout Method ### Description Initiates the checkout process with the provided checkout payload. The payload includes details about the order amount, currency, merchant reference ID, customer information, and items being purchased. ### Method ```javascript checkoutSdk.startCheckout(options) ``` ### Parameters #### Request Body - **checkout_payload** (object) - Required - The payload containing checkout details. - **amount_in_cents** (integer) - Required - The total amount of the order in cents. - **currency** (string) - Required - The 3 character currency code as defined by ISO 4217. - **merchant_reference_id** (string) - Required - A unique identifier for the checkout, used for tracking. Must contain only alphanumeric characters, dashes (-), and underscores (_). - **customer** (object) - Optional - Information about the customer. - **email** (string) - Required - The customer's email address. - **first_name** (string) - Required - The customer's first name. - **last_name** (string) - Required - The customer's last name. - **phone** (string) - Optional - The customer's phone number. - **billing_address_street1** (string) - Required - The street and number of the billing address. - **billing_address_street2** (string) - Optional - The apt or unit of the billing address. - **billing_address_city** (string) - Required - The city of the billing address. - **billing_address_state** (string) - Required - The 2 character state code of the billing address. - **billing_address_postal_code** (string) - Required - The postal delivery code of the billing address. - **billing_address_country_code** (string) - Required - The 2 character country code of the billing address. - **items** (array) - Required - A list of items being purchased. - **name** (string) - Required - The name of the item. - **sku** (string) - Required - The SKU identifier for the item. - **quantity** (integer) - Required - The quantity of the item purchased. - **price** (object) - Required - The price object for the item. - **amount_in_cents** (integer) - Required - The amount of the item in cents. - **currency** (string) - Required - The 3 character currency code as defined by ISO 4217. ### Request Example ```json { "checkout_payload": { "amount_in_cents": 1000, "currency": "USD", "merchant_reference_id": "merchant-checkout-id-max-255", "customer": { "email": "test@test.com", "first_name": "John", "last_name": "Doe", "phone": "0987654321", "billing_address_street1": "3432 Terry Lane", "billing_address_street2": "12", "billing_address_city": "Katy", "billing_address_state": "TX", "billing_address_postal_code": "77449", "billing_address_country_code": "US" }, "items": [ { "name": "Blue tee", "sku": "sku123456", "quantity": 1, "price": { "amount_in_cents": 1000, "currency": "USD" } } ] } } ``` ### Response (No specific response schema is detailed in the source. Typically, a successful initialization would return a redirect URL or a checkout session ID.) ### Error Handling (No specific error handling details are provided in the source.) ``` -------------------------------- ### Get Settlement Summaries Source: https://docs.sezzle.com/docs/api/core/settlements/getv2summary Fetches a list of settlement summaries. You can filter the results by specifying a start date, end date, offset, and currency code. ```APIDOC ## GET /v2/settlements/summaries ### Description Get a summarized list of settlement payouts. ### Method GET ### Endpoint /v2/settlements/summaries ### Parameters #### Query Parameters - **start-date** (string) - Required - The UTC start date for the report. Must be in yyyy-mm-dd format. - **end-date** (string) - Optional - The UTC end date for the report. Must be in yyyy-mm-dd format. If omitted, will default to the current date. - **offset** (string) - Optional - The offset for the report. Limit is 20. - **currency-code** (string) - Optional - The ISO-4217 currency code selected by users at checkout. If omitted, will default to USD. ### Response #### Success Response (200) - **uuid** (string) - The unique identifier for the settlement - **payout_currency** (string) - The ISO-4217 currency code of the payout sent to the destination bank account - **settlement_currency** (string) - The ISO-4217 currency code of the amount to be settled - **payout_date** (string) - The UTC date and time of the payout - **final_payout_amount** (number) - The final amount sent in the currency of the destination bank account - **net_settlement_amount** (number) - The net amount (after forex fees) to be settled - **forex_fees** (number) - Foreign exchange fees associated with this settlement payout - **status** (string) - The current status of the payout #### Response Example ```json [ { "uuid": "b7916fbe-f30a-4435-b411-124634287a8ca", "payout_currency": "USD", "payout_date": "2019-12-09T15:52:33Z", "net_settlement_amount": 93.7, "forex_fees": 0, "status": "Complete" }, { "uuid": "c51343hba-d54b-5641-e341-15235523b3at", "payout_currency": "CAD", "payout_date": "2019-12-10T15:52:33Z", "net_settlement_amount": 234.71, "forex_fees": 4.69, "status": "Complete" } ] ``` ```