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:
| Parameter | Type | Description |
|---|---|---|
skip | number | Offset-based pagination offset. |
take | number | Offset-based page size. |
after | string | Cursor for forward pagination. |
first | number | Page size for forward cursor pagination. |
before | string | Cursor for backward pagination. |
last | number | Page size for backward cursor pagination. |
sorting | object | Sort field and direction. |
getOne()
Fetch a single transaction provider by ID.
const provider = await accrupay.transactionProviders.getOne({
id: 'provider-id',
});
| Parameter | Type | Required | Description |
|---|---|---|---|
id | string | Yes | AccruPay transaction provider ID. |
Return shape
| Field | Type | Description |
|---|---|---|
id | string | AccruPay transaction provider ID. |
merchantId | string | Owning merchant ID. |
provider | TRANSACTION_PROVIDER | Provider type enum (e.g. see Provider Integrations for available values). |
providerCode | string | Your account identifier at the provider. |
status | string | Provider account status. |
createdAt | string | ISO creation timestamp. |
updatedAt | string | ISO last-update timestamp. |
Usage pattern
Retrieve your provider ID once at startup (or cache it) and reuse it across operations:
const { data: 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: { /* ... */ },
});