Implementing BlueSnap Checkout

Follow the steps in this section to implement BlueSnap Checkout on your website.

Before Getting Started

  • Authentication: You need to create API credentials and define the IP addresses of your server to take advantage of BlueSnap Checkout.
  • Domain: In all steps below, replace BLUESNAPDOMAINPATH with the relevant domain for either the BlueSnap Sandbox or Production environment, as follows:
    • Sandbox:
    • Production:
  • Errors: If you encounter any errors while following the steps below, refer to BlueSnap Checkout Errors.
  • Customization: Find more information about customizing your checkout page on our Page Design and Custom Fields guide.
  • Apple Pay: If you want to accept Apple Pay, please contact Merchant Support to have it enabled for your account.

Step 1: Add the BlueSnap JavaScript file to your site

Add the following BlueSnap JavaScript file to your site, replacing BLUESNAPDOMAINPATH with:

  • Sandbox:
  • Production:

<script type="text/javascript" src="BLUESNAPDOMAINPATH/web-sdk/5/bluesnap.js"></script>

Step 2: Create a Token

When your shopper is ready to complete their purchase, you create a token for the checkout process with BlueSnap.

This token is a JSON Web Token (JWT) that securely stores data about the transaction and allows BlueSnap to verify your identity. Unauthorized websites are prevented from creating BlueSnap Checkout pages on your behalf.

To create the BlueSnap Checkout token, first have your client-side application reach out to your server. Next, send a server-to-server POST request to /services/2/bn3-services/jwt of the relevant BlueSnap domain for Sandbox or Production.


API calls require the use of your API credentials, Basic authentication, and headers. Refer Authentication & Headers for details.

In the request body, you can include Secure Payment Parameters.

Token expiration

Your token expires in any of the following situations:

  • It has been 2 hours since the token was created.
  • The token has successfully been used to process a transaction.

If a token expires, you must create a new one.

Request Examples

curl -v -X POST \
-H 'Content-Type: application/json' \
-H 'Accept: application/json' \ 
-H 'Authorization: Basic dXNlcm5hbWU6cGFzc3dvcmQ=' \
-d '
  "mode": "one_time",
  "onBehalf": "false",
  "currency": "USD",
  "successUrl": "",
  "cancelUrl": "",
  "merchantTransactionId": "myid1234",
  "lineItems": [
      "id": "001",
      "quantity": 2,
      "label": "T-Shirt",
      "description": "T-Shirt with logo",
      "amount": 20
      "id": "002",
      "quantity": 1,
      "label": "Shorts",
      "description": "Green shorts with pockets",
      "amount": 15
curl -v -X POST \
-H 'Content-Type: application/json' \
-H 'Accept: application/json' \
-H 'Authorization: Basic dXNlcm5hbWU6cGFzc3dvcmQ=' \
-d '
  "mode": "subscription",
  "successUrl": "",
  "cancelUrl": "",
  "planItems": [
      "id": "001", // the plan id from createPlan API
      "quantity": 1,
      "label": "AAA subscription", // override the plan-name
      "recurringChargeAmount": 20, // override the recurringChargeAmount
      "trialPeriodDays": 14, // override the trialPeriodDays
      "initialChargeAmount": 10 // override the initialChargeAmount

Response Example

  "jwt": "eyJhbGciOiJIUzI1NiJ9.eyJwYXlsb2FkIjp7ImNvbW1vbkp3dFBheWxvYWQiOnsiaWQiOiI1OTU4NTkxODYxNTgwMDg5OTI3NzEiLCJtZXJjaGFudElkIjo0MDAwNDgsImRhdGVDcmVhdGVkIjoxNjA2OTk2MjI5OTExLCJlbnYiOiJERVY2In0sImN1cnJlbmN5IjoiVVNEIiwic3VjY2Vzc1VybCI6Imh0dHBzOi8vaG9tZS5ibHVlc25hcC5jb20iLCJjYW5jZWxVcmwiOiJodHRwczovL2FwLmJsdWVzbmFwLmludDo0MDA0L2NhbmNlbCIsIm1lcmNoYW50VHJhbnNhY3Rpb25JZCI6IjU5NTg1OTE4NjE1ODAwODk5Mjc3MSIsImxpbmVJdGVtcyI6W3siaWQiOiJpZDEiLCJsYWJlbCI6IlJhaW5ib3ciLCJkZXNjcmlwdGlvbiI6IlRvdWNoIHRoZSBSYWluYm93IiwicXVhbnRpdHkiOjEsImFtb3VudCI6MTAuMCwiaW1nVXJsIjpudWxsfV19fQ.Mi4eiNKCsGDTsLHnTXPfe4-UNpQYSY-OvKufwZr2jR0",
  "merchantTransactionId": "myid1234"

If successful, the response includes your token, which you can then send back to your client-side application.

document.getElementById('payButton').addEventListener('click', function () {
  // Get the token from your server
    .then((response) => response.json())
    .then((data) => {
    	const token = data.token;
      // Continued below...
    .catch((error) => {

Step 3: Complete your sale

  1. Now that you have your token, you can initiate and display BlueSnap Checkout page so your shopper can begin the checkout process. Call bluesnap.redirectToPaymentPage with an sdkRequest object containing these properties. This redirects the shopper and display the BlueSnap checkout page.
document.getElementById('payButton').addEventListener('click', function () {
  // Continued from above
  const sdkRequest = {
    jwt: token
  1. When your shopper successfully finishes checking out, BlueSnap processes the transaction and direct the shopper back to your website via the successUrl in the JWT token. BlueSnap appends your URL with data about the transaction.

Note: Some payment methods require additional implementation steps. Refer to Additional Implementation Steps.

Verifying Transactions

To ensure transactions are valid, we recommend comparing and validating your transaction details against existing information. You can retrieve transaction details using the URL parameters that have been passed into your successURL.

There are two ways to verify a transaction:

  1. Use the Retrieve API request to confirm the transaction details are valid and that the transaction was successful. Since BlueSnap operates in two different data centers, your code needs to retrieve the transaction from the data center that processed the transaction. Use the BlueSnap invoice ID (returned in the callback URL) to determine which domain to use to call the Retrieve API.

    BlueSnap Invoice IDCall domain
  2. Set up IPNs to receive an alert for any event, including a charge.

Payment Methods: Additional Implementation Steps


After successfully checking out using SEPA, the shopper is redirected to your successUrl. In your successUrl you should perform the following steps:

  1. Use BlueSnap Checkout Return URL Parameters to perform a Retrieve SEPA DD Transaction request and obtain the transaction details. The response includes the necessary information for the next steps.
  2. Follow the SEPA implementation guide starting from Step 3.

Local Bank Transfer

After successfully checking out using Local Bank Transfer, the shopper is redirected to your successUrl. In your successUrl you should perform the following steps:

  1. Use BlueSnap Checkout Return URL Parameters to perform a Retrieve LBT Transaction request and obtain the transaction details. The response includes the necessary information for the next steps.
  2. Start at Step 3 and follow the Local Bank Transfer Transaction Processing guide. To understand which details should be displayed to the shopper:
    1. Read Step 4 of the Complete the Payment section.
    2. Refer to the image in Step 2 of the Placing the Order section.

Embedding in an iframe

BlueSnap Checkout can be configured to open inside a container in your website using an iframe, instead of redirecting your shopper to a separate page.

Add the attribute data-bluesnap='iframe-container' to a div element on your page as shown here:
<div data-bluesnap="iframe-container"></div>

Note: You can configure the redirection method of the page using the displayData.iframeOptions.topRedirect flag. By default, topRedirect is false, which causes only the iframe window to redirect to your success/cancel URLs. If you set the topRedirect parameter to true, BlueSnap Checkout redirects your entire page to the success/cancel URLs.


  • ApplePay is not supported in iframe mode.
  • In iframe mode, iDeal Sofort and PayPal always perform top redirection, regardless of the state of the topRedirect flag.

Returning Shoppers

When a transaction is successful, the object in the response of the Retrieve API request includes the shopper ID in the vaultedShopperId property. If you want to allow returning shoppers to use their saved information for payments, you can save the vaultedShopperId and associate it with your shopper. When the shopper checks out again and you are sending a token creation request, you can then include the vaultedShopperId in the shopperId field.

To leverage this feature, configure the checkout page to display a checkbox that the shopper can use to save their card information after a successful transaction. Here are some examples of how the checkout experience might look:

Next steps

Once you've finished implementing BlueSnap Checkout, explore the docs for additional ways to get the most out of BlueSnap's platform.

Learn about BlueSnap's IPN (Webhooks) and how to stay informed of important events.