Add UPI Links, GST Invoices and DPDP Consent
Pay-by-UPI links, numbered GST tax invoices, and consent and data-request records for Indian customers.
Install
npm i @dapplelight/signet-payments @dapplelight/signet-db drizzle-ormMake a UPI link
import { upiIntent } from "@dapplelight/signet-payments/upi"
export function payLink(orderId: string) {
return upiIntent({ pa: "shop@okbank", pn: "Corner Shop", amount: 49_900, tr: orderId, note: "Order 42" })
}Use it as an href on mobile or render it as a QR code yourself. Confirm payment through your gateway, not the link.
Number invoices without gaps
import { sequences } from "@dapplelight/signet-db/columns/sqlite"
export { sequences }Issue a GST invoice
import { financialYear, gstInvoice, invoiceNumber, renderGstInvoiceHtml } from "@dapplelight/signet-payments/gst"
import { nextSequence } from "@dapplelight/signet-db"
import * as schema from "../db/schema"
import { db } from "./db"
const name = "Acme Software Pvt Ltd"
const address = "12 MG Road, Bengaluru"
const gstin = "29ABCDE1234F1Z5"
export async function issueInvoice(now: Date) {
const fy = financialYear(now)
const seq = await nextSequence(db, schema.sequences, `invoice:INV:${fy}`)
const inv = gstInvoice({
number: invoiceNumber({ prefix: "INV", fy, seq }),
date: now,
supplier: { name, address, gstin },
recipient: { name, address, gstin },
placeOfSupply: "29",
lines: [{ description: "Plan, 1 year", hsn: "998314", quantity: 1, unit: "OTH", unitPrice: 99_900, rate: 18 }],
})
return renderGstInvoiceHtml(inv)
}inv.taxType is intra for CGST and SGST, or inter for IGST. Amounts are in paise.
Record consent and data requests
import { privacyTables } from "@dapplelight/signet-db/columns/sqlite"
import { createPrivacy } from "@dapplelight/signet-db/privacy"
import { notes, tags, users } from "../db/schema"
import { db } from "./db"
export const { consents, dataRequests } = privacyTables()
export const privacy = createPrivacy(db, {
tables: { consents, dataRequests },
userTables: [notes, tags, [users, users.id]],
respondWithinMs: 30 * 86_400_000,
})Use it
import { privacy } from "./privacy"
export async function consentAndErase(userId: string, staffId: string) {
await privacy.give(userId, "marketing-email", { noticeVersion: "2026-11-01", source: "signup" })
await privacy.withdraw(userId, "marketing-email")
const req = await privacy.requestErasure(userId)
await privacy.fulfil(req.id, { actor: { type: "user", id: staffId } })
}Fulfilling an erasure deletes the rows in userTables. This is record-keeping, not legal advice.
Next
Add Web-to-App Funnels With Hosted Checkout
A hosted quiz and checkout page with Apple Pay, Google Pay and URL discounts, then a one-time link that moves the purchase into the app.
Add a Waitlist, Invites, Referrals and Onboarding
Launch tooling in your own database: waitlist, one-shot invites, referral rewards, onboarding progress, a changelog and feedback.