A comprehensive Python application for generating ecommerce order JSON payloads with both GUI and CLI interfaces. Supports Made-to-Order (MTO) items with customizable sub-items and customer questions.
- Dual Interface: Both GUI (tkinter) and CLI interfaces available
- Tabbed GUI Interface: Organized into 5 tabs for easy navigation
- Order Details
- Customer Information
- Order Items
- Payment Information
- JSON Preview
- Configure order IDs, store IDs, totals, and status
- Set delivery timeslots with automatic date calculation
- Add admin and user comments
- Choose fulfillment type (delivery/pickup)
- Real-time total calculations
- Complete customer details (name, email, phone, loyalty card)
- Full shipping address with delivery instructions
- Customer source keys and identifiers
- IP address and user agent tracking
- Item Templates: Pre-built templates for common MTO items
- Generic Custom Item
- Custom T-Shirt
- Custom Jewelry
- MTO (Made-to-Order) Support:
- Manage MTO sub-items with categories
- Configure sub-item options (left, right, whole)
- Customer questions and responses system
- Field keys with UUID generation
- Item Properties: SKU, name, quantity, price, weight, etc.
- Item Characteristics: Prepared, weighted, age-restricted, alcohol, etc.
- Location Management: Department, aisle, section, shelf assignments
- Multiple payment method support
- Card type and transaction details
- Payment instrument configuration
- Gift card support
- Real-time JSON preview with syntax highlighting
- Save to file functionality
- Copy to clipboard option
- Formatted JSON output
- Validation and error handling
- Ensure you have Python 3.6+ installed
- Clone or download the project files
- No external dependencies required - all modules used are built into Python:
- tkinter (GUI interface)
- json (JSON processing)
- datetime (date/time handling)
- uuid (unique identifier generation)
python order_generator.pypython cli_order_generator.pyFor interactive mode:
python cli_order_generator.py --interactiveCreate MTO Order/
├── order_generator.py # Main GUI application
├── cli_order_generator.py # Command-line interface
├── item_manager.py # Order item management
├── mto_manager.py # MTO sub-items and questions
├── item_templates.py # Pre-built item templates
├── requirements.txt # Dependencies (none external)
└── README.md # This file
- Main application class with tabbed interface
- Real-time data validation and JSON generation
- Integration with item and MTO managers
- Add, edit, and remove order items
- Template-based item creation
- Item validation and data management
- Manage MTO sub-items with categories
- Customer questions and responses system
- UUID generation for field keys
- Sub-item option configuration (left/right/whole)
- Pre-built templates for common MTO items
- Includes MTO metadata and customer questions
- Easily extensible for new templates
- Command-line order generation
- Interactive mode for step-by-step creation
- Batch processing capabilities
- Default order structure generation
- Add multiple sub-items to a single order item
- Configure sub-item categories (e.g., "Veggies", "Buns", "Size", "Color")
- Set sub-item options (left, right, whole selections)
- Automatic sub-item numbering
- Dynamic question creation with field keys
- Sequence-based question ordering
- Custom field prompts and responses
- UUID-based field identification
- Pre-configured MTO items with metadata
- Reusable question and sub-item structures
- Easy template selection during item creation
The generated JSON follows a comprehensive ecommerce order structure including:
- Order Metadata: ID, status, totals, timeslots, fulfillment type
- Customer Information: Complete customer details and addresses
- Order Items: Products with locations, MTO metadata, and characteristics
- Payment Information: Payment methods, cards, and transactions
- MTO Data: Sub-items and customer questions/responses
- Comments: Admin and user comments
- Custom Fields: Extensible field system
The application comes pre-populated with sample data including:
- Sample customer (Susana Dixon)
- Sample order item with MTO metadata
- Sample payment information
- Sample shipping address
- Pre-built item templates
The application is designed to be highly extensible:
- New Templates: Add custom item templates in
item_templates.py - MTO Categories: Extend sub-item categories and options
- Question Types: Add new question types and field prompts
- UI Layout: Modify tab structure and form fields
- Validation: Add custom validation rules
- Export Formats: Extend export capabilities
python cli_order_generator.pypython cli_order_generator.py --interactivepython cli_order_generator.py --order-id "200000" --customer-name "John Doe"- Import Errors: Ensure Python 3.6+ is installed
- GUI Issues: Verify tkinter is available in your Python installation
- JSON Generation Errors: Check that all required fields are filled
- MTO Management: Ensure items are selected before managing MTO data
- Template Loading: Verify template names match available templates
The application welcomes contributions for:
- Additional item templates
- New MTO categories and options
- Enhanced validation rules
- API integrations
- Export format extensions
- UI/UX improvements
- Performance optimizations
This project is open source and available under the MIT License.