Browse the catalog
Browsing your product catalog with the SUQO TypeScript SDK.
Read-only — the only resource that works before your seller account completes KYC verification, since there's no seller action involved in just browsing your own catalog.
Listing products
const page = await suqo.products.list();
page.results; // Product[]list() is paginated — see Pagination for page/pageSize and .autoPaging(). It takes the same { page?, pageSize? } params every paginated resource does:
await suqo.products.list({ page: 2, pageSize: 50 });Finding a billing period to subscribe to
A Product carries its plan[], and each Plan carries its billingPeriods[]. The pbpId on a billing period is what you pass to subscriptions.create() — it's the one identifier that ties "what a buyer is browsing" to "what they subscribe to":
const product = page.results[0];
const billingPeriod = product?.plan[0]?.billingPeriods[0];
if (!billingPeriod) throw new Error("no billing period available");
await suqo.subscriptions.create({
pbpId: billingPeriod.pbpId,
returnUrl: "https://your-app.example/return",
customer: { phone: "9800000001", fullName: "John Doe", email: "[email protected]", address: "Kathmandu" },
});Fields worth knowing about
vatcan benull— not every product has VAT configured.price,vatPercentage,totalSubscribersare decimal-shaped values sent as strings on the wire (e.g."500.00") and kept as strings end to end — never coerced tonumber. Format or parse them yourself if you need arithmetic; the SDK won't silently round anything.planand a plan'sbillingPeriodscan both come back empty — a product with no plans configured yet is spec-legal, not a bug in your integration.
interface Product {
productId: string;
name: string;
description: string;
type: string;
isActive: boolean;
termsAndConditions: string;
featuresAndBenefits: string;
vat: ProductVat | null;
productImage: string[];
plan: Plan[];
totalSubscribers: string; // decimal string
createdAt: string;
updatedAt: string;
}