Vivawallet class is the main entry point for standard merchant integrations. Once instantiated with your credentials, it exposes typed sub-clients for payments, transactions, webhooks, fees, bank transfers, wallets, data services, POS helpers, reseller flows, RF code payments, obligations, payment sources, and legacy bank-account operations.
Initialization
Pass your OAuth credentials together with your merchant Basic Auth credentials. The SDK uses the right authentication method for each API call.Your OAuth 2.0 Client ID, used for Bearer-token API calls.
Your OAuth 2.0 Client Secret.
Your merchant UUID, used as the username in Viva Basic Auth endpoints.
Your merchant API key, used as the password in Viva Basic Auth endpoints.
Stored on the client for source-code helpers. Pass
sourceCode in method options when a payment or transaction endpoint requires one.When
true, the client uses VivaWallet demo endpoints for API calls.Enables internal SDK error logging when
true.Available Modules
After instantiation, all sub-clients are available as properties of theVivawallet instance:
payments
Create, retrieve, update, cancel, and create legacy payment orders.
transactions
Retrieve, cancel, refund, rebate, tokenize, MOTO, preauth, OCT, and legacy transaction operations.
webhooks
Add, update, delete, and list webhook subscriptions. Retrieve webhook verification keys.
fees
Retrieve fee amounts for payment orders through the Basic Auth fees endpoint.
bankTransfers
Link bank accounts, retrieve transfer options, create transfer fees, and execute outgoing transfers.
wallets
Merchant wallet balances and balance transfers between Viva accounts.
dataServices
Transaction search, MT940 exports, sale transaction exports, and account transaction search.
pos
Standard Cloud Terminal helpers for device search, POS transactions, terminal actions, and session management.
resellers
Reseller payment flows including cash, bill, OTP, and reseller order creation.
rfCodePayments
Generate RF code payment references.
obligations
Create payment obligations tied to specific amounts and references.
source
Create or set payment source codes associated with your merchant account.
legacyBankAccounts
Legacy bank account linking and outgoing transfer operations.
Usage Example
Each sub-client method returns a typedMethodReturn result object:
getSmartCheckout Helper
After creating a payment order, redirect your customer to the VivaWallet SmartCheckout page using the standalone getSmartCheckout() function. This function constructs the full redirect URL from the order code and optional display options.
The order code returned by
payments.createOrder(), converted to a string.Optional color value passed to VivaWallet for the checkout UI.
Optional VivaWallet payment method identifier to pre-select on the checkout page.
When
true, the URL points to the VivaWallet demo checkout environment instead of production.getSmartCheckout() returns the full SmartCheckout URL as a string.
Demo Environment
Passdev: true when constructing the Vivawallet client to route API calls to VivaWallet demo endpoints. getSmartCheckout() also accepts dev: true, because the checkout redirect URL is built independently from the client instance.
Demo credentials are separate from live credentials. Use matching demo credentials when the client is created with
dev: true.Related Guides
Payments
Learn how to create, retrieve, update, and cancel payment orders.
Transactions
Cancel, refund, and inspect transaction details.
Webhooks
Manage webhook subscriptions and type incoming events.
Webhook Helpers
Verify, deduplicate, and soft-validate incoming webhook deliveries.
Cloud Terminal
Search POS devices, initiate terminal requests, and manage sessions.
Bank Transfers
Link bank accounts and execute outgoing fund transfers.
Wallets
Check balances and move funds between merchant wallets.