Setup & Billplz configuration
Follow these steps to connect Billplz and run a first end-to-end test order.
1. Add secrets in Project Settings → Secrets
Open the Lovable project settings and add these five secrets:
BILLPLZ_API_KEY— from Billplz → Settings → Account settings.BILLPLZ_COLLECTION_ID— the collection you want bills created under.BILLPLZ_X_SIGNATURE_KEY— Billplz → Settings → X Signature Key.BILLPLZ_API_BASE_URL—https://www.billplz-sandbox.com/api/v3for testing, orhttps://www.billplz.com/api/v3for production.APP_PUBLIC_URL— the public URL your customers use to reach this app (e.g. the preview URL, or your custom domain). Billplz uses it to build the callback and redirect URLs.
Secrets are only used server-side. They never reach the customer's browser.
2. Configure Billplz URLs
In your Billplz collection settings, set:
- Callback URL:
{APP_PUBLIC_URL}/api/public/billplz/callback - Redirect URL: leave blank in Billplz — this app passes a unique
redirect_urlper bill that points to/api/public/billplz/redirect?order_code=….
The callback endpoint verifies Billplz's x_signature before marking any order paid. Callbacks are idempotent — replays cannot double-count anything.
3. Create your admin user
4. Test one full order (sandbox)
- Open
/order?partner_code=DNC001&source=qron your phone. - Fill the form, accept the privacy consent, tap Pay.
- You are redirected to Billplz. Complete the sandbox payment.
- Billplz posts to
/api/public/billplz/callback. The webhook verifies the signature and marks the order Paid. - You land on
/order/result. It shows "Payment received". - In /admin, open the order, set fulfilment to Shipped and then Delivered, and add a tracking number.
- Open /admin/commissions. DNC001 now has 1 × RM12 due for that month.
5. Go live
- Switch
BILLPLZ_API_BASE_URLtohttps://www.billplz.com/api/v3. - Replace all Billplz credentials with your production ones.
- Publish the app so
APP_PUBLIC_URLbecomes stable. - Update the callback URL in Billplz to the published URL.
Partner codes
DNC001 to DNC020 are seeded as active. Add more anytime in /admin/partners. Each partner has a copy-ready referral link.