Transactions
Transactions are the core payment record in AccruPay. Every charge, refund, void, authorization, and payout is represented as a transaction.
All operations on this page require the accrupay-api-secret header and must be called from your backend.
Transaction fields
The following fields are available on the Transaction type. Request only the fields you need.
| Field | Type | Description |
|---|---|---|
id | String! | AccruPay transaction ID |
merchantInternalTransactionCode | String | Your own reference code for this transaction |
providerCode | String | Provider-assigned transaction reference |
merchantTransactionProviderId | String | ID of the merchant-provider configuration used |
action | TRANSACTION_ACTION! | Type of transaction (PAYMENT, REFUND, VOID, etc.) |
status | TRANSACTION_STATUS! | Current status |
amount | BigInt | Transaction amount in minor currency units |
currency | CURRENCY | ISO 4217 currency code |
paymentMethod | PAYMENT_METHOD | Payment method type (CARD, ACH, OTHER) |
achSecCode | TRANSACTION_ACH_SECCODE | ACH SEC code (ACH transactions only) |
errorCode | String | Provider error code if status is ERROR or FAILED |
errorMessage | String | Human-readable error message |
customerPaymentMethodId | String | ID of the stored payment method used, if any |
customerId | String | AccruPay customer ID |
merchantInternalCustomerCode | String | Your own reference code for the customer |
billingFirstName | String | Billing first name |
billingLastName | String | Billing last name |
billingEmail | String | Billing email address |
billingPhone | String | Billing phone number |
billingAddress | String | Billing street address |
billingCity | String | Billing city |
billingState | String | Billing state or region |
billingZip | String | Billing postal code |
billingAddressCountry | COUNTRY_ISO_2 | Billing country |
createdAt | DateTimeISO! | When the transaction was created |
updatedAt | DateTimeISO! | When the transaction was last updated |
merchantApiTransactions — list transactions
Returns a paginated list of transactions for your merchant account.
Query
query ListTransactions(
$take: Int
$skip: Int
$after: String
$first: Int
$status: TRANSACTION_STATUS
$action: TRANSACTION_ACTION
$currency: CURRENCY
$merchantInternalTransactionCode: String
$merchantInternalCustomerCode: String
$customerId: String
$customerPaymentMethodId: String
$merchantTransactionProviderId: String
$createdAtFrom: DateTimeISO
$createdAtTo: DateTimeISO
) {
merchantApiTransactions(
take: $take
skip: $skip
after: $after
first: $first
status: $status
action: $action
currency: $currency
merchantInternalTransactionCode: $merchantInternalTransactionCode
merchantInternalCustomerCode: $merchantInternalCustomerCode
customerId: $customerId
customerPaymentMethodId: $customerPaymentMethodId
merchantTransactionProviderId: $merchantTransactionProviderId
createdAtFrom: $createdAtFrom
createdAtTo: $createdAtTo
) {
edges {
node {
id
merchantInternalTransactionCode
providerCode
action
status
amount
currency
paymentMethod
createdAt
updatedAt
}
cursor
}
pageInfo {
hasNextPage
hasPreviousPage
startCursor
endCursor
}
totalCount
}
}
curl example
curl -X POST https://api.pay.accru.co/graphql \
-H "Content-Type: application/json" \
-H "accrupay-api-secret: YOUR_SECRET" \
-d '{
"query": "query ListTransactions($take: Int, $skip: Int, $status: TRANSACTION_STATUS) { merchantApiTransactions(take: $take, skip: $skip, status: $status) { edges { node { id merchantInternalTransactionCode status amount currency createdAt } } totalCount } }",
"variables": { "take": 10, "skip": 0, "status": "SUCCEEDED" }
}'
Filter parameters
| Parameter | Type | Description |
|---|---|---|
take | Int | Page size for offset pagination |
skip | Int | Offset for offset pagination |
first | Int | Page size for cursor pagination (forward) |
last | Int | Page size for cursor pagination (backward) |
after | String | Cursor for forward pagination |
before | String | Cursor for backward pagination |
status | TRANSACTION_STATUS | Filter by transaction status |
action | TRANSACTION_ACTION | Filter by transaction action type |
currency | CURRENCY | Filter by currency |
merchantInternalTransactionCode | String | Filter by your transaction reference |
merchantInternalCustomerCode | String | Filter by your customer reference |
customerId | String | Filter by AccruPay customer ID |
customerPaymentMethodId | String | Filter by stored payment method ID |
merchantTransactionProviderId | String | Filter by merchant-provider configuration ID |
createdAtFrom | DateTimeISO | Filter transactions created on or after this timestamp |
createdAtTo | DateTimeISO | Filter transactions created on or before this timestamp |
merchantApiTransaction — get one transaction
Fetch a single transaction by any of three identifiers. Provide exactly one.
Query
query GetTransaction(
$id: String
$merchantInternalTransactionCode: String
$providerCode: String
) {
merchantApiTransaction(
id: $id
merchantInternalTransactionCode: $merchantInternalTransactionCode
providerCode: $providerCode
) {
id
merchantInternalTransactionCode
providerCode
action
status
amount
currency
paymentMethod
errorCode
errorMessage
billingFirstName
billingLastName
billingEmail
createdAt
updatedAt
}
}
Identifiers
| Parameter | Type | Description |
|---|---|---|
id | String | AccruPay transaction ID |
merchantInternalTransactionCode | String | Your own transaction reference code |
providerCode | String | Provider-assigned transaction reference |
Use merchantInternalTransactionCode when you need to look up a transaction using your own internal order or invoice ID.
merchantApiTransactionVoid — void a transaction
Voids an authorized or pending transaction before it is captured. Returns the updated transaction.
Mutation
mutation VoidTransaction(
$id: String
$merchantInternalTransactionCode: String
$providerCode: String
) {
merchantApiTransactionVoid(
id: $id
merchantInternalTransactionCode: $merchantInternalTransactionCode
providerCode: $providerCode
) {
id
status
action
amount
currency
updatedAt
}
}
Identifiers
| Parameter | Type | Description |
|---|---|---|
id | String | AccruPay transaction ID |
merchantInternalTransactionCode | String | Your own transaction reference code |
providerCode | String | Provider-assigned transaction reference |
Provide exactly one identifier.
merchantApiTransactionRefund — refund a transaction
Refunds a previously completed transaction. You must always provide the amount to refund.
Mutation
mutation RefundTransaction(
$amount: BigInt!
$id: String
$merchantInternalTransactionCode: String
$providerCode: String
) {
merchantApiTransactionRefund(
amount: $amount
id: $id
merchantInternalTransactionCode: $merchantInternalTransactionCode
providerCode: $providerCode
) {
id
status
action
amount
currency
updatedAt
}
}
curl example
curl -X POST https://api.pay.accru.co/graphql \
-H "Content-Type: application/json" \
-H "accrupay-api-secret: YOUR_SECRET" \
-d '{
"query": "mutation RefundTransaction($amount: BigInt!, $id: String) { merchantApiTransactionRefund(amount: $amount, id: $id) { id status action amount currency updatedAt } }",
"variables": { "amount": 5000, "id": "txn_abc123" }
}'
Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
amount | BigInt! | Yes | Amount to refund in minor currency units |
id | String | One required | AccruPay transaction ID |
merchantInternalTransactionCode | String | One required | Your own transaction reference code |
providerCode | String | One required | Provider-assigned transaction reference |
amount is always required. There is no full-refund shorthand — you must explicitly pass the full transaction amount if you intend to refund completely. Partial refunds use the same mutation with a smaller amount.
merchantApiTransactionSyncOne — sync transaction state
Fetches the latest state of a transaction from the provider and updates AccruPay's record. Use this when you suspect the local status is stale or after a webhook is delayed.
Mutation
mutation SyncTransaction(
$merchantTransactionProviderId: String!
$id: String
$merchantInternalTransactionCode: String
$providerCode: String
) {
merchantApiTransactionSyncOne(
merchantTransactionProviderId: $merchantTransactionProviderId
id: $id
merchantInternalTransactionCode: $merchantInternalTransactionCode
providerCode: $providerCode
) {
id
status
action
amount
currency
updatedAt
}
}
Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
merchantTransactionProviderId | String! | Yes | ID of the merchant-provider configuration to sync against |
id | String | One required | AccruPay transaction ID |
merchantInternalTransactionCode | String | One required | Your own transaction reference code |
providerCode | String | One required | Provider-assigned transaction reference |
merchantTransactionProviderId is always required for sync, in addition to one transaction identifier. This tells AccruPay which provider connection to query for the latest state.