{
	"info": {
		"_postman_id": "a9e657c9-9488-4c1d-8472-358045618451",
		"name": "Apalis Auth Microservice",
		"description": "Comprehensive collection for Authentication and User management.",
		"schema": "https://schema.getpostman.com/json/collection/v2.1.0/collection.json"
	},
	"item": [
		{
			"name": "Customer Authentication",
			"item": [
				{
					"name": "Register",
					"request": {
						"method": "POST",
						"header": [
							{
								"key": "Content-Type",
								"value": "application/json"
							},
							{
								"key": "Accept",
								"value": "application/json"
							}
						],
						"body": {
							"mode": "raw",
							"raw": "{\n    \"first_name\": \"John\",\n    \"last_name\": \"Doe\",\n    \"email\": \"john.doe@example.com\",\n    \"mobile_no\": \"+919876543210\",\n    \"password\": \"Password@123\",\n    \"language\": \"en\",\n    \"device_type\": \"android\",\n    \"device_token\": \"fcm_token_xyz\"\n}"
						},
						"url": {
							"raw": "{{base_url}}/api/v1/register",
							"host": [
								"{{base_url}}"
							],
							"path": [
								"api",
								"v1",
								"register"
							]
						},
						"description": "Registers a new customer with personal and device details."
					},
					"response": [
						{
							"name": "Success - 201 Created",
							"originalRequest": {
								"method": "POST",
								"header": [],
								"body": {
									"mode": "raw",
									"raw": "{...}"
								},
								"url": {
									"raw": "{{base_url}}/api/v1/register"
								}
							},
							"status": "Created",
							"code": 201,
							"header": [
								{
									"key": "Content-Type",
									"value": "application/json"
								}
							],
							"body": "{\n    \"code\": 201,\n    \"message\": \"Registration successful.\",\n    \"data\": {\n        \"user\": { \"id\": 1, \"name\": \"John Doe\", \"email\": \"john.doe@example.com\", \"status\": \"active\" },\n        \"token\": \"eyJhbGci...\",\n        \"token_expired_at\": 1713184898\n    }\n}"
						}
					]
				},
				{
					"name": "Login",
					"request": {
						"method": "POST",
						"header": [
							{
								"key": "Content-Type",
								"value": "application/json"
							},
							{
								"key": "Accept",
								"value": "application/json"
							}
						],
						"body": {
							"mode": "raw",
							"raw": "{\n    \"type\": \"email\",\n    \"email\": \"john.doe@example.com\",\n    \"password\": \"Password@123\"\n}"
						},
						"url": {
							"raw": "{{base_url}}/api/v1/login",
							"host": [
								"{{base_url}}"
							],
							"path": [
								"api",
								"v1",
								"login"
							]
						}
					}
				},
				{
					"name": "Send OTP",
					"request": {
						"method": "POST",
						"header": [
							{
								"key": "Content-Type",
								"value": "application/json"
							},
							{
								"key": "Accept",
								"value": "application/json"
							}
						],
						"body": {
							"mode": "raw",
							"raw": "{\n    \"email\": \"john@example.com\",\n    \"type\": \"login\"\n}"
						},
						"url": {
							"raw": "{{base_url}}/api/v1/send-otp",
							"host": [
								"{{base_url}}"
							],
							"path": [
								"api",
								"v1",
								"send-otp"
							]
						},
						"description": "Sends an OTP to the provided identifier for verification."
					},
					"response": [
						{
							"name": "Success - 200 OK",
							"status": "OK",
							"code": 200,
							"header": [
								{
									"key": "Content-Type",
									"value": "application/json"
								}
							],
							"body": "{\n    \"code\": 200,\n    \"message\": \"OTP sent successfully.\",\n    \"data\": {\n        \"otp\": \"123456\"\n    }\n}"
						}
					]
				},
				{
					"name": "Verify OTP",
					"request": {
						"method": "POST",
						"header": [
							{
								"key": "Content-Type",
								"value": "application/json"
							},
							{
								"key": "Accept",
								"value": "application/json"
							}
						],
						"body": {
							"mode": "raw",
							"raw": "{\n    \"email\": \"john@example.com\",\n    \"otp\": \"123456\",\n    \"type\": \"login\"\n}"
						},
						"url": {
							"raw": "{{base_url}}/api/v1/verify-otp",
							"host": [
								"{{base_url}}"
							],
							"path": [
								"api",
								"v1",
								"verify-otp"
							]
						},
						"description": "Verifies the received OTP against system records."
					},
					"response": [
						{
							"name": "Success - 200 OK",
							"status": "OK",
							"code": 200,
							"header": [
								{
									"key": "Content-Type",
									"value": "application/json"
								}
							],
							"body": "{\n    \"code\": 200,\n    \"message\": \"OTP verified successfully.\",\n    \"data\": {\n        \"verify_otp\": true\n    }\n}"
						}
					]
				},
				{
					"name": "Forgot Password",
					"request": {
						"method": "POST",
						"header": [
							{
								"key": "Content-Type",
								"value": "application/json"
							},
							{
								"key": "Accept",
								"value": "application/json"
							}
						],
						"body": {
							"mode": "raw",
							"raw": "{\n    \"email\": \"john@example.com\"\n}"
						},
						"url": {
							"raw": "{{base_url}}/api/v1/forgot-password",
							"host": [
								"{{base_url}}"
							],
							"path": [
								"api",
								"v1",
								"forgot-password"
							]
						}
					}
				},
				{
					"name": "Reset Password",
					"request": {
						"method": "POST",
						"header": [
							{
								"key": "Content-Type",
								"value": "application/json"
							},
							{
								"key": "Accept",
								"value": "application/json"
							}
						],
						"body": {
							"mode": "raw",
							"raw": "{\n    \"email\": \"john@example.com\",\n    \"password\": \"newpassword123\",\n    \"password_confirmation\": \"newpassword123\"\n}"
						},
						"url": {
							"raw": "{{base_url}}/api/v1/reset-password",
							"host": [
								"{{base_url}}"
							],
							"path": [
								"api",
								"v1",
								"reset-password"
							]
						}
					}
				},
				{
					"name": "Send Verify Email",
					"request": {
						"method": "POST",
						"header": [
							{
								"key": "Content-Type",
								"value": "application/json"
							},
							{
								"key": "Accept",
								"value": "application/json"
							}
						],
						"body": {
							"mode": "raw",
							"raw": "{\n    \"email\": \"john@example.com\"\n}"
						},
						"url": {
							"raw": "{{base_url}}/api/v1/send-verify-email",
							"host": [
								"{{base_url}}"
							],
							"path": [
								"api",
								"v1",
								"send-verify-email"
							]
						}
					}
				},
				{
					"name": "User Exists",
					"request": {
						"method": "POST",
						"header": [
							{
								"key": "Content-Type",
								"value": "application/json"
							},
							{
								"key": "Accept",
								"value": "application/json"
							}
						],
						"body": {
							"mode": "raw",
							"raw": "{\n    \"email_or_mobile_no\": \"john@example.com\",\n    \"type\": \"customer\"\n}"
						},
						"url": {
							"raw": "{{base_url}}/api/v1/user-exists",
							"host": [
								"{{base_url}}"
							],
							"path": [
								"api",
								"v1",
								"user-exists"
							]
						}
					}
				},
				{
					"name": "Get User Detail",
					"request": {
						"method": "GET",
						"header": [
							{
								"key": "Accept",
								"value": "application/json"
							}
						],
						"url": {
							"raw": "{{base_url}}/api/v1/user/detail/1",
							"host": [
								"{{base_url}}"
							],
							"path": [
								"api",
								"v1",
								"user",
								"detail",
								"1"
							]
						}
					}
				},
				{
					"name": "Update Profile",
					"request": {
						"method": "POST",
						"header": [
							{
								"key": "Authorization",
								"value": "Bearer {{token}}"
							},
							{
								"key": "Accept",
								"value": "application/json"
							}
						],
						"body": {
							"mode": "formdata",
							"formdata": [
								{
									"key": "first_name",
									"value": "John",
									"type": "text"
								},
								{
									"key": "last_name",
									"value": "Doe",
									"type": "text"
								},
								{
									"key": "language",
									"value": "en",
									"type": "text"
								},
								{
									"key": "profile_picture",
									"type": "file",
									"src": ""
								}
							]
						},
						"url": {
							"raw": "{{base_url}}/api/v1/update-profile",
							"host": [
								"{{base_url}}"
							],
							"path": [
								"api",
								"v1",
								"update-profile"
							]
						},
						"description": "Updates customer personal info and profile picture."
					},
					"response": [
						{
							"name": "Success - 200 OK",
							"status": "OK",
							"code": 200,
							"header": [
								{
									"key": "Content-Type",
									"value": "application/json"
								}
							],
							"body": "{\n    \"code\": 200,\n    \"message\": \"Profile updated successfully.\",\n    \"data\": {\n        \"user\": {\n            \"id\": 15,\n            \"name\": \"John Doe\",\n            \"language\": \"en\"\n        }\n    }\n}"
						}
					]
				},
				{
					"name": "Update Mobile Number",
					"request": {
						"method": "POST",
						"header": [
							{
								"key": "Authorization",
								"value": "Bearer {{token}}"
							},
							{
								"key": "Content-Type",
								"value": "application/json"
							},
							{
								"key": "Accept",
								"value": "application/json"
							}
						],
						"body": {
							"mode": "raw",
							"raw": "{\n    \"mobile_no\": \"+919876543211\"\n}"
						},
						"url": {
							"raw": "{{base_url}}/api/v1/update-mobile-no",
							"host": [
								"{{base_url}}"
							],
							"path": [
								"api",
								"v1",
								"update-mobile-no"
							]
						},
						"description": "Updates the authenticated user's mobile number."
					},
					"response": [
						{
							"name": "Success - 200 OK",
							"status": "OK",
							"code": 200,
							"header": [
								{
									"key": "Content-Type",
									"value": "application/json"
								}
							],
							"body": "{\n    \"code\": 200,\n    \"message\": \"Mobile number updated successfully.\",\n    \"data\": {\n        \"user\": {\n            \"id\": 15,\n            \"name\": \"John Doe\",\n            \"mobile_no\": \"+919876543211\"\n        }\n    }\n}"
						}
					]
				},
				{
					"name": "Add Device Info",
					"request": {
						"method": "POST",
						"header": [
							{
								"key": "Content-Type",
								"value": "application/json"
							},
							{
								"key": "Accept",
								"value": "application/json"
							}
						],
						"body": {
							"mode": "raw",
							"raw": "{\n    \"user_type\": \"customer\",\n    \"user_id\": 15,\n    \"device_token\": \"fcm_token_abcdef123456789\",\n    \"device_name\": \"Galaxy S23 Ultra\",\n    \"device_model\": \"SM-S918B\",\n    \"device_type\": \"android\",\n    \"app_version\": \"2.1.0\",\n    \"os_version\": \"13.0\"\n}"
						},
						"url": {
							"raw": "{{base_url}}/api/v1/add-device",
							"host": [
								"{{base_url}}"
							],
							"path": [
								"api",
								"v1",
								"add-device"
							]
						},
						"description": "Registers or updates device information for push notifications."
					},
					"response": [
						{
							"name": "Success - 201 Created",
							"status": "Created",
							"code": 201,
							"header": [
								{
									"key": "Content-Type",
									"value": "application/json"
								}
							],
							"body": "{\n    \"code\": 201,\n    \"message\": \"Device information added successfully.\",\n    \"data\": []\n}"
						}
					]
				},
				{
					"name": "Upgrade User Tier",
					"request": {
						"method": "POST",
						"header": [
							{
								"key": "Content-Type",
								"value": "application/json"
							},
							{
								"key": "Accept",
								"value": "application/json"
							}
						],
						"body": {
							"mode": "raw",
							"raw": "{\n    \"user_id\": 15,\n    \"tier_id\": 3\n}"
						},
						"url": {
							"raw": "{{base_url}}/api/v1/users/upgrade-tier",
							"host": [
								"{{base_url}}"
							],
							"path": [
								"api",
								"v1",
								"users",
								"upgrade-tier"
							]
						},
						"description": "Upgrades a user to a specific tier level."
					},
					"response": [
						{
							"name": "Success - 200 OK (Upgraded)",
							"status": "OK",
							"code": 200,
							"header": [
								{
									"key": "Content-Type",
									"value": "application/json"
								}
							],
							"body": "{\n    \"code\": 200,\n    \"message\": \"User tier has been upgraded successfully.\",\n    \"data\": {\n        \"user_id\": 15,\n        \"old_tier_id\": 1,\n        \"new_tier_id\": 3\n    }\n}"
						},
						{
							"name": "Success - 200 OK (Already in Tier)",
							"status": "OK",
							"code": 200,
							"header": [
								{
									"key": "Content-Type",
									"value": "application/json"
								}
							],
							"body": "{\n    \"code\": 200,\n    \"message\": \"User is already in the requested tier.\",\n    \"data\": []\n}"
						}
					]
				},
				{
					"name": "Logout",
					"request": {
						"method": "POST",
						"header": [
							{
								"key": "Authorization",
								"value": "Bearer {{token}}"
							},
							{
								"key": "Content-Type",
								"value": "application/json"
							},
							{
								"key": "Accept",
								"value": "application/json"
							}
						],
						"body": {
							"mode": "raw",
							"raw": "{\n    \"device_token\": \"fcm_token_abcdef123456789\"\n}"
						},
						"url": {
							"raw": "{{base_url}}/api/v1/logout",
							"host": [
								"{{base_url}}"
							],
							"path": [
								"api",
								"v1",
								"logout"
							]
						},
						"description": "Invalidates the session and removes device info."
					},
					"response": [
						{
							"name": "Success - 200 OK",
							"status": "OK",
							"code": 200,
							"header": [
								{
									"key": "Content-Type",
									"value": "application/json"
								}
							],
							"body": "{\n    \"code\": 200,\n    \"message\": \"Logout successful.\",\n    \"data\": []\n}"
						}
					]
				},
				{
					"name": "Get Profile (Me)",
					"request": {
						"method": "GET",
						"header": [
							{
								"key": "Authorization",
								"value": "Bearer {{token}}"
							},
							{
								"key": "Accept",
								"value": "application/json"
							}
						],
						"url": {
							"raw": "{{base_url}}/api/v1/me",
							"host": [
								"{{base_url}}"
							],
							"path": [
								"api",
								"v1",
								"me"
							]
						},
						"description": "Retrieves the authenticated user's profile details."
					},
					"response": [
						{
							"name": "Success - 200 OK",
							"status": "OK",
							"code": 200,
							"header": [
								{
									"key": "Content-Type",
									"value": "application/json"
								}
							],
							"body": "{\n    \"code\": 200,\n    \"message\": \"User detail fetched successfully.\",\n    \"data\": {\n        \"user\": {\n            \"id\": 15,\n            \"name\": \"John Doe\",\n            \"email\": \"john.doe@example.com\",\n            \"status\": \"active\",\n            \"tier_label\": \"Standard\"\n        }\n    }\n}"
						}
					]
				},
				{
					"name": "Get Driver Lat-Long",
					"request": {
						"method": "GET",
						"header": [
							{
								"key": "Authorization",
								"value": "Bearer {{token}}"
							},
							{
								"key": "Accept",
								"value": "application/json"
							}
						],
						"url": {
							"raw": "{{base_url}}/api/v1/driver/:id/get-lat-long",
							"host": [
								"{{base_url}}"
							],
							"path": [
								"api",
								"v1",
								"driver",
								":id",
								"get-lat-long"
							],
							"variable": [
								{
									"key": "id",
									"value": "5"
								}
							]
						},
						"description": "Fetches the current latitude and longitude of a driver for tracking."
					},
					"response": [
						{
							"name": "Success - 200 OK",
							"status": "OK",
							"code": 200,
							"header": [
								{
									"key": "Content-Type",
									"value": "application/json"
								}
							],
							"body": "{\n    \"code\": 200,\n    \"message\": \"Latitude and longitude fetched successfully.\",\n    \"data\": {\n        \"latitude\": 23.022505,\n        \"longitude\": 72.571362\n    }\n}"
						}
					]
				}
			]
		}
	],
	"variable": [
		{
			"key": "base_url",
			"value": "http://localhost:8000"
		},
		{
			"key": "token",
			"value": ""
		}
	]
}