Skip to main content

Payment Providers

A payment provider in AccruPay is a connected PSP (payment service provider) account that AccruPay can route transactions through. AccruPay supports multiple providers — see the Provider Integrations section in the sidebar for setup instructions for each one.

How provider routing works

When you start a payment session, AccruPay needs to know which provider to route the transaction to. You have three options:

1. Route by provider type (transactionProvider)

Pass the transactionProvider enum to route to a specific provider type. AccruPay selects the merchant's active account of that type.

import AccruPay, { TRANSACTION_PROVIDER, CURRENCY, COUNTRY_ISO_2 } from '@accrupay/node';

const sdk = new AccruPay({
apiSecret: process.env.ACCRUPAY_API_SECRET,
});

const session = await sdk.transactions.clientSessions.payments.start({
transactionProvider: TRANSACTION_PROVIDER[process.env.ACCRUPAY_PROVIDER_TYPE as keyof typeof TRANSACTION_PROVIDER], // see Provider Integrations for values
data: {
amount: 5000n,
currency: CURRENCY.USD,
merchantInternalCustomerCode: 'customer-123',
merchantInternalTransactionCode: 'txn-789',
billing: {
billingFirstName: 'Jane',
billingLastName: 'Smith',
billingEmail: 'jane@example.com',
billingAddressCountry: COUNTRY_ISO_2.US,
billingAddressLine1: '456 Market St',
billingAddressCity: 'San Francisco',
billingAddressState: 'CA',
billingAddressPostalCode: '94105',
},
storePaymentMethod: false,
},
});

2. Route to a specific account (merchantTransactionProviderId)

Pass a merchantTransactionProviderId UUID to target a specific connected account. Use this when your merchant has multiple accounts at the same provider and needs precise routing — for example, different business units, currencies, or regions.

const session = await sdk.transactions.clientSessions.payments.start({
merchantTransactionProviderId: process.env.ACCRUPAY_PROVIDER_ACCOUNT_ID,
data: {
amount: 5000n,
currency: CURRENCY.USD,
merchantInternalCustomerCode: 'customer-123',
merchantInternalTransactionCode: 'txn-789',
billing: {
// ...
},
storePaymentMethod: false,
},
});

3. Use the merchant's default provider (omit both)

If you omit both transactionProvider and merchantTransactionProviderId, AccruPay routes the transaction to the merchant's configured default provider.

const session = await sdk.transactions.clientSessions.payments.start({
data: {
amount: 5000n,
currency: CURRENCY.USD,
merchantInternalCustomerCode: 'customer-123',
merchantInternalTransactionCode: 'txn-789',
billing: {
// ...
},
storePaymentMethod: false,
},
});
tip

Set a default provider in your merchant account settings so start() calls without explicit routing always have a predictable fallback.

Routing reference

ParameterTypeBehavior
transactionProviderTRANSACTION_PROVIDER enumRoutes to the merchant's active account for that provider type
merchantTransactionProviderIdUUID stringRoutes to exactly that connected account
(omitted)Routes to the merchant's default provider
note

transactionProvider and merchantTransactionProviderId are mutually exclusive. Pass one or the other, not both.

Feature availability

Supported payment methods and capabilities vary by provider. Not every provider supports every feature — for example, stored payment methods, ACH, or specific currencies may only be available on certain providers.

Feature availability for each provider is documented on its integration page. See the Provider Integrations section in the sidebar for setup and capability details per provider.

Next steps