################################### #results = sql.executeScriptsFromFile('N:\Planning\John\SQL Queries\Python Queries\\sql_test_files.sql') #print "hello world" today = datetime.datetime.now() #print today.strftime("%Y-%m-%d") #exit() AccessKeyID = 'ACCESS KEY' SecretKey = 'SECRET KEY' merchant_id = 'SELLER ID' marketplaceId = 'MARKETPLACE' conn = MWSConnection(AccessKeyID, SecretKey) conn.SellerId = 'SELLER ID' conn.Merchant = 'MERCHANT NAME' conn.MarketplaceId = 'MARKETPLACE' #https://docs.developer.amazonservices.com/en_US/dev_guide/DG_Endpoints.html variants = tera.runQuery( "select * from list_of_top_sellers where sales >= '1000' " ) #where upc = '190528763607' #print variants #variants = [190528763294, 190528763379] print type(variants) x = 0 records = len(variants) for variant in variants:
#payload = {'amazonorderid':'123123123123'} url = 'https://api.fieldbook.com/v1/56733a810c342f030073c9d9/orders' itemUrl = 'https://api.fieldbook.com/v1/56733a810c342f030073c9d9/orderitems' headers = {'content-type': 'application/json', 'accept': 'application/json'} accessKey = "accessKey" merchantID = "merchantID" marketplaceID = "marketplaceID" secretKey = "secretKey" mws = MWSConnection(accessKey, secretKey) mws.Merchant = merchantID mws.SellerId = merchantID mws.MarketplaceId = marketplaceID while month < 13: response = mws.list_orders(CreatedAfter='2015-12-01T00:00:00Z', MarketplaceId=[marketplaceID]) #if month>9: #response = mws.list_orders(CreatedAfter = '2015-10-01T00:00:00Z', MarketplaceId = [marketplaceID]) orders = response.ListOrdersResult.Orders.Order for order in orders: payload = { 'amazonorderid': getattr(order, 'LatestShipDate', "Unknown"), 'latestshipdate':
import boto from boto.mws.connection import MWSConnection MarketPlaceID = 'MARKETPLACE_ID' MerchantID = 'MERCHANT_ID' AccessKeyID = 'ACCESS_KEY' SecretKey = 'SECRET_KEY' conn = MWSConnection( aws_access_key_id=AccessKeyID, aws_secret_access_key=SecretKey) conn.SellerId = MerchantID conn.Merchant = MerchantID conn.MarketplaceId = MarketPlaceID request = conn.list_inventory_supply(QueryStartDateTime='2015-04-01')
url = 'https://api.fieldbook.com/v1/56733a810c342f030073c9d9/orders' itemUrl = 'https://api.fieldbook.com/v1/56733a810c342f030073c9d9/orderitems' headers = {'content-type': 'application/json', 'accept': 'application/json'} accessKey = "accessKey" merchantID = "merchantID" marketplaceID = "marketplaceID" secretKey = "secretKey" mws = MWSConnection(accessKey, secretKey) mws.Merchant = merchantID mws.SellerId = merchantID mws.MarketplaceId = marketplaceID while month < 13: response = mws.list_orders(CreatedAfter = '2015-12-01T00:00:00Z', MarketplaceId = [marketplaceID]) #if month>9: #response = mws.list_orders(CreatedAfter = '2015-10-01T00:00:00Z', MarketplaceId = [marketplaceID]) orders = response.ListOrdersResult.Orders.Order for order in orders: payload = {'amazonorderid' : getattr(order, 'LatestShipDate', "Unknown"),
from boto.mws.connection import MWSConnection import csv import cred import importtos3 import datetime MarketPlaceID = cred.marketplaceid() MerchantID = cred.merchantid() AccessKeyID = cred.accessid() SecretKey = cred.secretkey() mws = MWSConnection(AccessKeyID, SecretKey) mws.SellerId = MerchantID mws.Merchant = MerchantID mws.MarketplaceId = MarketPlaceID def Flat_File_Open_Listings_Data(yesterday, tomorrow): d = mws.get_report_request_list( MaxCount=1, ReportTypeList=['_GET_FLAT_FILE_OPEN_LISTINGS_DATA_'], RequestedFromDate=yesterday, RequestedToDate=tomorrow) data = "" for i in d.GetReportRequestListResult.ReportRequestInfo: #print "\n\n----------------",i.ReportType,i.GeneratedReportId,"-------------------------" if (i.ReportType != "FeedSummaryReport"): reportid = str(i.GeneratedReportId) report = mws.get_report(ReportId=reportid)