VietBilling
VietBilling Docs

Getting Started

Prepare an Organization, PayOS, Product, ProductPrice, webhook, and API key.

Before you write code

You need a VietBilling Organization, PayOS integration details, a recurring Product with a ProductPrice, an Organization API key, and a public HTTPS webhook URL.

Environment variables

VIETBILLING_API_URL=https://api.vietbilling.com
VIETBILLING_API_KEY=vb_live_replace_me
VIETBILLING_WEBHOOK_SECRET=whsec_replace_me

Keep these values on the server. Never ship an API key or webhook secret in a browser bundle.

Minimal integration flow

  1. Create a customer using your internal user id as external_id.
  2. Create a Checkout for the selected Product; VietBilling resolves the live ProductPrice.
  3. Send the customer to checkout_url.
  4. Check the Checkout on the server when the customer returns.
  5. Process webhooks to synchronize the Subscription and BenefitGrants.

Go-live check

Before production, test successful payment, abandoned checkout, webhook redelivery, and one renewal cycle. Use the API Reference to verify endpoints.