Skip to main content

Transactions Overview

Transactions represent individual payment operations in AccruPay. This guide covers transaction concepts and operations.

Transaction Lifecycle

Session Created → Payment Processing → Transaction Completed

Refund/Void Available

Transaction Types

Client Payment Sessions

Client-side payment processing where the customer enters payment details in a secure hosted form or iframe.

Use Cases:

  • E-commerce checkout
  • One-time payments
  • Donations

Server Payment Methods

Server-side payment processing using stored payment methods.

Use Cases:

  • Stored payment method charges
  • Subscription renewals
  • Automated payments

Transaction Statuses

  • PENDING - Transaction is processing
  • SUCCESS - Payment completed successfully
  • FAILED - Payment failed
  • VOIDED - Transaction was voided
  • REFUNDED - Transaction was refunded (partially or fully)

Key Fields

Amount and Currency

Amounts are stored in cents (smallest currency unit):

const amount = 10000n; // $100.00 USD

Internal Codes

Use internal codes to track transactions and customers in your system:

{
merchantInternalCustomerCode: 'customer-123', // Your customer ID
merchantInternalTransactionCode: 'txn-456', // Your transaction ID
}

Core Operations

Create Payment Session

Start a new payment session:

mutation {
merchantApiClientTransactionPaymentSessionStart(
transactionProvider: NUVEI
data: {
amount: "10000"
currency: USD
merchantInternalTransactionCode: "txn-123"
merchantInternalCustomerCode: "customer-456"
billing: {
billingFirstName: "John"
billingLastName: "Doe"
billingEmail: "john@example.com"
billingAddressCountry: US
}
storePaymentMethod: false
}
) {
id
token
providerCode
}
}

Verify Session

Verify payment completion:

mutation {
merchantApiClientTransactionPaymentSessionVerify(
id: "session-id"
) {
id
status
amount
currency
}
}

List Transactions

query {
merchantApiTransactions(
take: 10
skip: 0
currency: USD
) {
items {
id
amount
currency
status
createdAt
}
totalCount
}
}

Refund Transaction

mutation {
merchantApiTransactionRefundOne(
id: "transaction-id"
amount: "1000"
) {
id
status
refundedAmount
}
}

Next Steps