Skip to main content
Marketplace is the client class for multi-seller platform integrations. It covers platform payment orders, connected seller accounts, Marketplace transaction cancellation, fund transfers, webhooks, and payment source helpers.

Constructor

Import and instantiate the Marketplace client with your platform credentials:
clientId
string
required
OAuth 2.0 Client ID for the platform account.
clientSecret
string
required
OAuth 2.0 Client Secret paired with clientId for token requests.
merchantId
string
required
Merchant UUID of the platform account. Used as the username in Viva Basic Auth requests.
apikey
string
required
API key for the platform account. Used as the Basic Auth password.
sourceCode
string | null
Stored on the client for source-code helpers. Pass source codes in method options when a Marketplace endpoint requires one.
dev
boolean
default:"false"
When true, the client uses VivaWallet demo endpoints for API calls.
logs
boolean
default:"false"
Enables internal SDK error logging when true.

Sub-client Modules

Each module is available as a property on the Marketplace instance.

Common Methods

marketplace.transfers.sendFunds(data)

Sends funds from the platform account to a connected account.

marketplace.transfers.createTransferReversal(transferId, options)

Creates a full or partial reversal for an existing transfer. Pass amount: null or omit the options object for a full reversal.

marketplace.transactions.cancelTransaction(transactionId, refundOptions)

Cancels or refunds a Marketplace transaction with Marketplace-specific refund options.

getVivaWebhookCode()

Deprecated compatibility helper. Prefer marketplace.webhooks.retrieveWebhookKey().