tr3mulant/channel-lister

Guided product creation for eComm

Maintainers

Package info

github.com/tr3mulant/channel-lister

pkg:composer/tr3mulant/channel-lister

Statistics

Installs: 2

Dependents: 0

Suggesters: 0

Stars: 0

Open Issues: 0

v1 2025-08-26 21:14 UTC

This package is auto-updated.

Last update: 2026-03-27 18:14:16 UTC


README

Channel Lister Logo

Channel Lister

Streamlined Multi-Channel eCommerce Product Listing Tool

Channel Lister is a modern Laravel package that simplifies multi-channel eCommerce product listing management. Evolved from the Channel Advisor Master Lister (CAML), it provides a guided product creation experience with dynamic marketplace integration, featuring Amazon SP-API support for real-time listing requirements and automated CSV/JSON export generation.

โœจ Key Features

  • ๐Ÿ›’ Multi-Channel Support - Create listings for multiple eCommerce marketplaces
  • ๐Ÿ”„ Dynamic Forms - Auto-generated forms based on real-time marketplace requirements
  • ๐Ÿ“Š Amazon SP-API Integration - Native integration with Amazon's Selling Partner API
  • ๐Ÿ“ Flexible Field System - Custom and marketplace-specific field definitions
  • ๐Ÿ“‹ Smart Validation - Real-time validation with progress tracking
  • ๐Ÿ“„ Multiple Export Formats - CSV and JSON export for various platforms
  • ๐Ÿ” Existing Listing Lookup - Pre-populate forms from existing marketplace data
  • ๐Ÿ“ฆ Shipping Cost Calculator - Real-time shipping cost calculations with ShipEngine API
  • โšก Modern Stack - Built with Laravel, Pest testing, and modern PHP 8.3+

Requires PHP 8.3+

๐Ÿš€ Quick Start

Install via Composer:

composer require ige/channel-lister

โšก Automatic Installation (Recommended)

Use the install command for automatic setup:

php artisan channel-lister:install

This command will:

  • ๐Ÿ“ฆ Publish the service provider
  • ๐ŸŽจ Publish package assets
  • ๐Ÿ‘๏ธ Publish customizable views
  • โš™๏ธ Publish configuration files
  • ๐Ÿ—„๏ธ Publish database migrations
  • ๐Ÿ”ง Automatically register the service provider (supports Laravel 8/9/10/11+)

After installation, run the migrations:

php artisan migrate

๐ŸŽฏ Granular Publishing (Advanced)

For more control over what gets published, you can use specific tags:

๐Ÿ“‹ Views Only - Customize UI components

php artisan vendor:publish --tag=channel-lister-views

Publishes to: resources/views/vendor/channel-lister/
Use case: Customize field management interface, form components, and layouts

๐ŸŽจ Frontend Assets Only - For custom build processes

php artisan vendor:publish --tag=channel-lister-frontend-assets

Publishes to: resources/css/vendor/channel-lister/ and resources/js/vendor/channel-lister/
Use case: Integrate with Vite, Webpack, or other build tools

๐Ÿ“ฆ Everything - Complete control

php artisan vendor:publish --tag=channel-lister-resources

Publishes to: resources/vendor/channel-lister/
Use case: Full customization of all resources

๐Ÿ”ง Individual Components

# Configuration only
php artisan vendor:publish --tag=channel-lister-config

# Database migrations only
php artisan vendor:publish --tag=channel-lister-migrations

# Public assets only
php artisan vendor:publish --tag=channel-lister-assets

๐Ÿ› ๏ธ Manual Installation (Alternative)

Alternatively, you can install manually by publishing everything:

php artisan vendor:publish --provider="IGE\ChannelLister\ChannelListerServiceProvider"

Then run the migrations:

php artisan migrate

๐Ÿ› ๏ธ Development Commands

Code Quality & Testing

๐Ÿš€ Run the entire test suite:

composer test

โœ… Run unit tests using PEST:

composer test:unit

โš—๏ธ Run static analysis using PHPStan:

composer test:types

Code Formatting & Refactoring

๐Ÿงน Format code with Laravel Pint:

composer lint

โœ… Refactor code using Rector:

composer refacto

Development Server

๐ŸŒ Launch development server:

composer serve

๐Ÿ—‘๏ธ Clear caches:

composer clear

๐Ÿ“ฆ Build assets:

composer build

๐Ÿ“Š Amazon SP-API Integration

Channel Lister features comprehensive Amazon Selling Partner API (SP-API) integration for dynamic listing creation. This powerful feature enables:

  • Search for Amazon product types
  • Fetch dynamic listing requirements from Amazon
  • Look up existing listings by identifier (ASIN, GTIN, UPC, EAN, ISBN)
  • Generate marketplace-specific forms dynamically

โš™๏ธ Configuration

Add the following environment variables to your .env file:

# Amazon SP-API Configuration
AMAZON_SP_API_BASE_URL=https://sellingpartnerapi-na.amazon.com
AMAZON_MARKETPLACE_ID=ATVPDKIKX0DER
AMAZON_SP_API_REGION=us-east-1
AMAZON_SP_API_CLIENT_ID=your_client_id_here
AMAZON_SP_API_CLIENT_SECRET=your_client_secret_here
AMAZON_SP_API_REFRESH_TOKEN=your_refresh_token_here

# Shipping Calculator (Optional)
CHANNEL_LISTER_SHIPSTATION_API_KEY=your_shipengine_api_key_here
CHANNEL_LISTER_SHIPSTATION_BASE_URL=https://api.shipengine.com/v1

Note: The system now uses OAuth 2.0 with automatic token refresh. You only need to provide your client credentials and refresh token - access tokens are managed automatically.

๐Ÿ“‹ Usage

  1. Product Type Search: Use the Amazon product type search component to find and select the appropriate product type for your listing.

  2. Dynamic Form Generation: Once a product type is selected, the system will fetch the listing requirements from Amazon SP-API and generate the appropriate form fields.

  3. Existing Listing Lookup: Enter an identifier (ASIN, GTIN, etc.) to look up and pre-populate form fields from an existing Amazon listing.

๐Ÿ”— API Endpoints

Product Type & Requirements:

  • POST /api/amazon-listing/search-product-types - Search for Amazon product types
  • POST /api/amazon-listing/listing-requirements - Get listing requirements for a product type
  • POST /api/amazon-listing/existing-listing - Look up existing listing by identifier

Form Submission & Management:

  • POST /api/amazon-listing/submit - Submit listing form data
  • POST /api/amazon-listing/validate - Validate a listing
  • POST /api/amazon-listing/generate-file - Generate CSV/JSON files
  • GET /api/amazon-listing/listings - Get all listings with pagination
  • GET /api/amazon-listing/listings/{id} - Get specific listing details
  • GET /api/amazon-listing/listings/{id}/download - Download generated files

๐Ÿ” Token Management

The system includes robust SP-API token management with:

  • Automatic token refresh - Tokens are refreshed automatically before expiration
  • Caching - Valid tokens are cached to reduce API calls
  • Error handling - Comprehensive error handling for authentication failures
  • Rate limiting - Built-in protection against API rate limits
  • Debugging - Console command for checking token status

Debug Token Status

Use the console command to check your Amazon SP-API token status:

php artisan channel-lister:amazon-token-status

# Force refresh token
php artisan channel-lister:amazon-token-status --refresh

Authentication Flow

  1. Initial Setup: Configure your client credentials and refresh token
  2. Automatic Management: The system automatically obtains and refreshes access tokens
  3. Request Authentication: All SP-API calls are automatically authenticated
  4. Error Recovery: Failed authentication attempts trigger automatic token refresh

๐Ÿ“ Form Submission Workflow

The system provides a complete workflow for creating Amazon listings:

1. Product Type Selection

  • Search and select appropriate Amazon product type
  • System fetches dynamic listing requirements from SP-API
  • Form fields are generated based on Amazon's current requirements

2. Form Completion

  • Fill out dynamically generated form fields
  • Real-time validation feedback
  • Progress tracking showing completion percentage
  • Support for existing listing lookup and pre-population

3. Validation & Processing

  • Save Draft: Store form data without validation
  • Validate: Comprehensive validation against Amazon requirements
  • Business Rules: SKU uniqueness, price validation, dimension consistency
  • Required Fields: Automatic detection of missing required fields

4. File Generation

  • CSV Export: Amazon-compatible CSV format for bulk upload
  • JSON Export: Structured data for API integration
  • Field Mapping: Automatic mapping to Amazon feed column names
  • Data Transformation: Amazon-specific formatting (prices, dimensions, etc.)

5. Download & Submission

  • Secure file downloads with proper MIME types
  • Files ready for Amazon Seller Central upload
  • Persistent storage with listing history

โœ… Validation Features

  • Amazon Requirements: Dynamic validation based on current SP-API requirements
  • Field Types: String, numeric, boolean, enum validation
  • Constraints: Length limits, regex patterns, value ranges
  • Business Logic: SKU uniqueness, price consistency, dimension validation
  • Real-time Feedback: Instant validation results and progress tracking

๐Ÿ“ฆ Shipping Cost Calculator

Channel Lister includes a powerful shipping cost calculator that integrates with ShipEngine API to provide real-time shipping rates from major carriers (UPS, FedEx, USPS). This feature helps sellers accurately estimate shipping costs for their products, improving pricing decisions and customer experience.

โœจ Features

  • Real-time Rate Shopping - Get live rates from multiple carriers simultaneously
  • Dimensional Weight Calculation - Automatic calculation for different carrier divisors
  • IP Geolocation - Detect origin location automatically from user's IP
  • Manual Entry Fallback - Enter shipping costs manually when API is unavailable
  • Smart Integration - Seamlessly integrated into cost-related form fields
  • Carrier Comparison - Compare rates across UPS, FedEx, and USPS
  • Auto-fill Dimensions - Pull package dimensions from existing form fields

โš™๏ธ Configuration

Add the following environment variables to your .env file:

# ShipEngine API Configuration
CHANNEL_LISTER_SHIPSTATION_API_KEY=your_shipengine_api_key_here
CHANNEL_LISTER_SHIPSTATION_BASE_URL=https://api.shipengine.com/v1

Note: The system gracefully handles missing API keys by providing manual entry options for shipping costs. ShipEngine API usage incurs costs based on your plan - see ShipEngine pricing for details.

๐Ÿ“‹ Usage

The shipping calculator appears as an integrated button within cost-related form fields:

  1. Automatic Detection: Click "Calculate Shipping" button on any shipping cost field
  2. Location Setup: System detects your location via IP or enter ZIP codes manually
  3. Package Details: Enter dimensions (length, width, height) and weight
  4. Auto-fill: Use existing form data to populate dimensions automatically
  5. Rate Comparison: View rates from multiple carriers sorted by price
  6. Selection: Click desired rate to populate the form field

๐Ÿ”— API Endpoints

Shipping Calculator Endpoints:

  • GET /api/shipping/check-api - Check if ShipEngine API key is available
  • GET /api/shipping/location - Get user location from IP address
  • POST /api/shipping/calculate - Calculate shipping rates for package
  • GET /api/shipping/carriers - Get available carriers from ShipEngine
  • POST /api/shipping/dimensional-weight - Calculate dimensional weight only

๐Ÿ“Š Dimensional Weight Calculation

The system automatically calculates dimensional weight using carrier-specific divisors:

  • UPS Commercial: 139 cubic inches per pound
  • FedEx: 139 cubic inches per pound
  • USPS: 166 cubic inches per pound

Billable Weight: The greater of actual weight or dimensional weight is used for rate calculation.

๐ŸŽฏ Integration Details

The shipping calculator integrates seamlessly with the form system:

  • Field Detection: Automatically appears on fields with "shipping", "cost", or similar names
  • Modal Interface: Clean, user-friendly modal with step-by-step workflow
  • Responsive Design: Works on desktop and mobile devices
  • Error Handling: Graceful fallbacks when API is unavailable
  • Caching: Efficient rate caching to minimize API calls

๐Ÿ’ก Manual Entry Mode

When ShipEngine API is not configured or unavailable:

  • System automatically switches to manual entry mode
  • Users can enter estimated shipping costs directly
  • All functionality remains available without API dependency
  • Clear messaging indicates manual entry is required

๐Ÿ”ง Development & Testing

The shipping calculator includes comprehensive test coverage and follows Laravel best practices:

  • Service Layer: Clean separation of concerns with ShippingCalculatorService
  • API Integration: Robust HTTP client with error handling
  • Form Components: Reusable Blade components with JavaScript integration
  • Validation: Input validation for dimensions, ZIP codes, and weights
  • Testing: Full test suite covering happy paths and error conditions

๐Ÿ”ง Form Field Configuration & Customization

Channel Lister provides a powerful and flexible form field system that allows you to fully customize the listing creation experience. You can manage fields for different marketplaces, add new marketplaces, and customize field behavior through the ChannelListerField model and management interface.

โšก Quick Setup with Default Fields

Use the seeding command to populate your database with pre-configured fields for ChannelAdvisor/Rithum and Amazon:

php artisan channel-lister:seed-fields

Command Options:

  • --force - Force seeding even if fields already exist (overwrites existing fields)

What this command does:

  • ๐Ÿ“ฆ Seeds 27 default fields for common marketplace operations
  • ๐Ÿช Includes fields for ChannelAdvisor/Rithum integration
  • ๐Ÿ›’ Includes Amazon-specific product type fields
  • โš™๏ธ Sets up proper field ordering, validation, and grouping
  • ๐Ÿ”„ Handles different input types (text, select, currency, etc.)

๐ŸŽ›๏ธ Field Management Interface

Access the field management interface via the channel-lister-field routes:

Available Routes:

// Web interface for field management
Route::resource('/channel-lister-field', ChannelListerFieldController::class)

Management Operations:

  • ๐Ÿ“‹ List Fields - /channel-lister-field - View all fields with filtering by marketplace
  • โž• Create Field - /channel-lister-field/create - Add new custom fields
  • ๐Ÿ‘๏ธ View Field - /channel-lister-field/{id} - View field details
  • โœ๏ธ Edit Field - /channel-lister-field/{id}/edit - Modify existing fields
  • ๐Ÿ—‘๏ธ Delete Field - /channel-lister-field/{id} - Remove fields (with confirmation)

๐Ÿ“Š ChannelListerField Model

The ChannelListerField model is the core of the field system:

Model Attributes:

$field = new ChannelListerField([
    'ordering' => 1,                    // Display order (integer)
    'field_name' => 'Product Title',    // Internal field name
    'display_name' => 'Title',          // User-facing label
    'tooltip' => 'Enter product title', // Help text
    'example' => 'Blue Widget Pro',     // Example value
    'marketplace' => 'amazon',          // Target marketplace
    'input_type' => 'text',            // Field input type
    'input_type_aux' => null,          // Additional input options
    'required' => true,                // Whether field is required
    'grouping' => 'Product Details',   // Form section grouping
    'type' => 'custom',               // Field type (custom/channeladvisor)
]);

Available Input Types:

  • text - Standard text input
  • textarea - Multi-line text input
  • select - Dropdown selection (uses input_type_aux for options)
  • checkbox - Boolean checkbox
  • currency - Currency input with formatting
  • decimal - Decimal number input
  • integer - Whole number input
  • url - URL input with validation
  • comma-separated - Multi-value comma-separated input
  • custom - Special custom components (UPC generator, shipping calculator, etc.)
  • alert - Display informational alerts

Field Types:

  • custom - User-defined fields for specific business needs
  • channeladvisor - Fields designed for ChannelAdvisor/Rithum integration

Useful Scopes:

// Get fields for specific marketplace
ChannelListerField::forMarketplace('amazon')->get();

// Get only required fields
ChannelListerField::required()->get();

// Get fields by grouping
ChannelListerField::byGrouping('Product Details')->get();

// Get ordered fields
ChannelListerField::ordered()->get(); // ascending
ChannelListerField::ordered('desc')->get(); // descending

// Chain scopes for complex queries
ChannelListerField::forMarketplace('ebay')
    ->required()
    ->ordered()
    ->get();

๐Ÿ›’ Adding New Marketplaces

You can easily add support for new marketplaces by creating fields with custom marketplace keys:

// Add fields for a new marketplace (e.g., 'etsy')
ChannelListerField::create([
    'ordering' => 1,
    'field_name' => 'Etsy Category',
    'display_name' => 'Product Category',
    'marketplace' => 'etsy',           // New marketplace key
    'input_type' => 'select',
    'input_type_aux' => 'Clothing||Electronics||Home & Garden',
    'required' => true,
    'grouping' => 'Etsy Specific',
    'type' => 'custom',
]);

Marketplace Display Names:

The system automatically generates display names for marketplaces using the ChannelLister::marketplaceDisplayName() method:

  • amazon โ†’ "Amazon"
  • ebay โ†’ "eBay"
  • walmart โ†’ "Walmart"
  • custom-marketplace โ†’ "Custom Marketplace"

๐Ÿ”ง Advanced Field Configuration

Select Field Options:

For select fields, use the input_type_aux field to define options:

// Simple options
'input_type_aux' => 'Small||Medium||Large'

// Key-value pairs
'input_type_aux' => 'sm==Small||md==Medium||lg==Large'

// From code
$field->input_type_aux = ['Option 1', 'Option 2', 'Option 3'];

Custom Field Components:

Special custom components are available via the custom input type:

// UPC generator component  
'input_type' => 'custom',
'input_type_aux' => '', // UPC generation logic

// Amazon product type search
'input_type' => 'custom', 
'input_type_aux' => 'amazon-product-type-search',

// Shipping cost calculator
'field_name' => 'Cost Shipping',
'input_type' => 'custom', // Automatically triggers shipping calculator

Validation Patterns:

Use input_type_aux for regex validation on text fields:

'input_type' => 'text',
'input_type_aux' => '^[A-Z0-9-]{5,20}$', // SKU format validation

๐ŸŽฏ Practical Examples

Example 1: Adding Shopify Support

// Create Shopify-specific fields
$fields = [
    [
        'ordering' => 1,
        'field_name' => 'shopify_handle',
        'display_name' => 'URL Handle', 
        'marketplace' => 'shopify',
        'input_type' => 'text',
        'required' => true,
        'grouping' => 'Shopify Settings',
        'type' => 'custom',
    ],
    [
        'ordering' => 2,
        'field_name' => 'shopify_tags',
        'display_name' => 'Product Tags',
        'marketplace' => 'shopify', 
        'input_type' => 'comma-separated',
        'required' => false,
        'grouping' => 'Shopify Settings',
        'type' => 'custom',
    ],
];

foreach ($fields as $field) {
    ChannelListerField::create($field);
}

Example 2: Custom Validation Field

ChannelListerField::create([
    'ordering' => 10,
    'field_name' => 'model_number',
    'display_name' => 'Model Number',
    'tooltip' => 'Enter manufacturer model number (letters, numbers, hyphens only)',
    'example' => 'ABC-123-XYZ',
    'marketplace' => 'common',
    'input_type' => 'text',
    'input_type_aux' => '^[A-Z0-9-]{3,50}$', // Validation regex
    'required' => true,
    'grouping' => 'Product Information',
    'type' => 'custom',
]);

Example 3: Dynamic Select Field

ChannelListerField::create([
    'ordering' => 5,
    'field_name' => 'condition',
    'display_name' => 'Product Condition',
    'marketplace' => 'common',
    'input_type' => 'select',
    'input_type_aux' => 'new==New||used-like-new==Used - Like New||used-good==Used - Good||used-acceptable==Used - Acceptable',
    'required' => true,
    'grouping' => 'Product Details',
    'type' => 'custom',
]);

๐Ÿ” Field Management Best Practices

  1. ๐Ÿ“‹ Consistent Ordering - Use meaningful ordering values (10, 20, 30) to allow easy insertion
  2. ๐Ÿท๏ธ Clear Naming - Use descriptive field_name and display_name values
  3. ๐Ÿ“ Helpful Tooltips - Provide context and examples for complex fields
  4. ๐ŸŽฏ Logical Grouping - Group related fields together for better UX
  5. โœ… Proper Validation - Use appropriate input types and validation patterns
  6. ๐ŸŒ Marketplace Specific - Use marketplace keys consistently across your application

๐Ÿ”ง Programmatic Field Management

// Create fields programmatically
$marketplaceFields = [
    'tiktok' => [
        ['field_name' => 'tiktok_category', 'display_name' => 'TikTok Category'],
        ['field_name' => 'tiktok_hashtags', 'display_name' => 'Hashtags'],
    ]
];

foreach ($marketplaceFields as $marketplace => $fields) {
    foreach ($fields as $index => $fieldData) {
        ChannelListerField::create(array_merge($fieldData, [
            'marketplace' => $marketplace,
            'ordering' => ($index + 1) * 10,
            'input_type' => 'text',
            'required' => false,
            'grouping' => ucfirst($marketplace) . ' Settings',
            'type' => 'custom',
        ]));
    }
}

This flexible field system allows you to adapt Channel Lister to any marketplace or business requirement while maintaining a consistent, user-friendly interface.

๐Ÿ“„ License

This package is open-sourced software licensed under the MIT license.

๐Ÿ™ Credits

๐Ÿ“ž Support

For support, issues, or feature requests, please open an issue on GitHub.