Skip to content
Transaction History

Transaction History

Transaction History

List, detail, and statement lookups over previously settled transactions — the transactionhistory package (Service Codes 12-14).

resp, err := transactionhistory.TransactionHistoryList(ctx, transport, hb, transactionhistory.TransactionHistoryListRequest{
	PartnerReferenceNo: "2020102900000000000001",
	FromDateTime: "2026-09-14T10:00:00+07:00",
	ToDateTime: "2026-09-14T10:00:00+07:00",
})
if err != nil {
	// errors.Is(err, snap.ErrBadRequest), snap.ErrUnauthorized, etc.
}

TransactionHistoryList

Lists past transactions in a date range (Service Code 12).

func TransactionHistoryList(ctx context.Context, t *snap.Transport, hb snap.HeaderBuilder, req TransactionHistoryListRequest) (TransactionHistoryListResponse, error)

Request — TransactionHistoryListRequest

pageSize and pageNumber are string, not int — the standard sends them as quoted numbers on the wire (e.g. "10").

FieldTypePresence
partnerReferenceNostringOptional
fromDateTimestringOptional
toDateTimestringOptional
pageSizestringOptional
pageNumberstringOptional
additionalInfojson.RawMessageOptional

Response — TransactionHistoryListResponse

The response body.

FieldTypePresence
responseCodestringMandatory
responseMessagestringMandatory
referenceNostringOptional
partnerReferenceNostringOptional
detailData[]TransactionDetailOptional
additionalInfojson.RawMessageOptional
TransactionDetail fields

One entry in detailData.

FieldTypePresence
dateTimestringOptional
amount*snap.MoneyOptional
remarkstringOptional
sourceOfFunds[]SourceOfFundOptional
statusstringMandatory
typestringMandatory
additionalInfojson.RawMessageOptional
SourceOfFund fields

Describes one source of funds used for a transaction. source is Mandatory; amount is a pointer since only its own value/currency are Mandatory, not the container itself.

FieldTypePresence
sourcestringMandatory
amount*snap.MoneyOptional

TransactionHistoryDetail

Fetches one transaction’s full detail (Service Code 13).

func TransactionHistoryDetail(ctx context.Context, t *snap.Transport, hb snap.HeaderBuilder, req TransactionHistoryDetailRequest) (TransactionHistoryDetailResponse, error)

Request — TransactionHistoryDetailRequest

FieldTypePresence
originalPartnerReferenceNostringMandatory
additionalInfojson.RawMessageOptional

Response — TransactionHistoryDetailResponse

amount and refundAmount are pointers since the container itself is Optional, even though Money’s own value/currency are Mandatory.

FieldTypePresence
responseCodestringMandatory
responseMessagestringMandatory
referenceNostringOptional
partnerReferenceNostringOptional
amount*snap.MoneyOptional
cancelledTimestringOptional
dateTimestringMandatory
refundAmount*snap.MoneyOptional
remarkstringOptional
sourceOfFunds[]SourceOfFundOptional
statusstringMandatory
typestringMandatory
additionalInfojson.RawMessageOptional
SourceOfFund fields

Describes one source of funds used for a transaction. source is Mandatory; amount is a pointer since only its own value/currency are Mandatory, not the container itself.

FieldTypePresence
sourcestringMandatory
amount*snap.MoneyOptional

BankStatement

Fetches a bank-statement-style transaction listing with running balances (Service Code 14).

func BankStatement(ctx context.Context, t *snap.Transport, hb snap.HeaderBuilder, req BankStatementRequest) (BankStatementResponse, error)

Request — BankStatementRequest

bankCardToken and accountNo are mutually exclusive — set exactly one. This package doesn’t enforce that; the server does.

FieldTypePresence
partnerReferenceNostringOptional
bankCardTokenstringOptional
accountNostringOptional
fromDateTimestringOptional
toDateTimestringOptional
additionalInfojson.RawMessageOptional

Response — BankStatementResponse

The response body.

FieldTypePresence
responseCodestringMandatory
responseMessagestringMandatory
referenceNostringOptional
partnerReferenceNostringOptional
balance[]BankStatementBalanceOptional
totalCreditEntries*BankStatementEntryTotalOptional
totalDebitEntries*BankStatementEntryTotalOptional
hasMorestringOptional
lastRecordDateTimestringOptional
detailData[]BankStatementDetailOptional
additionalInfojson.RawMessageOptional
BankStatementBalance fields

One entry in balance: the running balance before/after the statement period. Uses BankStatementBalanceAmount instead of plain Money because it also carries a dateTime.

FieldTypePresence
amountBankStatementBalanceAmountMandatory
startingBalanceBankStatementBalanceAmountMandatory
endingBalanceBankStatementBalanceAmountMandatory
BankStatementBalanceAmount fields

The {value, currency, dateTime} shape used by BankStatementBalance — like Money, plus a timestamp.

FieldTypePresence
valuestringMandatory
currencystringMandatory
dateTimestringMandatory
BankStatementEntryTotal fields

Shared shape for totalCreditEntries and totalDebitEntries. numberOfEntries is string, not int — same reasoning as pageSize/pageNumber above.

FieldTypePresence
numberOfEntriesstringOptional
amountsnap.MoneyMandatory
BankStatementDetail fields

One entry in detailData: a single transaction line.

FieldTypePresence
detailBalance*BankStatementDetailBalanceOptional
amount*snap.MoneyOptional
originAmount*snap.MoneyOptional
transactionDatestringMandatory
remarkstringMandatory
transactionIdstringOptional
typestringMandatory
transactionDetailStatusstringOptional
detailInfojson.RawMessageOptional
BankStatementDetailBalance fields

The balance immediately before (startAmount) and after (endAmount) one transaction.

FieldTypePresence
startAmount[]BankStatementDetailBalanceEntryOptional
endAmount[]BankStatementDetailBalanceEntryOptional
BankStatementDetailBalanceEntry fields

One entry in startAmount/endAmount.

FieldTypePresence
amount*snap.MoneyOptional