import sys import pprint from ebay_api import EbayAPI api = EbayAPI(sys.argv[1]) try: sku = sys.argv[3] except IndexError: sku = None r = api.relist_fixed_price_item(sys.argv[2], sku=sku) pprint.pprint(r.dict())
import sys import time from ebay_api import EbayAPI storefront = sys.argv[1] assert storefront in ('old_glory', 'animalworld') api = EbayAPI(storefront) job_id = api.create_active_inventory_report() for i in range(4): time.sleep(120) file_reference_id = api.get_job_status_request(job_id) if file_reference_id: break else: print 'unable to get a file reference id' api.download_file(job_id, file_reference_id)
import datetime import sys from ebaysdk.exception import ConnectionError sys.path.insert(0, '..') from ebay_api import EbayAPI from iMerchandise.connection import iMerchConnection storefront = sys.argv[1] conn = iMerchConnection() api = EbayAPI(storefront) if storefront == 'animalworld': storefront_id = 2 elif storefront == 'old_glory': storefront_id = 1 else: print 'incorrect storefront' sys.exit(1) # last_update_date_file_name = 'last_update_date.txt' # with open(last_update_date_file_name, 'r') as f: # last_update_date = f.read() # query = """select ps.sku, pi.quantity as `actual_quantity`, ps.name, ps.value, ps.ebay_parent_child, ps.item_id, p.producttype, # if(p.productstatus = 'R1', # if(if(pi.virtual_stock_allowed = 'Y', pi.virtual_quantity, pi.Quantity) <= (select if(r1_enabled = 1, r1_limit, 9999) from feedersettings.threshold_settings where channel_id = 4 and storefront_id = %(storefront_id)s), 0, if(pi.virtual_stock_allowed = 'Y', pi.virtual_quantity, pi.Quantity)) , # if(if(pi.virtual_stock_allowed = 'Y', pi.virtual_quantity, pi.Quantity) <= (select if(c1_enabled = 1, c1_limit, 9999) from feedersettings.threshold_settings where channel_id = 4 and storefront_id = %(storefront_id)s), 0, if(pi.virtual_stock_allowed = 'Y', pi.virtual_quantity, pi.Quantity))) as quantity,
'Name': 'Size', 'Value': 'XL', } } }, 'Variation': { 'Quantity': '9', 'SKU': '1970-L', 'StartPrice': '9.95', 'VariationSpecifics': { 'NameValueList': { 'Name': 'Size', 'Value': 'L', } } }, 'VariationSpecificsSet': { 'NameValueList': { 'Name': 'Size', 'Value': 'XL', 'Value': 'L', } }, } } } ebay_api = EbayAPI() response = ebay_api.add_fixed_price_item(variation_item_data) print response.dict()
import sys storefront = sys.argv[1].lower() if storefront == 'old_glory': storefront_id = 1 elif storefront == 'animalworld': storefront_id = 2 from ebay_api import EbayAPI from iMerchandise.connection import iMerchConnection from iMerchandise.tracking import get_shipment_info_for_channel api = EbayAPI(storefront) conn = iMerchConnection() results = conn.get_shipped_orders_not_sent('ebay', storefront) if not results: print 'no orders ready yet' sys.exit(0) external_ids = set([row['external_id'] for row in results]) for external_id in external_ids: conn.cursor.execute( "SELECT ebay_item_id, ebaytransactionid, sku FROM sales_order_table WHERE external_id = %s;", (external_id, )) ebay_ids = conn.cursor.fetchall() trackinginfo = conn.get_tracking_info(external_id, 'ebay', storefront)
import sys import pprint from ebay_api import EbayAPI api = EbayAPI(sys.argv[1]) r = api.end_item(sys.argv[2]) pprint.pprint(r.dict())
import sys import pprint from ebay_api import EbayAPI api = EbayAPI(sys.argv[1]) r = api.get_item_by_id(sys.argv[2]) pprint.pprint(r.dict())
def get_all_upload_jobs(): api = EbayAPI('old_glory') api.get_all_created_jobs()