
Next.js eCommerce development looks straightforward until you try to sell in a market where most shoppers do not pay by international card. In Pakistan, a checkout that only accepts Visa and Mastercard leaves a large share of buyers unable to complete their order. They expect Easypaisa, JazzCash, Raast, and local Paypak cards. Add sellers who want to list products, a trade-in program for used devices, and an admin team with different responsibilities, and you are building a marketplace platform, not a template store.
This guide uses ImadNext, a certified tech eCommerce platform we built under the tagline "Shop Smart, Live Better", as a worked example. We cover the architecture, how local payment integration fits alongside cards, how multi-vendor seller onboarding works, the real-time notification layer, and what to plan for if you are building something similar.
Why Next.js and Node.js for a Custom eCommerce Platform
For Next.js eCommerce development at this scope, ImadNext splits into two applications: a Next.js storefront with React 18 and TypeScript, and a Node.js and Express API, also in TypeScript, backed by MongoDB through Mongoose. Each choice was made for practical reasons.
- Next.js for the storefront because product, collection, and brand pages need to rank in search and load fast on mobile connections. Server rendering and static generation give crawlers full HTML, while client-side navigation keeps browsing smooth. Good technical SEO is built into the framework rather than bolted on later.
- A separate Express API because the same backend serves the storefront, the admin dashboard, and the seller portal. Keeping business logic in one API means payments, inventory, and orders behave identically wherever they are triggered.
- MongoDB because a tech catalog has uneven product attributes: a laptop, a phone, and a smartwatch have very different specifications. A document model stores those naturally without dozens of sparse columns.
- Redux Toolkit with RTK Query on the frontend for caching API responses, so cart state, product lists, and order history stay consistent without hand-written fetching logic.
- Tailwind CSS for a consistent, responsive interface across storefront and dashboard.
A store like this also needs more than browsing and checkout. ImadNext includes time-limited deals with countdown timers and marketing slots, a filter system across collections and brands, order tracking with status management, a blog, help center, reviews, wishlist, and subscriber management. In total the platform covers 12 core features across the storefront, sellers, and admin.
How to Integrate Easypaisa and JazzCash Payments in a Next.js Store
The defining requirement was payment coverage. ImadNext supports 6 payment methods: Visa and Mastercard plus 4 Pakistan-local integrations, Easypaisa, JazzCash, Raast, and Paypak. Each local provider has its own merchant onboarding, credentials, and API conventions, so the engineering challenge is keeping that variety from leaking into the rest of the application.
One payment interface, many providers
The approach we recommend, and the shape this kind of system takes, is a payment module in the Express backend with a common interface: create a payment for an order, handle the provider's callback, and confirm status. Each provider is an adapter behind that interface. The checkout page in Next.js only asks the API to start a payment with a chosen method; it never talks to a provider's secret-bearing endpoints directly.
Server-side verification is non-negotiable
Mobile wallet and bank payment flows typically involve a redirect or an in-app approval, followed by a callback to your server. The browser returning to a "success" page proves nothing. Order status should only change when the backend has verified the provider's signed response or queried the transaction status itself. Inputs are validated with Joi before any of this logic runs, and every callback is logged with Winston so disputed payments can be traced.
Reconciliation for the payments that fall through
Wallet payments sometimes complete after the customer closes the tab, or a callback arrives late. A scheduled job, which in this stack is a natural fit for Croner, can re-check pending transactions and update orders so nothing stays stuck in "awaiting payment". For a broader look at gateway selection and failure handling, see our payment gateway integration guide.
If your target market pays by mobile wallet, local payment methods are not a nice-to-have feature. They decide whether checkout works at all.
Building Multi-Vendor Seller Onboarding and a Trade-In Program
ImadNext is not only a single-merchant store. It includes a seller application and onboarding portal where vendors apply, are reviewed, and get access to list products. Multi-vendor seller onboarding raises a few design questions worth settling early:
- Application review as a workflow. Sellers move through clear states, such as applied, under review, approved, or rejected, so the admin team always knows what needs attention.
- Document handling. Seller documents and product images upload to AWS S3 using presigned URLs. The browser uploads directly to S3 with a short-lived, permission-limited URL issued by the API, so large files never pass through the application server and the bucket is never publicly writable.
- Role separation. A multi-role admin dashboard means administrators, staff, and sellers see different data and actions. Permissions are enforced in the API, not just hidden in the interface.
The trade-in program for used devices follows a similar pattern: a customer submits a device, the team evaluates it, and the outcome flows back to the customer. Modeling these as explicit state machines in the backend makes them auditable and easy to extend later.
Real-Time Order Notifications with Socket.io and Firebase Cloud Messaging
An eCommerce platform generates constant events: new orders, status changes, seller applications, deal launches. ImadNext uses two channels for them.
Socket.io handles live, in-session updates. When an order changes status, the customer viewing their order page or the admin watching the dashboard sees it immediately without refreshing. Firebase Cloud Messaging, through Firebase Admin on the server, sends push notifications for order updates and marketing messages to users who are not currently on the site. Nodemailer covers transactional email for confirmations and account messages.
The design principle is that notifications are a side effect of state changes in the backend, never the source of truth. The order record changes first; then the API emits a Socket.io event, sends a push, or queues an email. If a notification fails, the order is still correct.
Engagement features build on the same foundation. The One-Win game adds gamification to bring users back, and the deal system pairs countdown timers with notifications so time-limited offers reach people while they are still live.
Securing a Node.js eCommerce Backend: JWT, Google OAuth, and Twilio OTP
Stores that handle payments and seller accounts attract abuse, so ImadNext uses 3 authentication layers: JWT for API sessions, Google OAuth through Passport.js for quick sign-in, and Twilio OTP for phone verification. Phone OTP matters in markets where many customers rely primarily on a mobile number rather than email.
On top of authentication, the Express API is hardened with standard middleware:
- Helmet to set secure HTTP headers.
- express-rate-limit to throttle login, OTP, and checkout endpoints against brute force and SMS cost abuse.
- XSS protection on user-supplied content such as reviews and seller listings.
- Joi validation on every request body, so malformed or malicious input is rejected before it reaches business logic.
- Winston logging for an audit trail across payments, admin actions, and errors.
None of these are exotic. The value is in applying all of them consistently from the first release rather than after an incident.
What to Plan for When Building a Similar eCommerce Platform
If you are considering a custom Next.js eCommerce build for a market with local payment methods, these are the questions to settle before development starts:
- Which payment methods do your customers actually use? List them and start merchant onboarding with each provider early. Approvals and sandbox access often take longer than the code.
- Are you one merchant or a marketplace? Seller onboarding, commissions, and payouts change the data model significantly. Decide before the first migration.
- Who works in the admin dashboard? Define roles and permissions up front: sales reports, notifications, and website analytics are useful only if the right people see them.
- Is a hosted platform enough? For many stores it is. We compare the options honestly in custom eCommerce development vs Shopify. Custom makes sense when local payments, marketplace logic, or programs like trade-ins are central to the business.
Frequently Asked Questions
Can Next.js handle a full eCommerce platform?
Yes. Next.js works well as the storefront, with a dedicated backend API handling orders, payments, and inventory. Separating the two lets the storefront, admin dashboard, and seller portal share one set of business rules.
How do you integrate JazzCash and Easypaisa with a Node.js backend?
Register as a merchant with each provider, then build a server-side adapter for each that creates payments, receives callbacks, and verifies transaction status. Only update order status after server-side verification, and reconcile pending payments on a schedule.
What is Raast and should my store support it?
Raast is Pakistan's instant payment system run by the State Bank of Pakistan, enabling direct bank transfers. Supporting it gives customers without wallets or cards another way to pay, which widens your checkout coverage.
How should a multi-vendor store handle seller onboarding?
Treat it as a workflow with clear states, store seller documents securely, for example in S3 with presigned uploads, and enforce role-based permissions in the API so sellers only access their own products and orders.
You can see the live storefront at imadnext.com and the full project summary on the ImadNext case study page. If you are planning a Next.js eCommerce store that needs local payments, sellers, or features a template cannot handle, our eCommerce development team can help you scope it. Tell us about your project and we will give you a straight answer on what it takes.
