Verified registry: @codedeb/commerce-nepal@0.2.1 was confirmed publicly (version metadata, latest dist-tag and tarball).
Public npm release: @codedeb/commerce-nepal@0.2.0 · Released: 20 November 2026 · ESM: JavaScript + TypeScript declarations.
npm install @codedeb/commerce-nepal
Read the integration reference or engineering guide. Code Deb's noncommercial SDK license applies to Code Deb-owned material; commercial use requires a separate agreement. Upstream notices are retained where applicable.
Operational primitives for Nepal e-commerce disclosures, buyer consent, NPR checkout totals and grievance records. This source does not provide statutory compliance certification or IRD-certified billing. The npm distribution is public; it does not confer legal or billing certification.
Data validation
validateBusinessDisclosure checks required business identity, PAN/VAT number shape, contact and grievance fields. validateProductDisclosure requires product origin, final price, delivery terms, return terms and availability. Validators are documentation aids, not government registry lookups.
NPR checkout arithmetic
quoteCheckout uses integer paisa, explicit VAT-included or VAT-excluded basis and caller-configured VAT basis points. The merchant must use its actual tax category and legally applicable rate.
import { quoteCheckout, recordCheckoutConsent, createComplaint }
from '@codedeb/commerce-nepal';
const quote = quoteCheckout({
unitPricePaisa:150000, quantity:2, deliveryPaisa:10000,
vatRateBasisPoints:1300, vatBasis:'included',
});
const acceptance = recordCheckoutConsent({
orderReference:'TEST-100',termsVersion:'2026-11',accepted:true,quote
});
const complaint = createComplaint({
id:'CASE-100',orderReference:acceptance.orderReference,
note:'Delivery review requested'
});
Complaint workflow and evidence
transitionComplaint enforces the configured state machine and cannot silently reopen a resolved case. The default 15-day operational review window is configurable; confirm deadlines against current law and the transaction. appendEvidence creates a tenant-bound hash chain for server-side append-only storage, which the integrator must supply.
Tax invoice integration
InvoiceGateway is an interface for an independently verified provider. It intentionally does not create official tax invoices or invent invoice numbers. Do not represent this library or a client using it as certified without documented external approval.
Legal reference and human review
Review Nepal's Electronic Commerce Act 2081 and Directive 2082, applicable IRD rules and sector requirements with qualified reviewers. This is compliance-supporting software, not a legal opinion.
SDK overview | Engineering services
Multi-line checkout, order transitions and refunds
cart.ts includes quoteCart, which applies integer-paisa tax per SKU, including/excluding VAT, per-line discounts and configurable delivery taxes. reserveCart requires a merchant-isolated, atomic inventory reservation adapter to avoid overselling.
orders.ts defines createOrder, transitionOrder and changeOrderStatus. Each transition checks the expected version, legal state transition and unique event ID. The application database must enforce these checks with an atomic compare-and-swap.
returns.ts provides calculateRefund against quantities and charged line amounts; this produces a quote, not a real transfer or payment reversal.
import {quoteCart,reserveCart} from '@codedeb/commerce-nepal/cart';
import {createOrder,transitionOrder} from '@codedeb/commerce-nepal/orders';
const quote=quoteCart({lines:[{
sku:'SKU-100',quantity:2,unitPricePaisa:150000,
vatRateBasisPoints:1300,vatBasis:'included'
}],deliveryPaisa:10000});
const order=createOrder({id:'SO-100',tenant:'shop',quote});
const confirmed=transitionOrder(order,{
to:'confirmed',expectedVersion:1,actor:'owner',eventId:'evt-1'
});
Payment webhook security
payments.ts implements a generic HMAC-SHA256 envelope, timestamp validation and a replay-prevention adapter. Provider-specific eSewa, Khalti, Fonepay and connectIPS signature contracts are not implemented and must not be replaced by this generic signature format. Integrate official, authorized provider documentation and verify actual settlement before marking an order paid.
Legal and accounting boundaries
Checkout disclosures, evidence hashing and VAT calculations do not certify e-commerce operations, IRD billing or merchant eligibility. Tax rules and grievance deadlines require jurisdiction-specific review, compliant invoicing integrations and lawful retention controls.
Release history
- 0.2.0 — 20 November 2026: First public Code Deb npm distribution. Independently packaged ESM exports and TypeScript declarations passed isolated consumer verification.
Production implementation walkthrough
- Keep NPR monetary amounts in integer paisa and define VAT inclusion.
- Validate buyer disclosures and versioned terms consent before payment.
- Commit inventory and payment through atomic adapters, never a quote alone.
- Check local legal requirements independently; the SDK is not IRD certified.
Reproducible installation and compatibility
npm view @codedeb/commerce-nepal@0.2.1 version
npm install @codedeb/commerce-nepal@0.2.1
Pin the exact version in the application lockfile; review its exported ESM subpaths and bundled TypeScript declarations. A new package version does not retroactively update older immutable tarballs.
Integration acceptance checklist
- Validate boundary inputs, invalid payloads and every caller-provided adapter before connecting customer data.
- Type-check the actual package from a clean test application, not only from this monorepo's source paths.
- Exercise authorization failures, missing configuration and relevant concurrency or retry paths.
- Keep credential and sensitive data out of logs; store only necessary operational evidence.
Troubleshooting and version policy
Module not found: Check the exact import subpath and package version in node_modules and the lockfile. Unexpected result: Review the required application-owned credentials and adapters. npm 404: Verify the requested immutable version using the public registry; do not mistake a local tarball for a published release.
Related integration guides
See invoice refs and promotion engine for complementary capabilities. Use the SDK directory and Developer resources for API references and engineering guides.