📍 Bolt / Developers / Developer References / Install the Bolt Tokenizer

Install the Bolt Tokenizer

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

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.

Requirements

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}

  • 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

Example

import TkClient from @boltpay/tokenizer;

const tkClient = new TkCLient("sandbox", async (url, request) => fetch(url, request));
const cardToken = tkClient.postToken({cc: "4111111111111111", cvv: "000"});
👎

How did we do?

📖On This Page