# How to Connect Amazon Seller

## Overview

Automation Studio supports Amazon Seller integration for managing orders, inventory, and tracking via the Amazon Selling Partner API.

## Step 1: Set Up Amazon Selling Partner API

1. Go to [Amazon Seller Central](https://sellercentral.amazon.com/)
2. Navigate to "Apps & Services" → "Develop Apps"
3. Create a new application
4. Get your:
   - LWA (Login with Amazon) Client ID
   - Client Secret
   - Refresh Token
5. Note your Seller ID and Marketplace ID

## Step 2: Add Integration in Automation Studio

1. Open Automation Studio
2. Click the **🔗 Registry** button (top-right)
3. Click **+ Add Integration**
4. Select **Amazon Seller** as the provider
5. Enter a name (e.g., "US Marketplace")
6. Enter your Amazon API credentials:
   - Client ID
   - Client Secret
   - Refresh Token
   - Seller ID
   - Marketplace ID (e.g., ATVPDKIKX0DER for US)
7. Click **Save**
8. Click **Test** to verify the connection

## Step 3: Use in Flows

1. In Flow Builder, add a **Vendor** node
2. In the node configuration:
   - Select **Amazon** as the vendor provider
   - Select your Amazon integration from the dropdown
   - Choose operation:
     - **getOrders**: Retrieve orders from Amazon
     - **updateTracking**: Update shipment tracking for an order
     - **updateInventory**: Update product inventory levels
3. Configure operation-specific fields
4. Save and test your flow

## Example Flow

**Amazon Order → Shipment:**
1. Trigger: Schedule (daily check for new orders)
2. Vendor Node: Amazon getOrders
3. For each order:
   - Vendor Node: UPS createShipment
   - Vendor Node: Amazon updateTracking
   - Email Node: Send tracking to customer

## Testing

Use the **Test** button to verify Amazon API connection.

## Troubleshooting

- **OAuth token expired**: Refresh token using LWA
- **Invalid marketplace**: Verify Marketplace ID
- **Rate limits**: Amazon has strict rate limits; implement retry logic

## Security

- OAuth credentials stored securely
- Never expose credentials
- Rotate refresh tokens periodically

