Automated Importing of Amazon Sellercentral Orders via gmail API?
Is anyone interested in collaborating on importing amazon orders in as-automated-process-as-possible to within a zen-cart framework?
Current dev game-plan:
//sync productid or product model as seller sku > asin (add asin field within products table)
////pull data from amazon into a zen-cart order
//use tampermonkey browser add-on to scrape/populate data from order page and push to (operating system's) clipboard? (or to a page in the admin (or straight to the shopping cart if you use my admin-on-catalog-side browser cookie hack)
(similar to: https://gist.github.com/jacenko/a9b7...d44276e103ca3e)
//submit order under [email protected] email account
Future-istic game-plan:
//use gmail api to scrap "your earnings" email w/ exact figures (note missing data amount paid for shipping in amazon sellercentral (if shipping was purchased through amazon)
//use casperjs or amazon api to gather amount paid for shipping
//calculate actual purchase price by "your earnings" - "shipping actually purchased" = "final retail price"
//if you have cost data in zen-cart you can then calculate your profit on the order (I have hacks that do this that aren't core within super-orders and from the profit margin calculator add-on)
note: I realize this is a high degree of specificity/customization for an open-source community so my current expectations are low.
any suggestions/pseudo code welcome. (:
Re: Automated Importing of Amazon Sellercentral Orders via gmail API?
Why would you want to build this? Is it so that you can use Zen-Cart as master inventory tracking? Is it because you use Zen-Cart as your shipping solution?
Re: Automated Importing of Amazon Sellercentral Orders via gmail API?
Quote:
Originally Posted by
lindasdd
Why would you want to build this? Is it so that you can use Zen-Cart as master inventory tracking? Is it because you use Zen-Cart as your shipping solution?
Yes, I currently use zen-cart as my inventory mgmt system. I currently ship through the marketplace's that we've sold through. And if our zen-cart store gets a sale I create them on the USPS, UPS, or Fedex sites manually. I haven't received a level of sales that I need a better shipping solution, but hope to increase them soon. (:
Re: Automated Importing of Amazon Sellercentral Orders via gmail API?
So I'd like to share the code for this approach via GitHub, however I was thinking I should smooth out the logging into your gmail first.
I'm currently stuck on the token.json file getting created successfully, because I'm trying to place it in YOUR_ADMIN and the chmod permissions are 0755 instead of 0777.
Should I put the token.json in the root "public_html" ? Any thoughts?
Here's how the google api code generates the "token.json" file:
PHP Code:
file_put_contents($tokenPath, json_encode($client->getAccessToken()));
It works as it should on my localhost machine, just not on my shared hosting atm.
Re: Automated Importing of Amazon Sellercentral Orders via gmail API?
Quote:
Originally Posted by
wolfderby
So I'd like to share the code for this approach via GitHub, however I was thinking I should smooth out the logging into your gmail first.
I'm currently stuck on the token.json file getting created successfully, because I'm trying to place it in YOUR_ADMIN and the chmod permissions are 0755 instead of 0777.
Should I put the token.json in the root "public_html" ? Any thoughts?
Here's how the google api code generates the "token.json" file:
PHP Code:
file_put_contents($tokenPath, json_encode($client->getAccessToken()));
It works as it should on my localhost machine, just not on my shared hosting atm.
Got it! (: now I will clean it up a bit!
Re: Automated Importing of Amazon Sellercentral Orders via gmail API?
Quote:
Originally Posted by
wolfderby
Should I put the token.json in the root "public_html" ? Any thoughts?
NO! That token is basically a password alternative.
Never put a sensitive file like that in the root of your site! Bots are always crawling for those kinds of things hoping to find something they can use to get access they shouldn't have.
Put it in the directory "above" public_html so that nobody can ever read it via a web browser.
And probably call it gmail_token.json or something specific to its purpose so that you know not to delete it when cleaning up things above public_html.
Re: Automated Importing of Amazon Sellercentral Orders via gmail API?
Quote:
Originally Posted by
DrByte
NO! That token is basically a password alternative.
Never put a sensitive file like that in the root of your site! Bots are always crawling for those kinds of things hoping to find something they can use to get access they shouldn't have.
Put it in the directory "above" public_html so that nobody can ever read it via a web browser.
And probably call it gmail_token.json or something specific to its purpose so that you know not to delete it when cleaning up things above public_html.
Got it. Thanks, yeah I was able to keep it in the admin, turned out I had an issue w/ the secret in the credentials.json file being incorrect.