Plans and billing

Video guide

Gói và hoá đơn MONA Pay: xem hạn mức, nâng gói, thanh toán · Xem trên YouTube
Xem transcript video (9 phần)

Kiểm tra hạn mức trước

Webhook đang chạy mà đột nhiên không phát tiếp có thể liên quan hạn mức gói, không phải endpoint hỏng. Trong video này, mình sẽ đọc mức dùng, xem các gói, tạo hóa đơn nâng gói, thanh toán bằng VietQR và theo dõi đến khi kích hoạt. Anh chị cũng sẽ hiểu khoản nào được tính là một giao dịch và điều gì xảy ra khi vượt hạn mức.

Cách đếm giao dịch

Gói Miễn phí có năm trăm giao dịch tiền vào mỗi tháng và dùng đủ tính năng. Hệ thống đếm một khoản tiền credit trên mọi tài khoản thật và tài khoản ảo đã nối, chốt theo giờ Việt Nam. Tiền ra, giao dịch sandbox và webhook gửi lại không tính. Gói trả phí tính theo số giao dịch, không lấy phần trăm số tiền. Giá cụ thể đọc tại trang Bảng giá.

Đọc gói và mức dùng

Gọi GET /api/v1/billing/plans không cần xác thực để đọc năm gói cùng code, giá tháng, giá năm, hạn mức, phí vượt và tính năng. Gọi GET /api/v1/billing/usage với Bearer để lấy plan_code, tx_used, tx_limit, overage_tx, overage_amount và plan_expires_at. Đây là hai endpoint nên hiển thị trong trang quản trị trước khi cho người dùng bấm nâng gói.

Khi vượt hạn mức

Với gói Miễn phí, tháng đầu vượt hạn mức vẫn nhận đủ thông báo. Nếu tiếp tục vượt ở tháng kế tiếp, giao dịch vẫn được lưu trong dashboard nhưng webhook và Telegram cho phần vượt sẽ dừng đến khi nâng gói; log ghi QUOTA_EXCEEDED. Gói trả phí không khóa, phần vượt được tính phụ trội. Hệ thống nhắc qua Telegram một lần ở mốc tám mươi phần trăm và một trăm phần trăm.

Tạo hóa đơn nâng gói

Tạo hóa đơn bằng POST /api/v1/billing/invoices, gửi Bearer, X-Client-Secret, plan_code và cycle. Mã gói nhận startup, business, enterprise hoặc scale. Chu kỳ nhận month hoặc year; trả năm tính tiền mười tháng. Response HTTP hai trăm lẻ một tạo hóa đơn pending, có mã chuyển khoản bắt đầu bằng MPAY rồi sáu số và hạn thanh toán bốn mươi tám giờ.

Thanh toán đúng mã MPAY

Response còn có khối payment với link ảnh VietQR và payload EMVCo để tự dựng QR. Khách phải chuyển đúng số tiền và ghi đúng mã MPAY vào tài khoản trên hóa đơn. Sau khi tiền vào, hệ thống tự khớp mã cùng số tiền. Ứng dụng gọi GET /api/v1/billing/invoices/{id} đến khi status thành paid; gói được kích hoạt tại thời điểm đó.

Kích hoạt hoặc hủy hóa đơn

Cùng gói còn hạn thì thời gian mới được cộng từ ngày hết hạn cũ. Đổi sang gói khác thì kỳ được tính lại từ lúc thanh toán. Nếu tạo nhầm, gọi POST /api/v1/billing/invoices/{id}/cancel khi hóa đơn còn pending. Quá bốn mươi tám giờ chưa thanh toán, trạng thái tự thành expired. Danh sách hóa đơn đọc bằng GET, hỗ trợ lọc status và phân trang.

Gói MONA và gia hạn

Khách hàng đang dùng dịch vụ web, phần mềm hoặc hosting của The MONA Group có thể được gán gói mona; gói này không mua qua API. Khi đã được gán, endpoint usage trả plan_code bằng mona. Với gói trả phí quá hạn bảy ngày chưa gia hạn, tài khoản hạ về Miễn phí nhưng dữ liệu vẫn giữ. Nâng gói không làm đổi payload, chữ ký hay cấu hình webhook.

Mở docs hoặc dashboard

Danh sách endpoint và luồng nâng gói nằm tại monapay.vn/docs/api/goi-va-hoa-don. Anh chị đăng ký tại my.monapay.vn, mở Gói và thanh toán nếu muốn thao tác bằng dashboard và theo dõi QR tự đổi trạng thái khi nhận tiền. Nếu cần kiểm tra hạn mức, hóa đơn hoặc mã MPAY, gọi tổng đài một chín không không, sáu ba sáu, sáu bốn tám để đội MONA hỗ trợ.

MONA Pay is free for 500 incoming transactions per month with every feature included. Sell more and you upgrade to a paid plan priced by transaction count, never a percentage of the money. This page is for developers and AI agents that need to read plans, read usage and upgrade through the API instead of clicking the dashboard. List prices are on the pricing page.

MONA customers: completely free

If you already use web, software or hosting services from The MONA Group, you get a dedicated mona plan: completely free, no transaction limit, for as long as you remain a MONA customer. This plan cannot be bought through the API; the MONA team assigns it at project hand-over, or call 1900 636 648. Once assigned, GET /api/v1/billing/usage returns plan_code: "mona" and everything below about quotas no longer applies to you.

How transactions are counted

A transaction is one incoming (credit) payment recorded on any linked account or virtual account, with the month cut at Vietnam time (UTC+7). Outgoing payments, sandbox transactions and webhook retries are not counted.

When you exceed the quota:

  • Free plan: the first month you exceed, everything still gets delivered (grace). From the next month you exceed, transactions above the limit are still recorded in the dashboard but webhook and Telegram delivery pauses until you upgrade. No transaction is lost. If the client has a webhook configured, each blocked transaction writes a webhook_log row with the error QUOTA_EXCEEDED for reconciliation.
  • Paid plans: nothing is blocked; transactions above the limit are charged as overage per transaction (listed per plan) and collected on the end-of-month invoice.
  • The system sends exactly one Telegram reminder at 80% and one at 100% of the monthly quota.

Endpoints

Base URL https://api.monapay.vn (legacy alias https://ipn.mona.host). Bearer authentication like every other API, see Authentication. Write requests (POST) also need the X-Client-Secret header.

Method Path Auth Purpose
GET /api/v1/billing/plans Public Read the 5 plans: code, price_month, price_year (yearly = 10 months), tx_limit, overage_per_tx, features
GET /api/v1/billing/usage Bearer Current month usage: plan_code, tx_used, tx_limit, overage_tx, overage_amount, plan_expires_at
GET /api/v1/billing/invoices Bearer List invoices, filter ?status=, paginate ?page=&limit=, returns { data, total }
POST /api/v1/billing/invoices Bearer + secret Create an upgrade invoice, returns 201
GET /api/v1/billing/invoices/{id} Bearer One invoice, used to poll its status
POST /api/v1/billing/invoices/{id}/cancel Bearer + secret Cancel an invoice that is still pending

Upgrading through the API, step by step

  1. Create the invoice:
curl -X POST https://api.monapay.vn/api/v1/billing/invoices \
  -H "Authorization: Bearer $TOKEN" -H "X-Client-Secret: $SECRET" \
  -H "Content-Type: application/json" \
  -d '{"plan_code": "startup", "cycle": "month"}'

plan_code accepts startup, business, enterprise, scale; cycle accepts month or year (a year is billed as 10 months).

  1. The 201 response returns the invoice with status: "pending", a transfer code in the form MPAY + 6 digits, a 48-hour payment deadline, and a payment block with a VietQR image link and the EMVCo payload so you can render your own QR. Have the payer scan the QR or transfer the exact amount with the MPAY code as the transfer note to the account printed on the invoice.

  2. When the money arrives, the system matches it within seconds (it reads the bank’s transaction notification and compares code plus amount). Poll GET /api/v1/billing/invoices/{id} until status becomes paid; the plan activates at that moment. Renewing the same plan extends from the previous expiry date; switching to a different plan restarts from the payment time.

  3. Created the wrong invoice? POST /api/v1/billing/invoices/{id}/cancel while it is still pending. After 48 hours unpaid, the invoice moves to expired on its own with no charge.

Prefer not to touch the API: the dashboard my.monapay.vn → Plans and billing runs the same flow, with a QR panel that flips to paid as soon as the money lands.

Frequently asked questions

I am on the Free plan and never exceeded it. Am I charged anything? No. No setup fee, no maintenance fee, no percentage of the money. Only when you sell more than 500 transactions a month does upgrading become a question.

When is the overage invoice issued? At the start of the next month the previous period is closed: a paid plan with overage receives one overage invoice (exactly one per period). A paid plan more than 7 days past expiry without renewal drops back to Free, with all data kept.

Do webhooks change when I upgrade? No. Payload, HMAC signature and webhook configuration stay the same; the plan only decides how many transactions are fanned out each month.