Install the Bolt Tokenizer

Bolt’s tokenizer can be used to implement custom back-office integrations, such as direct payment processing, when also paired with the authorization endpoint.

Bolt offers its tokenizer as both an API and a public package on NPM. These instructions will walk you through using the NPM package. To use the API, please see the API documentation.

Tokenizer NPM Package

Tokenization is handled in a separate service from Bolt Checkout and is PCI compliant. See the Authorization endpoint’s request body schema for more information.


All of the following must be provided when using Bolt’s Tokenizer:

  • A valid credit card number from a supported card network.
  • A valid CVV

How to use the Tokenizer

  1. Import the package:
import TkClient from "@boltpay/tokenizer";
  1. Create a new instance of the TkClient object:
const tkClient = new TkClient(env, async (url, request) => fetchFunc(url, request));

In the initial call, the env value can be to either sandbox or production. fetchFunc is a function used to send HTTP requests (for example, you could use the javascript built-in function fetch).

  1. Call the postToken method with the credit card information:
const cardToken = tkClient.postToken(credit_card);
  1. Authorize using the v1/merchant/transactions/authorize endpoint found here.

Objects & Values

credit_card is the javascript object {cc: credit card number, cvv: cvv}

postToken returns the javascript object {token, expiry, last4, bin, network}

Object Value
token The token is the newly generated credit card token.
expiry The date at which the token expires.
last4 The last 4 digits of the card number.
bin The credit card bin.
network The credit card network.


import TkClient from "@boltpay/tokenizer";

const tkClient = new TkClient("sandbox", async (url, request) => fetch(url, request));
const cardToken = tkClient.postToken({cc: "4111111111111111", cvv: "000"});
📖On This Page
Filter by Section
Filter by Topic