# hendt/ebay-api architecture

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

- Interactive diagram: https://gitdiagram.com/hendt/ebay-api
- Repository: https://github.com/hendt/ebay-api

## Overview

This is a TypeScript eBay client library covering RESTful and Traditional XML APIs. The main workflow is to configure an eBayApi client, obtain authorization, select an API family and domain, and send requests through the shared transport. The graph groups the documented API domains rather than enumerating every operation. Source excerpts support the client, authentication, REST request, and transport links; domain coverage is documented in the README, but most domain implementations were not sampled, so their internal calls are not shown.

Main entry points: [`src/api/apiFactory.ts`](https://github.com/hendt/ebay-api/blob/master/src/api/apiFactory.ts) (API factory), [`src/auth/index.ts`](https://github.com/hendt/ebay-api/blob/master/src/auth/index.ts) (Auth container), [`src/eBayApi.ts`](https://github.com/hendt/ebay-api/blob/master/src/eBayApi.ts) (eBay API client), [`src/api/restful/index.ts`](https://github.com/hendt/ebay-api/blob/master/src/api/restful/index.ts) (REST request handling)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_client["Client runtime"]
  node_ebay_client["eBay API client<br/>[eBayApi.ts]"]
  node_api_factory["API factory<br/>[apiFactory.ts]"]
end

subgraph group_identity["Auth and transport"]
  node_api_base["API base<br/>[base.ts]"]
  node_auth_container["Auth container<br/>[index.ts]"]
  node_oauth["OAuth2<br/>[oAuth2.ts]"]
  node_authnauth["Auth'N'Auth<br/>[authNAuth.ts]"]
  node_rest_dispatch["REST request handling<br/>[index.ts]"]
  node_http_transport["HTTP transport<br/>[request.ts]"]
end

subgraph group_rest["REST API domains"]
  node_buy["Buy APIs"]
  node_commerce["Commerce APIs"]
  node_developer_apis["Developer APIs"]
  node_post_order["Post Order APIs"]
  node_sell["Sell APIs"]
  node_openapi_types["REST API types"]
end

subgraph group_traditional["Traditional APIs"]
  node_xml_request["XML requests<br/>[XMLRequest.ts]"]
  node_traditional_apis["Traditional API family"]
  node_traditional_types["Traditional types"]
end

node_developer(("Application developer"))

node_developer -->|"configures"| node_ebay_client
node_ebay_client -->|"creates APIs"| node_api_factory
node_ebay_client -->|"exposes auth"| node_auth_container
node_api_factory -->|"creates domain APIs"| node_buy
node_api_factory -->|"creates domain APIs"| node_commerce
node_api_factory -->|"creates domain APIs"| node_developer_apis
node_api_factory -->|"creates domain APIs"| node_post_order
node_api_factory -->|"creates domain APIs"| node_sell
node_auth_container -->|"provides"| node_oauth
node_auth_container -->|"provides"| node_authnauth
node_rest_dispatch -->|"gets authorization"| node_auth_container
node_rest_dispatch -.->|"sends requests"| node_http_transport
node_authnauth -->|"sends XML calls"| node_xml_request
node_traditional_apis -.->|"uses XML requests"| node_xml_request
node_buy -.->|"uses API schemas"| node_openapi_types
node_sell -.->|"uses API schemas"| node_openapi_types
node_traditional_apis -.->|"uses response types"| node_traditional_types

click node_ebay_client "https://github.com/hendt/ebay-api/blob/master/src/eBayApi.ts"
click node_api_factory "https://github.com/hendt/ebay-api/blob/master/src/api/apiFactory.ts"
click node_api_base "https://github.com/hendt/ebay-api/blob/master/src/api/base.ts"
click node_auth_container "https://github.com/hendt/ebay-api/blob/master/src/auth/index.ts"
click node_oauth "https://github.com/hendt/ebay-api/blob/master/src/auth/oAuth2.ts"
click node_authnauth "https://github.com/hendt/ebay-api/blob/master/src/auth/authNAuth.ts"
click node_rest_dispatch "https://github.com/hendt/ebay-api/blob/master/src/api/restful/index.ts"
click node_xml_request "https://github.com/hendt/ebay-api/blob/master/src/api/traditional/XMLRequest.ts"
click node_http_transport "https://github.com/hendt/ebay-api/blob/master/src/request.ts"
click node_buy "https://github.com/hendt/ebay-api/tree/master/src/api/restful/buy"
click node_commerce "https://github.com/hendt/ebay-api/tree/master/src/api/restful/commerce"
click node_developer_apis "https://github.com/hendt/ebay-api/tree/master/src/api/restful/developer"
click node_post_order "https://github.com/hendt/ebay-api/tree/master/src/api/restful/postOrder"
click node_sell "https://github.com/hendt/ebay-api/tree/master/src/api/restful/sell"
click node_traditional_apis "https://github.com/hendt/ebay-api/tree/master/src/api/traditional"
click node_openapi_types "https://github.com/hendt/ebay-api/tree/master/src/types/restful/specs"
click node_traditional_types "https://github.com/hendt/ebay-api/tree/master/src/types/traditional"

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_ebay_client,node_api_factory toneBlue
class node_api_base,node_auth_container,node_oauth,node_authnauth,node_rest_dispatch,node_http_transport toneAmber
class node_buy,node_commerce,node_developer_apis,node_post_order,node_sell,node_openapi_types toneMint
class node_xml_request,node_traditional_apis,node_traditional_types toneRose
class node_developer toneIndigo
```

## Components

### Client runtime

- [eBay API client](https://github.com/hendt/ebay-api/blob/master/src/eBayApi.ts): `src/eBayApi.ts`
- [API factory](https://github.com/hendt/ebay-api/blob/master/src/api/apiFactory.ts): `src/api/apiFactory.ts`

### Auth and transport

- [API base](https://github.com/hendt/ebay-api/blob/master/src/api/base.ts): `src/api/base.ts`
- [Auth container](https://github.com/hendt/ebay-api/blob/master/src/auth/index.ts): `src/auth/index.ts`
- [OAuth2](https://github.com/hendt/ebay-api/blob/master/src/auth/oAuth2.ts): `src/auth/oAuth2.ts`
- [Auth'N'Auth](https://github.com/hendt/ebay-api/blob/master/src/auth/authNAuth.ts): `src/auth/authNAuth.ts`
- [REST request handling](https://github.com/hendt/ebay-api/blob/master/src/api/restful/index.ts): `src/api/restful/index.ts`
- [HTTP transport](https://github.com/hendt/ebay-api/blob/master/src/request.ts): `src/request.ts`

### REST API domains

- [Buy APIs](https://github.com/hendt/ebay-api/tree/master/src/api/restful/buy): `src/api/restful/buy`
- [Commerce APIs](https://github.com/hendt/ebay-api/tree/master/src/api/restful/commerce): `src/api/restful/commerce`
- [Developer APIs](https://github.com/hendt/ebay-api/tree/master/src/api/restful/developer): `src/api/restful/developer`
- [Post Order APIs](https://github.com/hendt/ebay-api/tree/master/src/api/restful/postOrder): `src/api/restful/postOrder`
- [Sell APIs](https://github.com/hendt/ebay-api/tree/master/src/api/restful/sell): `src/api/restful/sell`
- [REST API types](https://github.com/hendt/ebay-api/tree/master/src/types/restful/specs): `src/types/restful/specs`

### Traditional APIs

- [XML requests](https://github.com/hendt/ebay-api/blob/master/src/api/traditional/XMLRequest.ts): `src/api/traditional/XMLRequest.ts`
- [Traditional API family](https://github.com/hendt/ebay-api/tree/master/src/api/traditional): `src/api/traditional`
- [Traditional types](https://github.com/hendt/ebay-api/tree/master/src/types/traditional): `src/types/traditional`

### Other components

- **Application developer**

## Connections

- Application developer → eBay API client: configures
- eBay API client → API factory: creates APIs (evidence: `src/eBayApi.ts`)
- eBay API client → Auth container: exposes auth (evidence: `src/eBayApi.ts`)
- API factory → Buy APIs: creates domain APIs (evidence: `src/api/apiFactory.ts`)
- API factory → Commerce APIs: creates domain APIs (evidence: `src/api/apiFactory.ts`)
- API factory → Developer APIs: creates domain APIs (evidence: `src/api/apiFactory.ts`)
- API factory → Post Order APIs: creates domain APIs (evidence: `src/api/apiFactory.ts`)
- API factory → Sell APIs: creates domain APIs (evidence: `src/api/apiFactory.ts`)
- Auth container → OAuth2: provides (evidence: `src/auth/index.ts`)
- Auth container → Auth'N'Auth: provides (evidence: `src/auth/index.ts`)
- REST request handling → Auth container: gets authorization (evidence: `src/api/restful/index.ts`)
- REST request handling → HTTP transport: sends requests (evidence: `src/api/restful/index.ts`)
- Auth'N'Auth → XML requests: sends XML calls (evidence: `src/auth/authNAuth.ts`)
- Traditional API family → XML requests: uses XML requests (evidence: `src/api/traditional/XMLRequest.ts`)
- Buy APIs → REST API types: uses API schemas
- Sell APIs → REST API types: uses API schemas (evidence: `src/api/restful/sell/marketing/index.ts`)
- Traditional API family → Traditional types: uses response types
