Transactions in SePay CLI

Look up transactions with SePay CLI, find the ones whose webhook was not delivered so you can reconcile them, and view each transaction in detail.

||

When a webhook never reaches your handler, your order isn't updated. To reconcile transactions with SePay CLI, sepay transaction list --webhook-success 0 lists those transactions so you can compare them with your own records.

The CLI suits manual lookups and scripts on your machine. An application that reconciles on its own in production calls the List Transactions API; see Reconcile transactions through the API.

transaction list and transaction get run on both sandbox and production and only read data. You need to be signed in. Production also needs the read scope (Environments).

transaction list

Lists transactions, filtered by date, direction, account or webhook status.

Parameters

FlagTypeDescription
--fromstringFrom this time. YYYY-MM-DD, YYYY-MM-DD HH:MM:SS or RFC3339, in Vietnam time
--tostringUp to this time, same formats. A bare date covers that whole day: --to 2026-09-22 includes a transaction at 23:59
--transfer-typestringin | out
--webhook-successstring0: the webhook wasn't delivered successfully; 1: it was
--bank-accountstringBank account xid
--va-xidstringVA xid
--reference-numberstringReference number, exact match
--searchstringSearch by reference number, content or payment code
--transaction-date-sortstringasc | desc. Default: newest first
--since-idstringOnly transactions after this xid; use together with --transaction-date-sort asc
--page, --per-pageintPagination; 20 rows by default, up to 100
--fieldsstringThe fields to return, comma-separated

Run sepay transaction list --help for the other flags (amount range, --bank, --transaction-content).

A reversed range stops the command with exit code 2 before anything is sent to SePay, for example a start date after the end date:

$ sepay transaction list --from 2026-10-02 --to 2026-10-01Error: --from must not be after --toRun 'sepay transaction list --help' for usage.

A minimum amount greater than the maximum is refused the same way:

$ sepay transaction list --amount-in-min 500000 --amount-in-max 100000Error: --amount-in-min must not be greater than --amount-in-maxRun 'sepay transaction list --help' for usage.

Example

$ sepay transaction list --webhook-success 0 --from 2026-09-22ID                                    DATE                 AMOUNT    CONTENT                     CODE    BANK  WHb7d30f15-xxxx-xxxx-xxxx-fa163e2f7c98  2026-09-22 15:40:12  +120.000  DH1712 thanh toan don hang  DH1712  ACB   failpage 1/1 · 1 of 1
ColumnDescription
IDThe transaction xid
AMOUNT+ money in, - money out
CODEThe payment code SePay read from the transfer content
WHWebhook delivery result: ok delivered, fail not delivered or no webhook applies to the account, - no data

Notes

  • fail doesn't tell a failed delivery apart from an account with no webhook, so --webhook-success 0 also lists transactions of accounts that no webhook covers.
  • WH reflects your endpoint's response, not whether your system recorded the order: a handler can return success without having processed the payment (for example because of a bug in your code).
  • With --json, the result is an array where each element is a transaction (id, transaction_date, transfer_type, amount_in, amount_out, reference_number, code, webhook_success). The array carries no pagination information. When more pages remain, stderr gets one extra line ending in more rows remain; page through with --page/--per-page; a script should loop over --page until it receives fewer rows than --per-page.
  • --since-id with the default order (newest first) skips transactions, so always pair it with --transaction-date-sort asc.

transaction get

Shows one transaction. The argument is the xid: the ID column, the id field in --json output, or txn= from sepay webhook listen.

$ sepay transaction get 3c9a6e41-xxxx-xxxx-xxxx-a6006ab65acaFIELD        VALUEID           3c9a6e41-xxxx-xxxx-xxxx-a6006ab65acaDate         2026-09-22 15:40:12Amount       +150.000Accumulated  1.150.000Content      DH00012 thanh toan don hangReference    FT26092212345Code         DH00012Bank         ACBAccount      123456789VA           -Webhook      fail

The id field in a webhook payload is an integer, not an xid, so transaction get rejects it. To find a transaction from webhook data, look it up by the bank's reference: referenceCode in the webhook payload, reference_number in --json output and the value of --reference-number are the same code.

$ sepay transaction list --reference-number FT26092212345