This version of our Documentation is for the eyes of employees and select merchants only.
API Reference

Our reference library for integrating with our API

Classic Docs

Documentation for our Classic API

Checkout.js reference

We've gathered all those hard-to-find bits of information in this handy Checkout.js reference guide to help you build your integration with ease.

Checkout.js is a legacy solution. Upgrade to Hosted Payments Page—our easiest integration method.

Configuration options

This is a complete list of Checkout.js configuration options.


You can only create payments in currencies that have been enabled for your account. Please contact your Customer Success manager if you need to process in additional currencies.

Data-key attributeJavaScript keyDescription
data-public-keypublicKeyYour public key. You can find it in the Hub.
data-payment-tokenpaymentTokenYour payment token. This is only required when creating an alternative payment charge with payment token.
data-customer-emailcustomerEmailThe customer's email address.
data-valuevalueThe payment value displayed in the payment lightbox.
data-currencycurrencyThe payment currency displayed in the payment lightbox.

Specifies the available payment methods.

  • mixed: all enabled credit/debit cards and alternative/local payments
  • cards: all enabled credit/debit cards only
  • localpayments: all enabled alternative payment methods only

This is a required field for card payments and must be set to either cards or mixed.


Set to cardTokenisation to enable the card tokenization charge option. This is a required field for card payments and must be set to cardTokenisation (i.e., cardFormMode: cardTokenisation).

This does not apply for alternative payments.


Data-key attributeJavaScript keyDescriptionDefault
data-debug-modedebugModeSet to true to view console messages.N/A
data-namespacenamespaceUse to customize the default Checkout namespace.N/A

Customer details

billingDetails is the only way to send customer details when using Checkout.js.

Data-key attributeJavaScript keyDescriptionDefault
data-customer-namecustomerNameThe name of the customer.N/A
Not supportedbillingDetails

Payment billing details:
{addressLine1, addressLine2, postcode, country, city, phone{number}}


Example billing details

<form class="payment-form" method="POST" action="">
    window.CKOConfig = {
      publicKey: 'pk_test_6ff46046-30af-41d9-bf58-929022d2cd14',
      paymentToken: 'pay_tok_SPECIMEN-000',
      customerEmail: '',
      value: 100,
      customerName: 'John Smith',
      billingDetails: {
        'addressLine1': "623 Slade Street",
        'addressLine2': "Apartment 8",
        'postcode': "31313",
        'country': "US",
        'city': "Hinesville",
        'phone': {'number': "9125084652"}
  <script async src=""></script>

In a live environment, replace <script async src=""></script> with <script async src=""></script>.

Payment details

Data-key attributeJavaScript keyDescriptionDefault

Specifies the available payment methods:

  • mixed: all enabled credit/debit cards and alternative/local payments
  • cards: all enabled credit/debit cards only
  • localpayments: all enabled alternative/local payments only
data-payment-provider-idpaymentProviderIdDefines a single alternative payment method within the payment widget. For example, iDEAL: lpp_9.N/A
data-lp-codelpCodeDeprecated. Please use paymentProviderId (above) instead.N/A

Boolean value that displays ISO3 currency code (e.g., GBP) instead of the currency symbol (e.g., £).

  • true: display ISO3 currency code
  • false: display currency symbol
data-geo-country-codecountryCodeISO2 country code (e.g., CN = China; UK = United Kingdom) that determines the order in which alternative payment methods are displayed in the payment widget and lightbox. Alternative payment methods supported in the country specified will be displayed first.N/A

Widget options

These are applicable when integrating via Checkout.configure(), as it does not display the payment widget.

Data-key attributeJavaScript keyDescriptionDefault
data-widget-colorwidgetColorHEX value of your chosen widget color.#000333
data-button-colorbuttonColorHEX value of your chosen button color.#00B660
data-button-label-colorbuttonLabelColorHEX value of your chosen button text color.#FFFFFF
data-button-labelbuttonLabelString value that sets the text inside the widget button.Pay Now
data-pay-button-selectorpayButtonSelectorThe .class or #id of the element acting as the parent for the widget button.N/A
Not supportedwidgetContainerSelectorThe .class or #id of the element hosting the Checkout.js widget.<body>
data-icon-container-selectoriconContainerSelectorThe .class or #id of the element hosting the Checkout.js widget card icons.Same element as Pay Now button.
  • 0: all
  • 1: pay button only
  • 2: icons only
  • 3: active icons only (clicking an icon opens the payment lightbox)

Lightbox options

Data-key attributeJavaScript keyDescriptionDefault
data-titletitleThe title of your payment form.N/A
data-subtitlesubtitleThe subtitle of your payment form.N/A
data-logo-urllogoUrlThe URL of your logo (180 x 36 pixels), beginning with https.The logo
data-theme-colorthemeColorHEX value of your chosen theme color.#00b660
Not supportediconColorHEX value of your chosen icon color.#3075dd
data-form-button-labelformButtonLabelString value that sets the text inside the lightbox form's submit button.Checkout Now

Boolean value that forces redirect to the payment app instead of opening the payment app in an iframe.

  • true: enable redirection
  • false: disable redirection

Boolean value that forces mobile redirection instead of using tabs.

  • true: enable mobile redirection
  • false: disable mobile redirection
Not supportedredirectUrl

The URL where a cardholder would be redirected once their card details are submitted via the payment app. If forceRedirect or forceMobileRedirect is enabled, a redirectUrl must be specified. If the redirect URL parameter is specified, it will override the FORM action URL.


Boolean value that preloads lightbox.

  • true: enable lightbox preload
  • false: disable lightbox preload

Boolean value that locks the lightbox into a single state.

  • true: enable single state
  • false: disable single state

Sets the colour scheme of the lightbox. Available options include:

  • standard: blue
  • light: white
Not supportedcardFormMode

Enables payments with a card token.

Please see Checkout.js for examples.

or cardTokenised if Checkout.js is called asynchronously.

Not supporteduseMobileLightboxOpens the payment app inside the merchant checkout screen on mobile devices.false


Data-key attributeJavaScript keyDescription

Defines language of the (supplied) text displayed in the payment widget and payment lightbox.

Available options include:

  • DE-DE: German
  • EN-GB: English
  • ES-ES: Spanish
  • FR-FR: French
  • IT-IT: Italian
  • KR-KR: Korean
  • NL-NL: Dutch

Advanced styling

You can define advanced styling and customization of Checkout.js using the Javascript API and setting the styling property in the configuration object.

// Method A
window.CKOConfig.styling = {
 formButtonColor: "#591459",
 overlayShade: "light"
// Method B

  styling: {
    formButtonColor: "#591459",
    overlayShade: "light"

The available options for the styling object are:

Data-key attributeJavaScript keyDescriptionDefault
N/AformButtonColorHEX value of your chosen lightbox submit button color#00B660
N/AformButtonLabelColorHEX value of your chosen lightbox submit button label color.#FFFFFF

Sets the color of the overlay behind the payment lightbox.

Available options include:

  • dark
  • light
N/AoverlayOpacityOpacity of the overlay displayed behind the payment lightbox, expressed as a number between 0.8 and 1.0.9

Boolean value that displays widget icons on mobile.

  • true: mobile icons enabled
  • false: mobile icons disabled

Sets size of the payment widget icons. Available options include:

  • small (40 x 22px)
  • medium (50 x 28px)
  • large (60 x 34px)


With Checkout.js, we dispatch events which you can handle for various purposes. The table below provides the full list of events — use them to attach to one or more handlers.

Event nameJavaScript constantDescription
readyREADYTriggered when Checkout.js is registered on the global namespace and is safe to use.

After tokenizing a card; it returns a card token and a card object containing the paymentMethod (e.g., VISA, AMEX, etc.) and bin (first six digits of the credit card number).

For example, {cardToken: "card_tok_111", card: {paymentMethod: 'VISA', bin: '424242'}}

cardTokenisationFailedCARD_TOKENISATION_FAILEDAfter card tokenization fails.
paymentTokenExpiredPAYMENT_TOKEN_EXPIREDAfter paymentToken expires.
lpChargedLP_CHARGEDAfter successful local payment charge (see sample code below).

After a local payment fails; this event object will contain the payment URL and response code.
For example, {localPayment: {paymentUrl: "http://www..."}, responseCode: 20***}.

apiErrorAPI_ERRORFailure to receive a correct response from the Checkout's Gateway API will result in an apiError event being dispatched.

Example: using configuration options to define lpCharged options

  publicKey: '...',
  lpCharged: {
    callback: function(event) {
    options: {
      removeOverlayOnRedirect: false,
      removeSpinnerOnRedirect: false,
      onRedirectMessage: "your message here..."

Localization events

Event nameJavaScript constantDescription
localisationLoadedLOCALISATION_LOADEDWhen a language other than English is loaded.
localisationLoadFailedLOCALISATION_LOAD_FAILEDWhen failing to load a requested language.

Widget and lightbox events

Event nameJavaScript constantDescription
widgetRenderedWIDGET_RENDEREDAfter the Checkout.js widget is rendered.
lightboxActivatedLIGHTBOX_ACTIVATEDAfter the Checkout.js lightbox opens.
lightboxDeactivatedLIGHTBOX_DEACTIVATEDAfter the Checkout.js lightbox closes automatically following the completion of a payment, or after the user closes the lightbox manually.
lightboxCancelledLIGHTBOX_CANCELLEDIf the user presses esc or cancel before the Checkout.js lightbox loads.
lightboxLoadFailedLIGHTBOX_LOAD_FAILEDIf the Checkout.js lightbox fails to load.
invalidLightboxConfigINVALID_LIGHTBOX_CONFIGIf configuration parameters required by the Checkout.js lightbox (publicKey, paymentToken, value, currency) are missing or invalid.

Adding an event handler

There are two ways to add an event handler:

  • using the standard approach
  • using configuration options
Checkout.addEventHandler(Checkout.Events., handler, options);
  publicKey: '...',
  : handler