Files
AI_Pharmacy_Api/postman_collection.json
T

849 lines
21 KiB
JSON

{
"info": {
"name": "AI Pharmacy Core API",
"description": "Complete Postman testing collection for AI Pharmacy Core API with pre-configured headers, authentication, and sample payloads.",
"schema": "https://schema.getpostman.com/json/collection/v2.1.0/collection.json"
},
"variable": [
{
"key": "baseUrl",
"value": "http://localhost:8080",
"type": "string"
},
{
"key": "token",
"value": "",
"type": "string"
},
{
"key": "apiKey",
"value": "DUMUqJrNeyuaPDSZSsMf91qjgwc5K3N7",
"type": "string"
}
],
"auth": {
"type": "bearer",
"bearer": [
{
"key": "token",
"value": "{{token}}",
"type": "string"
}
]
},
"item": [
{
"name": "1. Auth & Identity",
"item": [
{
"name": "Register Pharmacist",
"request": {
"method": "POST",
"header": [
{
"key": "x-api-key",
"value": "{{apiKey}}",
"type": "text"
},
{
"key": "Content-Type",
"value": "application/json",
"type": "text"
}
],
"url": {
"raw": "{{baseUrl}}/v1/auth/register",
"host": [
"{{baseUrl}}"
],
"path": [
"v1",
"auth",
"register"
]
},
"body": {
"mode": "raw",
"raw": "{\n \"username\": \"pharmacist_jayam\",\n \"password\": \"Pharmacy@2026\",\n \"hospital_id\": \"hosp_001\",\n \"pharmacy_name\": \"Jayam Medicos & Pharmacy\",\n \"dl_number\": \"DL-TN-123456\",\n \"gstin\": \"33AAAAA0000A1Z5\",\n \"pharmacist_reg_number\": \"REG-TN-987654\",\n \"address\": \"123 Main Road, Anna Nagar, Chennai, Tamil Nadu - 600040\"\n}",
"options": {
"raw": {
"language": "json"
}
}
}
}
},
{
"name": "Pharmacist Login",
"request": {
"method": "POST",
"header": [
{
"key": "x-api-key",
"value": "{{apiKey}}",
"type": "text"
},
{
"key": "Content-Type",
"value": "application/json",
"type": "text"
}
],
"url": {
"raw": "{{baseUrl}}/v1/auth/login",
"host": [
"{{baseUrl}}"
],
"path": [
"v1",
"auth",
"login"
]
},
"body": {
"mode": "raw",
"raw": "{\n \"username\": \"pharmacist_jayam\",\n \"password\": \"Pharmacy@2026\"\n}",
"options": {
"raw": {
"language": "json"
}
}
}
}
},
{
"name": "Hospital M2M Auth Token",
"request": {
"method": "POST",
"header": [
{
"key": "x-api-key",
"value": "{{apiKey}}",
"type": "text"
},
{
"key": "Content-Type",
"value": "application/json",
"type": "text"
}
],
"url": {
"raw": "{{baseUrl}}/v1/auth/token",
"host": [
"{{baseUrl}}"
],
"path": [
"v1",
"auth",
"token"
]
},
"body": {
"mode": "raw",
"raw": "{\n \"grant_type\": \"client_credentials\",\n \"client_id\": \"pharmacy-v1-staging\",\n \"client_secret\": \"my_secret_key\"\n}",
"options": {
"raw": {
"language": "json"
}
}
}
}
},
{
"name": "Get Current Profile",
"request": {
"method": "GET",
"header": [
{
"key": "x-api-key",
"value": "{{apiKey}}",
"type": "text"
}
],
"url": {
"raw": "{{baseUrl}}/v1/auth/me",
"host": [
"{{baseUrl}}"
],
"path": [
"v1",
"auth",
"me"
]
}
}
},
{
"name": "Update Profile",
"request": {
"method": "PUT",
"header": [
{
"key": "x-api-key",
"value": "{{apiKey}}",
"type": "text"
},
{
"key": "Content-Type",
"value": "application/json",
"type": "text"
}
],
"url": {
"raw": "{{baseUrl}}/v1/auth/me",
"host": [
"{{baseUrl}}"
],
"path": [
"v1",
"auth",
"me"
]
},
"body": {
"mode": "raw",
"raw": "{}",
"options": {
"raw": {
"language": "json"
}
}
}
}
},
{
"name": "Logout",
"request": {
"method": "POST",
"header": [
{
"key": "x-api-key",
"value": "{{apiKey}}",
"type": "text"
},
{
"key": "Content-Type",
"value": "application/json",
"type": "text"
}
],
"url": {
"raw": "{{baseUrl}}/v1/auth/logout",
"host": [
"{{baseUrl}}"
],
"path": [
"v1",
"auth",
"logout"
]
},
"body": {
"mode": "raw",
"raw": "{}",
"options": {
"raw": {
"language": "json"
}
}
}
}
}
]
},
{
"name": "2. Catalogue",
"item": [
{
"name": "Get All Drugs",
"request": {
"method": "GET",
"header": [
{
"key": "x-api-key",
"value": "{{apiKey}}",
"type": "text"
}
],
"url": {
"raw": "{{baseUrl}}/v1/drugs",
"host": [
"{{baseUrl}}"
],
"path": [
"v1",
"drugs"
]
}
}
},
{
"name": "Create Drug",
"request": {
"method": "POST",
"header": [
{
"key": "x-api-key",
"value": "{{apiKey}}",
"type": "text"
},
{
"key": "Content-Type",
"value": "application/json",
"type": "text"
}
],
"url": {
"raw": "{{baseUrl}}/v1/drugs",
"host": [
"{{baseUrl}}"
],
"path": [
"v1",
"drugs"
]
},
"body": {
"mode": "raw",
"raw": "{\n \"id\": \"drg_101\",\n \"generic_name\": \"Amoxicillin and Potassium Clavulanate\",\n \"atc_code\": \"J01CR02\",\n \"schedule\": \"H1\",\n \"is_nti\": false,\n \"pregnancy_category\": \"B\"\n}",
"options": {
"raw": {
"language": "json"
}
}
}
}
},
{
"name": "Search Drugs",
"request": {
"method": "GET",
"header": [
{
"key": "x-api-key",
"value": "{{apiKey}}",
"type": "text"
}
],
"url": {
"raw": "{{baseUrl}}/v1/drugs/search",
"host": [
"{{baseUrl}}"
],
"path": [
"v1",
"drugs",
"search"
]
}
}
},
{
"name": "Get Product Batches",
"request": {
"method": "GET",
"header": [
{
"key": "x-api-key",
"value": "{{apiKey}}",
"type": "text"
}
],
"url": {
"raw": "{{baseUrl}}/v1/products/prd_4410/batches",
"host": [
"{{baseUrl}}"
],
"path": [
"v1",
"products",
"prd_4410",
"batches"
]
}
}
}
]
},
{
"name": "3. Inventory",
"item": [
{
"name": "Create Goods Received Note (GRN)",
"request": {
"method": "POST",
"header": [
{
"key": "x-api-key",
"value": "{{apiKey}}",
"type": "text"
},
{
"key": "Content-Type",
"value": "application/json",
"type": "text"
}
],
"url": {
"raw": "{{baseUrl}}/v1/inventory/grn",
"host": [
"{{baseUrl}}"
],
"path": [
"v1",
"inventory",
"grn"
]
},
"body": {
"mode": "raw",
"raw": "{\n \"supplier_id\": \"sup_001\",\n \"product_id\": \"prd_4410\",\n \"batch_no\": \"BATCH-2026-01\",\n \"expiry\": \"2027-12-31\",\n \"qty_on_hand\": 500,\n \"purchase_price\": 45\n}",
"options": {
"raw": {
"language": "json"
}
}
}
}
},
{
"name": "Get Expiring Stock",
"request": {
"method": "GET",
"header": [
{
"key": "x-api-key",
"value": "{{apiKey}}",
"type": "text"
}
],
"url": {
"raw": "{{baseUrl}}/v1/inventory/expiring",
"host": [
"{{baseUrl}}"
],
"path": [
"v1",
"inventory",
"expiring"
]
}
}
},
{
"name": "Get Low Stock",
"request": {
"method": "GET",
"header": [
{
"key": "x-api-key",
"value": "{{apiKey}}",
"type": "text"
}
],
"url": {
"raw": "{{baseUrl}}/v1/inventory/low-stock",
"host": [
"{{baseUrl}}"
],
"path": [
"v1",
"inventory",
"low-stock"
]
}
}
},
{
"name": "Stock Adjustment",
"request": {
"method": "POST",
"header": [
{
"key": "x-api-key",
"value": "{{apiKey}}",
"type": "text"
},
{
"key": "Content-Type",
"value": "application/json",
"type": "text"
}
],
"url": {
"raw": "{{baseUrl}}/v1/inventory/adjustments",
"host": [
"{{baseUrl}}"
],
"path": [
"v1",
"inventory",
"adjustments"
]
},
"body": {
"mode": "raw",
"raw": "{}",
"options": {
"raw": {
"language": "json"
}
}
}
}
},
{
"name": "Recall Batch",
"request": {
"method": "GET",
"header": [
{
"key": "x-api-key",
"value": "{{apiKey}}",
"type": "text"
}
],
"url": {
"raw": "{{baseUrl}}/v1/inventory/recall/B4421",
"host": [
"{{baseUrl}}"
],
"path": [
"v1",
"inventory",
"recall",
"B4421"
]
}
}
}
]
},
{
"name": "4. Dispensing & Orders",
"item": [
{
"name": "Create Dispensing Order",
"request": {
"method": "POST",
"header": [
{
"key": "x-api-key",
"value": "{{apiKey}}",
"type": "text"
},
{
"key": "Content-Type",
"value": "application/json",
"type": "text"
}
],
"url": {
"raw": "{{baseUrl}}/v1/orders",
"host": [
"{{baseUrl}}"
],
"path": [
"v1",
"orders"
]
},
"body": {
"mode": "raw",
"raw": "{\n \"subject_ref\": \"patient_001\",\n \"prescription_id\": \"rx_001\",\n \"payment_method\": \"cash\",\n \"items\": [\n {\n \"batch_no\": \"B4421\",\n \"qty\": 10,\n \"unit_price\": 7.85\n }\n ]\n}",
"options": {
"raw": {
"language": "json"
}
}
}
}
},
{
"name": "Get Order History",
"request": {
"method": "GET",
"header": [
{
"key": "x-api-key",
"value": "{{apiKey}}",
"type": "text"
}
],
"url": {
"raw": "{{baseUrl}}/v1/orders/history",
"host": [
"{{baseUrl}}"
],
"path": [
"v1",
"orders",
"history"
]
}
}
},
{
"name": "Get H1 Register",
"request": {
"method": "GET",
"header": [
{
"key": "x-api-key",
"value": "{{apiKey}}",
"type": "text"
}
],
"url": {
"raw": "{{baseUrl}}/v1/orders/h1-register",
"host": [
"{{baseUrl}}"
],
"path": [
"v1",
"orders",
"h1-register"
]
}
}
},
{
"name": "Get Invoice PDF",
"request": {
"method": "GET",
"header": [
{
"key": "x-api-key",
"value": "{{apiKey}}",
"type": "text"
}
],
"url": {
"raw": "{{baseUrl}}/v1/orders/ord_001/invoice/pdf",
"host": [
"{{baseUrl}}"
],
"path": [
"v1",
"orders",
"ord_001",
"invoice",
"pdf"
]
}
}
}
]
},
{
"name": "5. Integration (Hospital & Telegaruda)",
"item": [
{
"name": "Sync Hospital Patient",
"request": {
"method": "POST",
"header": [
{
"key": "x-api-key",
"value": "{{apiKey}}",
"type": "text"
},
{
"key": "Content-Type",
"value": "application/json",
"type": "text"
}
],
"url": {
"raw": "{{baseUrl}}/v1/integration/hospital/patient-sync",
"host": [
"{{baseUrl}}"
],
"path": [
"v1",
"integration",
"hospital",
"patient-sync"
]
},
"body": {
"mode": "raw",
"raw": "{\n \"hospital_patient_id\": \"PAT-2026-8891\",\n \"full_name\": \"Ramesh Kumar\",\n \"contact_number\": \"9876543210\",\n \"email\": \"ramesh@example.com\",\n \"allergies\": \"Penicillin\"\n}",
"options": {
"raw": {
"language": "json"
}
}
}
}
},
{
"name": "Get Hospital Patients",
"request": {
"method": "GET",
"header": [
{
"key": "x-api-key",
"value": "{{apiKey}}",
"type": "text"
}
],
"url": {
"raw": "{{baseUrl}}/v1/integration/hospital/patients",
"host": [
"{{baseUrl}}"
],
"path": [
"v1",
"integration",
"hospital",
"patients"
]
}
}
},
{
"name": "Get Hospital Prescriptions",
"request": {
"method": "GET",
"header": [
{
"key": "x-api-key",
"value": "{{apiKey}}",
"type": "text"
}
],
"url": {
"raw": "{{baseUrl}}/v1/integration/hospital/prescriptions",
"host": [
"{{baseUrl}}"
],
"path": [
"v1",
"integration",
"hospital",
"prescriptions"
]
}
}
},
{
"name": "Receive Telegaruda Rx",
"request": {
"method": "POST",
"header": [
{
"key": "x-api-key",
"value": "{{apiKey}}",
"type": "text"
},
{
"key": "Content-Type",
"value": "application/json",
"type": "text"
}
],
"url": {
"raw": "{{baseUrl}}/v1/integration/telegaruda/prescription",
"host": [
"{{baseUrl}}"
],
"path": [
"v1",
"integration",
"telegaruda",
"prescription"
]
},
"body": {
"mode": "raw",
"raw": "{}",
"options": {
"raw": {
"language": "json"
}
}
}
}
}
]
},
{
"name": "6. Audit & Analytics",
"item": [
{
"name": "Get Dashboard Metrics",
"request": {
"method": "GET",
"header": [
{
"key": "x-api-key",
"value": "{{apiKey}}",
"type": "text"
}
],
"url": {
"raw": "{{baseUrl}}/v1/audit/dashboard-metrics",
"host": [
"{{baseUrl}}"
],
"path": [
"v1",
"audit",
"dashboard-metrics"
]
}
}
},
{
"name": "Get AI Calls Log",
"request": {
"method": "GET",
"header": [
{
"key": "x-api-key",
"value": "{{apiKey}}",
"type": "text"
}
],
"url": {
"raw": "{{baseUrl}}/v1/audit/ai-calls",
"host": [
"{{baseUrl}}"
],
"path": [
"v1",
"audit",
"ai-calls"
]
}
}
},
{
"name": "Get Safety Overrides Log",
"request": {
"method": "GET",
"header": [
{
"key": "x-api-key",
"value": "{{apiKey}}",
"type": "text"
}
],
"url": {
"raw": "{{baseUrl}}/v1/audit/overrides",
"host": [
"{{baseUrl}}"
],
"path": [
"v1",
"audit",
"overrides"
]
}
}
}
]
}
]
}