SePay CLI overview

Test your SePay integration locally: SePay CLI forwards webhooks to localhost with no public URL and creates sandbox payments to check your code.

||

Try SePay CLI with two terminals. Terminal 1 receives sandbox webhooks and forwards them to your handler on localhost:3000. Terminal 2 simulates an incoming payment of 50,000 VND with order code DH1709:

Terminal 1: receive webhooks
$ sepay webhook listen --forward localhost:3000env: sandbox  Delivering for every bank account of this company.✓ Listening for sandbox events → http://localhost:3000/   (Ctrl+C to stop · retries+enter to manage)14:22:07  payment_in   → http://localhost:3000/   200   12ms   txn=a41c9e02-xxxx-xxxx-xxxx-fa163e2f7c98   wh=5f0e2a7b-xxxx-xxxx-xxxx-3c9d81e04b6a
Terminal 2: simulate a transaction
$ sepay sandbox simulate payment_in --bank-account 832529c1-xxxx-xxxx-xxxx-fa163e2f7c98 --amount 50000 --code DH1709env: sandboxSimulated payment_in event.a41c9e02-xxxx-xxxx-xxxx-fa163e2f7c98

Terminal 1 prints a line for the delivered webhook: 200 is the HTTP status your handler returned, txn= is the xid of the new transaction.

Commands by task

TaskCommand groupEnvironmentDocs
Create sample data and simulated transactionssandboxSandboxSandbox
Receive webhooks on your machine and test your handlerwebhookSandbox & production*Webhooks
View and reconcile transactionstransactionSandbox & productionTransactions
Payment codespaycodeSandbox & productionPayment codes
Virtual accounts (VA)vaSandbox & production*Virtual accounts (VA)
Payment GatewaypgSandbox & production**Payment Gateway
eInvoiceeinvoiceSandbox & production**eInvoice
Bank HubbankhubSandboxBank Hub

* Some commands are sandbox-only. See Environments.

** On production there are only read commands: pg order list, pg order get, einvoice invoice list, einvoice invoice get. The other commands of the two groups run on the sandbox only.

Sandbox and production

Commands run in the sandbox by default, on Test mode data with no real money. Add --env production to work with real transactions. On production, your token needs the scopes the command requires.

Warning

A command that changes data on production runs only when you confirm it on your own terminal. An AI does not confirm it for you: it hands you the command to run yourself. The command takes effect as soon as you confirm; some commands can't be undone (confirmation rule). Add --dry-run to preview what the command would send (Dry run).

Get started with SePay CLI

You need a my.sepay.vn account, with Test mode turned on for your company (see Test mode). Install the CLI, then follow the Quickstart to sign in with sepay login and get your first webhook on your machine.