Esempio n. 1
0
#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:
    SKU = [variant[0]]
    print '--------------------------------------------'
Esempio n. 2
0
#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':
            getattr(order, 'LatestShipDate', "Unknown"),
Esempio n. 3
0
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': getattr(order, 'LatestShipDate', "Unknown"),
Esempio n. 4
0
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')
Esempio n. 5
0
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)
Esempio n. 6
0
import datetime

###################################
#Return a result set
###################################

today = datetime.datetime.now()
print today.strftime("%Y-%m-%d")

AccessKeyID = 'ACCESS KEY'
merchant_id = 'MERCHANT ID'
SecretKey = 'SECRET KEY'
conn = MWSConnection(AccessKeyID, SecretKey)
conn.SellerId = 'SELLER ID'
conn.Merchant = 'MERCHANT NAME'
conn.MarketplaceId = 'MARKETPLACE ID'
marketplaceId = 'MARKETPLACE ID'

result = conn.list_inventory_supply(
    QueryStartDateTime='2017-07-01')  #Gets First Page
r = result.ListInventorySupplyResult.InventorySupplyList
inventory = []
for item in r:
    print item
    #exit()
    oh_units = item.InStockSupplyQuantity
    ttl_units = item.TotalSupplyQuantity
    ASIN = item.ASIN
    Variant = item.SellerSKU
    inventory.append([ASIN, Variant, oh_units, ttl_units])