Skip to content

Billing — Gommo platform (preview) ​

Coming to Gommo platform

Unified billing UX on this site (/billing/*, portal credits) is a preview of what Gommo will ship. Gommo payment APIs exist upstream; this gateway wrapper is not the long-term contract.

→ Gommo platform roadmap

Separate from /gateway — credit top-up via Gommo bank transfer (default) or legacy PayOS + internal sendBalances.

Env ​

VariablePurpose
GOMMO_API_DOMAINDomain sent to Gommo (create_payment, default <registration-domain>)
TOPUP_ORDERS_FILEJSON order map (default data/topup-orders.json)
PAYOS_CLIENT_IDLegacy PayOS only
PAYOS_API_KEYLegacy PayOS only
PAYOS_CHECKSUM_KEYLegacy PayOS + webhook verify
PAYOS_WEBHOOK_URLRegister on my.payos.vn → https://api…/billing/webhook/payos
GOMMO_ACCESS_TOKENLegacy fulfillment via sendBalances

Endpoints ​

MethodPathAuthMode
GET/billing/status——
GET/billing/packages——
POST/billing/payment/createBearer userGommo
POST/billing/payment/syncBearer userGommo
GET/billing/topup/ordersBearer userLocal history
GET/billing/topup/orders/:orderCode—Local lookup
POST/billing/topup/createBearer userLegacy PayOS
GET/POST/billing/webhook/payosPayOS signatureLegacy

Create Gommo payment ​

bash
curl.exe -X POST "http://localhost:3001/billing/payment/create" ^
  -H "Authorization: Bearer USER_TOKEN" ^
  -H "Content-Type: application/json" ^
  -d "{\"username\":\"gommo_user\",\"packageId\":\"basic-member\",\"invoiceBuyer\":{\"type\":\"consumer\",\"name\":\"Bán cho người tiêu dùng\",\"email\":\"\"}}"

Response fields (pass-through from Gommo):

FieldDescription
orderCode / contentTransfer memo (SP…)
qrImage / qrFallbackpayment QR image URLs
holder, acc, bank, storeBank transfer details
amountVnd, amountBaseVnd, vatAmountVndCharge breakdown
paymentServere.g. sepay

Optional body fields: promoCode, referralCode (also invoiceBuyer.referral_code for personal invoices).

Sync payment ​

bash
curl.exe -X POST "http://localhost:3001/billing/payment/sync" ^
  -H "Authorization: Bearer USER_TOKEN" ^
  -H "Content-Type: application/json" ^
  -d "{\"orderCode\":\"SP...\"}"

When data.paid is true, the gateway marks the local order credited.

Legacy PayOS topup ​

POST /billing/topup/create creates a PayOS checkout and stores a numeric orderCode. Webhook PAID triggers internal sendCreditsToUser().

Credit packages ​

See GET /billing/packages or src/services/creditPackages.ts. Each package maps to a Gommo credit_plans key sent as gommoIdBase on create_payment (credit-basic, credit-agency, …). amountVnd is the pre-VAT plan price (priceVND on Gommo platform /prices); checkout adds 5% VAT.