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
- Create a customer using your internal user id as
external_id. - Create a Checkout for the selected Product; VietBilling resolves the live ProductPrice.
- Send the customer to
checkout_url. - Check the Checkout on the server when the customer returns.
- 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.