# API Contract v1 (Initial)

Base URL: `https://apibazzar.softcomp.io`

## Auth

### POST `/api/v1/auth/login`

Request:

```json
{
  "username": "admin",
  "password": "secret"
}
```

Response (200):

```json
{
  "access_token": "jwt",
  "refresh_token": "jwt",
  "expires_in": 1800
}
```

### POST `/api/v1/auth/refresh`

Request:

```json
{
  "refresh_token": "jwt"
}
```

### POST `/api/v1/auth/logout`

Request:

```json
{
  "refresh_token": "jwt"
}
```

### GET `/api/v1/auth/me`

Response:

```json
{
  "id": 1,
  "name": "Super Admin",
  "role": "superadmin"
}
```

## Products

### GET `/api/v1/products`

Query:

- `limit` default `20`
- `offset` default `0`

### POST `/api/v1/products`

```json
{
  "item_code": "SKU-001",
  "barcode": "8990001",
  "name": "Product A",
  "base_price": 199000
}
```

## Members

### GET `/api/v1/members`
### POST `/api/v1/members`

## Pricing Approval

### POST `/api/v1/prices/change-requests`
### GET `/api/v1/prices/change-requests`
### POST `/api/v1/prices/change-requests/:id/approve`
### POST `/api/v1/prices/change-requests/:id/reject`
### GET `/api/v1/prices/current?product_id=&outlet_id=`

## POS

### POST `/api/v1/pos/cart/price-preview`
### POST `/api/v1/pos/checkout`
### GET `/api/v1/pos/orders/:id`

