A comprehensive Python-based solution for automating Printify API operations, including product creation, image management, and template replication for various product types.
- Multi-Product Support: Horizontal, vertical, square, and T-shirt AOP products
- Image Management: Automated image placement and scaling
- Template Replication: Copy and customize existing product templates
- Batch Operations: Process multiple products with different image configurations
- Error Handling: Comprehensive error handling and logging
- Flexible Configuration: Easy-to-configure settings for different use cases
- Python: 3.7 or higher (3.8+ recommended)
- RAM: Minimum 4GB, recommended 8GB+ for large operations
- Storage: Minimum 100MB, recommended 1GB+ for caching
- OS: Windows 10/11, macOS 10.14+, or Linux (Ubuntu 18.04+)
requests>=2.25.0
- Valid Printify API key
- Active Printify shop account
- Proper API permissions for product management and image uploads
-
Clone or download the project
git clone <repository-url> cd repo_API_PRINTIFY
-
Install Python dependencies
pip install requests
-
Configure your settings
- Edit
ESSENTIAL_values.py
with your API credentials - Set up product templates in Printify
- Configure product IDs and variant IDs
- Edit
Before using the tool, you must configure the following values:
API_KEY = "your_printify_api_key"
COOKIE = "your_authentication_cookie"
id_SHOP = "your_shop_id"
PRODUCT_TITLE_0 = "Your Base Product Title"
PRODUCT_TITLE_SUFFIX_0 = ["Suffix1", "Suffix2", "Suffix3"]
IMAGE_VERSION_0 = "VERSION"
PAGINATION_0 = 10
COPY_STARTSWITH_0 = "COPY"
UPLOAD_STARTSWITH = "VERSION"
id_SIMPLE_HORIZONTAL_PRODUCT = "your_horizontal_template_id"
id_SIMPLE_VERTICAL_PRODUCT = "your_vertical_template_id"
id_SIMPLE_SQUARE_PRODUCT = "your_square_template_id"
id_SIMPLE_TSHIRT_AOP = "your_tshirt_template_id"
# Display product information
python METHOD_controller.py return_info
# Create simple horizontal product
python METHOD_controller.py product_simple_horizontal
# Create horizontal product with specific number of images
python METHOD_controller.py product_simple_horizontal-1-images
python METHOD_controller.py product_simple_horizontal-2-images
python METHOD_controller.py product_simple_horizontal-3-images
python METHOD_controller.py product_simple_horizontal-4-images
# Create square products
python METHOD_controller.py product_simple_square
python METHOD_controller.py product_simple_square-1-images
python METHOD_controller.py product_simple_square-2-images
python METHOD_controller.py product_simple_square-3-images
python METHOD_controller.py product_simple_square-4-images
# Create vertical products
python METHOD_controller.py product_simple_vertical
python METHOD_controller.py product_simple_vertical-1-images
python METHOD_controller.py product_simple_vertical-2-images
python METHOD_controller.py product_simple_vertical-3-images
python METHOD_controller.py product_simple_vertical-4-images
python METHOD_controller.py product_simple_vertical-5-images
python METHOD_controller.py product_simple_vertical-9-images
# Create T-shirt AOP products
python METHOD_controller.py product_simple_t_shirt_AOP
# Create specific design products
python METHOD_controller.py product_specific_design-1_horizontal
python METHOD_controller.py product_specific_design-1_vertical
# Horizontal products
python METHOD_controller.py --horizontal product_simple_horizontal-2-images
# Square products
python METHOD_controller.py --square product_simple_square-3-images
# Vertical products
python METHOD_controller.py --vertical product_simple_vertical-4-images
# Specific design products
python METHOD_controller.py --specific product_specific_design-1_horizontal
# Other products
python METHOD_controller.py --other product_simple_t_shirt_AOP
repo_API_PRINTIFY/
βββ README.md # This file
βββ requirements.md # Detailed requirements and setup
βββ ESSENTIAL_values.py # Configuration values
βββ ESSENTIAL_instance.py # Product instances
βββ METHOD_class.py # Core product classes
βββ METHOD_controller.py # Main controller
βββ METHOD_requests.py # HTTP request handling
βββ METHOD_parse.py # Data parsing utilities
βββ METHOD_wrapper.py # Function wrapper utilities
βββ help_formatter.py # Help formatting utilities
βββ __pycache__/ # Python cache files
- Create a Printify account
- Generate an API key from your account settings
- Note your shop ID
- Create product templates for each product type you want to use
- Upload images to Printify following the naming convention:
- Format:
VERSION0077.jpg
(where VERSION is your IMAGE_VERSION_0) - Ensure images are in the correct format and size
- Format:
- Create template products in Printify for each product type
- Note the product IDs and variant IDs
- Create copy products with "COPY" prefix for image replacement
- Edit
ESSENTIAL_values.py
with your API credentials - Configure product IDs and variant IDs
- Set up image version and pagination settings
- Test with
return_info
command
- Cause: Incorrect parameter passing to Parse_C2 function
- Solution: Ensure all Parse_C2 calls use single integers, not lists
- Cause: Invalid API key or cookie
- Solution: Verify your API credentials in
ESSENTIAL_values.py
- Cause: Product IDs not configured or templates don't exist
- Solution: Create templates in Printify and update IDs in configuration
- Cause: Images not uploaded or naming convention mismatch
- Solution: Upload images with correct naming convention and check IMAGE_VERSION_0
"Error: Instance 'simple_HZ' not found"
: Check instance configuration"Parse_C error"
: Verify template data structure"Wrapper function error"
: Check image and copy product lists
- Format:
VERSION0077.jpg
- Example:
VERSION0077.jpg
,VERSION0078.jpg
- Format:
COPY_Your_Product_Title
- Example:
COPY_Horizontal_Canvas_Wrap
- Format:
{PRODUCT_TITLE_0}{PRODUCT_TITLE_SUFFIX_0}
- Example:
Canvas Wrap - Design 1
-
Setup Phase
- Configure API credentials
- Create product templates
- Upload images
- Create copy products
-
Execution Phase
- Run desired command
- Monitor output for errors
- Verify product creation in Printify
-
Verification Phase
- Check created products in Printify dashboard
- Verify image placement and scaling
- Test product variants
- Printify API Documentation: https://printify.com/docs/
- Requirements File: See
requirements.md
for detailed setup instructions - Help Command: Run
python help_formatter.py
for formatted help
- Fork the repository
- Create a feature branch
- Make your changes
- Test thoroughly
- Submit a pull request
This project is licensed under the MIT License - see the LICENSE file for details.
This tool is designed for automation of Printify API operations. Please ensure compliance with Printify's terms of service and API usage guidelines. The authors are not responsible for any misuse or violations of Printify's policies.
For support and questions, please refer to the troubleshooting section above or check the requirements.md
file for detailed documentation.