# saleweaver/python-amazon-sp-api architecture

> Architecture diagram of the GitHub repository saleweaver/python-amazon-sp-api, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-10-20). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/saleweaver/python-amazon-sp-api
- Repository: https://github.com/saleweaver/python-amazon-sp-api

## Overview

This repository is a Python wrapper for Amazon’s Selling Partner API, offering synchronous and asyncio clients. A caller creates a service client and invokes an endpoint method; the client obtains authorization, sends an HTTP request, and returns a response wrapper. The API surface spans seller, catalog, order, fulfillment, finance, and vendor workflows, alongside reports, feeds, and analytics. The tree and README establish these capability areas; sampled source shows client, authentication, transport, and endpoint behavior. Many individual API modules were not sampled, so their internal links are not asserted.

Main entry points: [`sp_api/base/client.py`](https://github.com/saleweaver/python-amazon-sp-api/blob/master/sp_api/base/client.py) (Sync client), [`sp_api/asyncio/base/client.py`](https://github.com/saleweaver/python-amazon-sp-api/blob/master/sp_api/asyncio/base/client.py) (Async client), [`sp_api/api/services/services.py`](https://github.com/saleweaver/python-amazon-sp-api/blob/master/sp_api/api/services/services.py) (Home services), [`sp_api/api/reports`](https://github.com/saleweaver/python-amazon-sp-api/tree/master/sp_api/api/reports) (Reports and feeds)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_clients["Client runtime"]
  node_sync["Sync client<br/>[client.py]"]
  node_async["Async client<br/>[client.py]"]
  node_auth["Access tokens"]
  node_async_auth["Async tokens"]
  node_transport["HTTP transport"]
  node_async_transport["Async transport"]
  node_response["API response<br/>[ApiResponse.py]"]
  node_versioning["Version dispatch"]
end

subgraph group_commerce["Seller commerce"]
  node_catalog_listings["Catalog and listings"]
  node_orders_sales["Orders and sales"]
  node_seller_finance["Finance and invoices"]
  node_account_apps["Seller and app management"]
end

subgraph group_operations["Fulfillment operations"]
  node_inbound["Inbound fulfillment"]
  node_outbound["Outbound fulfillment"]
  node_inventory["Inventory services"]
  node_shipping["Shipping services"]
  node_services["Home services<br/>[services.py]"]
end

subgraph group_insights["Data and reporting"]
  node_reports["Reports and feeds"]
  node_analytics["Data Kiosk"]
  node_notifications["Notifications"]
end

subgraph group_vendor["Vendor operations"]
  node_vendor_orders["Vendor orders"]
  node_vendor_fulfillment["Vendor fulfillment"]
end

node_developer(("API caller"))
node_amazon{{"Amazon SP-API"}}
node_lwa{{"Amazon LWA"}}

node_developer -->|"calls endpoints"| node_sync
node_developer -->|"awaits endpoints"| node_async
node_sync -->|"gets token"| node_auth
node_sync -->|"sends request"| node_transport
node_async -->|"gets token"| node_async_auth
node_async -->|"sends request"| node_async_transport
node_auth -->|"requests token"| node_lwa
node_async_auth -->|"requests token"| node_lwa
node_transport -.->|"sends HTTP"| node_amazon
node_async_transport -.->|"sends HTTP"| node_amazon
node_catalog_listings -.->|"uses client"| node_sync
node_orders_sales -->|"uses client"| node_sync
node_reports -->|"uses client"| node_sync
node_analytics -->|"uses client"| node_sync
node_reports -->|"uses client"| node_async
node_inbound -->|"inherits client"| node_sync
node_services -->|"calls request"| node_sync
node_services -->|"calls request"| node_async
node_sync -->|"parses response"| node_response
node_async -->|"parses response"| node_response
node_versioning -->|"dispatches versions"| node_vendor_fulfillment

click node_sync "https://github.com/saleweaver/python-amazon-sp-api/blob/master/sp_api/base/client.py"
click node_async "https://github.com/saleweaver/python-amazon-sp-api/blob/master/sp_api/asyncio/base/client.py"
click node_auth "https://github.com/saleweaver/python-amazon-sp-api/blob/master/sp_api/auth/access_token_client.py"
click node_async_auth "https://github.com/saleweaver/python-amazon-sp-api/blob/master/sp_api/asyncio/auth/access_token_client.py"
click node_transport "https://github.com/saleweaver/python-amazon-sp-api/blob/master/sp_api/base/_transport_httpx.py"
click node_async_transport "https://github.com/saleweaver/python-amazon-sp-api/blob/master/sp_api/asyncio/base/_transport_httpx.py"
click node_response "https://github.com/saleweaver/python-amazon-sp-api/blob/master/sp_api/base/ApiResponse.py"
click node_versioning "https://github.com/saleweaver/python-amazon-sp-api/blob/master/sp_api/util/versioned_client.py"
click node_catalog_listings "https://github.com/saleweaver/python-amazon-sp-api/tree/master/sp_api/api/catalog_items"
click node_orders_sales "https://github.com/saleweaver/python-amazon-sp-api/tree/master/sp_api/api/orders"
click node_seller_finance "https://github.com/saleweaver/python-amazon-sp-api/tree/master/sp_api/api/finances"
click node_account_apps "https://github.com/saleweaver/python-amazon-sp-api/tree/master/sp_api/api/sellers"
click node_inbound "https://github.com/saleweaver/python-amazon-sp-api/blob/master/sp_api/api/fulfillment_inbound/fulfillment_inbound_2024_03_20.py"
click node_outbound "https://github.com/saleweaver/python-amazon-sp-api/tree/master/sp_api/api/fulfillment_outbound"
click node_inventory "https://github.com/saleweaver/python-amazon-sp-api/tree/master/sp_api/api/inventories"
click node_shipping "https://github.com/saleweaver/python-amazon-sp-api/tree/master/sp_api/api/shipping"
click node_reports "https://github.com/saleweaver/python-amazon-sp-api/tree/master/sp_api/api/reports"
click node_analytics "https://github.com/saleweaver/python-amazon-sp-api/tree/master/sp_api/api/data_kiosk"
click node_notifications "https://github.com/saleweaver/python-amazon-sp-api/tree/master/sp_api/api/notifications"
click node_vendor_orders "https://github.com/saleweaver/python-amazon-sp-api/tree/master/sp_api/api/vendor_orders"
click node_vendor_fulfillment "https://github.com/saleweaver/python-amazon-sp-api/blob/master/sp_api/api/vendor_direct_fulfillment_orders/vendor_direct_fulfillment_orders_2021_12_28.py"
click node_services "https://github.com/saleweaver/python-amazon-sp-api/blob/master/sp_api/api/services/services.py"

classDef toneNeutral fill:#f8fafc,stroke:#334155,stroke-width:1.5px,color:#0f172a
classDef toneBlue fill:#dbeafe,stroke:#2563eb,stroke-width:1.5px,color:#172554
classDef toneAmber fill:#fef3c7,stroke:#d97706,stroke-width:1.5px,color:#78350f
classDef toneMint fill:#dcfce7,stroke:#16a34a,stroke-width:1.5px,color:#14532d
classDef toneRose fill:#ffe4e6,stroke:#e11d48,stroke-width:1.5px,color:#881337
classDef toneIndigo fill:#e0e7ff,stroke:#4f46e5,stroke-width:1.5px,color:#312e81
classDef toneTeal fill:#ccfbf1,stroke:#0f766e,stroke-width:1.5px,color:#134e4a
class node_sync,node_async,node_auth,node_async_auth,node_transport,node_async_transport,node_response,node_versioning toneBlue
class node_catalog_listings,node_orders_sales,node_seller_finance,node_account_apps toneAmber
class node_inbound,node_outbound,node_inventory,node_shipping,node_services,node_developer,node_amazon toneMint
class node_reports,node_analytics,node_notifications toneRose
class node_vendor_orders,node_vendor_fulfillment,node_lwa toneIndigo
```

## Components

### Client runtime

- [Sync client](https://github.com/saleweaver/python-amazon-sp-api/blob/master/sp_api/base/client.py): `sp_api/base/client.py`
- [Async client](https://github.com/saleweaver/python-amazon-sp-api/blob/master/sp_api/asyncio/base/client.py): `sp_api/asyncio/base/client.py`
- [Access tokens](https://github.com/saleweaver/python-amazon-sp-api/blob/master/sp_api/auth/access_token_client.py): `sp_api/auth/access_token_client.py`
- [Async tokens](https://github.com/saleweaver/python-amazon-sp-api/blob/master/sp_api/asyncio/auth/access_token_client.py): `sp_api/asyncio/auth/access_token_client.py`
- [HTTP transport](https://github.com/saleweaver/python-amazon-sp-api/blob/master/sp_api/base/_transport_httpx.py): `sp_api/base/_transport_httpx.py`
- [Async transport](https://github.com/saleweaver/python-amazon-sp-api/blob/master/sp_api/asyncio/base/_transport_httpx.py): `sp_api/asyncio/base/_transport_httpx.py`
- [API response](https://github.com/saleweaver/python-amazon-sp-api/blob/master/sp_api/base/ApiResponse.py): `sp_api/base/ApiResponse.py`
- [Version dispatch](https://github.com/saleweaver/python-amazon-sp-api/blob/master/sp_api/util/versioned_client.py): `sp_api/util/versioned_client.py`

### Seller commerce

- [Catalog and listings](https://github.com/saleweaver/python-amazon-sp-api/tree/master/sp_api/api/catalog_items): `sp_api/api/catalog_items`
- [Orders and sales](https://github.com/saleweaver/python-amazon-sp-api/tree/master/sp_api/api/orders): `sp_api/api/orders`
- [Finance and invoices](https://github.com/saleweaver/python-amazon-sp-api/tree/master/sp_api/api/finances): `sp_api/api/finances`
- [Seller and app management](https://github.com/saleweaver/python-amazon-sp-api/tree/master/sp_api/api/sellers): `sp_api/api/sellers`

### Fulfillment operations

- [Inbound fulfillment](https://github.com/saleweaver/python-amazon-sp-api/blob/master/sp_api/api/fulfillment_inbound/fulfillment_inbound_2024_03_20.py): `sp_api/api/fulfillment_inbound/fulfillment_inbound_2024_03_20.py`
- [Outbound fulfillment](https://github.com/saleweaver/python-amazon-sp-api/tree/master/sp_api/api/fulfillment_outbound): `sp_api/api/fulfillment_outbound`
- [Inventory services](https://github.com/saleweaver/python-amazon-sp-api/tree/master/sp_api/api/inventories): `sp_api/api/inventories`
- [Shipping services](https://github.com/saleweaver/python-amazon-sp-api/tree/master/sp_api/api/shipping): `sp_api/api/shipping`
- [Home services](https://github.com/saleweaver/python-amazon-sp-api/blob/master/sp_api/api/services/services.py): `sp_api/api/services/services.py`

### Data and reporting

- [Reports and feeds](https://github.com/saleweaver/python-amazon-sp-api/tree/master/sp_api/api/reports): `sp_api/api/reports`
- [Data Kiosk](https://github.com/saleweaver/python-amazon-sp-api/tree/master/sp_api/api/data_kiosk): `sp_api/api/data_kiosk`
- [Notifications](https://github.com/saleweaver/python-amazon-sp-api/tree/master/sp_api/api/notifications): `sp_api/api/notifications`

### Vendor operations

- [Vendor orders](https://github.com/saleweaver/python-amazon-sp-api/tree/master/sp_api/api/vendor_orders): `sp_api/api/vendor_orders`
- [Vendor fulfillment](https://github.com/saleweaver/python-amazon-sp-api/blob/master/sp_api/api/vendor_direct_fulfillment_orders/vendor_direct_fulfillment_orders_2021_12_28.py): `sp_api/api/vendor_direct_fulfillment_orders/vendor_direct_fulfillment_orders_2021_12_28.py`

### Other components

- **API caller**
- **Amazon SP-API**
- **Amazon LWA**

## Connections

- API caller → Sync client: calls endpoints
- API caller → Async client: awaits endpoints
- Sync client → Access tokens: gets token (evidence: `sp_api/base/client.py`)
- Sync client → HTTP transport: sends request (evidence: `sp_api/base/client.py`)
- Async client → Async tokens: gets token (evidence: `sp_api/asyncio/base/client.py`)
- Async client → Async transport: sends request (evidence: `sp_api/asyncio/base/client.py`)
- Access tokens → Amazon LWA: requests token (evidence: `sp_api/auth/access_token_client.py`)
- Async tokens → Amazon LWA: requests token (evidence: `sp_api/asyncio/auth/access_token_client.py`)
- HTTP transport → Amazon SP-API: sends HTTP
- Async transport → Amazon SP-API: sends HTTP
- Catalog and listings → Sync client: uses client
- Orders and sales → Sync client: uses client
- Reports and feeds → Sync client: uses client
- Data Kiosk → Sync client: uses client
- Reports and feeds → Async client: uses client
- Inbound fulfillment → Sync client: inherits client (evidence: `sp_api/api/fulfillment_inbound/fulfillment_inbound_2024_03_20.py`)
- Home services → Sync client: calls request (evidence: `sp_api/api/services/services.py`)
- Home services → Async client: calls request
- Sync client → API response: parses response (evidence: `sp_api/base/client.py`)
- Async client → API response: parses response (evidence: `sp_api/asyncio/base/client.py`)
- Version dispatch → Vendor fulfillment: dispatches versions
