{
	"info": {
		"name": "Smart Khata Book API Collection",
		"description": "Collection of all 26 REST APIs for the Smart Khata Book CodeIgniter 4 application.",
		"schema": "https://schema.getpostman.com/json/collection/v2.1.0/collection.json"
	},
	"item": [
		{
			"name": "1. Authentication & Security",
			"item": [
				{
					"name": "API 01. Send OTP Request",
					"request": {
						"method": "POST",
						"header": [
							{
								"key": "Content-Type",
								"value": "application/json"
							}
						],
						"body": {
							"mode": "raw",
							"raw": "{\n  \"phone\": \"+919876543210\"\n}"
						},
						"url": {
							"raw": "{{baseUrl}}/api/v1/auth/request-otp",
							"host": [
								"{{baseUrl}}"
							],
							"path": [
								"api",
								"v1",
								"auth",
								"request-otp"
							]
						}
					}
				},
				{
					"name": "API 02. Verify OTP",
					"request": {
						"method": "POST",
						"header": [
							{
								"key": "Content-Type",
								"value": "application/json"
							}
						],
						"body": {
							"mode": "raw",
							"raw": "{\n  \"phone\": \"+919876543210\",\n  \"otp\": \"5582\"\n}"
						},
						"url": {
							"raw": "{{baseUrl}}/api/v1/auth/verify-otp",
							"host": [
								"{{baseUrl}}"
							],
							"path": [
								"api",
								"v1",
								"auth",
								"verify-otp"
							]
						}
					}
				}
			]
		},
		{
			"name": "2. Shop & Branding Configuration",
			"item": [
				{
					"name": "API 03. Create New Shop",
					"request": {
						"auth": {
							"type": "bearer",
							"bearer": [
								{
									"key": "token",
									"value": "{{token}}",
									"type": "string"
								}
							]
						},
						"method": "POST",
						"header": [
							{
								"key": "Content-Type",
								"value": "application/json"
							}
						],
						"body": {
							"mode": "raw",
							"raw": "{\n  \"name\": \"Sharma General Store\",\n  \"businessType\": \"Retail\",\n  \"city\": \"Lucknow\",\n  \"address\": \"Shop No 14, Grain Market, Lucknow\",\n  \"gstin\": \"09AAAAA1111A1Z1\"\n}"
						},
						"url": {
							"raw": "{{baseUrl}}/api/v1/shops/create",
							"host": [
								"{{baseUrl}}"
							],
							"path": [
								"api",
								"v1",
								"shops",
								"create"
							]
						}
					}
				},
				{
					"name": "API 04. Update Shop Profile Details",
					"request": {
						"auth": {
							"type": "bearer",
							"bearer": [
								{
									"key": "token",
									"value": "{{token}}",
									"type": "string"
								}
							]
						},
						"method": "PUT",
						"header": [
							{
								"key": "Content-Type",
								"value": "application/json"
							}
						],
						"body": {
							"mode": "raw",
							"raw": "{\n  \"name\": \"Sharma & Sons Store\",\n  \"businessType\": \"Wholesale\",\n  \"city\": \"Kanpur\",\n  \"address\": \"Gali No 2, Market, Kanpur\",\n  \"gstin\": \"09AAAAA1111A1Z2\",\n  \"logoUrl\": \"https://storage.googleapis.com/logos/shop_sharma.png\"\n}"
						},
						"url": {
							"raw": "{{baseUrl}}/api/v1/shops/{{shopId}}/update",
							"host": [
								"{{baseUrl}}"
							],
							"path": [
								"api",
								"v1",
								"shops",
								"{{shopId}}",
								"update"
							]
						}
					}
				},
				{
					"name": "API 05. Fetch Shop Profile",
					"request": {
						"auth": {
							"type": "bearer",
							"bearer": [
								{
									"key": "token",
									"value": "{{token}}",
									"type": "string"
								}
							]
						},
						"method": "GET",
						"header": [],
						"url": {
							"raw": "{{baseUrl}}/api/v1/shops/{{shopId}}",
							"host": [
								"{{baseUrl}}"
							],
							"path": [
								"api",
								"v1",
								"shops",
								"{{shopId}}"
							]
						}
					}
				}
			]
		},
		{
			"name": "3. Customer Book Ledger",
			"item": [
				{
					"name": "API 06. Add New Customer",
					"request": {
						"auth": {
							"type": "bearer",
							"bearer": [
								{
									"key": "token",
									"value": "{{token}}",
									"type": "string"
								}
							]
						},
						"method": "POST",
						"header": [
							{
								"key": "Content-Type",
								"value": "application/json"
							}
						],
						"body": {
							"mode": "raw",
							"raw": "{\n  \"shopId\": \"{{shopId}}\",\n  \"name\": \"Ravi Singh\",\n  \"phone\": \"+919876512345\"\n}"
						},
						"url": {
							"raw": "{{baseUrl}}/api/v1/customers/add",
							"host": [
								"{{baseUrl}}"
							],
							"path": [
								"api",
								"v1",
								"customers",
								"add"
							]
						}
					}
				},
				{
					"name": "API 07. Fetch Customer List",
					"request": {
						"auth": {
							"type": "bearer",
							"bearer": [
								{
									"key": "token",
									"value": "{{token}}",
									"type": "string"
								}
							]
						},
						"method": "GET",
						"header": [],
						"url": {
							"raw": "{{baseUrl}}/api/v1/shops/{{shopId}}/customers",
							"host": [
								"{{baseUrl}}"
							],
							"path": [
								"api",
								"v1",
								"shops",
								"{{shopId}}",
								"customers"
							]
						}
					}
				},
				{
					"name": "API 08. Edit Customer Details",
					"request": {
						"auth": {
							"type": "bearer",
							"bearer": [
								{
									"key": "token",
									"value": "{{token}}",
									"type": "string"
								}
							]
						},
						"method": "PUT",
						"header": [
							{
								"key": "Content-Type",
								"value": "application/json"
							}
						],
						"body": {
							"mode": "raw",
							"raw": "{\n  \"name\": \"Ravi Kumar Singh\",\n  \"phone\": \"+919876599999\"\n}"
						},
						"url": {
							"raw": "{{baseUrl}}/api/v1/customers/{{customerId}}/edit",
							"host": [
								"{{baseUrl}}"
							],
							"path": [
								"api",
								"v1",
								"customers",
								"{{customerId}}",
								"edit"
							]
						}
					}
				},
				{
					"name": "API 09. Delete Customer",
					"request": {
						"auth": {
							"type": "bearer",
							"bearer": [
								{
									"key": "token",
									"value": "{{token}}",
									"type": "string"
								}
							]
						},
						"method": "DELETE",
						"header": [],
						"url": {
							"raw": "{{baseUrl}}/api/v1/customers/{{customerId}}",
							"host": [
								"{{baseUrl}}"
							],
							"path": [
								"api",
								"v1",
								"customers",
								"{{customerId}}"
							]
						}
					}
				}
			]
		},
		{
			"name": "4. Customer Transactions",
			"item": [
				{
					"name": "API 10. Add Customer Ledger Entry",
					"request": {
						"auth": {
							"type": "bearer",
							"bearer": [
								{
									"key": "token",
									"value": "{{token}}",
									"type": "string"
								}
							]
						},
						"method": "POST",
						"header": [
							{
								"key": "Content-Type",
								"value": "application/json"
							}
						],
						"body": {
							"mode": "raw",
							"raw": "{\n  \"customerId\": \"{{customerId}}\",\n  \"shopId\": \"{{shopId}}\",\n  \"title\": \"Aata & Rice packet\",\n  \"amount\": -1200.00,\n  \"billNumber\": \"BILL-4412\",\n  \"isCredit\": false,\n  \"dateTime\": \"2026-06-30 18:30\"\n}"
						},
						"url": {
							"raw": "{{baseUrl}}/api/v1/transactions/customer/add",
							"host": [
								"{{baseUrl}}"
							],
							"path": [
								"api",
								"v1",
								"transactions",
								"customer",
								"add"
							]
						}
					}
				},
				{
					"name": "API 11. Fetch Transaction History",
					"request": {
						"auth": {
							"type": "bearer",
							"bearer": [
								{
									"key": "token",
									"value": "{{token}}",
									"type": "string"
								}
							]
						},
						"method": "GET",
						"header": [],
						"url": {
							"raw": "{{baseUrl}}/api/v1/customers/{{customerId}}/transactions",
							"host": [
								"{{baseUrl}}"
							],
							"path": [
								"api",
								"v1",
								"customers",
								"{{customerId}}",
								"transactions"
							]
						}
					}
				},
				{
					"name": "API 12. Modify Customer Entry",
					"request": {
						"auth": {
							"type": "bearer",
							"bearer": [
								{
									"key": "token",
									"value": "{{token}}",
									"type": "string"
								}
							]
						},
						"method": "PUT",
						"header": [
							{
								"key": "Content-Type",
								"value": "application/json"
							}
						],
						"body": {
							"mode": "raw",
							"raw": "{\n  \"title\": \"Aata packet only\",\n  \"amount\": -500.00,\n  \"billNumber\": \"BILL-4412\"\n}"
						},
						"url": {
							"raw": "{{baseUrl}}/api/v1/transactions/customer/{{transactionId}}/edit",
							"host": [
								"{{baseUrl}}"
							],
							"path": [
								"api",
								"v1",
								"transactions",
								"customer",
								"{{transactionId}}",
								"edit"
							]
						}
					}
				},
				{
					"name": "API 13. Delete Customer Entry",
					"request": {
						"auth": {
							"type": "bearer",
							"bearer": [
								{
									"key": "token",
									"value": "{{token}}",
									"type": "string"
								}
							]
						},
						"method": "DELETE",
						"header": [],
						"url": {
							"raw": "{{baseUrl}}/api/v1/transactions/customer/{{transactionId}}",
							"host": [
								"{{baseUrl}}"
							],
							"path": [
								"api",
								"v1",
								"transactions",
								"customer",
								"{{transactionId}}"
							]
						}
					}
				}
			]
		},
		{
			"name": "5. Supplier Ledger",
			"item": [
				{
					"name": "API 14. Add New Supplier",
					"request": {
						"auth": {
							"type": "bearer",
							"bearer": [
								{
									"key": "token",
									"value": "{{token}}",
									"type": "string"
								}
							]
						},
						"method": "POST",
						"header": [
							{
								"key": "Content-Type",
								"value": "application/json"
							}
						],
						"body": {
							"mode": "raw",
							"raw": "{\n  \"shopId\": \"{{shopId}}\",\n  \"name\": \"Krishna Wholesalers\",\n  \"phone\": \"+919888877777\",\n  \"address\": \"42 Grains Market, Delhi\"\n}"
						},
						"url": {
							"raw": "{{baseUrl}}/api/v1/suppliers/add",
							"host": [
								"{{baseUrl}}"
							],
							"path": [
								"api",
								"v1",
								"suppliers",
								"add"
							]
						}
					}
				},
				{
					"name": "API 15. Fetch Suppliers List",
					"request": {
						"auth": {
							"type": "bearer",
							"bearer": [
								{
									"key": "token",
									"value": "{{token}}",
									"type": "string"
								}
							]
						},
						"method": "GET",
						"header": [],
						"url": {
							"raw": "{{baseUrl}}/api/v1/shops/{{shopId}}/suppliers",
							"host": [
								"{{baseUrl}}"
							],
							"path": [
								"api",
								"v1",
								"shops",
								"{{shopId}}",
								"suppliers"
							]
						}
					}
				},
				{
					"name": "API 16. Edit Supplier Details",
					"request": {
						"auth": {
							"type": "bearer",
							"bearer": [
								{
									"key": "token",
									"value": "{{token}}",
									"type": "string"
								}
							]
						},
						"method": "PUT",
						"header": [
							{
								"key": "Content-Type",
								"value": "application/json"
							}
						],
						"body": {
							"mode": "raw",
							"raw": "{\n  \"name\": \"Krishna Wholesalers Ltd\",\n  \"phone\": \"+919888877777\",\n  \"address\": \"Shop 42, Grains Market, Delhi\"\n}"
						},
						"url": {
							"raw": "{{baseUrl}}/api/v1/suppliers/{{supplierId}}/edit",
							"host": [
								"{{baseUrl}}"
							],
							"path": [
								"api",
								"v1",
								"suppliers",
								"{{supplierId}}",
								"edit"
							]
						}
					}
				},
				{
					"name": "API 17. Delete Supplier",
					"request": {
						"auth": {
							"type": "bearer",
							"bearer": [
								{
									"key": "token",
									"value": "{{token}}",
									"type": "string"
								}
							]
						},
						"method": "DELETE",
						"header": [],
						"url": {
							"raw": "{{baseUrl}}/api/v1/suppliers/{{supplierId}}",
							"host": [
								"{{baseUrl}}"
							],
							"path": [
								"api",
								"v1",
								"suppliers",
								"{{supplierId}}"
							]
						}
					}
				}
			]
		},
		{
			"name": "6. Supplier Transactions",
			"item": [
				{
					"name": "API 18. Add Supplier Transaction Entry",
					"request": {
						"auth": {
							"type": "bearer",
							"bearer": [
								{
									"key": "token",
									"value": "{{token}}",
									"type": "string"
								}
							]
						},
						"method": "POST",
						"header": [
							{
								"key": "Content-Type",
								"value": "application/json"
							}
						],
						"body": {
							"mode": "raw",
							"raw": "{\n  \"supplierId\": \"{{supplierId}}\",\n  \"shopId\": \"{{shopId}}\",\n  \"amount\": 15400.00,\n  \"isPurchase\": true,\n  \"billNo\": \"PUR-992\",\n  \"photoUrl\": \"https://storage.googleapis.com/bills/bill_pur_992.jpg\",\n  \"dateTime\": \"2026-06-30 14:00\"\n}"
						},
						"url": {
							"raw": "{{baseUrl}}/api/v1/transactions/supplier/add",
							"host": [
								"{{baseUrl}}"
							],
							"path": [
								"api",
								"v1",
								"transactions",
								"supplier",
								"add"
							]
						}
					}
				},
				{
					"name": "API 19. Fetch Supplier Transactions",
					"request": {
						"auth": {
							"type": "bearer",
							"bearer": [
								{
									"key": "token",
									"value": "{{token}}",
									"type": "string"
								}
							]
						},
						"method": "GET",
						"header": [],
						"url": {
							"raw": "{{baseUrl}}/api/v1/suppliers/{{supplierId}}/transactions",
							"host": [
								"{{baseUrl}}"
							],
							"path": [
								"api",
								"v1",
								"suppliers",
								"{{supplierId}}",
								"transactions"
							]
						}
					}
				},
				{
					"name": "API 20. Edit Supplier Entry",
					"request": {
						"auth": {
							"type": "bearer",
							"bearer": [
								{
									"key": "token",
									"value": "{{token}}",
									"type": "string"
								}
							]
						},
						"method": "PUT",
						"header": [
							{
								"key": "Content-Type",
								"value": "application/json"
							}
						],
						"body": {
							"mode": "raw",
							"raw": "{\n  \"amount\": 15000.00,\n  \"billNo\": \"PUR-992-revised\"\n}"
						},
						"url": {
							"raw": "{{baseUrl}}/api/v1/transactions/supplier/{{transactionId}}/edit",
							"host": [
								"{{baseUrl}}"
							],
							"path": [
								"api",
								"v1",
								"transactions",
								"supplier",
								"{{transactionId}}",
								"edit"
							]
						}
					}
				},
				{
					"name": "API 21. Delete Supplier Entry",
					"request": {
						"auth": {
							"type": "bearer",
							"bearer": [
								{
									"key": "token",
									"value": "{{token}}",
									"type": "string"
								}
							]
						},
						"method": "DELETE",
						"header": [],
						"url": {
							"raw": "{{baseUrl}}/api/v1/transactions/supplier/{{transactionId}}",
							"host": [
								"{{baseUrl}}"
							],
							"path": [
								"api",
								"v1",
								"transactions",
								"supplier",
								"{{transactionId}}"
							]
						}
					}
				}
			]
		},
		{
			"name": "7. Staff & Team Management",
			"item": [
				{
					"name": "API 22. Invite Staff Member",
					"request": {
						"auth": {
							"type": "bearer",
							"bearer": [
								{
									"key": "token",
									"value": "{{token}}",
									"type": "string"
								}
							]
						},
						"method": "POST",
						"header": [
							{
								"key": "Content-Type",
								"value": "application/json"
							}
						],
						"body": {
							"mode": "raw",
							"raw": "{\n  \"shopId\": \"{{shopId}}\",\n  \"name\": \"Suresh Kumar\",\n  \"phone\": \"+919876598765\",\n  \"role\": \"staff\"\n}"
						},
						"url": {
							"raw": "{{baseUrl}}/api/v1/team/invite",
							"host": [
								"{{baseUrl}}"
							],
							"path": [
								"api",
								"v1",
								"team",
								"invite"
							]
						}
					}
				},
				{
					"name": "API 23. Submit Verification Documents (Staff Login verification)",
					"request": {
						"method": "POST",
						"header": [],
						"body": {
							"mode": "formdata",
							"formdata": [
								{
									"key": "phone",
									"value": "+919876598765",
									"type": "text"
								},
								{
									"key": "securityCode",
									"value": "SURESH-5582",
									"type": "text"
								},
								{
									"key": "photo",
									"type": "file",
									"src": []
								},
								{
									"key": "document",
									"type": "file",
									"src": []
								}
							]
						},
						"url": {
							"raw": "{{baseUrl}}/api/v1/team/verify-credentials",
							"host": [
								"{{baseUrl}}"
							],
							"path": [
								"api",
								"v1",
								"team",
								"verify-credentials"
							]
						}
					}
				},
				{
					"name": "API 24. Deactivate Member (Remote Log out)",
					"request": {
						"auth": {
							"type": "bearer",
							"bearer": [
								{
									"key": "token",
									"value": "{{token}}",
									"type": "string"
								}
							]
						},
						"method": "POST",
						"header": [
							{
								"key": "Content-Type",
								"value": "application/json"
							}
						],
						"body": {
							"mode": "raw",
							"raw": "{\n  \"shopId\": \"{{shopId}}\",\n  \"phone\": \"+919876598765\"\n}"
						},
						"url": {
							"raw": "{{baseUrl}}/api/v1/team/deactivate",
							"host": [
								"{{baseUrl}}"
							],
							"path": [
								"api",
								"v1",
								"team",
								"deactivate"
							]
						}
					}
				}
			]
		},
		{
			"name": "8. Stock & Exports",
			"item": [
				{
					"name": "API 25. Fetch Stock Inventory",
					"request": {
						"auth": {
							"type": "bearer",
							"bearer": [
								{
									"key": "token",
									"value": "{{token}}",
									"type": "string"
								}
							]
						},
						"method": "GET",
						"header": [],
						"url": {
							"raw": "{{baseUrl}}/api/v1/shops/{{shopId}}/inventory",
							"host": [
								"{{baseUrl}}"
							],
							"path": [
								"api",
								"v1",
								"shops",
								"{{shopId}}",
								"inventory"
							]
						}
					}
				},
				{
					"name": "API 26. Request Older Report Email (Export Safety Guard)",
					"request": {
						"auth": {
							"type": "bearer",
							"bearer": [
								{
									"key": "token",
									"value": "{{token}}",
									"type": "string"
								}
							]
						},
						"method": "POST",
						"header": [
							{
								"key": "Content-Type",
								"value": "application/json"
							}
						],
						"body": {
							"mode": "raw",
							"raw": "{\n  \"shopId\": \"{{shopId}}\",\n  \"customerName\": \"Ravi Singh\",\n  \"email\": \"ramesh.sharma@gmail.com\",\n  \"yearRange\": \"2022-2023\"\n}"
						},
						"url": {
							"raw": "{{baseUrl}}/api/v1/reports/export-email",
							"host": [
								"{{baseUrl}}"
							],
							"path": [
								"api",
								"v1",
								"reports",
								"export-email"
							]
						}
					}
				}
			]
		}
	],
	"variable": [
		{
			"key": "baseUrl",
			"value": "http://localhost:8080",
			"type": "string"
		},
		{
			"key": "token",
			"value": "your_jwt_bearer_token_here",
			"type": "string"
		},
		{
			"key": "shopId",
			"value": "shop_sharma_991",
			"type": "string"
		},
		{
			"key": "customerId",
			"value": "cust_ravi_001",
			"type": "string"
		},
		{
			"key": "transactionId",
			"value": "tx_cust_abc001",
			"type": "string"
		},
		{
			"key": "supplierId",
			"value": "sup_krish_01",
			"type": "string"
		}
	]
}
