# BE/FE Handoff: Product Price Field Mapping

Date: 2026-04-28
Endpoint: `PUT /api/v1/products/:id`

## Canonical fields (BE)

- `sell_price` for harga jual
- `promo_price` for harga promo
- `qty_stock` for stok

## Accepted aliases (transitional compatibility)

- `price` -> `sell_price`
- `harga_promo` -> `promo_price`
- `stock` -> `qty_stock`

## Numeric parsing behavior

BE now accepts numeric values in both JSON number and string formats:

- `299000`
- `"299000"`
- `"299.000"`
- `"149.500"`

Values are parsed as Rupiah full value (not scaled down).

## Update behavior summary

`PUT /products/:id` now normalizes aliases to canonical fields before update logic:

- `sell_price` updates base/normal price path,
- `promo_price` updates product promo price path,
- `qty_stock` updates stock adjustment path.

This prevents old value fallback caused by mismatched field names.
