Skip to main content

TumiPay Cards JS

JavaScript/TypeScript SDK for secure credit and debit card tokenization.

Sandbox Demo

Test the SDK interactively in UAT before integrating it in your application.

Cards SDK Demo

Try initialize(), validateCard(), getBinInfo(), and authenticateCard() with your UAT credentials and test cards.
Use your UAT merchantId, Token-Top, and Basic Auth credentials. The demo supports COP, PEN, and MXN.

Installation

Quick Start


Standard Response

All methods return the same envelope:

Constructor

Does not make network calls. Only configures the instance.

initialize({ merchantId })

Fetches merchant configuration from the TumiPay server and prepares the SDK for operation. Must be called before generateSubscriptionToken and getBinInfo.

Response

Error Codes


validateCard(request)

Validates card data locally — no network calls. Does not require initialization.

Parameters

Response — success

Response — validation error

Supported Brands

Error Codes


generateSubscriptionToken(card)

Generates a subscription token via Kushki. Requires prior initialization. Kushki credentials are sourced automatically from the context loaded in initialize().

Parameters

Response

Error Codes


getBinInfo(bin)

Fetches bank, brand, and card type from Kushki. Requires prior initialization.

Parameters

Response

Error Codes


Helper Methods


TypeScript Types


Utility Functions