Skip to content
This repository has been archived by the owner on Jul 26, 2023. It is now read-only.

How to handle multiple Amazon accounts? #27

Open
otherjoel opened this issue May 12, 2021 · 1 comment
Open

How to handle multiple Amazon accounts? #27

otherjoel opened this issue May 12, 2021 · 1 comment

Comments

@otherjoel
Copy link

My spouse and I have separate Amazon accounts, but all purchases for both accounts are charged to the same credit card account.

It looks like in order to use this tool I would need to run it twice, once for my Amazon account and once for hers. Are there any gotchas I should look out for?

@vjjft
Copy link

vjjft commented May 20, 2022

In case anyone comes across this issue:

I use this tool with two Amazon accounts by setting different ---cache-dir values for each Amazon account.

Additionally, I choose to use two YNAB accounts for easier review and decreased chance of dropping duplicate transactions (which could otherwise occur if both Amazon accounts order the same product on the same day).

Following here is a basic shell script (Bash) that I use, with no external configuration file

note: You may need to change the --cache-dir value depending on how you have the utility installed. (I have amazon-ynab-sync installed locally via NPM)

runSync(){
  local accountNameBase="Amazon Sync"
  local ynabAccessToken="__________"
  local ynabBudgetName="Main Budget"
  npx amazon-ynab-sync \
    --cache-dir "./cache/${user}" \
    --ynab-access-token "${ynabAccessToken}" \
    --ynab-budget-name "${ynabBudgetName}" \
    --ynab-account-name "${accountNameBase} ${accountNameLetter}" \
    --amazon-username $user \
    --amazon-password  $pass \
    ${cliOptions} \
    ; 
}

# cliOptions="--log-level silly --debug-mode"

user="[email protected]"
pass="XXXXXXXX"
accountNameLetter="A"
runSync

user="[email protected]"
pass="YYYYYYYY"
accountNameLetter="B"
runSync

For the passwords, I recommend following the instructions provided in the README: https://github.com/starsprung/amazon-ynab-sync#providing-login-credentials-non-interactively

If you are using LastPass and have multiple entries under 'amazon.com': You can either rename them, or use $( lpass show --password <UNIQUEID> ) which specifies a UNIQUEID (see man lpass) which can be found using lpass show amazon.com and repeated lpass show --username <id> )

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants