### Install Sellpass Python SDK Source: https://github.com/sellpass/python-api-sdk/blob/main/README.md Use this command to install the Sellpass Python SDK. Ensure you have Python 3.7+ installed. ```bash python3 -m pip install sellpass ``` -------------------------------- ### Get and Create Products (v2) Source: https://context7.com/sellpass/python-api-sdk/llms.txt Retrieve all products or create a new product using the v2 API. Requires API key and shop_id for initialization. ```python from sellpass import SellPass sp = SellPass(api_key="your-api-key", shop_id=4100) # Get all products products = sp.get_productsv2() for product in products: print(f"Product: {product['title']} - ${product['price']}") ``` -------------------------------- ### Initialize Sellpass API Client and Fetch Data Source: https://github.com/sellpass/python-api-sdk/blob/main/README.md Initialize the SellPass client with your API key and shop ID. This example demonstrates fetching shop name, customers, feedback, and tickets. ```python from sellpass import SellPass api_key = "API Key from https://dashboard.sellpass.io/settings/security" # Replace with your API key if __name__ == "__main__": sp = SellPass( api_key = api_key, debug = True, shop_id = None # <--- Replace shop_id with your shop ID, if you have multiple shops ) print(f"Shop name: {sp.get_public_shop()[0]['shop']['name']}") # Get shop name customers = sp.get_customers() # Get all customers feedback = sp.get_feedback() # Get all feedback tickets = sp.get_tickets() # Get all tickets ``` -------------------------------- ### Get and Create Shops Source: https://context7.com/sellpass/python-api-sdk/llms.txt Retrieve all shops associated with your account or create a new shop. Requires API key for initialization. ```python from sellpass import SellPass sp = SellPass(api_key="your-api-key") # Get all shops shops = sp.get_shops() for shop in shops: print(f"Shop ID: {shop['shop']['id']}, Name: {shop['shop']['name']}") # Create a new shop new_shop = sp.create_shop(name="My New Store") print(f"Created shop with ID: {new_shop['id']}") ``` -------------------------------- ### GET /get_productv2 Source: https://context7.com/sellpass/python-api-sdk/llms.txt Retrieves details for a specific product by ID. ```APIDOC ## GET /get_productv2 ### Description Retrieves the full details of a product, including its variants. ### Parameters #### Query Parameters - **product_id** (integer) - Required - The ID of the product to retrieve ### Response #### Success Response (200) - **title** (string) - Product title - **variants** (array) - List of product variants ``` -------------------------------- ### Get and Update Product by ID Source: https://context7.com/sellpass/python-api-sdk/llms.txt Retrieve a specific product's details using its ID, then update its information. Ensure the product ID is correct before attempting to edit. ```python from sellpass import SellPass sp = SellPass(api_key="your-api-key", shop_id=4100) # Get specific product product = sp.get_productv2(product_id=1234) print(f"Product: {product['title']}") print(f"Variants: {len(product['variants'])}") # Update product sp.edit_productv2( product_id=1234, title="Updated Product Title", description="

Updated description with new features.

", short_description="Updated short desc", path="updated-product", seo="Updated Product - Best Price", unlisted=False, private=False, on_hold=False, variants=[ {"title": "Basic", "price": 19.99, "stock": 200}, {"title": "Premium", "price": 39.99, "stock": 100} ] ) ``` -------------------------------- ### GET /get_invoices Source: https://context7.com/sellpass/python-api-sdk/llms.txt Retrieves a list of all invoices for the shop. ```APIDOC ## GET /get_invoices ### Description Fetches all invoices associated with the authenticated shop. ### Response #### Success Response (200) - **id** (string) - Invoice ID - **total** (float) - Total amount - **status** (string) - Current status of the invoice ``` -------------------------------- ### Get Customer Data and Statistics Source: https://context7.com/sellpass/python-api-sdk/llms.txt Retrieve customer statistics, specific customer details, and IP addresses for fraud prevention. Requires initialization with API key and shop ID. ```python from sellpass import SellPass sp = SellPass(api_key="your-api-key", shop_id=4100) # Get customer statistics stats = sp.get_customers() print(f"Total customers: {stats['totalCustomers']}") print(f"Returning customers: {stats['returningCustomers']}") # Get specific customer details customer = sp.get_customer(customer_id=12345) print(f"Email: {customer['email']}") print(f"Total spent: ${customer['totalSpent']}") print(f"Orders: {customer['orderCount']}") # Get customer IP addresses (fraud prevention) ips = sp.get_customer_ips(customer_id=12345) for ip in ips: print(f"IP: {ip['address']} - Last used: {ip['lastUsed']}") ``` -------------------------------- ### GET /get_invoice Source: https://context7.com/sellpass/python-api-sdk/llms.txt Retrieves details for a specific invoice. ```APIDOC ## GET /get_invoice ### Description Fetches detailed information for a specific invoice by its ID. ### Parameters #### Query Parameters - **invoice_id** (string) - Required - The unique identifier for the invoice ### Response #### Success Response (200) - **customerEmail** (string) - Customer email address - **items** (array) - List of items in the invoice - **status** (string) - Invoice status ``` -------------------------------- ### Retrieve Dashboard Statistics Source: https://context7.com/sellpass/python-api-sdk/llms.txt Get key shop analytics and statistics, including total revenue, orders today, total orders, and conversion rate. ```python from sellpass import SellPass sp = SellPass(api_key="your-api-key", shop_id=4100) # Get dashboard statistics dashboard = sp.get_dashboard() print(f"Total revenue: ${dashboard['totalRevenue']}") print(f"Orders today: {dashboard['ordersToday']}") print(f"Total orders: {dashboard['totalOrders']}") print(f"Conversion rate: {dashboard['conversionRate']}%" ) ``` -------------------------------- ### Get, Edit, or Delete Specific Coupons Source: https://context7.com/sellpass/python-api-sdk/llms.txt Retrieve details of a specific coupon, update its parameters, or delete it. Requires coupon ID. Initialization with API key and shop ID is necessary. ```python from sellpass import SellPass sp = SellPass(api_key="your-api-key", shop_id=4100) # Get specific coupon coupon = sp.get_coupon(coupon_id=567) print(f"Uses remaining: {coupon['maxUses'] - coupon['usedCount']}") # Update coupon sp.edit_coupon( coupon_id=567, name="SAVE25", discount=25.0, is_fixed=False, note="Updated to 25% off", max_uses=200 ) # Delete coupon sp.delete_coupon(coupon_id=567) ``` -------------------------------- ### Get, Edit, or Delete Specific Categories Source: https://context7.com/sellpass/python-api-sdk/llms.txt Retrieve details of a specific category, update its name or associated listings, or delete it. Requires category ID. Initialization with API key and shop ID is necessary. ```python from sellpass import SellPass sp = SellPass(api_key="your-api-key", shop_id=4100) # Get specific category # sp.get_category(category_id=1) # Edit category # sp.edit_category(category_id=1, name="Updated Category Name") # Delete category # sp.delete_category(category_id=1) ``` -------------------------------- ### Configure Widgets and Storefront Source: https://context7.com/sellpass/python-api-sdk/llms.txt Configure analytics and support widgets using their respective keys. Also, customize the storefront's hero section with a title, description, and button text. ```python from sellpass import SellPass sp = SellPass(api_key="your-api-key", shop_id=4100) # Configure analytics and support widgets sp.edit_widgets( crisp_key="your-crisp-website-id", google_analytics_key="G-XXXXXXXXXX", hotjar_key="1234567", intercom_key="your-intercom-app-id" ) # Configure storefront hero section sp.edit_storefront( title="Welcome to Premium Digital Store", description="The best digital products at unbeatable prices", button_text="Browse Products", disable_button=False, disable_title=False, disable_description=False ) ``` -------------------------------- ### Manage FAQs Source: https://context7.com/sellpass/python-api-sdk/llms.txt Create, update, and delete frequently asked questions. ```python from sellpass import SellPass sp = SellPass(api_key="your-api-key", shop_id=4100) # Get all FAQs faqs = sp.get_faqs() for faq in faqs: print(f"Q: {faq['question']}") print(f"A: {faq['answer']}") # Create new FAQ sp.create_faq( question="How do I receive my product?", answer="After payment, you'll receive an email with your license key and download link." ) # Edit FAQ sp.edit_faq( faq_id=123, question="How do I receive my digital product?", answer="Products are delivered instantly via email after payment confirmation." ) # Delete FAQ sp.delete_faq(faq_id=123) ``` -------------------------------- ### POST /create_productv2 Source: https://context7.com/sellpass/python-api-sdk/llms.txt Creates a new product with variants. ```APIDOC ## POST /create_productv2 ### Description Creates a new product with specified variants and metadata. ### Request Body - **title** (string) - Required - Product title - **description** (string) - Required - HTML description - **short_description** (string) - Required - Short description - **path** (string) - Required - URL path - **seo** (string) - Required - SEO title - **unlisted** (boolean) - Required - Visibility setting - **private** (boolean) - Required - Privacy setting - **on_hold** (boolean) - Required - Hold status - **variants** (array) - Required - List of product variants ### Response #### Success Response (200) - **id** (integer) - The ID of the created product ``` -------------------------------- ### Create New Product with Variants Source: https://context7.com/sellpass/python-api-sdk/llms.txt Use this function to create a new product with multiple variants. Ensure all required fields like title, description, and price are provided for each variant. ```python new_product = sp.create_productv2( title="Premium Software License", description="

Lifetime access to our premium software.

", short_description="Lifetime premium license", path="premium-license", seo="Premium Software License - Lifetime Access", unlisted=False, private=False, on_hold=False, variants=[ { "title": "Standard", "description": "Single device license", "price": 29.99, "stock": 100 }, { "title": "Pro", "description": "Up to 5 devices", "price": 49.99, "stock": 50 } ] ) print(f"Created product ID: {new_product['id']}") ``` -------------------------------- ### Update SEO, Logo, and Background Images Source: https://context7.com/sellpass/python-api-sdk/llms.txt Configure SEO settings, upload a shop logo, background image, SEO image (Open Graph), and favicon. Ensure images are correctly encoded in base64. ```python from sellpass import SellPass import base64 sp = SellPass(api_key="your-api-key", shop_id=4100) # Update SEO settings sp.edit_seo( title="Premium Digital Store - Best Software Licenses", description="Shop the best digital products including software licenses, game keys, and more." ) # Upload logo with open("logo.png", "rb") as f: logo_base64 = base64.b64encode(f.read()).decode() sp.edit_logo(file=f"data:image/png;base64,{logo_base64}") # Upload background image with open("background.jpg", "rb") as f: bg_base64 = base64.b64encode(f.read()).decode() sp.edit_background(file=f"data:image/jpeg;base64,{bg_base64}") # Upload SEO image (Open Graph) sp.edit_seo_image(file=f"data:image/png;base64,{logo_base64}") # Upload favicon sp.edit_seo_favicon(file=f"data:image/png;base64,{logo_base64}") ``` -------------------------------- ### Configure Social Media Links Source: https://context7.com/sellpass/python-api-sdk/llms.txt Set up social media links for your shop by providing a list of dictionaries, each containing a 'type' and 'url' for a social platform. ```python from sellpass import SellPass sp = SellPass(api_key="your-api-key", shop_id=4100) # Set social media links sp.edit_links(social_links=[ {"type": "twitter", "url": "https://twitter.com/mystore"}, {"type": "discord", "url": "https://discord.gg/mystore"}, {"type": "instagram", "url": "https://instagram.com/mystore"}, {"type": "youtube", "url": "https://youtube.com/mystore"} ]) ``` -------------------------------- ### Manage Listings Source: https://context7.com/sellpass/python-api-sdk/llms.txt Retrieve and reorder product listings within the shop. ```python from sellpass import SellPass sp = SellPass(api_key="your-api-key", shop_id=4100) # Get all listings listings = sp.get_listings() for listing in listings: print(f"Position {listing['position']}: {listing['title']}") # Reorder listings sp.edit_listings_position( listings=[ {"id": 1234, "position": 0}, {"id": 1235, "position": 1}, {"id": 1236, "position": 2} ] ) ``` -------------------------------- ### Initialize SellPass Client Source: https://context7.com/sellpass/python-api-sdk/llms.txt Initialize the SellPass client with your API key. Auto-detects shop_id or allows explicit setting. Debug logging can be enabled. ```python from sellpass import SellPass # Basic initialization - auto-detects shop_id sp = SellPass( api_key="your-api-key-from-dashboard", debug=True # Enable debug logging ) # Initialize with specific shop_id for multi-shop accounts sp = SellPass( api_key="your-api-key-from-dashboard", shop_id=4100, debug=False ) # Access shop name shop_info = sp.get_public_shop() print(f"Shop name: {shop_info[0]['shop']['name']}") # Output: Shop name: My Digital Store ``` -------------------------------- ### Manage Shop Coupons Source: https://context7.com/sellpass/python-api-sdk/llms.txt Retrieve all coupons or create new ones. Supports percentage or fixed amount discounts, with options for product and gateway restrictions, and usage limits. Requires initialization with API key and shop ID. ```python from sellpass import SellPass sp = SellPass(api_key="your-api-key", shop_id=4100) # Get all coupons coupons = sp.get_coupons() for coupon in coupons: print(f"Code: {coupon['name']} - Discount: {coupon['discount']}") # Create percentage discount coupon sp.create_coupon( name="SAVE20", discount=20.0, is_fixed=False, # Percentage discount note="20% off promotion", start_date="2024-01-01T00:00:00Z", end_date="2024-01-31T23:59:59Z", max_uses=100 ) # Create fixed amount discount coupon sp.create_coupon( name="10OFF", discount=10.0, is_fixed=True, # Fixed $10 off note="$10 off any purchase", restrct_to_products=[1234, 1235], # Only for specific products restrict_to_gateways=["stripe", "paypal"], # Only for certain payment methods max_uses=50 ) ``` -------------------------------- ### Bulk Edit Product Payment Methods Source: https://context7.com/sellpass/python-api-sdk/llms.txt Efficiently update payment gateway settings for multiple products simultaneously. Provide a list of product IDs and a dictionary specifying enabled gateways. ```python from sellpass import SellPass sp = SellPass(api_key="your-api-key", shop_id=4100) # Update payment methods for multiple products sp.bulk_edit_productsv2_payment_method( product_ids=[1234, 1235, 1236], gateways_list={ "stripe": True, "paypal": True, "coinbase": False, "cashapp": True } ) ``` -------------------------------- ### Configure Payment Gateways Source: https://context7.com/sellpass/python-api-sdk/llms.txt Configure various payment methods like Coinbase, Stripe, PayPal, and CashApp. Requires API key, shop_id, and specific gateway credentials. ```python from sellpass import SellPass sp = SellPass(api_key="your-api-key", shop_id=4100) # Configure Coinbase Commerce sp.edit_shop_coinbase( api_key="coinbase-api-key", webhook_secret="coinbase-webhook-secret", gateway_rules={"minAmount": 5, "maxAmount": 500} ) # Configure Stripe Connect sp.edit_shop_stripe( code="stripe-authorization-code", gateway_rules={"minAmount": 1, "maxAmount": 1000} ) # Configure PayPal Email sp.edit_shop_paypal_email( email="payments@example.com", gateway_rules={"minAmount": 5} ) # Configure PayPal Friends & Family sp.edit_shop_paypal_family_and_friends( email="payments@example.com", gateway_rules={} ) # Configure CashApp sp.edit_shop_cashapp( cashtag="$MyStore", email="cashapp@example.com", gateway_rules={"minAmount": 10} ) # Configure crypto via Virtual Payments sp.edit_shop_virtual_payments( private_key="private-key", public_key="public-key", receive_currency="BTC", gateway_rules={} ) ``` -------------------------------- ### Edit Shop Settings Source: https://context7.com/sellpass/python-api-sdk/llms.txt Configure various shop settings including name, subdomain, currency, timezone, and sales status. Requires API key and shop_id. ```python from sellpass import SellPass sp = SellPass(api_key="your-api-key", shop_id=4100) # Update shop name sp.edit_shop_name(name="Premium Digital Goods") # Update subdomain sp.edit_shop_subdomain(subdomain="premium-store") # Set currency and timezone sp.edit_shop_currency(currency="USD") sp.edit_shop_timezone(utc_timezone_offset=-5) # EST # Put shop on hold (pause sales) sp.edit_shop_on_hold(status=True) # Set popup message for customers sp.edit_shop_popup_message(message="Welcome! Use code SAVE10 for 10% off!") # Update terms of service sp.edit_shop_terms(terms="By purchasing, you agree to our refund policy...") ``` -------------------------------- ### Customize Shop Design Source: https://context7.com/sellpass/python-api-sdk/llms.txt Update your shop's visual appearance by setting colors, text, and display options. Ensure all required parameters are provided for a complete update. ```python from sellpass import SellPass sp = SellPass(api_key="your-api-key", shop_id=4100) # Get current design settings design = sp.get_design() # Update shop design sp.edit_design( primary_color="#6366f1", primary_color_accent="#4f46e5", background_color="#0f172a", secondary_color="#1e293b", primary_text_color="#f8fafc", secondary_text_color="#94a3b8", dark_mode=True, disable_business_name=False, disable_search_bar=False, disable_product_title=False, disable_business_logo=False, disable_reviews=False, disable_products_sold=False, hide_out_of_stock_products=True, disable_shadows=False, disable_support=False, font_link="https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600&display=swap" ) ``` -------------------------------- ### Manage Product Categories Source: https://context7.com/sellpass/python-api-sdk/llms.txt Retrieve all product categories and their associated listings, or create a new category with specified listings. Requires initialization with API key and shop ID. ```python from sellpass import SellPass sp = SellPass(api_key="your-api-key", shop_id=4100) # Get all categories categories = sp.get_categories() for cat in categories: print(f"Category: {cat['name']} - Products: {len(cat['listingIds'])}") # Create new category sp.create_category( name="Software Licenses", listingids=[1234, 1235, 1236] ) ``` -------------------------------- ### Manage Shop Announcements Source: https://context7.com/sellpass/python-api-sdk/llms.txt Retrieve all shop announcements or create a new one. Requires initialization with API key and shop ID. New announcements can include title, descriptions, and button links. ```python from sellpass import SellPass sp = SellPass(api_key="your-api-key", shop_id=4100) # Get all announcements announcements = sp.get_announcements() for ann in announcements: print(f"{ann['title']}: {ann['shortDescription']}") # Create new announcement response = sp.create_announcement( title="Black Friday Sale!", short_description="50% off everything this weekend!", description="

Our biggest sale of the year! Use code BF50 at checkout.

", unlisted=False, private=False, button_text="Shop Now", button_link="https://mystore.sellpass.io" ) print(f"Created announcement ID: {response['id']}") # Output: { # 'id': 1341, # 'path': 'yD7PV1W41MO2', # 'title': 'Black Friday Sale!', # 'shortDescription': '50% off everything this weekend!', # 'createdAt': '2022-12-08T15:37:00.4600125Z' # } ``` -------------------------------- ### Manage Products using v1 API Source: https://context7.com/sellpass/python-api-sdk/llms.txt Perform basic product management operations like retrieving all products, deleting a single product, or bulk deleting multiple products using the v1 API endpoints. ```python from sellpass import SellPass sp = SellPass(api_key="your-api-key", shop_id=4100) # Get all products products = sp.get_products() # Delete a single product sp.delete_product(product_id=1234) # Bulk delete multiple products sp.bulk_delete_products(product_ids=[1235, 1236, 1237]) ``` -------------------------------- ### Manage Product Groups Source: https://context7.com/sellpass/python-api-sdk/llms.txt Retrieve, create, and update product groups for featured collections. ```python from sellpass import SellPass sp = SellPass(api_key="your-api-key", shop_id=4100) # Get all groups groups = sp.get_groups() for group in groups: print(f"Group: {group['title']} - Products: {len(group['productIds'])}") # Create new group sp.create_group( title="Best Sellers", description="Our most popular products", product_ids=[1234, 1235, 1236], priority=1, # Display order type=0, # Group type main=True # Show on main page ) ``` ```python from sellpass import SellPass import base64 sp = SellPass(api_key="your-api-key", shop_id=4100) # Get specific group group = sp.get_group(group_id=456) # Edit group sp.edit_group( group_id=456, title="Top Sellers 2024", description="Our bestselling products this year", product_ids=[1234, 1235, 1236, 1237], priority=1, type=0, main=True ) # Update group thumbnail with open("group-thumbnail.png", "rb") as f: image_base64 = base64.b64encode(f.read()).decode() sp.edit_group_thumbnail( group_id=456, file=f"data:image/png;base64,{image_base64}" ) # Delete group sp.delete_group(group_id=456) ``` -------------------------------- ### Handle API Exceptions Source: https://context7.com/sellpass/python-api-sdk/llms.txt Demonstrates wrapping API calls in try-except blocks to capture and display detailed error information returned by the Sellpass API. ```python from sellpass import SellPass sp = SellPass(api_key="your-api-key", shop_id=4100) try: product = sp.get_productv2(product_id=99999) except Exception as e: print(f"Error: {e}") # Output: Sellpass error: # Endpoint: https://dev.sellpass.io/self/4100/v2/products/99999 # Status code: 404 # Errors: ['Product not found'] # Message: The requested resource was not found ``` -------------------------------- ### Upload Product Thumbnail and SEO Image Source: https://context7.com/sellpass/python-api-sdk/llms.txt Upload images for a product's thumbnail and SEO. Images must be base64 encoded. Ensure the file path is correct and the image format is supported. ```python from sellpass import SellPass import base64 sp = SellPass(api_key="your-api-key", shop_id=4100) # Upload thumbnail (base64 encoded image) with open("product-image.png", "rb") as f: image_base64 = base64.b64encode(f.read()).decode() sp.edit_productv2_thumbnail( product_id=1234, file=f"data:image/png;base64,{image_base64}" ) # Upload SEO image sp.edit_productv2_seo_image( product_id=1234, file=f"data:image/png;base64,{image_base64}" ) ``` -------------------------------- ### Create a Sellpass Announcement Source: https://github.com/sellpass/python-api-sdk/blob/main/README.md Use this function to create a new announcement on Sellpass. Ensure all required parameters like title, description, and button details are provided. ```python response = sp.create_announcement( title = "Test Announcement", short_description = "This is a test!", description = "This is a test announcement, showing of the SellPass API!", unlisted = False, private = False, button_text = "Use now!", button_link = "https://sellpass.io" ) # Create an announcement print(response) ``` -------------------------------- ### Bulk Edit Product Fields, Visibility, and Integrations Source: https://context7.com/sellpass/python-api-sdk/llms.txt Update custom fields, visibility settings, and Discord integration for multiple products in bulk. This function allows for efficient batch updates. ```python from sellpass import SellPass sp = SellPass(api_key="your-api-key", shop_id=4100) # Bulk update custom fields sp.bulk_edit_product_fields( product_ids=[1234, 1235], custom_fields=[ {"name": "License Type", "value": "Lifetime"}, {"name": "Support", "value": "24/7"} ] ) # Bulk update customer notes sp.bulk_edit_product_notes( product_ids=[1234, 1235], note="Thank you for your purchase! Check your email for delivery." ) # Bulk update visibility sp.bulk_edit_product_visibility( product_ids=[1234, 1235], unlisted=False, private=False, on_hold=False ) # Bulk update Discord integration sp.bulk_edit_product_discord_integration( product_ids=[1234, 1235], discord_social_connect_settings={ "enabled": True, "guildId": "123456789", "roleId": "987654321" } ) ``` -------------------------------- ### FAQ Management Source: https://context7.com/sellpass/python-api-sdk/llms.txt Endpoints for managing shop FAQs. ```APIDOC ## GET /faqs ### Description Retrieve all FAQs. ## POST /faqs ### Description Create a new FAQ. ## PUT /faqs/{faq_id} ### Description Update an existing FAQ. ## DELETE /faqs/{faq_id} ### Description Delete an FAQ. ``` -------------------------------- ### POST /edit_productv2 Source: https://context7.com/sellpass/python-api-sdk/llms.txt Updates an existing product's details. ```APIDOC ## POST /edit_productv2 ### Description Updates the fields of an existing product identified by its ID. ### Request Body - **product_id** (integer) - Required - ID of the product to update - **title** (string) - Optional - New title - **description** (string) - Optional - New description - **short_description** (string) - Optional - New short description - **path** (string) - Optional - New URL path - **seo** (string) - Optional - New SEO title - **variants** (array) - Optional - Updated list of variants ``` -------------------------------- ### Retrieve Order and Invoice Information Source: https://context7.com/sellpass/python-api-sdk/llms.txt Fetch all invoices or specific invoice details from your shop. This is useful for tracking orders and customer transactions. ```python from sellpass import SellPass sp = SellPass(api_key="your-api-key", shop_id=4100) # Get all invoices invoices = sp.get_invoices() for invoice in invoices: print(f"Invoice {invoice['id']}: ${invoice['total']} - {invoice['status']}") # Get specific invoice details invoice = sp.get_invoice(invoice_id="INV-ABC123") print(f"Customer: {invoice['customerEmail']}") print(f"Products: {invoice['items']}") print(f"Status: {invoice['status']}") ``` -------------------------------- ### Products API (v2) Source: https://context7.com/sellpass/python-api-sdk/llms.txt Endpoints for managing digital products within a Sellpass shop using the v2 API. ```APIDOC ## GET /v2/products ### Description Retrieve all products associated with the specified shop ID. ### Method GET ### Endpoint /v2/products ### Response #### Success Response (200) - **products** (array) - List of product objects containing title and price. ``` -------------------------------- ### Manage Feedback Source: https://context7.com/sellpass/python-api-sdk/llms.txt Retrieve customer feedback and respond to specific items. ```python from sellpass import SellPass sp = SellPass(api_key="your-api-key", shop_id=4100) # Get all feedback feedback = sp.get_feedback() for item in feedback: print(f"Rating: {item['rating']}/5 - {item['message']}") # Get specific feedback item item = sp.get_feedback_item(feedback_id=456) # Respond to feedback sp.answer_feedback_item( feedback_id=456, answer="Thank you for your review! We're glad you enjoyed our product." ) ``` -------------------------------- ### Manage Blacklist Source: https://context7.com/sellpass/python-api-sdk/llms.txt Prevent fraud by blocking specific emails, IPs, or countries. ```python from sellpass import SellPass sp = SellPass(api_key="your-api-key", shop_id=4100) # Get blacklist blacklist = sp.get_blacklist() for item in blacklist: print(f"Blocked: {item['data']} - Type: {item['type']}") # Block an email address (type=0) sp.create_blocked_item( data="fraudster@example.com", note="Chargeback on order INV-123", type=0 # 0=email, 1=IP, 2=country ) # Block an IP address (type=1) sp.create_blocked_item( data="192.168.1.100", note="Multiple fraud attempts", type=1 ) # Block a country (type=2) sp.create_blocked_item( data="XX", note="High fraud rate country", type=2 ) ``` ```python from sellpass import SellPass sp = SellPass(api_key="your-api-key", shop_id=4100) # Get specific blocked item item = sp.get_blocked_item(blocked_id=789) # Update blocked item sp.edit_blocked_item( blocked_id=789, data="updated@example.com", note="Updated note", type=0 ) # Remove from blacklist sp.delete_blocked_item(blocked_id=789) ``` -------------------------------- ### Categories API Source: https://context7.com/sellpass/python-api-sdk/llms.txt Organize products into categories, including retrieving, creating, editing, and deleting categories. ```APIDOC ## GET /categories ### Description Get a list of all product categories. ### Method GET ### Endpoint `/categories` ### Response #### Success Response (200) - **name** (string) - The name of the category. - **listingIds** (array) - A list of product IDs within the category. ### Response Example ```json [ { "name": "Software Licenses", "listingIds": [1234, 1235, 1236] } ] ``` ## POST /categories ### Description Create a new product category. ### Method POST ### Endpoint `/categories` ### Parameters #### Request Body - **name** (string) - Required - The name of the category. - **listingIds** (array) - Optional - A list of product IDs to include in the category upon creation. ### Request Example ```json { "name": "Software Licenses", "listingIds": [1234, 1235, 1236] } ``` ## GET /categories/{category_id} ### Description Get details for a specific category. ### Method GET ### Endpoint `/categories/{category_id}` ### Parameters #### Path Parameters - **category_id** (integer) - Required - The ID of the category. ### Response #### Success Response (200) - **name** (string) - The name of the category. - **listingIds** (array) - A list of product IDs within the category. ### Response Example ```json { "name": "Software Licenses", "listingIds": [1234, 1235, 1236] } ``` ## PUT /categories/{category_id} ### Description Update an existing category. ### Method PUT ### Endpoint `/categories/{category_id}` ### Parameters #### Path Parameters - **category_id** (integer) - Required - The ID of the category to update. #### Request Body - **name** (string) - Optional - The new name for the category. - **listingIds** (array) - Optional - A new list of product IDs to associate with the category. ### Request Example ```json { "name": "Digital Software", "listingIds": [1234, 1235, 1237] } ``` ## DELETE /categories/{category_id} ### Description Delete a category. ### Method DELETE ### Endpoint `/categories/{category_id}` ### Parameters #### Path Parameters - **category_id** (integer) - Required - The ID of the category to delete. ### Request Example ```json { "category_id": 101 } ``` ``` -------------------------------- ### Shop Management API Source: https://context7.com/sellpass/python-api-sdk/llms.txt Endpoints for retrieving shop information, creating new shops, and updating shop settings such as name, subdomain, currency, and terms of service. ```APIDOC ## GET /shops ### Description Retrieve all shops associated with the authenticated account. ### Method GET ### Endpoint /shops ## POST /shops ### Description Create a new shop. ### Method POST ### Endpoint /shops ### Request Body - **name** (string) - Required - The name of the new shop. ``` -------------------------------- ### Retrieve Public Shop Data Source: https://context7.com/sellpass/python-api-sdk/llms.txt Accesses public shop information, listings, feedback, and announcements without requiring authentication. ```python from sellpass import SellPass sp = SellPass(api_key="your-api-key", shop_id=4100) # Get public shop information info = sp.get_public_shop_info() print(f"Shop: {info['name']}") print(f"Description: {info['description']}") # Get public listings listings = sp.get_public_shop_listings() for listing in listings: print(f"{listing['title']} - ${listing['price']}") # Get public feedback/reviews feedback = sp.get_public_shop_feedback() for review in feedback: print(f"★{review['rating']} - {review['message']}") # Get public announcements announcements = sp.get_public_shop_announcements() ``` -------------------------------- ### Manage Support Tickets Source: https://context7.com/sellpass/python-api-sdk/llms.txt Handle customer support tickets by retrieving all tickets, fetching specific ticket details, replying to messages, and closing tickets. ```python from sellpass import SellPass sp = SellPass(api_key="your-api-key", shop_id=4100) # Get all tickets tickets = sp.get_tickets() for ticket in tickets: print(f"Ticket #{ticket['id']}: {ticket['subject']} - {ticket['status']}") # Get specific ticket with messages ticket = sp.get_ticket(ticket_id=789) print(f"Subject: {ticket['subject']}") for msg in ticket['messages']: print(f" {msg['sender']}: {msg['content']}") # Reply to ticket sp.answer_ticket( ticket_id=789, message="Thank you for contacting us. Your issue has been resolved." ) # Close ticket sp.close_ticket(ticket_id=789) ``` -------------------------------- ### Product Groups Management Source: https://context7.com/sellpass/python-api-sdk/llms.txt Endpoints for managing featured product collections. ```APIDOC ## GET /groups ### Description Retrieve all product groups. ## POST /groups ### Description Create a new product group. ### Request Body - **title** (string) - Required - Group title. - **description** (string) - Optional - Group description. - **product_ids** (list) - Optional - List of product IDs. - **priority** (int) - Optional - Display order. - **type** (int) - Optional - Group type. - **main** (bool) - Optional - Whether to show on main page. ## GET /groups/{group_id} ### Description Retrieve a specific product group. ## PUT /groups/{group_id} ### Description Update an existing product group. ## PUT /groups/{group_id}/thumbnail ### Description Update the thumbnail image for a group. ## DELETE /groups/{group_id} ### Description Delete a product group. ``` -------------------------------- ### Manage Categories Source: https://context7.com/sellpass/python-api-sdk/llms.txt Perform CRUD operations on shop categories using category IDs. ```python # Get specific category category = sp.get_category(category_id=123) print(f"Category: {category['name']}") # Update category sp.edit_category( category_id=123, name="Premium Software", listingids=[1234, 1235, 1236, 1237] ) # Delete category sp.delete_category(category_id=123) ``` -------------------------------- ### Manage Order Fulfillment and Communication Source: https://context7.com/sellpass/python-api-sdk/llms.txt Perform actions related to order fulfillment and customer communication, such as resending invoice emails or processing orders. ```python from sellpass import SellPass sp = SellPass(api_key="your-api-key", shop_id=4100) # Example usage (actual functions not provided in source) # sp.resend_invoice_email(invoice_id="INV-ABC123") # sp.replace_invoice(invoice_id="INV-ABC123") # sp.process_invoice(invoice_id="INV-ABC123") ``` -------------------------------- ### Coupons API Source: https://context7.com/sellpass/python-api-sdk/llms.txt Manage discount coupons for your shop, including retrieving, creating, editing, and deleting coupons. ```APIDOC ## GET /coupons ### Description Get a list of all coupons available in the shop. ### Method GET ### Endpoint `/coupons` ### Response #### Success Response (200) - **name** (string) - The name or code of the coupon. - **discount** (number) - The discount value (percentage or fixed amount). ### Response Example ```json [ { "name": "SAVE20", "discount": 20.0 } ] ``` ## POST /coupons ### Description Create a new coupon. ### Method POST ### Endpoint `/coupons` ### Parameters #### Request Body - **name** (string) - Required - The name or code for the coupon. - **discount** (number) - Required - The discount value. - **is_fixed** (boolean) - Required - True for a fixed amount discount, False for a percentage discount. - **note** (string) - Optional - A note about the coupon. - **start_date** (string) - Optional - The start date for the coupon (ISO 8601 format). - **end_date** (string) - Optional - The end date for the coupon (ISO 8601 format). - **max_uses** (integer) - Optional - The maximum number of times the coupon can be used. - **restrict_to_products** (array) - Optional - A list of product IDs to restrict the coupon to. - **restrict_to_gateways** (array) - Optional - A list of gateway IDs to restrict the coupon to. ### Request Example (Percentage Discount) ```json { "name": "SAVE20", "discount": 20.0, "is_fixed": false, "note": "20% off promotion", "start_date": "2024-01-01T00:00:00Z", "end_date": "2024-01-31T23:59:59Z", "max_uses": 100 } ``` ### Request Example (Fixed Amount Discount) ```json { "name": "10OFF", "discount": 10.0, "is_fixed": true, "note": "$10 off any purchase", "restrict_to_products": [1234, 1235], "restrict_to_gateways": ["stripe", "paypal"], "max_uses": 50 } ``` ## GET /coupons/{coupon_id} ### Description Get details for a specific coupon. ### Method GET ### Endpoint `/coupons/{coupon_id}` ### Parameters #### Path Parameters - **coupon_id** (integer) - Required - The ID of the coupon. ### Response #### Success Response (200) - **maxUses** (integer) - The maximum number of uses allowed for the coupon. - **usedCount** (integer) - The number of times the coupon has been used. ### Response Example ```json { "name": "SAVE20", "discount": 20.0, "is_fixed": false, "maxUses": 100, "usedCount": 10 } ``` ## PUT /coupons/{coupon_id} ### Description Update an existing coupon. ### Method PUT ### Endpoint `/coupons/{coupon_id}` ### Parameters #### Path Parameters - **coupon_id** (integer) - Required - The ID of the coupon to update. #### Request Body - **name** (string) - Optional - The new name or code for the coupon. - **discount** (number) - Optional - The new discount value. - **is_fixed** (boolean) - Optional - True for a fixed amount discount, False for a percentage discount. - **note** (string) - Optional - A new note about the coupon. - **max_uses** (integer) - Optional - The new maximum number of uses. ### Request Example ```json { "name": "SAVE25", "discount": 25.0, "is_fixed": false, "note": "Updated to 25% off", "max_uses": 200 } ``` ## DELETE /coupons/{coupon_id} ### Description Delete a coupon. ### Method DELETE ### Endpoint `/coupons/{coupon_id}` ### Parameters #### Path Parameters - **coupon_id** (integer) - Required - The ID of the coupon to delete. ### Request Example ```json { "coupon_id": 567 } ``` ``` -------------------------------- ### Feedback Management Source: https://context7.com/sellpass/python-api-sdk/llms.txt Endpoints for managing customer reviews. ```APIDOC ## GET /feedback ### Description Retrieve all feedback. ## GET /feedback/{feedback_id} ### Description Retrieve a specific feedback item. ## POST /feedback/{feedback_id}/answer ### Description Respond to a customer feedback item. ``` -------------------------------- ### Category Management Source: https://context7.com/sellpass/python-api-sdk/llms.txt Endpoints for retrieving, updating, and deleting product categories. ```APIDOC ## GET /categories/{category_id} ### Description Retrieve details of a specific category. ### Parameters #### Path Parameters - **category_id** (int) - Required - The ID of the category. ## PUT /categories/{category_id} ### Description Update an existing category. ### Parameters #### Path Parameters - **category_id** (int) - Required - The ID of the category. #### Request Body - **name** (string) - Optional - New name for the category. - **listingids** (list) - Optional - List of product listing IDs to associate. ## DELETE /categories/{category_id} ### Description Delete a specific category. ### Parameters #### Path Parameters - **category_id** (int) - Required - The ID of the category. ``` -------------------------------- ### Blacklist Management Source: https://context7.com/sellpass/python-api-sdk/llms.txt Endpoints for managing fraud prevention via email, IP, or country blocking. ```APIDOC ## GET /blacklist ### Description Retrieve all blocked items. ## POST /blacklist ### Description Block an item (email, IP, or country). ### Request Body - **data** (string) - Required - The value to block. - **note** (string) - Optional - Reason for blocking. - **type** (int) - Required - 0=email, 1=IP, 2=country. ## GET /blacklist/{blocked_id} ### Description Retrieve a specific blocked item. ## PUT /blacklist/{blocked_id} ### Description Update a blocked item. ## DELETE /blacklist/{blocked_id} ### Description Remove an item from the blacklist. ``` -------------------------------- ### Replace Invoice Items Source: https://context7.com/sellpass/python-api-sdk/llms.txt Replace items within an existing invoice, useful for correcting issues like a bad license key. Requires invoice ID, part invoice ID, and quantity. ```python sp.replace_invoice( invoice_id="INV-ABC123", part_invoice_id=5678, quantity=1 ) ``` -------------------------------- ### Customers Management API Source: https://context7.com/sellpass/python-api-sdk/llms.txt Access customer data and statistics, including retrieving lists of customers, individual customer details, and their IP addresses. ```APIDOC ## GET /customers ### Description Get customer statistics for the shop. ### Method GET ### Endpoint `/customers` ### Response #### Success Response (200) - **totalCustomers** (integer) - The total number of customers. - **returningCustomers** (integer) - The number of returning customers. ### Response Example ```json { "totalCustomers": 1500, "returningCustomers": 750 } ``` ## GET /customer/{customer_id} ### Description Get details for a specific customer. ### Method GET ### Endpoint `/customer/{customer_id}` ### Parameters #### Path Parameters - **customer_id** (integer) - Required - The ID of the customer. ### Response #### Success Response (200) - **email** (string) - The customer's email address. - **totalSpent** (number) - The total amount spent by the customer. - **orderCount** (integer) - The number of orders placed by the customer. ### Response Example ```json { "email": "customer@example.com", "totalSpent": 125.50, "orderCount": 5 } ``` ## GET /customer/{customer_id}/ips ### Description Get a list of IP addresses associated with a customer, useful for fraud prevention. ### Method GET ### Endpoint `/customer/{customer_id}/ips` ### Parameters #### Path Parameters - **customer_id** (integer) - Required - The ID of the customer. ### Response #### Success Response (200) - **address** (string) - The IP address. - **lastUsed** (string) - The timestamp when the IP address was last used. ### Response Example ```json [ { "address": "192.168.1.1", "lastUsed": "2023-10-27T10:00:00Z" } ] ``` ```