ឯកសារ API
ឯកសារ REST API សម្រាប់ Client និង Integration។
Authentication
Endpoint ឯកជនប្រើ Secure Session Cookie ដែលមានស្រាប់។
Roles
super_admin, business_store, store, seller, buyer, viewer
កំណត់ចំនួនផលិតផល ចំនួនរូប ទំហំរូប/វីដេអូ និងសិទ្ធិលក់សម្រាប់តួនាទីនីមួយៗ។
/api/v1/locationsPublicរាជធានី/ខេត្ត ក្រុង/ស្រុក/ខណ្ឌ ឃុំ/សង្កាត់ និងភូមិ ដែលអាចជ្រើសបានរួចជាស្រេច។
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 }
}
សាកល្បង Endpoint
/api/v1/productsPublicផលិតផលដែលបានបោះពុម្ព ជាមួយហាង តម្លៃ ស្តុក និងការផ្សព្វផ្សាយ។
Query
?q=tomatoAuthenticated responses may include distance_km when both buyer and public store coordinates are available.
Response
{
"data": [ ... ],
"meta": { "count": 1 }
}
សាកល្បង Endpoint
/api/v1/storesPublicហាងសាធារណៈសកម្ម និងព័ត៌មានផ្ទៀងផ្ទាត់។
Exact coordinates are returned only for stores whose location visibility is public.
Response
{
"data": [ ... ],
"meta": { "count": 1 }
}
សាកល្បង Endpoint
/api/v1/meSessionProfile និងសមតុល្យ Wallet នៃគណនីដែលបាន Login។
Response
{
"data": [ ... ],
"meta": { "count": 1 }
}
សាកល្បង Endpoint
/api/v1/ordersSessionការបញ្ជាទិញរបស់អ្នកទិញ ឬអ្នកលក់ដែលបាន Login។
Super admin sees all orders; selling roles see their store orders; buyers/viewers see their own orders.
Response
{
"data": [ ... ],
"meta": { "count": 1 }
}
សាកល្បង Endpoint
/api/v1/notificationsSessionការជូនដំណឹងរបស់គណនីដែលបាន Login។
Response
{
"data": [ ... ],
"meta": { "count": 1 }
}
សាកល្បង Endpoint
ឧទាហរណ៍ API
curl -H "Accept: application/json" \
"https://phumikasephal.com/api/v1/locations"
curl -H "Accept: application/json" \
"https://phumikasephal.com/api/v1/products?q=rice"
Endpoint ឯកជន៖ ផ្ញើ Session Cookie ដែលបាន Login។