Skip to content

Payment methods (Core) ​

After loadSession(), list wallets and exchanges for the session. If you passed modules when creating the client, methods whose module is not enabled are omitted.

Fetch ​

ts
import {
  createSwappedConnectClient,
  IntegrationProvider,
  IntegrationProviderType,
} from '@swapped/connect-sdk'

const client = createSwappedConnectClient({ sessionId: 'your-session-id' })
await client.loadSession()

const exchanges = await client.paymentMethods.get({ category: 'exchanges' })
const wallets = await client.paymentMethods.get({ category: 'wallets' })
// → Wallets flow (type: wallet)

const binance = await client.paymentMethods.getOne({
  provider: IntegrationProvider.Binance,
  type: IntegrationProviderType.ExchangePay,
})
const coinbase = await client.paymentMethods.getOne({
  provider: IntegrationProvider.Coinbase,
  type: IntegrationProviderType.ExchangeOauth,
})

if (binance) {
  // → Exchange Pay with IntegrationProvider.Binance
}

if (coinbase) {
  // → Coinbase OAuth withdraw flow (type: exchange_oauth), not Exchange Pay
}

const cashApp = await client.paymentMethods.getOne({
  provider: IntegrationProvider.CashApp,
})
// Cash App is not in the `exchanges` category - filter by provider or type

const exchangePayOnly = await client.paymentMethods.get({
  type: IntegrationProviderType.ExchangePay,
})

Use refetch({ category: 'exchanges' }) when you need a fresh list from the API. getOne returns the first match, or null.

Shape ​

Each row is an IntegrationPaymentMethod - a union of wallet, exchange, and Cash App. Shared fields:

FieldUse for
idStable list key
nameFull label
shortName / uniqueShortNameCompact / disambiguated label
providerIntegrationProvider - route and getOne
typeDiscriminant: wallet, exchange_pay, exchange_oauth, cash_app, …
icon.light / icon.darkSmall picker icon
logo.light / logo.darkLarger brand mark
recommendedHighlight in the list
enabledPresent when the API sends it
priority / priorityWallet / priorityExchangeSort within a category

Narrow on type (or provider) before reading variant-only fields. Variants: IntegrationPaymentMethodWallet, IntegrationPaymentMethodExchange, IntegrationPaymentMethodCashApp. API: IntegrationPaymentMethod.

ts
<img src={method.icon.dark || method.icon.light} alt="" />
<span>{method.shortName || method.name}</span>

Filters ​

FieldExample
category'exchanges' or 'wallets'
typeIntegrationProviderType.Wallet, IntegrationProviderType.ExchangePay, IntegrationProviderType.CashApp, or [IntegrationProviderType.ExchangePay, IntegrationProviderType.ExchangeOauth]
providerIntegrationProvider.CashApp, IntegrationProvider.Binance, or [IntegrationProvider.Binance, IntegrationProvider.Kucoin]

Next ​