feat: Integrate Amazon SP-API for product sellability and pricing

- Added `amazon-sp-api` dependency to package.json.
- Enhanced configuration to include SP-API credentials and settings.
- Implemented SP-API client initialization and error handling in sp-api.ts.
- Developed functions to fetch product sellability and pricing data.
- Updated main processing logic in index.ts to incorporate sellability checks before fetching pricing.
- Modified LLM analysis to account for sellability status and reasons.
- Created a new sp-test.ts script for testing SP-API connectivity and sellability.
- Updated types.ts to define SellabilityInfo and extend SpApiData.
- Enhanced result reporting in writer.ts to include sellability information.
This commit is contained in:
Victor Noguera
2026-04-08 21:33:43 -04:00
parent 2e626ce1f3
commit 53901e4dde
11 changed files with 1133 additions and 53 deletions

View File

@@ -42,7 +42,13 @@ export interface KeepaData {
categoryTree: string[];
}
export interface SpApiData {
export type SellabilityInfo = {
canSell: boolean | null;
sellabilityStatus: "available" | "restricted" | "not_available" | "unknown";
sellabilityReason?: string;
};
export interface SpApiData extends SellabilityInfo {
fbaFee: number;
fbmFee: number;
referralFeePercent: number;