A complete, production-ready ecommerce solution for Strapi CMS. This plugin provides a comprehensive backend for managing ecommerce functionality without requiring developers to manually create content types, routes, or controllers. Simply install, configure, and start building your online store.
This plugin is designed to be a drop-in ecommerce backend layer for Strapi:
- Zero Manual Setup: No need to create content types, routes, or controllers manually
- Ready-to-Use APIs: All ecommerce endpoints are pre-built and documented
- Admin Configuration: Manage all settings through the Strapi admin panel
- WooCommerce-like Flow: Complete ecommerce workflow similar to WooCommerce
- Production Ready: Built with security, validation, and best practices in mind
npm install @webbycrown/webbycommerceAdd the plugin to your config/plugins.js:
module.exports = ({ env }) => ({
'webbycommerce': {
enabled: true,
resolve: require.resolve('@webbycrown/webbycommerce'),
},
});If you're developing locally, you can enable it from the local path:
module.exports = ({ env }) => ({
'webbycommerce': {
enabled: true,
resolve: './src/plugins/webbycommerce',
},
});You can populate your store with sample products/categories/etc using any of the following options:
npx strapi-ecommerce-setupWhen prompted "Would you like to seed example data? (y/n):", answer y.
- Go to Strapi Admin β Settings β Advanced Ecommerce
- Click "Seed Demo Data"
Add this to your Strapi projectβs .env and then start Strapi:
STRAPI_PLUGIN_ADVANCED_ECOMMERCE_SEED_DATA=truenpm run developAfter the demo data is seeded once, set it back to false (or remove it) to avoid reseeding on every startup.
After installation, navigate to Settings β Users & Permissions β Roles and select the Public role (or any role you want to grant access).
Under the WebbyCommerce section, enable the Enable permission to allow access to ecommerce API endpoints.
Navigate to Settings β WebbyCommerce in the Strapi admin panel. You'll find several configuration tabs:
- Allowed Frontend Domains: Add your frontend domain(s) for CORS and security
- API Route Prefix: Customize the API route prefix (default:
webbycommerce)- Examples:
/api/ecommerce,/api/v1,/api/shop
- Examples:
- SMTP Configuration: Configure email settings for OTP and notifications
- Host, Port, Secure (TLS), Username, Password
- From Email and From Name
- Authentication Method: Choose between:
- Default (Email/Password): Uses Strapi's built-in authentication
- OTP (Email/Mobile Verification): One-time password authentication
- Single Address Mode: Users can have only one billing and one shipping address
- Multiple Address Mode: Users can create unlimited addresses
The plugin automatically extends the user schema with ecommerce-specific fields. The plugin will attempt to automatically add OTP fields to the user schema when it starts up.
Required Fields:
username(string, required, unique)email(email, required)phone_no(string, required, unique)first_name(string, required)last_name(string, required)
Optional Fields:
display_name(string)company_name(string)
OTP Fields (required if using OTP authentication):
otp(integer, nullable) - Stores the OTP codeisOtpVerified(boolean, default: false) - Tracks if OTP has been verified
The plugin automatically adds OTP fields to the user schema on startup. If you see an error about OTP fields not being available, you may need to manually extend the schema.
If the automatic schema extension doesn't work, create a schema extension file in your main Strapi project:
-
Create the directory structure:
src/extensions/users-permissions/content-types/user/ -
Create
schema.jsonin that directory with the following content:{ "kind": "collectionType", "collectionName": "up_users", "info": { "name": "user", "description": "", "singularName": "user", "pluralName": "users" }, "options": {}, "pluginOptions": {}, "attributes": { "otp": { "type": "integer", "required": false, "private": true }, "isOtpVerified": { "type": "boolean", "default": false, "required": false, "private": true } } } -
Restart Strapi to apply the schema changes.
The plugin creates an Address content type automatically with the following fields:
Required Fields:
type(integer, 0=billing, 1=shipping)first_name(string)last_name(string)country(string)city(string)street_address(text)postcode(string)phone(string)email_address(email, required for billing addresses)
Optional Fields:
company_name(string)region(string)
Relations:
user(manyToOne β plugin::users-permissions.user)
All API endpoints are documented in the Strapi admin panel under Settings β Advanced Ecommerce β API Collections. Each endpoint includes:
- Request/Response examples
- Authentication requirements
- Usage instructions
- cURL examples
The base URL depends on your configured route prefix:
- Default:
http://localhost:1337/api/webbycommerce - Custom:
http://localhost:1337/api/{your-prefix}
Most endpoints require a JWT token. Include it in the Authorization header:
Authorization: Bearer YOUR_JWT_TOKEN
When Default authentication method is selected:
POST /api/auth/local
Content-Type: application/json
{
"identifier": "user@example.com",
"password": "password"
}
POST /api/auth/local/register
Content-Type: application/json
{
"username": "user1234",
"email": "user@example.com",
"password": "password"
}
When OTP authentication method is selected:
POST /api/{prefix}/auth/login-register
Content-Type: application/json
{
"email": "user@example.com",
"type": "email"
}
Response:
{
"message": "OTP sent to email.",
"userId": 1,
"isNewUser": false,
"emailSent": true
}POST /api/{prefix}/auth/verify-otp
Content-Type: application/json
{
"email": "user@example.com",
"otp": "123456",
"type": "email"
}
Response:
{
"message": "Login successfully!",
"jwt": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9...",
"user": {
"id": 1,
"username": "user1234",
"email": "user@example.com",
"phone_no": null
}
}GET /api/{prefix}/auth/profile
Authorization: Bearer YOUR_JWT_TOKEN
Response:
{
"user": {
"id": 1,
"username": "user1234",
"email": "user@example.com",
"phone_no": "+1234567890",
"first_name": "John",
"last_name": "Doe",
"display_name": "John Doe",
"company_name": "WebbyCrown Solutions",
"confirmed": true,
"blocked": false,
"role": {
"id": 1,
"name": "Authenticated",
"type": "authenticated"
},
"createdAt": "2024-01-01T00:00:00.000Z",
"updatedAt": "2024-01-01T00:00:00.000Z"
}
}Note: All fields (except password) are always returned, using null for missing values.
PUT /api/{prefix}/auth/profile
Authorization: Bearer YOUR_JWT_TOKEN
Content-Type: application/json
{
"first_name": "John",
"last_name": "Doe",
"email": "user@example.com",
"phone_no": "+1234567890",
"display_name": "John Doe",
"company_name": "WebbyCrown Solutions",
"currentPassword": "oldpassword",
"newPassword": "newpassword"
}
Required Fields:
first_namelast_nameemail(must be unique)phone_no(must be unique)
Optional Fields:
display_namecompany_namecurrentPasswordandnewPassword(only available when Default authentication method is enabled)
Response:
{
"message": "Profile updated successfully.",
"user": {
"id": 1,
"username": "user1234",
"email": "user@example.com",
"phone_no": "+1234567890",
"first_name": "John",
"last_name": "Doe",
"display_name": "John Doe",
"company_name": "WebbyCrown Solutions",
"confirmed": true,
"blocked": false,
"updatedAt": "2024-01-01T12:00:00.000Z"
}
}GET /api/{prefix}/addresses
Authorization: Bearer YOUR_JWT_TOKEN
Query Parameters:
type(optional): Filter by type (0=billing, 1=shipping)
Response:
{
"data": [
{
"id": 1,
"type": 0,
"first_name": "John",
"last_name": "Doe",
"company_name": "WebbyCrown Solutions",
"country": "United States",
"region": "California",
"city": "San Francisco",
"street_address": "123 Main Street",
"postcode": "94102",
"phone": "+1234567890",
"email_address": "john@example.com",
"createdAt": "2024-01-01T00:00:00.000Z",
"updatedAt": "2024-01-01T00:00:00.000Z"
}
]
}GET /api/{prefix}/addresses/:id
Authorization: Bearer YOUR_JWT_TOKEN
POST /api/{prefix}/addresses
Authorization: Bearer YOUR_JWT_TOKEN
Content-Type: application/json
{
"type": 0,
"first_name": "John",
"last_name": "Doe",
"company_name": "WebbyCrown Solutions",
"country": "United States",
"region": "California",
"city": "San Francisco",
"street_address": "123 Main Street",
"postcode": "94102",
"phone": "+1234567890",
"email_address": "john@example.com"
}
Required Fields:
type(0=billing, 1=shipping)first_namelast_namecountrycitystreet_addresspostcodephoneemail_address(required for billing addresses, type=0)
Optional Fields:
company_nameregion
Single Address Mode:
- In single address mode, only one billing (type=0) and one shipping (type=1) address are allowed per user
- Attempting to create a duplicate address type returns
403 Forbidden
Multiple Address Mode:
- Users can create unlimited addresses
PUT /api/{prefix}/addresses/:id
Authorization: Bearer YOUR_JWT_TOKEN
Content-Type: application/json
{
"street_address": "456 Updated Street",
"city": "Los Angeles"
}
All fields are optional. Only provided fields will be updated.
DELETE /api/{prefix}/addresses/:id
Authorization: Bearer YOUR_JWT_TOKEN
- All endpoints require the Enable permission to be granted in Users & Permissions
- Custom permission checking via
ensureEcommercePermissionutility
- CORS protection through allowed frontend domains configuration
- API token validation for additional security layers
- JWT token validation for protected endpoints
- User-specific data isolation (users can only access their own data)
- Comprehensive field validation (required fields, email format, etc.)
- Type checking and sanitization
- Unique constraint validation (email, phone_no)
Controllers:
auth.js: Authentication and profile managementaddress.js: Address CRUD operationscontroller.js: Plugin settings managementshipping.js: Shipping CRUD operationsproduct.js: Product CRUD operationsorder.js: Order CRUD operationscart.js: Cart CRUD operationspayment.js: Payment CRUD operationsreview.js: Review CRUD operationswishlist.js: Wishlist CRUD operationswebhook.js: Webhook CRUD operationscoupon.js: Coupon CRUD operations
Utilities:
check-ecommerce-permission.js: Permission validationsend-email.js: Email sending (SMTP or Strapi email plugin)
User Extensions:
- Custom fields added to
plugin::users-permissions.user - Relations to addresses
Address Content Type:
- Created automatically as
api::address.address - Many-to-one relation with users
-
Test endpoints using:
- Postman
- cURL
- The API Collections page in admin panel
-
Check logs for errors:
# Strapi logs will show plugin-specific errors with [webbycommerce] prefix- Check SMTP configuration in Configure tab
- Verify email plugin is configured (fallback)
- Check server logs for email errors
- Verify JWT token is valid and not expired
- Check that Enable permission is granted in Users & Permissions
- Ensure token is included in
Authorization: Bearer <token>header
- Check shipping type mode (single vs multiple)
- In single mode, update existing address instead of creating duplicate
- Verify route prefix matches configuration
- Check that plugin is enabled in
config/plugins.js - Restart Strapi after configuration changes
- Ensure user schema extension is properly configured
- Restart Strapi after schema changes
- Check that all required fields are present in schema
- The API Collections page in admin panel shows all available endpoints
- Use this page to test endpoints and view responses
- Fixed bugs of update schema
- Created auth login method API
- Created unified auth method API
- Fixed bugs of update schema
- Fixed bugs and resolved issues with the category slug API.
- Added Bulk Product API
- Fix critical bugs
- Updated README documentation
- Resolved reported bugs
π First production-ready release of WebbyCommerce, a complete ecommerce backend plugin for Strapi CMS.
β¨ Added
- Drop-in ecommerce backend for Strapi with zero manual setup
- Automatic creation of required content types, routes, and controllers
- Admin panel integration for plugin configuration
- Customizable API route prefix support
- Allowed frontend domain (CORS) configuration
- Default authentication (Email / Password) using Strapi auth
- OTP-based authentication (Email / Mobile)
- OTP verification and login flow
- JWT-based authentication enforcement
- Automatic user creation for new OTP users
- User profile APIs (get & update)
- Automatic user schema extension with ecommerce fields
- first_name, last_name
- phone_no
- display_name, company_name
- OTP-related fields
- Secure password update support (default auth)
- Automatic Address content type creation
- Billing and Shipping address support
- Single-address mode (1 billing + 1 shipping)
- Multiple-address mode (unlimited addresses)
- Full CRUD APIs with user-level data isolation
- Cart management
- Order management
- Product management
- Shipping management
- Payment handling
- Coupon management
- Wishlist functionality
- Product reviews
- Webhook handling
- SMTP configuration for OTP & notifications
- Authentication method selection (Default / OTP)
- Shipping address mode configuration
- Centralized plugin settings UI in Strapi admin
- Permission-based API access control
- Custom ecommerce permission validator
- JWT validation for protected routes
- User-owned resource access enforcement
- Input validation & sanitization
- Unique constraint validation (email, phone)
- Built-in API Collections documentation in admin panel
- Request/response examples for all endpoints
- cURL examples for testing
- Clear plugin-specific logging with [webbycommerce] prefix
WebbyCrown
- Email: info@webbycrown.com
- Website: https://webbycrown.com