इसे छोड़कर कंटेंट पर जाएं

Products & Features

Define करें कि आप क्या बेचते हैं। variants के साथ products बनाएं, entitlement-based access control के लिए reusable features जोड़ें।

Proyecta Commerce तीन concepts का उपयोग करता है: products, variants, और features

  • Product — वह चीज़ जो आप बेचते हैं (जैसे “Pro Plan”, “T-shirt”, “Strategy Call”)
  • Variant — किसी product का pricing tier या configuration (जैसे “Pro Monthly $29”, “Pro Annual $290”, “T-shirt – Large”)
  • Feature — एक reusable entitlement key जिसे आपका app runtime पर check करता है (जैसे pro_features, unlimited_projects, api_access)

एक product में कई variants हो सकते हैं। एक product में एक या अधिक resources भी attached होते हैं — आमतौर पर features — जो किसी customer के subscribe करने पर access देते हैं।

आप क्या बेचते हैं — इसे model करने के दो तरीके

Section titled “आप क्या बेचते हैं — इसे model करने के दो तरीके”

Commerce पूरे platform के साथ मिलकर काम करता है, इसलिए “बेची जाने वाली चीज़” के दो रूप होते हैं — और Proyecta आपके लिए सही रूप चुनता है:

  • Commerce-native products — subscriptions, plans, one-time upgrades, और features/entitlements। इन्हें सीधे Admin > Commerce > Products में define किया जाता है। इस page का बाकी हिस्सा इसी model के बारे में बताता है।
  • Content-backed storefront catalog — photos, prices, और descriptions वाले goods जिन्हें कोई business owner रोज़ाना edit करता है। ये CMS में sellable collection के रूप में रहते हैं: हर entry खुद एक product होती है। जब कोई entry publish होती है, Proyecta उसे automatically Commerce में एक real, purchasable product के रूप में जोड़ देता है — product और उसका priced variant खुद बना देता है, और price सीधे content field से copy कर लेता है। Storefront content price render करता है और checkout linked variant को charge करता है, और चूंकि दोनों का एक ही source है, वे कभी अलग नहीं हो सकते। इन items को आप content के रूप में manage करते हैं (अपने app के Admin में, builder में या अपनी published site पर), Commerce > Products के अंतर्गत नहीं। देखें Content Management

एक plain catalog जो card payments नहीं लेता — केवल browse करने वाला menu, या कोई ऐसा store जिसका “buy” button WhatsApp order link खोलता है — वह सिर्फ साधारण content है — एक ordinary catalog collection, जिसमें Commerce weave नहीं है। Card checkout ही किसी collection को sellable बनाता है।

Admin > Commerce > Products में, Create product पर click करें (या AI से कहें: "Create a Pro plan at $29/month and a Business plan at $99/month.")। हर product के लिए ज़रूरी है:

  • एक display name (जैसे “Pro”)
  • कम से कम एक variant

हर variant की अपनी pricing होती है:

Field Notes
name Variant का display label (“Monthly”, “Annual”, “Large”)
currency तीन अक्षरों का ISO code — USD, EUR, GBP, JPY, BRL, MXN, INR… (130+ supported)
unit_amount सबसे छोटी currency unit (cents) में price। 2900 = $29.00
recurring Optional — { interval: 'week' | 'month' | 'year' }। One-time prices के लिए इसे छोड़ दें। Daily billing अभी supported नहीं है।
is_default Accepted है लेकिन अभी enforce नहीं किया गया — default variant selection अभी implement नहीं हुई है।
media CDN file ID से images या videos attach करें (देखें Files)

Pricing immutable होती है। एक बार variant बन जाने के बाद उसकी price बदली नहीं जा सकती — इसके बजाय एक नया variant बनाएं। यह मौजूदा subscribers को accidental price changes से बचाता है।

Features, access-control का मूल building block हैं। Admin > Commerce > Products में एक बार feature बनाएं, फिर उसे एक या अधिक products से attach करें। हर feature का एक name, एक optional description, और एक key होती है — lowercase letters, numbers, और underscores (जैसे pro_features) — और यही वह चीज़ है जिसे आपका app check करता है।

जब आप कोई product बनाते हैं, तो आप “resources” के ज़रिए उसमें features attach करते हैं। किसी product को subscribe करने वाले customers को उससे attached हर feature का access मिल जाता है।

फिर, अपने app में उस key पर gate लगाएं:

const { hasAccess, isLoading } = useEntitlement('pro_features');
if (isLoading) return <Spinner />;
if (!hasAccess) return <UpgradePrompt />;
return <ProOnlyThing />;

यह check signed-in session के खिलाफ server-side पर run होती है, इसलिए इसे browser से spoof नहीं किया जा सकता। पूरे pattern के लिए देखें Integrate Commerce Into My App

Note: हमेशा feature key पर gate लगाएं — यानी feature name से derived slug (जैसे, pro_features) — न कि feature की internal id पर।

इसी तरह आप अपने app code में Pro-only pages, API endpoints, या features को gate करते हैं।

SaaS subscriptions

Create products: Free ($0/month), Pro ($29/month, $290/year), Business ($99/month, $990/year).
Attach a 'pro_features' feature to Pro and Business so I can gate access in my code.

Physical goods

Create a T-shirt product with three variants: Small, Medium, Large at $25 each.

Digital goods

Create a course product with a single one-time variant at $149.

Donations

Create a donation product with three variants: $25, $50, $100 — all one-time.

Proyecta Commerce अभी physical products के लिए inventory track नहीं करता। अगर आप stocked items बेचते हैं, तो stock counts को अपने app के database में manage करें और अपने checkout flow में उन्हें check करें।

  • Checkout field customization — buyers से अतिरिक्त जानकारी collect करें
  • Pay-what-you-want pricing
  • Physical products के लिए Built-in inventory tracking