# @alepha/commerce - Core

Headless commerce for Alepha apps: catalog, cart, checkout. Extended by product-kind handlers.

## Installation

```bash
npm install @alepha/commerce
```

## Overview

Headless commerce core: catalog, orders, and two inventory ledgers.

- **Fungible stock** (`StockService`): a quantity on a product, sold by the
  `good` kind.
- **Interval claims on named resources** (`ResourceService`): a court, a
  seat on a leg, a room on a night, sold by an application's subclass of
  `ResourceKindHandler`.

Ships two product kinds - `good` (stock-tracked) and `digital` - and the
registry that lets any other module add more without editing this package.
Cart and checkout are separate modules (`@alepha/commerce/cart`,
`@alepha/commerce/checkout`) so a consumer that has no use for them, such as
a point-of-sale, does not carry their tables.

## API Reference

### Providers

- [`OrderDownloadsProvider`](https://latest.alepha.dev/docs/reference-providers-orderdownloadsprovider.md) - What can be downloaded for an order: read by the confirmation email and the
- [`ProductKindRegistry`](https://latest.alepha.dev/docs/reference-providers-productkindregistry.md) - Extension point letting any module teach the catalog a new kind of sellable
