Phumi Kasephal Phoumika Kasiphal
Chat Cart
REST API v1

API Documentation

REST API reference for marketplace clients and integrations.

JSON · UTF-8 · v4.5

Authentication

Authentication uses the existing secure session cookie for private endpoints.

Apply Nginx or gateway rate limits before exposing the API publicly.

Roles

super_admin, business_store, store, seller, buyer, viewer

Control product count, media size, and selling permissions for every account role. Zero products means unlimited only for selling roles.

GET/api/v1/locationsPublic

Ready-to-select province/capital, district, commune/sangkat, and village hierarchy.

Query

type=province|municipality|district|commune|village
parent=01

Use the returned code as parent to load the next administrative level.

Response

{
  "data": [ ... ],
  "meta": { "count": 1 }
}
Try endpoint
GET/api/v1/productsPublic

Published products with store, price, stock, and promotion data.

Query

?q=tomato

Authenticated responses may include distance_km when both buyer and public store coordinates are available.

Response

{
  "data": [ ... ],
  "meta": { "count": 1 }
}
Try endpoint
GET/api/v1/storesPublic

Active public stores and verification data.

Exact coordinates are returned only for stores whose location visibility is public.

Response

{
  "data": [ ... ],
  "meta": { "count": 1 }
}
Try endpoint
GET/api/v1/meSession

Current authenticated account profile and wallet summary.

Response

{
  "data": [ ... ],
  "meta": { "count": 1 }
}
Try endpoint
GET/api/v1/ordersSession

Authenticated buyer or seller order records.

Super admin sees all orders; selling roles see their store orders; buyers/viewers see their own orders.

Response

{
  "data": [ ... ],
  "meta": { "count": 1 }
}
Try endpoint
GET/api/v1/notificationsSession

Authenticated account notifications.

Response

{
  "data": [ ... ],
  "meta": { "count": 1 }
}
Try endpoint

API examples

curl -H "Accept: application/json" \
  "https://phumikasephal.com/api/v1/locations"

curl -H "Accept: application/json" \
  "https://phumikasephal.com/api/v1/products?q=rice"

Private endpoint: send the authenticated session cookie.