{
	"info": {
		"_postman_id": "a1b2c3d4-e5f6-7890-abcd-ef1234567890",
		"name": "OTP Service API",
		"description": "Sanctum-authenticated API for balance, services, activity records, OTP, messages, and token revoke.\n\n1. Set `base_url` (default: http://localhost:8000).\n2. Paste a Sanctum personal access token into `token` (generated from the admin Users UI).\n3. Replace `userServiceId` with an active assignment id from GET /api/services.",
		"schema": "https://schema.getpostman.com/json/collection/v2.1.0/collection.json"
	},
	"auth": {
		"type": "bearer",
		"bearer": [
			{
				"key": "token",
				"value": "{{token}}",
				"type": "string"
			}
		]
	},
	"variable": [
		{
			"key": "base_url",
			"value": "http://localhost:8000"
		},
		{
			"key": "token",
			"value": ""
		},
		{
			"key": "userServiceId",
			"value": "1"
		}
	],
	"item": [
		{
			"name": "Balance",
			"item": [
				{
					"name": "Get Current Balance",
					"request": {
						"method": "GET",
						"header": [
							{
								"key": "Accept",
								"value": "application/json"
							}
						],
						"url": {
							"raw": "{{base_url}}/api/balance",
							"host": [
								"{{base_url}}"
							],
							"path": [
								"api",
								"balance"
							]
						},
						"description": "Returns the authenticated user's current balance."
					},
					"response": []
				},
				{
					"name": "Get Balance Ledger",
					"request": {
						"method": "GET",
						"header": [
							{
								"key": "Accept",
								"value": "application/json"
							}
						],
						"url": {
							"raw": "{{base_url}}/api/balance/ledger?page=1&per_page=10&sort_by=created_at&sort_dir=desc&search=",
							"host": [
								"{{base_url}}"
							],
							"path": [
								"api",
								"balance",
								"ledger"
							],
							"query": [
								{
									"key": "page",
									"value": "1"
								},
								{
									"key": "per_page",
									"value": "10"
								},
								{
									"key": "sort_by",
									"value": "created_at",
									"description": "id, type, balance, current_balance, created_at, updated_at"
								},
								{
									"key": "sort_dir",
									"value": "desc",
									"description": "asc | desc"
								},
								{
									"key": "search",
									"value": "",
									"description": "Optional search term"
								}
							]
						},
						"description": "Paginated ledger entries for the authenticated user."
					},
					"response": []
				}
			]
		},
		{
			"name": "Services",
			"item": [
				{
					"name": "List Active Services",
					"request": {
						"method": "GET",
						"header": [
							{
								"key": "Accept",
								"value": "application/json"
							}
						],
						"url": {
							"raw": "{{base_url}}/api/services?page=1&per_page=10&sort_by=created_at&sort_dir=desc&search=",
							"host": [
								"{{base_url}}"
							],
							"path": [
								"api",
								"services"
							],
							"query": [
								{
									"key": "page",
									"value": "1"
								},
								{
									"key": "per_page",
									"value": "10"
								},
								{
									"key": "sort_by",
									"value": "created_at",
									"description": "id, service_name, price, max_per_day, max_per_month, created_at"
								},
								{
									"key": "sort_dir",
									"value": "desc"
								},
								{
									"key": "search",
									"value": ""
								}
							]
						},
						"description": "Lists the authenticated user's active service assignments. Copy an `id` into collection variable `userServiceId`."
					},
					"response": []
				},
				{
					"name": "Show Service",
					"request": {
						"method": "GET",
						"header": [
							{
								"key": "Accept",
								"value": "application/json"
							}
						],
						"url": {
							"raw": "{{base_url}}/api/services/{{userServiceId}}",
							"host": [
								"{{base_url}}"
							],
							"path": [
								"api",
								"services",
								"{{userServiceId}}"
							]
						},
						"description": "Show one active service assignment owned by the authenticated user."
					},
					"response": []
				},
				{
					"name": "List Service Activity Records",
					"request": {
						"method": "GET",
						"header": [
							{
								"key": "Accept",
								"value": "application/json"
							}
						],
						"url": {
							"raw": "{{base_url}}/api/services/{{userServiceId}}/records?page=1&per_page=10&sort_by=created_at&sort_dir=desc&search=",
							"host": [
								"{{base_url}}"
							],
							"path": [
								"api",
								"services",
								"{{userServiceId}}",
								"records"
							],
							"query": [
								{
									"key": "page",
									"value": "1"
								},
								{
									"key": "per_page",
									"value": "10"
								},
								{
									"key": "sort_by",
									"value": "created_at"
								},
								{
									"key": "sort_dir",
									"value": "desc"
								},
								{
									"key": "search",
									"value": ""
								}
							]
						},
						"description": "OTP requests or message sends for the selected active service (based on service slug)."
					},
					"response": []
				}
			]
		},
		{
			"name": "OTP",
			"item": [
				{
					"name": "Send OTP",
					"request": {
						"method": "POST",
						"header": [
							{
								"key": "Accept",
								"value": "application/json"
							},
							{
								"key": "Content-Type",
								"value": "application/json"
							}
						],
						"body": {
							"mode": "raw",
							"raw": "{\n    \"phone\": \"15551234567\"\n}",
							"options": {
								"raw": {
									"language": "json"
								}
							}
						},
						"url": {
							"raw": "{{base_url}}/api/otp/send",
							"host": [
								"{{base_url}}"
							],
							"path": [
								"api",
								"otp",
								"send"
							]
						},
						"description": "Send an OTP to a phone number."
					},
					"response": []
				},
				{
					"name": "Verify OTP",
					"request": {
						"method": "POST",
						"header": [
							{
								"key": "Accept",
								"value": "application/json"
							},
							{
								"key": "Content-Type",
								"value": "application/json"
							}
						],
						"body": {
							"mode": "raw",
							"raw": "{\n    \"phone\": \"15551234567\",\n    \"code\": \"123456\"\n}",
							"options": {
								"raw": {
									"language": "json"
								}
							}
						},
						"url": {
							"raw": "{{base_url}}/api/otp/verify",
							"host": [
								"{{base_url}}"
							],
							"path": [
								"api",
								"otp",
								"verify"
							]
						}
					},
					"response": []
				}
			]
		},
		{
			"name": "Messages",
			"item": [
				{
					"name": "Send Message",
					"request": {
						"method": "POST",
						"header": [
							{
								"key": "Accept",
								"value": "application/json"
							},
							{
								"key": "Content-Type",
								"value": "application/json"
							}
						],
						"body": {
							"mode": "raw",
							"raw": "{\n    \"body\": \"Hello from OTP Service\",\n    \"recipients\": [\n        \"15551112222\",\n        \"15553334444\"\n    ]\n}",
							"options": {
								"raw": {
									"language": "json"
								}
							}
						},
						"url": {
							"raw": "{{base_url}}/api/messages",
							"host": [
								"{{base_url}}"
							],
							"path": [
								"api",
								"messages"
							]
						},
						"description": "`user_service_id` is optional if the user has a single active Messages assignment."
					},
					"response": []
				}
			]
		},
		{
			"name": "Token",
			"item": [
				{
					"name": "Revoke Current Token",
					"request": {
						"method": "DELETE",
						"header": [
							{
								"key": "Accept",
								"value": "application/json"
							}
						],
						"url": {
							"raw": "{{base_url}}/api/token",
							"host": [
								"{{base_url}}"
							],
							"path": [
								"api",
								"token"
							]
						},
						"description": "Revokes the Bearer token used for this request. Clear the `token` collection variable afterward."
					},
					"response": []
				}
			]
		}
	]
}
