Results 1 to 7 of 7
  1. #1
    Join Date
    Dec 2008
    Location
    Pittsburgh, PA
    Posts
    237
    Plugin Contributions
    1

    Default 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. (:
    Last edited by wolfderby; 13 Dec 2020 at 11:25 PM. Reason: i suck at communicating

  2. #2
    Join Date
    Jun 2007
    Posts
    474
    Plugin Contributions
    2

    Default 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?

  3. #3
    Join Date
    Dec 2008
    Location
    Pittsburgh, PA
    Posts
    237
    Plugin Contributions
    1

    Default Re: Automated Importing of Amazon Sellercentral Orders via gmail API?

    Quote Originally Posted by lindasdd View Post
    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. (:

  4. #4
    Join Date
    Dec 2008
    Location
    Pittsburgh, PA
    Posts
    237
    Plugin Contributions
    1

    Default 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($tokenPathjson_encode($client->getAccessToken())); 
    It works as it should on my localhost machine, just not on my shared hosting atm.

  5. #5
    Join Date
    Dec 2008
    Location
    Pittsburgh, PA
    Posts
    237
    Plugin Contributions
    1

    Default Re: Automated Importing of Amazon Sellercentral Orders via gmail API?

    Quote Originally Posted by wolfderby View Post
    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($tokenPathjson_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!

  6. #6
    Join Date
    Jan 2004
    Posts
    66,364
    Blog Entries
    7
    Plugin Contributions
    274

    Default Re: Automated Importing of Amazon Sellercentral Orders via gmail API?

    Quote Originally Posted by wolfderby View Post
    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.
    .

    Zen Cart - putting the dream of business ownership within reach of anyone!
    Donate to: DrByte directly or to the Zen Cart team as a whole

    Remember: Any code suggestions you see here are merely suggestions. You assume full responsibility for your use of any such suggestions, including any impact ANY alterations you make to your site may have on your PCI compliance.
    Furthermore, any advice you see here about PCI matters is merely an opinion, and should not be relied upon as "official". Official PCI information should be obtained from the PCI Security Council directly or from one of their authorized Assessors.

  7. #7
    Join Date
    Dec 2008
    Location
    Pittsburgh, PA
    Posts
    237
    Plugin Contributions
    1

    Default Re: Automated Importing of Amazon Sellercentral Orders via gmail API?

    Quote Originally Posted by DrByte View Post
    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.

 

 

Similar Threads

  1. Is there an automated way to remove discontinued products via a feed?
    By floridaguy43 in forum Setting Up Categories, Products, Attributes
    Replies: 3
    Last Post: 2 Jan 2015, 02:40 AM
  2. Integration with Amazon via FBA/FWS
    By bgroup99 in forum General Questions
    Replies: 8
    Last Post: 26 Jan 2009, 07:05 AM
  3. Replies: 0
    Last Post: 25 Jun 2008, 11:35 AM
  4. Automated Backup via CRON ??
    By Netsmurf in forum General Questions
    Replies: 4
    Last Post: 14 May 2007, 06:05 PM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
disjunctive-egg
Zen-Cart, Internet Selling Services, Klamath Falls, OR