{
	"info": {
		"name": "Sahaj Mobile - Customer API",
		"description": "Customer Mobile App API for Sahaj Mobile Organization",
		"schema": "https://schema.getpostman.com/json/collection/v2.1.0/collection.json",
		"version": "1.0.0"
	},
	"auth": {
		"type": "bearer",
		"bearer": [
			{
				"key": "token",
				"value": "{{jwt_token}}",
				"type": "string"
			}
		]
	},
	"variable": [
		{
			"key": "base_url",
			"value": "http://localhost/sm.sahajmobile.org/index.php/API/Customer/V1/Api",
			"type": "string"
		},
		{
			"key": "jwt_token",
			"value": "",
			"type": "string"
		},
		{
			"key": "customer_mobile",
			"value": "38",
			"type": "string"
		},
		{
			"key": "customer_nid",
			"value": "5079644810",
			"type": "string"
		}
	],
	"item": [
		{
			"name": "Public Endpoints",
			"item": [
				{
					"name": "API Info",
					"request": {
						"auth": {
							"type": "noauth"
						},
						"method": "GET",
						"header": [],
						"url": {
							"raw": "{{base_url}}",
							"host": ["{{base_url}}"]
						}
					},
					"response": []
				},
				{
					"name": "Customer Login",
					"event": [
						{
							"listen": "test",
							"script": {
								"exec": [
									"if (pm.response.code === 200) {",
									"    var jsonData = pm.response.json();",
									"    if (jsonData.success && jsonData.data.token) {",
									"        pm.collectionVariables.set('jwt_token', jsonData.data.token);",
									"        console.log('JWT Token saved:', jsonData.data.token);",
									"    }",
									"}"
								],
								"type": "text/javascript"
							}
						}
					],
					"request": {
						"auth": {
							"type": "noauth"
						},
						"method": "POST",
						"header": [
							{
								"key": "Content-Type",
								"value": "application/json"
							}
						],
						"body": {
							"mode": "raw",
							"raw": "{\n    \"mobile\": \"{{customer_mobile}}\",\n    \"nid\": \"{{customer_nid}}\"\n}"
						},
						"url": {
							"raw": "{{base_url}}/login",
							"host": ["{{base_url}}"],
							"path": ["login"]
						}
					},
					"response": []
				},
				{
					"name": "Get FAQs",
					"request": {
						"auth": {
							"type": "noauth"
						},
						"method": "GET",
						"header": [],
						"url": {
							"raw": "{{base_url}}/faqs",
							"host": ["{{base_url}}"],
							"path": ["faqs"],
							"query": [
								{
									"key": "category_id",
									"value": "1",
									"disabled": true
								}
							]
						}
					},
					"response": []
				},
				{
					"name": "Get Support Info",
					"request": {
						"auth": {
							"type": "noauth"
						},
						"method": "GET",
						"header": [],
						"url": {
							"raw": "{{base_url}}/support",
							"host": ["{{base_url}}"],
							"path": ["support"]
						}
					},
					"response": []
				}
			]
		},
		{
			"name": "Protected Endpoints",
			"item": [
				{
					"name": "Customer Ledger",
					"request": {
						"method": "GET",
						"header": [
							{
								"key": "Authorization",
								"value": "Bearer {{jwt_token}}"
							}
						],
						"url": {
							"raw": "{{base_url}}/ledger",
							"host": ["{{base_url}}"],
							"path": ["ledger"]
						}
					},
					"response": []
				},
				{
					"name": "Payment History",
					"request": {
						"method": "GET",
						"header": [
							{
								"key": "Authorization",
								"value": "Bearer {{jwt_token}}"
							}
						],
						"url": {
							"raw": "{{base_url}}/payment_history?page=1&limit=20",
							"host": ["{{base_url}}"],
							"path": ["payment_history"],
							"query": [
								{
									"key": "page",
									"value": "1"
								},
								{
									"key": "limit",
									"value": "20"
								}
							]
						}
					},
					"response": []
				},
				{
					"name": "Upcoming EMI Schedule",
					"request": {
						"method": "GET",
						"header": [
							{
								"key": "Authorization",
								"value": "Bearer {{jwt_token}}"
							}
						],
						"url": {
							"raw": "{{base_url}}/upcoming_emi?limit=10",
							"host": ["{{base_url}}"],
							"path": ["upcoming_emi"],
							"query": [
								{
									"key": "limit",
									"value": "10"
								}
							]
						}
					},
					"response": []
				},
				{
					"name": "Repay Before Due (Payment Summary)",
					"request": {
						"method": "GET",
						"header": [
							{
								"key": "Authorization",
								"value": "Bearer {{jwt_token}}"
							}
						],
						"url": {
							"raw": "{{base_url}}/repay_before_due",
							"host": ["{{base_url}}"],
							"path": ["repay_before_due"]
						}
					},
					"response": []
				},
				{
					"name": "Submit Support Ticket",
					"request": {
						"method": "POST",
						"header": [
							{
								"key": "Authorization",
								"value": "Bearer {{jwt_token}}"
							},
							{
								"key": "Content-Type",
								"value": "application/json"
							}
						],
						"body": {
							"mode": "raw",
							"raw": "{\n    \"subject\": \"Payment Issue\",\n    \"message\": \"I am unable to make payment through Bkash. Please help.\",\n    \"priority\": \"high\"\n}"
						},
						"url": {
							"raw": "{{base_url}}/support_ticket",
							"host": ["{{base_url}}"],
							"path": ["support_ticket"]
						}
					},
					"response": []
				},
				{
					"name": "Initiate Payment",
					"request": {
						"method": "POST",
						"header": [
							{
								"key": "Authorization",
								"value": "Bearer {{jwt_token}}"
							},
							{
								"key": "Content-Type",
								"value": "application/json"
							}
						],
						"body": {
							"mode": "raw",
							"raw": "{\n    \"amount\": 5000,\n    \"gateway\": \"bkash\"\n}"
						},
						"url": {
							"raw": "{{base_url}}/payment_initiate",
							"host": ["{{base_url}}"],
							"path": ["payment_initiate"]
						}
					},
					"response": []
				}
			]
		},
		{
			"name": "Payment Gateway Options",
			"item": [
				{
					"name": "Bkash Payment",
					"request": {
						"method": "POST",
						"header": [
							{
								"key": "Authorization",
								"value": "Bearer {{jwt_token}}"
							},
							{
								"key": "Content-Type",
								"value": "application/json"
							}
						],
						"body": {
							"mode": "raw",
							"raw": "{\n    \"amount\": 1000,\n    \"gateway\": \"bkash\"\n}"
						},
						"url": {
							"raw": "{{base_url}}/payment_initiate",
							"host": ["{{base_url}}"],
							"path": ["payment_initiate"]
						}
					},
					"response": []
				},
				{
					"name": "Nagad Payment",
					"request": {
						"method": "POST",
						"header": [
							{
								"key": "Authorization",
								"value": "Bearer {{jwt_token}}"
							},
							{
								"key": "Content-Type",
								"value": "application/json"
							}
						],
						"body": {
							"mode": "raw",
							"raw": "{\n    \"amount\": 1000,\n    \"gateway\": \"nagad\"\n}"
						},
						"url": {
							"raw": "{{base_url}}/payment_initiate",
							"host": ["{{base_url}}"],
							"path": ["payment_initiate"]
						}
					},
					"response": []
				},
				{
					"name": "SurjoPay Payment",
					"request": {
						"method": "POST",
						"header": [
							{
								"key": "Authorization",
								"value": "Bearer {{jwt_token}}"
							},
							{
								"key": "Content-Type",
								"value": "application/json"
							}
						],
						"body": {
							"mode": "raw",
							"raw": "{\n    \"amount\": 1000,\n    \"gateway\": \"surjopay\"\n}"
						},
						"url": {
							"raw": "{{base_url}}/payment_initiate",
							"host": ["{{base_url}}"],
							"path": ["payment_initiate"]
						}
					},
					"response": []
				}
			]
		}
	]
}
