Skip to main content

Transaction Providers

A transaction provider represents a connected payment processor account in AccruPay. All transaction, plan, and customer operations are scoped to a specific provider — you pass merchantTransactionProviderId whenever you need to route a request to a particular account.

Most merchants have one provider, but the model supports multiple (e.g. different processors per region or business unit).

Methods​

getMany()​

List all transaction providers for the current merchant.

const providers = await accrupay.transactionProviders.getMany({
take: 20,
skip: 0,
});

Supports standard pagination parameters:

ParameterTypeDescription
skipnumberOffset-based pagination offset.
takenumberOffset-based page size.
afterstringCursor for forward pagination.
firstnumberPage size for forward cursor pagination.
beforestringCursor for backward pagination.
lastnumberPage size for backward cursor pagination.
sortingobjectSort field and direction.

getOne()​

Fetch a single transaction provider by ID.

const provider = await accrupay.transactionProviders.getOne({
merchantTransactionProviderId: 'provider-id',
});
ParameterTypeRequiredDescription
merchantTransactionProviderIdstringYesAccruPay transaction provider ID.

Return shape​

FieldTypeDescription
idstringAccruPay transaction provider ID.
merchantIdstringOwning merchant ID.
providerTRANSACTION_PROVIDERProvider type enum (e.g. see Provider Integrations for available values).
providerCodestringYour account identifier at the provider.
statusstringProvider account status.
createdAtstringISO creation timestamp.
updatedAtstringISO last-update timestamp.

Usage pattern​

Retrieve your provider ID once at startup (or cache it) and reuse it across operations:

const { items: providers } = await accrupay.transactionProviders.getMany({ take: 1 });
const providerId = providers[0].id;

// Use everywhere a merchantTransactionProviderId is required
const plan = await accrupay.paymentPlans.createOne({
merchantTransactionProviderId: providerId,
data: { /* ... */ },
});