Stores API
Store CRUD, settings, and store-product workflows for accounts building on top of Niyantha.
Base Path
https://api.niyantha.in/api/v1/sessionAuthentication
Authorization: Bearer <token>
Use these endpoints to create and operate account stores, bootstrap store settings, and manage store-scoped products. The same shapes are available through S2S at /api/v1/s2s/accounts with API-key auth.
/storesCreate a store owned by the authenticated account.
Request Fields
| Field | Type | Required | Description |
|---|---|---|---|
| type | string | Yes | Store type/business vertical. |
| name | string | Yes | Display name. |
| description | string | No | Store description. |
| location_id | uint | Yes | Saved location reference. |
| owner_aadhaar_front_file_id | uint | Yes | Front Aadhaar file ID. |
| owner_aadhaar_back_file_id | uint | Yes | Back Aadhaar file ID. |
| shop_body_type | string | Yes | stationary_shop, moving_shop, or d2c_brand. |
{
"type": "grocery",
"name": "Fresh Mart Hub",
"description": "Neighborhood store connected to Niyantha logistics",
"location_id": 101,
"owner_aadhaar_front_file_id": 12,
"owner_aadhaar_back_file_id": 13,
"shop_body_type": "stationary_shop"
}{
"id": 12,
"type": "grocery",
"name": "Fresh Mart Hub",
"location_id": 101,
"address": "MG Road, Bengaluru",
"status": "active",
"open_status": "open"
}/storesList stores owned by the authenticated account.
Query Parameters
| Field | Type | Required | Description |
|---|---|---|---|
| page | int | No | 1-based page index. |
| count | int | No | Page size. |
{
"items": [
{
"id": 12,
"type": "grocery",
"name": "Fresh Mart Hub",
"address": "MG Road, Bengaluru",
"status": "active",
"open_status": "open"
}
],
"page": 1,
"count": 1
}/stores/:id/settingsFetch store-scoped settings, product types, feature flags, and UI bootstrap data.
{
"product_types": ["grocery", "fish", "meat"],
"default_product_type": "grocery",
"feature_flags": {
"inventory": true,
"delivery": true
}
}/stores/:id/productsCreate a store product under a specific store.
Request Fields
| Field | Type | Required | Description |
|---|---|---|---|
| store_item_id | uint | Yes | Store item reference. |
| name | string | Yes | Product name. |
| type | string | Yes | Product type. |
| unit | string | Yes | Unit of measure. |
| price_per_unit | float | Yes | Selling price. |
| min_order_unit | float | Yes | Minimum order quantity. |
| max_order_unit | float | Yes | Maximum order quantity. |
{
"store_item_id": 501,
"name": "Tomato Crate",
"type": "vegetable",
"unit": "kg",
"price_per_unit": 24,
"min_order_unit": 1,
"max_order_unit": 100,
"stock_type": "limited",
"stock": 400
}{
"id": 7001,
"store_id": 12,
"name": "Tomato Crate",
"type": "vegetable",
"unit": "kg",
"price_per_unit": 24,
"is_active": false
}Notes
The same store and store-product contracts are available via S2S at /api/v1/s2s/accounts/stores... with X-API-Key and X-API-Secret.
Store listings for public discovery also exist in the backend, but this page focuses on the authenticated account integration path.