Amazon Business API integration replacing browser automation
- Add amazon_api.py with Reconciliation + Document API client - OAuth flow with manual code exchange for local installations - Dual mode: API (recommended) or Browser automation (fallback) - New settings: amazon_app_id, amazon_client_id, amazon_client_secret, amazon_refresh_token - Platform UI with mode switcher, API credential fields, OAuth button - Scheduler supports both API and browser modes - README with full Amazon API setup guide - httpx added for async HTTP requests Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
+7
-1
@@ -10,7 +10,7 @@ logger = logging.getLogger(__name__)
|
||||
|
||||
_fernet = None
|
||||
|
||||
ENCRYPTED_KEYS = {"imap_password", "smtp_password", "smb_password", "amazon_password"}
|
||||
ENCRYPTED_KEYS = {"imap_password", "smtp_password", "smb_password", "amazon_password", "amazon_client_secret", "amazon_refresh_token"}
|
||||
|
||||
DEFAULT_SETTINGS = {
|
||||
"imap_server": "",
|
||||
@@ -53,6 +53,12 @@ DEFAULT_SETTINGS = {
|
||||
"amazon_domain": "amazon.de",
|
||||
"amazon_last_sync": "",
|
||||
"amazon_since_date": "",
|
||||
# Amazon API (SP-API / Business API)
|
||||
"amazon_app_id": "", # amzn1.sp.solution.xxxxx (from Developer Portal)
|
||||
"amazon_client_id": "", # amzn1.application-oa2-client.xxxxx (LWA Client ID)
|
||||
"amazon_client_secret": "", # LWA Client Secret
|
||||
"amazon_refresh_token": "",
|
||||
"amazon_mode": "browser", # "browser" or "api"
|
||||
# Debug
|
||||
"debug_save_amazon_pdfs": "false",
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user