How to create a SePay webhook

Create a SePay webhook via the 4-step dashboard form: pick event types, filter by payment-code prefix, test send, edit, and clone configurations.

||

To create and manage webhooks, open the SePay Dashboard, then go to IntegrationsWebhooks. New webhooks are created through a 4-step form. Use the menu on each row to edit, clone, or test-send a webhook.

Webhooks page
Click to expand
Webhooks management page

4-step wizard

Click Add webhook.

Step 1: Basics

  • Name: memorable, e.g. "Website orders payment"
  • URL: the HTTP endpoint on your server that SePay will POST to. Must be HTTPS in production
  • Event type: see Event types below
  • Content-Type: leave as application/json (details if you need to change it)
  • Auto retry: enable to let SePay retry when your server returns an error. Retry schedule: Error handling
Step 1: Basics
Click to expand
Fill in basic webhook info

Step 2: Accounts

Pick which bank accounts trigger the webhook.

  • All accounts: every account triggers; new accounts linked later are auto-included.
  • Specific accounts: pick per account, configure VA per bank.

You can also configure the payment-code prefix filter and the "Skip transactions without code" toggle in this step. See Filters below.

Step 2: Accounts
Click to expand
Pick bank accounts and filters

Account + VA details: Bank accounts.

Step 3: Security

Pick how SePay authenticates with your endpoint:

  • None: testing only
  • API Key: header Authorization: Apikey ...
  • HMAC-SHA256 (recommended): signature in headers
  • OAuth 2.0: Bearer token via a token endpoint
Step 3: Security
Click to expand
Pick auth method

Comparison and code samples: Authentication.

Step 4: Alerts

  • Enable/disable alerts
  • Consecutive-failure threshold before sending (1–20, default 3)
  • Channels: Telegram, Slack, Discord
Step 4: Alerts
Click to expand
Configure failure alerts

Channel setup: Monitoring.

Event types

TypeWebhook fires when
Money inMoney is transferred into the account
Money outMoney is transferred out
BothAny transaction

Money out has constraints: only Sacombank, TPBank, VietinBank are supported, and TKP (memo-based VA) must be used (no official VA). See Note when choosing Money out only.

For payment-confirmation webhooks, Money in is usually enough.

Filters

Filter by payment-code prefix

Tell SePay to only fire the webhook when the payment code starts with a specific prefix.

Example: customer transfers with content GCDONHANG001. SePay extracts the code GCDONHANG001. Webhook configured with prefix GC → code starts with GC → fire.

PrefixPayment codeResult
GCGCDONHANG001Fire
GCORDERDONHANG001Skip
GC, ORDERORDERDONHANG001Fire (matches ORDER)
(none)AnyFire all

First, configure the code structure at Company → General settings → Payment code structure. Then in the wizard's Accounts step you'll see the prefix selector.

Prefix filter
Click to expand
Pick payment code prefix in the wizard

Prefixes are case-sensitive. GC and gc are two different prefixes.

Skip transactions without a code

When enabled, SePay only fires the webhook for transactions that have a payment code. Transactions with empty content or content that doesn't match the structure are skipped.

Check order

For each new transaction, SePay checks in order:

  1. Does the transaction belong to a configured account?
  2. If VA is configured, does the transaction match any VA?
  3. Is the event type (in/out) correct?
  4. Does the transaction have a payment code? (if "skip" is on)
  5. Does the code start with one of the selected prefixes?

The webhook fires only when all conditions pass.

Test send

Click Test send to verify your endpoint before any real transaction. SePay sends a sample payload to the URL and shows the HTTP status + response body immediately.

Test send result
Click to expand
Test send result dialog with HTTP status and response body
Test send payload ≠ real payload

The JSON structure matches, but id is a mock number (typically 0) and other fields are sample data. Don't hardcode test values into your code. Even after a successful test send, retest with a real transaction (small transfer into the account).

Manage webhooks

Next