Reconciliation
Reconciliation is the process of matching AccruPay transaction records to your internal orders and to the line items on your payment provider statements. This page describes the key identifiers, how to export transaction data, and how to handle state lag between AccruPay and the provider.
Key identifiers
Every AccruPay transaction carries several reference fields. Use the right one depending on what you are matching against.
| Field | Type | Description | Use for |
|---|---|---|---|
id | String | AccruPay UUID | Primary internal reference; use in all API calls |
merchantInternalTransactionCode | String | Your order or transaction ID — you set this when creating the transaction | Matching AccruPay records back to your own database |
providerCode | String | The provider's own transaction reference | Matching to line items on a provider statement or dashboard |
providerRelatedCode | String | Provider reference for a related transaction (e.g. the original sale when providerCode is a refund) | Refund reconciliation — links the refund back to the original charge |
providerAuthorizationCode | String | Authorization code issued by the card network | Matching to a card receipt or chargeback notice |
Exporting transactions by date range
Use merchantApiTransactions with date filters to export a batch:
query ExportTransactions(
$from: DateTime!
$to: DateTime!
$take: Int!
$skip: Int!
) {
merchantApiTransactions(
transactionDateFrom: $from
transactionDateTo: $to
take: $take
skip: $skip
) {
edges {
node {
id
merchantInternalTransactionCode
providerCode
providerRelatedCode
providerAuthorizationCode
status
amount
currency
createdAt
updatedAt
}
}
totalCount
pageInfo {
hasNextPage
}
}
}
Variables example
{
"from": "2025-01-01T00:00:00Z",
"to": "2025-01-31T23:59:59Z",
"take": 100,
"skip": 0
}
Cursor pagination for large exports
For statement periods with more than a few hundred transactions, paginate using skip and the totalCount to iterate through all records:
async function exportAllTransactions(from: string, to: string) {
const take = 100;
let skip = 0;
const results = [];
while (true) {
const page = await sdk.transactions.getMany({
transactionDateFrom: from,
transactionDateTo: to,
take,
skip,
});
results.push(...page.edges.map((e) => e.node));
if (!page.pageInfo.hasNextPage) break;
skip += take;
}
return results;
}
Reconciling refunds
When a refund is processed, AccruPay creates a separate transaction with:
status: SUCCEEDED (action: REFUND)providerCode: the provider's refund referenceproviderRelatedCode: the provider's reference for the original charge
To find all refunds for a given original transaction, query by providerRelatedCode equal to the original transaction's providerCode.
Why syncOne() exists
Provider webhook events can arrive late or, rarely, not at all. When this happens:
- AccruPay's record shows the last known state (e.g.
PENDING). - The provider dashboard shows the actual current state (e.g.
SUCCEEDED).
Calling syncOne() forces AccruPay to query the provider directly and update the record immediately:
mutation SyncTransaction {
merchantApiTransactionSyncOne(
merchantTransactionProviderId: "provider-id"
id: "transaction-id"
) {
id
status
providerCode
updatedAt
}
}
Call syncOne() whenever:
- A reconciliation run finds a
PENDINGtransaction that should have settled. - Your statement shows a charge with no matching
SUCCEEDEDrecord in AccruPay. - An ACH transaction has been outstanding longer than your provider's settlement window without moving to a terminal state (see ACH Payments for provider-specific timelines).
Reconciliation workflow
- Export AccruPay transactions for the statement period using date range pagination.
- Match on
providerCodeto find the same transaction in your provider statement. - Match on
merchantInternalTransactionCodeto confirm it maps to your internal order. - Flag mismatches: records in AccruPay with no provider statement entry, or statement entries with no AccruPay record.
- Call
syncOne()for any AccruPay records still inPENDINGto pull the latest state. - For refunds: use
providerRelatedCodeto confirm the refund is linked to the correct original charge.
Related
- Webhooks — how provider events flow into AccruPay
- Transactions API — query and sync operations
- Errors — understanding
providerErroron failed transactions