Stores Domain

Stores API

Store CRUD, settings, and store-product workflows for accounts building on top of Niyantha.

Base Path

https://api.niyantha.in/api/v1/session

Authentication

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.

POST/stores

Create a store owned by the authenticated account.

Bearer Token

Request Fields

FieldTypeRequiredDescription
typestringYesStore type/business vertical.
namestringYesDisplay name.
descriptionstringNoStore description.
location_iduintYesSaved location reference.
owner_aadhaar_front_file_iduintYesFront Aadhaar file ID.
owner_aadhaar_back_file_iduintYesBack Aadhaar file ID.
shop_body_typestringYesstationary_shop, moving_shop, or d2c_brand.
Sample Request
{
  "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"
}
Sample Response
{
  "id": 12,
  "type": "grocery",
  "name": "Fresh Mart Hub",
  "location_id": 101,
  "address": "MG Road, Bengaluru",
  "status": "active",
  "open_status": "open"
}
GET/stores

List stores owned by the authenticated account.

Bearer Token

Query Parameters

FieldTypeRequiredDescription
pageintNo1-based page index.
countintNoPage size.
Sample Response
{
  "items": [
    {
      "id": 12,
      "type": "grocery",
      "name": "Fresh Mart Hub",
      "address": "MG Road, Bengaluru",
      "status": "active",
      "open_status": "open"
    }
  ],
  "page": 1,
  "count": 1
}
GET/stores/:id/settings

Fetch store-scoped settings, product types, feature flags, and UI bootstrap data.

Bearer Token
Sample Response
{
  "product_types": ["grocery", "fish", "meat"],
  "default_product_type": "grocery",
  "feature_flags": {
    "inventory": true,
    "delivery": true
  }
}
POST/stores/:id/products

Create a store product under a specific store.

Bearer Token

Request Fields

FieldTypeRequiredDescription
store_item_iduintYesStore item reference.
namestringYesProduct name.
typestringYesProduct type.
unitstringYesUnit of measure.
price_per_unitfloatYesSelling price.
min_order_unitfloatYesMinimum order quantity.
max_order_unitfloatYesMaximum order quantity.
Sample Request
{
  "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
}
Sample Response
{
  "id": 7001,
  "store_id": 12,
  "name": "Tomato Crate",
  "type": "vegetable",
  "unit": "kg",
  "price_per_unit": 24,
  "is_active": false
}

Notes

1

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.

2

Store listings for public discovery also exist in the backend, but this page focuses on the authenticated account integration path.