HostBill integration guide

Integrate SePay into HostBill via the official module — automatically confirm payments after a customer transfers money, with multi-bank support and Telegram alerts.

||

Integrating SePay with HostBill confirms payments automatically as soon as the customer transfers money — invoices flip to paid without manual review.

If you run HostBill, this guide walks through wiring SePay in so payment confirmation happens automatically over bank transfer.


What you get after the integration

1. The shopper's experience

  • Pick a bank to pay with.
  • See a QR code to scan and pay.
  • Auto-notification once the payment lands.

2. The HostBill admin

  • Configure receiving bank accounts.
  • Show banks conditional on invoice amount.
  • Auto-flip invoices to paid once a transaction lands.
  • Many other tunable options.
  • Optional Telegram notification on SePay — only fires when SePay can't add the transaction to HostBill (so the accountant sees what needs manual handling).

1. Install and configure the SePay module

1.1. Install the module

Step 1: Download and unzip the module

Download the .zip and unzip — you should see a sepay folder containing class.sepay.php.

Module zip contents
Click to expand
The unzipped module — sepay/ contains class.sepay.php

Step 2: Upload the module to the right path

Open the HostBill source and go to public_html/includes/modules/Payment/. Copy the sepay folder there.

HostBill module path
Click to expand
Drop sepay/ into public_html/includes/modules/Payment/

Step 3: Sign in to HostBill admin

Open your browser and log in to the HostBill admin panel.

Step 4: Open Payment Modules

In the menu pick Settings → Modules → Payment Modules.

Open Payment Modules
Click to expand
Settings → Modules → Payment Modules

Step 5: Verify install

The screen has two tabs — Active and Inactive. A freshly installed module shows up in Inactive. Scroll to find SePay.

Active/Inactive tabs
Click to expand
Active and Inactive tabs in Payment Modules
SePay in Inactive
Click to expand
SePay module appears in the Inactive list

If it's there, the install worked.

1.2. Configure the module

1.2.1. Activate the module

Open Payment Modules, find SePay in Inactive, click Activate. The module then moves to Active.

Activate module
Click to expand
Click Activate to enable the module

1.2.2. Configure payments

Go to Payment Modules → pick the activated SePay module → click Edit General Settings.

Edit General Settings
Click to expand
Click Edit General Settings to open the form
Module config form
Click to expand
Module configuration form
1.2.2.1. Module Display Name

The display name shown on the checkout — customise to your liking.

Module Display Name
Click to expand
The display name shown to shoppers

Shown in the cart at order time:

Cart display
Click to expand
Display name in the cart

And on the checkout page:

Checkout display
Click to expand
Display name on the checkout page
1.2.2.2. Bank Name

A list of banks SePay supports. You can pick one or several — but each chosen bank must be linked on SePay before it works.

Bank list
Click to expand
Pick the bank account that receives payment
1.2.2.3. Bank Info

Fill in the bank-account details so customers can transfer. The format:

Code
1
Bank_name|Account_holder|Account_number|Min_invoice_amount(optional)|Max_invoice_amount(optional)

Fields are pipe-separated, one bank per line.

Bank Info field
Click to expand
Enter bank details using the pipe-separated format

Bank_name — must match what you picked in Bank Name (1.2.2.2).

VietinBank picked
Click to expand
Example: VietinBank picked in Bank Name
Bank name in Bank Info
Click to expand
Type the same VietinBank into Bank Info

Account_holder — Personal/business name registered on the account.

Account holder
Click to expand
Account holder name

Account_number — The number issued by the bank when you opened the account.

Account number
Click to expand
Bank account number
VA-only banks: OCB, KienLongBank, MSB, BIDV

For these four banks, use the VA number instead of the regular account number.

Min_invoice_amount (optional) — minimum invoice amount for this bank to show on checkout.

Min amount
Click to expand
Example min-amount configuration

Max_invoice_amount (optional) — maximum invoice amount for this bank to show.

Max amount
Click to expand
Example max-amount configuration

When picking multiple banks, put each bank on its own line.

Multi-bank config
Click to expand
One bank per line
1.2.2.4. Allow adding transactions when payment < invoice

Allow recording a transaction even when the payment is less than the invoice total.

Allow less than invoice
Click to expand
Allow underpayment
1.2.2.5. Allow adding transactions when payment > invoice

Allow recording a transaction even when the payment is greater than the invoice total.

Allow greater than invoice
Click to expand
Allow overpayment
1.2.2.6. Payment Code Prefix

Required. A prefix prepended to the payment-code transfer description. Must match the prefix configured on SePay.

Payment Code Prefix
Click to expand
Field for the payment-code prefix

Example with prefix HB:

HB prefix example
Click to expand
Prefix HB configured

The checkout shows it accordingly:

Prefix on checkout
Click to expand
HB prefix shown on the checkout page
1.2.2.7. Template QR

Three options:

  1. VietQR compact frame
  2. QR with V logo
  3. QR only (qronly)
Template QR field
Click to expand
Pick a QR template
Template 1
Click to expand
VietQR compact frame
Template 2
Click to expand
QR with V logo
Template 3
Click to expand
QR only
1.2.2.8. API Key

Required. A random string — must match the webhook authentication on SePay.

API Key field
Click to expand
Authentication key
1.2.2.9. Callback URL

The URL SePay calls after a successful transaction so HostBill can update the invoice status. Copy this into the SePay webhook configuration.

Callback URL
Click to expand
Callback URL generated by HostBill
1.2.2.10. Periodic invoice status check interval (s)

How often the system polls invoice status — between 1 and 10 seconds, default 3. Lower for faster responses, higher to reduce load.

Time interval
Click to expand
Interval for periodic status checks
1.2.2.11. Background conversion / Force background conversion / Limit to selected currencies

HostBill defaults around currency. SePay only supports VND, so you can ignore these fields.

Other defaults
Click to expand
These default fields can stay as-is

1.2.3. Create a webhook on SePay

So SePay can notify HostBill of incoming transactions.

SePay account required

If you don't have one yet, register here. Then add a bank account.

1.2.3.1. Create the webhook

Step 1: Sign in to My SePay

Visit https://my.sepay.vn/ and sign in.

My SePay dashboard
Click to expand
My SePay home

Step 2: Open Webhooks

In the left menu, pick Tích hợp Webhooks (Webhooks).

Webhooks menu
Click to expand
Webhooks menu in the left sidebar
Webhooks list
Click to expand
Webhooks list page

Step 3: Add a new webhook

Click Thêm webhooks (Add webhook) — a modal opens.

Add webhook button
Click to expand
Click to open the form
Add webhook form
Click to expand
Webhook configuration form
One webhook per bank

If HostBill has 3 banks configured, create 3 webhooks (one per bank).

Multi-bank example
Click to expand
Three banks configured on HostBill

Step 4: Fill in the form

Name — anything memorable. e.g. HostBill - QR transfer.

Webhook name
Click to expand
Name example: HostBill - QR transfer

Event — pick Có tiền vào (Money in).

Money in event
Click to expand
Pick Money in

Conditions — pick the bank account configured in Bank Name (1.2.2.2). The bank must be linked to SePay first.

Skip transactions without a payment code? — pick Yes if you only want filtered-by-prefix transactions (1.2.3.2). Or No to receive all and combine with a Telegram alert on failure.

Webhook conditions
Click to expand
Webhook condition setup

Webhook attributes:

  • URL — copy from HostBill module's Callback URL (1.2.2.9).
  • Payment-verification webhook? — pick Yes.
  • Retry? — SePay retries on HTTP responses outside [200, 299]. You can skip and rely on Telegram alerts instead.
Webhook attributes
Click to expand
Webhook attributes config

Authentication — pick API KEY, paste the key from HostBill module (1.2.2.8). Request Content-Type = application/json.

Auth config
Click to expand
API KEY auth + JSON content-type

Status — pick Active.

Step 5: Save

Click Add in the modal.

Add button
Click to expand
Click Add to save
Webhook saved
Click to expand
Newly created webhook in the list
1.2.3.2. Payment-code structure

Configure the prefix on SePay (matching the one in HostBill at 1.2.2.6) so webhooks fire correctly.

Step 1: Open General Configuration

In the left menu of My SePay, scroll to Statistics & ConfigurationCompany ConfigurationGeneral Configuration.

Step 2: Add a new code template

In Payment-code structure, click Add new template.

Add template
Click to expand
Add new code template
Template config UI
Click to expand
Payment-code structure config

Step 3: Enter the prefix and save

Type the prefix you set in 1.2.2.6 (e.g. HB) into Prefix, click Update.

Prefix form
Click to expand
Enter HB and click Update

1.3. Smoke-test the integration

1.3.1. Place a test order

Step 1: Place a small order

Place a test order on HostBill with the cheapest product — e.g. NVMe VPS - P1 — and click Continue.

Test order
Click to expand
Order NVMe VPS - P1

Step 2: Pick the SePay payment method

Pick the payment method using the display name from 1.2.2.1.

Pick SePay
Click to expand
Pick the SePay payment method

Step 3: Scan QR and transfer

The checkout page renders the QR + transfer details (the layout depends on your HostBill template).

Checkout QR
Click to expand
Checkout page with QR code and transfer info

The customer scans the QR or transfers manually. Once the transfer lands, SePay processes it and calls back HostBill.

1.3.2. Verify the transaction and webhook status

Step 1: Open Transactions on My SePay

In the left menu pick Giao dịch (Transactions) — you'll land on the transactions list.

Transactions menu
Click to expand
Transactions in the left sidebar
Transactions list
Click to expand
List of received transactions

Step 2: Inspect the Auto column

The webhook status shows in the Auto column. Success = SePay delivered the transaction to HostBill, which records it on the invoice and flips the status.

Auto column
Click to expand
The Auto column shows webhook status

2. Telegram alerts for manual handling

When SePay can't add a transaction to HostBill (no auto-add), you can configure a Telegram alert to your accounting team so they handle it manually.

Step 1: Open Telegram integration

In the left menu of My SePay pick Tích hợp Telegram (Telegram integration).

Telegram menu
Click to expand
Telegram integration in the sidebar

Step 2: Add a new integration

Click Add integration at the top right — modal opens.

Add integration button
Click to expand
Click Add integration
Telegram form
Click to expand
Telegram integration form

Step 3: Fill in the conditions

Event — pick Money in.

Money in event
Click to expand
Pick Money in

Conditions:

  • Source bank account — pick the bank you set in Bank Name (1.2.2.2) or All.
Pick bank
Click to expand
Pick the bank to alert on
  • Webhook status — pick Skip this condition.
Skip status
Click to expand
Skip this condition
  • Payment-verification webhook — pick Failed to alert when verification fails.
Webhook failed
Click to expand
Pick Failed
  • Min/Max amount — leave blank to receive all.
Min amount
Click to expand
Leave blank to receive all
Max amount
Click to expand
Leave blank to receive all
  • Content keywords / blocked keywords — leave blank.
Content option
Click to expand
Leave blank
Content miss option
Click to expand
Leave blank

Other config:

  • Telegram Chat ID — the group ID receiving alerts. To find it:

    1. Open the Telegram group's Info.
    2. Tap Add to add a member.
    3. Search for autopay_telebot (SePay Bot).
    4. The bot posts the Chat ID into the group — copy it.
    5. Click Send test message to verify.

    See the detailed guide.

  • Topic ID — optional, for groups with topics enabled.

  • Integration name — anything you like.

  • Status — pick Active.

Step 4: Save the integration

Click Add to save.

Save button
Click to expand
Click Add to save

Step 5: Customise the Telegram message

Edit the Telegram message template to match your needs.

Customise template
Click to expand
Customise the Telegram message

Then go back to 1.3 Smoke-test and try sending a payment with a deliberately-wrong description — the system should fire a Telegram alert.

Telegram demo
Click to expand
Example Telegram alert delivered to the group