Skip to main content
Vivawallet is the primary client class for standard merchant integrations. It exposes typed sub-client modules for payments, transactions, webhooks, fees, wallets, bank transfers, data services, POS helpers, resellers, RF code payments, obligations, source codes, and legacy bank accounts.

Constructor

Import and instantiate the client with your VivaWallet credentials:
string
required
OAuth 2.0 Client ID used to request Bearer tokens.
string
required
OAuth 2.0 Client Secret paired with clientId for token requests.
string
required
Merchant UUID used as the username in Viva Basic Auth requests.
string
required
API key used as the password in Viva Basic Auth requests.
string | null
Stored on the client for source-code helpers. Pass source codes in method options when a payment or transaction endpoint requires one.
boolean
default:"false"
When true, the client uses VivaWallet demo endpoints for API calls.
boolean
default:"false"
Enables internal SDK error logging when true.

Sub-client Modules

Each module is available as a property on the Vivawallet instance and handles one domain of the VivaWallet API.

Methods

getCloudTerminalAccessToken()

Calls POST /connect/token with grant_type=client_credentials and returns VivaWallet’s full token response. The SDK does not cache this token; callers should reuse it until expires_in elapses.

getVivaWebhookCode()

Deprecated wrapper around webhooks.retrieveWebhookKey().

getSmartCheckout(options)

A standalone named export, not a method on the class. It builds the full SmartCheckout redirect URL for a given order code.
Signature:
string
required
The order code returned by payments.createOrder(), converted to a string.
string
Optional color value appended to the SmartCheckout URL.
number
Optional VivaWallet payment method identifier to pre-select on SmartCheckout.
boolean
default:"false"
When true, constructs a URL pointing to the VivaWallet demo checkout environment.
Returns: string — the fully constructed SmartCheckout redirect URL.