Checkout button
A Snap Finance button for your checkout. Customers apply in a window over your page, without leaving your site.
- One script tag and a container element
- Callbacks for every step of the application
- Dark and light themes
>sdks>javascript
One script adds Snap Finance to your website: a checkout button that lets customers apply for finance in a window over your page, and product widgets that show what they could repay before they reach checkout.
A Snap Finance button for your checkout. Customers apply in a window over your page, without leaving your site.
Banners next to your prices that show customers how much they could repay with Snap Finance.
Checkout button
What happens after the customer clicks the button, and the callbacks your page receives at each step.

At checkout, the customer clicks the Snap Finance button you render. The application opens in a window over your page, so they never leave your site.

The customer fills in the "About you" screen. Once they submit it, Snap creates the application.
onApplicationId
After they fill in the next two pages, Snap decides straight away. Approved With Conditions means that we need extra checks before the customer can carry on.
onApprovedonApprovedWithConditionsonDenied
The customer verifies their bank account, pays their deposit and signs the agreement.
onUnverifiedAccountonPaymentFailure
The finance is in place and the window closes, returning the customer to your page.
onSuccess
Your server checks the application with the Status API, using the applicationId and token from the callbacks, before it updates the order.
Status APIGuide
Load the SDK, describe the order and render the checkout button.
<head> section of your website, using the code snippet below. The script should load before your document body loads.https://sdk.snapfinance.co.uk/v1/snapuk.min.js<head>
<meta charset="utf-8">
<!-- On production replace url with: https://sdk.snapfinance.co.uk/v1/snapuk.min.js -->
<script
src="https://sandbox-sdk.snapfinance.co.uk/v1/snapuk.min.js"
></script>
</head>snapuk object is available. Initialize Snap by calling snapuk.init(clientId) with the client ID Snap gave you.<script>
snapuk.init(clientId);
</script>| Field | Type | Description |
|---|---|---|
invoiceNumber | string | Your order reference. 1 to 10 letters, numbers, hyphens, underscores, dots or slashes. |
deliveryDate | string | When the order will be delivered, as YYYY-MM-DD. |
shippingCost | number | Shipping cost in pounds, e.g. 25.12. |
products | array | The items in the order: productId, description, quantity and price in pounds. |
customer | object | The customer's name, email, mobileNumber and address: houseNumber or houseName, unit, streetAddress, city and postcode. Unused address fields can be empty strings. |
const transaction = {
invoiceNumber: '12345',
deliveryDate: '2023-05-05',
shippingCost: 25.12,
products: [
{
productId: 'AMC47',
quantity: 4,
description: 'Item dose',
price: 250.99
}
],
customer: {
firstName: 'Joe',
lastName: 'Bloggs',
email: 'test@snapfinance.co.uk',
mobileNumber: '07712345678',
houseNumber: '7',
houseName: '',
unit: '',
streetAddress: 'Somewhere St',
city: 'London',
postcode: 'SW1A 1AA'
}
};Reference
The functions the button calls as the customer moves through their application.
applicationId and a token. A typical approved application fires onApplicationId, then onApproved, then onSuccess.| Callback | When it fires |
|---|---|
onApplicationId | The customer has submitted the "About you" screen and Snap has created the application. |
onApproved | The application has been approved. |
onApprovedWithConditions | The application has been approved, subject to extra checks. |
onDenied | The application has been declined. |
onSuccess | The finance is approved and the agreement is in place. Confirm it with the Status API, then complete the order. |
onClose | The customer closed the Snap window, at any stage. |
onWithdrawn | The application has been withdrawn. |
onUnverifiedAccount | Snap couldn’t verify the customer’s bank account. |
onPaymentFailure | The deposit payment failed the maximum number of times. |
onError | Something went wrong. Also receives a message; applicationId may be missing if the error happened before the application was created. |
applicationId or update an order, send it and the token to your server and check the application with the Status API.26 (PENDING_DEL), the expected status after onSuccess.Customise
Match the checkout button to the look of your store.
Example
A complete checkout page with the SDK, the transaction and every callback, explained part by part.