{"activeVersionTag":"latest","latestAvailableVersionTag":"latest","collection":{"info":{"_postman_id":"66987a0f-ffdc-4159-9427-fbd717a07fd8","name":"Motor Insurance Database II - Public API","description":"## Overview\n\nThe Motor Insurance Database (MID II) Public API provides secure, audited, real-time integration with the National Insurance Commission (NIC) motor insurance registry. Authorized institutions can programmatically submit policies, verify coverage, check sticker inventory, and manage fleet contracts.\n\n---\n\n## Authentication\n\nThis collection uses an API Key in header X-API-Key with value {{apiKey}}. Set apiKey in your active environment or vault. Child requests inherit this unless overridden.\n\n---\n\n## Base URLs\n\n| Environment | Base URL |\n| --- | --- |\n|  |  |\n| Development | `https://middevapi.nic.gov.gh` |\n|  |  |\n\n---\n\n## API Endpoints\n\n### 1\\. Health Check\n\nCheck API availability and status.\n\nEndpoint: `GET /api/public-api/health`\n\nAuthentication: None required\n\nResponse:\n\n``` json\n{\n\"data\": {\n\"status\": \"healthy\",\n\"timestamp\": \"2025-01-15T10:30:00Z\",\n\"service\": \"Public Motor Insurance API\"\n},\n\"httpStatusCode\": 200\n}\n\n ```\n\n``` markup\n2. Create Individual Motor Policy\nCreate a new motor insurance policy for a single vehicle.\nEndpoint: POST /api/public-api/individual/policies\nAuthentication: Required\nRequest Body:\n\n ```\n\n``` json\n{\n  \"data\": {\n  \"branchCode\": \"ACC-MAIN-001\",\n  \"productCode\": \"COMP-2025\",\n  \"riskTypeCode\": \"PRIVATE_INDIVIDUAL_X1\",\n  \"intermediaryCode\": \"INT-BROKER-007\",\n  \"subintermediaryCode\": \"SUB-INT-015\",\n  \"vehicleData\": {\n  \"registrationNumber\": \"GH-4567-22\",\n  \"chassisNumber\": \"JN1TANT31U0012345\",\n  \"make\": \"TOYOTA\",\n  \"model\": \"CAMRY\",\n  \"manufacturingYear\": 2022,\n  \"registrationYear\": 2022,\n  \"vehicleColour\": \"Black\",\n  \"bodyType\": \"Sedan\",\n  \"seatingCapacity\": 5,\n  \"grossWeight\": 1600,\n  \"cubicCapacity\": 2500,\n  \"vehicleUsage\": \"PRIVATE\",\n  \"vehicleMileage\": 12000,\n  \"fuelType\": \"Petrol\",\n  \"vehicleValue\": 150000.00,\n  \"verified\": true\n  },\n  \"customerData\": {\n  \"isActive\": true,\n  \"type\": \"NATURAL\",\n  \"ghanaCardNumber\": \"GHA-123456789-0\",\n  \"firstName\": \"Kwame\",\n  \"otherNames\": \"Kofi\",\n  \"lastName\": \"Mensah\",\n  \"title\": \"Mr.\",\n  \"dateOfBirth\": \"1985-06-15\",\n  \"gender\": \"MALE\",\n  \"nationality\": \"Ghanaian\",\n  \"levelOfEducation\": \"University Degree\",\n  \"maritalStatus\": \"Married\",\n  \"email\": \"kwame.mensah@example.com\",\n  \"phoneNumber\": \"+233244567890\",\n  \"digitalAddress\": \"GA-123-4567\",\n  \"residentialAddress\": \"House No. 45, North Legon, Accra\",\n  \"occupation\": \"Software Engineer\"\n  },\n  \"policyData\": {\n  \"startDate\": \"2025-01-01\",\n  \"expiryDate\": \"2025-12-31\",\n  \"sumInsured\": 150000.00,\n  \"grossPremium\": 4500.00,\n  \"type\": \"NEW_BUSINESS\",\n  \"transactionDate\": \"2024-12-20\",\n  \"excessBought\": true,\n  \"extraTppdl\": 10000.00,\n  \"umbrellaLimit\": 200000.00,\n  \"noClaimDiscount\": 15.0,\n  \"earnedNoClaimDiscount\": 15.0,\n  \"companyAssignedPolicyNumber\": \"POL-2025-001234\",\n  \"calculationType\": \"FULL_YEAR\"\n  }\n  }\n}\n\n ```\n\nSuccess Response (200):\n\n``` json\n{\n\"success\": true,\n\"message\": \"Policy created successfully\",\n\"data\": {\n\"policyId\": 1234,\n\"policyNumber\": \"POL-2025-001234\",\n\"vehicleId\": 567,\n\"customerId\": 890,\n\"customerType\": \"NATURAL\",\n\"stickerLink\": \"https://stickers.motorinsurance.com/STK-2025-12345\",\n\"stickerNumber\": \"STK-2025-12345\",\n\"status\": \"ACTIVE\",\n\"paymentId\": 456,\n\"customerAccountId\": 789\n},\n\"httpStatusCode\": 200\n}\n\n ```\n\nError Responses:\n\n``` json\n{\n\"success\": false,\n\"error\": \"Either registrationNumber or chassisNumber must be provided\",\n\"httpStatusCode\": 400\n}\n\n ```\n\n409 Conflict - Duplicate policy\n\n``` json\n{\n\"success\": false,\n\"error\": \"A policy already exists for this vehicle with overlapping dates\",\n\"suggestions\": [\"Check existing policies\", \"Adjust policy dates\"],\n\"httpStatusCode\": 409\n}\n\n ```\n\n## Risk Type Codes\n\nValid risk type codes for policies:\n\n| Code | Description |\n| --- | --- |\n| `PRIVATE_INDIVIDUAL_X1` | Private individual vehicles |\n| `PRIVATE_CORPORATE_X4` | Corporate/company vehicles |\n| `TAXI` | Taxi services |\n| `HIRING_CARS` | Car hire/rental services |\n| `MINI_BUS` | Minibuses (14 seats or less) |\n| `MAXI_BUS` | Large buses |\n| `MOTOR_CYCLE` | Motorcycles |\n| `AMBULANCE_HEARSE` | Emergency/funeral vehicles |\n| `OWN_GOODS_SMALL` | Small goods vehicles |\n| `OWN_GOODS_LARGE` | Large goods vehicles |\n| `ART_TANKERS` | Articulated tankers |\n| `GEN_CARTAGE_SMALL` | Small general cartage |\n| `GEN_CARTAGE_LARGE` | Large general cartage |\n| `Z802_ONSITE` | Construction machinery (on-site) |\n| `Z802_ONROAD` | Construction machinery (on-road) |\n| `GW1_CLASS_1` | Goods weight class 1 |\n| `GW1_CLASS_2` | Goods weight class 2 |\n| `GW1_CLASS_3` | Goods weight class 3 |\n\n## Data Formats & Standards\n\n### Dates\n\n- Format: ISO 8601 (YYYY-MM-DD)\n    \n- Example: 2025-01-15\n    \n- Validation: startDate must be before expiryDate\n    \n\n### Currency\n\n- All monetary values in Ghana Cedis (GHS)\n    \n- Format: Decimal numbers (e.g., 1250.50)\n    \n\n### Phone Numbers\n\n- Format: International format recommended (024XXXXXXXXX)\n    \n- Example: 0244567890\n    \n\n### Email Addresses\n\n- Format: Valid email format\n    \n- Example: [user@example.com](https://mailto:user@example.com)\n    \n\n## Error Codes\n\n| HTTP Status | Meaning |\n| --- | --- |\n| 200 | Success |\n| 400 | Bad Request - Validation error |\n| 401 | Unauthorized - Invalid/missing API key |\n| 403 | Forbidden - Insufficient privileges |\n| 404 | Not Found - Resource doesn't exist |\n| 409 | Conflict - Duplicate entry |\n| 500 | Internal Server Error |\n\nBest Practices\n\n1. Error Handling: Always check success field in responses\n    \n2. Idempotency: Use companyAssignedPolicyNumber for duplicate prevention\n    \n3. Validation: Validate data locally before API calls\n    \n4. Logging: Log all API requests and responses for audit\n    \n5. Retry Logic: Implement exponential backoff for 5xx errors\n    \n6. Pagination: Use appropriate page sizes to avoid timeouts\n    \n7. Caching: Cache reference data (products, risk types) locally\n    \n\n### 3\\. Create Fleet Policy\n\nCreate a fleet insurance contract with multiple vehicles.\n\nEndpoint: POST /api/public-api/fleets/policies\n\nAuthentication: Required\n\nRequest Body:\n\n``` json\n{\n  \"data\": {\n    \"currencyCode\": \"GHS\",\n    \"isActive\": true,\n    \"fleetSize\": 3,\n    \"fleetDiscount\": 15.0,\n    \"grossPremium\": 8500.00,\n    \"notes\": \"Corporate fleet policy for logistics company\",\n    \"startDate\": \"2025-01-01\",\n    \"expiryDate\": \"2025-12-31\",\n    \"transactionDate\": \"2024-12-20\",\n    \"paymentDate\": \"2024-12-22\",\n    \"paymentMode\": \"BANK_TRANSFER\",\n    \"specialTerms\": \"30-day grace period for premium payment\",\n    \"umbrellaLimit\": 500000.00,\n    \"branchCode\": \"ACC-MAIN\",\n    \"intermediaryCode\": \"INT-005\",\n    \"subintermediaryCode\": \"SUB-INT-012\",\n    \"customerData\": {\n      \"isActive\": true,\n      \"type\": \"LEGAL\",\n      \"companyName\": \"Swift Logistics Limited\",\n      \"tinNumber\": \"C0123456789\",\n      \"country\": \"Ghana\",\n      \"registeredAddress\": \"Plot 245, Industrial Area, Tema\",\n      \"businessSector\": \"Transportation and Logistics\",\n      \"companySize\": 150,\n      \"yearEstablished\": 2010,\n      \"contactPerson\": \"John Mensah\",\n      \"contactPersonPhone\": \"+233244567890\",\n      \"contactPersonEmail\": \"john.mensah@swiftlogistics.com.gh\",\n      \"email\": \"info@swiftlogistics.com.gh\",\n      \"phoneNumber\": \"+233302456789\",\n      \"digitalAddress\": \"GT-245-6789\"\n    },\n    \"vehicles\": [\n      {\n        \"registrationNumber\": \"AS-1234-20\",\n        \"make\": \"TOYOTA\",\n        \"model\": \"YARIS\",\n        \"manufacturingYear\": 2020,\n        \"registrationYear\": 2020,\n        \"chassisNumber\": \"ETJTFSX23P800012345\",\n        \"vehicleColour\": \"White\",\n        \"bodyType\": \"Van\",\n        \"fuelType\": \"Diesel\",\n        \"vehicleUsage\": \"COMMERCIAL\",\n        \"seatingCapacity\": 14,\n        \"grossWeight\": 2800,\n        \"vehicleMileage\": 45000,\n        \"vehicleValue\": 85000.00,\n        \"cubicCapacity\": 2700,\n        \"verified\": true,\n        \"productCode\": \"COMP-COMM\",\n        \"riskTypeCode\": \"MINI_BUS\",\n        \"sumInsured\": 85000.00,\n        \"grossPremium\": 2800.00,\n        \"excessBought\": true,\n        \"extraTppdl\": 5000.00,\n        \"fleetDiscount\": 15.0,\n        \"noClaimDiscount\": 10.0\n      },\n      {\n        \"registrationNumber\": \"AR-1234-20\",\n        \"make\": \"TOYOTA\",\n        \"model\": \"TUNDRA\",\n        \"manufacturingYear\": 2020,\n        \"registrationYear\": 2020,\n        \"chassisNumber\": \"JTFSX23P800012345\",\n        \"vehicleColour\": \"White\",\n        \"bodyType\": \"Van\",\n        \"fuelType\": \"Diesel\",\n        \"vehicleUsage\": \"COMMERCIAL\",\n        \"seatingCapacity\": 14,\n        \"grossWeight\": 2800,\n        \"vehicleMileage\": 45000,\n        \"vehicleValue\": 85000.00,\n        \"cubicCapacity\": 2700,\n        \"verified\": true,\n        \"productCode\": \"COMP-COMM\",\n        \"riskTypeCode\": \"MINI_BUS\",\n        \"sumInsured\": 85000.00,\n        \"grossPremium\": 2800.00,\n        \"excessBought\": true,\n        \"extraTppdl\": 5000.00,\n        \"fleetDiscount\": 15.0,\n        \"noClaimDiscount\": 10.0\n      },\n      {\n        \"registrationNumber\": \"WR-1234-20\",\n        \"make\": \"TESLA\",\n        \"model\": \"MODEL 3\",\n        \"manufacturingYear\": 2020,\n        \"registrationYear\": 2020,\n        \"chassisNumber\": \"YTREJTFSX23P800012345\",\n        \"vehicleColour\": \"White\",\n        \"bodyType\": \"Van\",\n        \"fuelType\": \"Diesel\",\n        \"vehicleUsage\": \"COMMERCIAL\",\n        \"seatingCapacity\": 14,\n        \"grossWeight\": 2800,\n        \"vehicleMileage\": 45000,\n        \"vehicleValue\": 85000.00,\n        \"cubicCapacity\": 2700,\n        \"verified\": true,\n        \"productCode\": \"COMP-COMM\",\n        \"riskTypeCode\": \"MINI_BUS\",\n        \"sumInsured\": 85000.00,\n        \"grossPremium\": 2800.00,\n        \"excessBought\": true,\n        \"extraTppdl\": 5000.00,\n        \"fleetDiscount\": 15.0,\n        \"noClaimDiscount\": 10.0\n      }\n    ]\n  }\n}\n\n ```","schema":"https://schema.getpostman.com/json/collection/v2.0.0/collection.json","isPublicCollection":false,"owner":"50193515","team":11655531,"collectionId":"66987a0f-ffdc-4159-9427-fbd717a07fd8","publishedId":"2sB3dHWD5H","public":true,"publicUrl":"https://middoc.nic.gov.gh","privateUrl":"https://go.postman.co/documentation/50193515-66987a0f-ffdc-4159-9427-fbd717a07fd8","customColor":{"top-bar":"FFFFFF","right-sidebar":"303030","highlight":"FF6C37"},"documentationLayout":"classic-single-column","customisation":{"metaTags":[{"name":"description","value":""},{"name":"title","value":"Motor Insurance Database Documentation"}],"appearance":{"default":"system_default","themes":[{"name":"dark","logo":"https://content.pstmn.io/9d32a5e6-71c2-4f9c-a978-f090d250c603/ZmF2aWNvbi5wbmc=","colors":{"top-bar":"212121","right-sidebar":"303030","highlight":"FF6C37"}},{"name":"light","logo":"https://content.pstmn.io/79541515-d4a3-4e2e-9876-87901242e0cc/TklDIExvZ28gc21hbGwucG5n","colors":{"top-bar":"FFFFFF","right-sidebar":"303030","highlight":"FF6C37"}}]}},"version":"8.10.0","publishDate":"2025-12-09T11:48:32.000Z","activeVersionTag":"latest","documentationTheme":"light","metaTags":{"title":"Motor Insurance Database Documentation","description":""},"logos":{"logoLight":"https://content.pstmn.io/79541515-d4a3-4e2e-9876-87901242e0cc/TklDIExvZ28gc21hbGwucG5n","logoDark":"https://content.pstmn.io/9d32a5e6-71c2-4f9c-a978-f090d250c603/ZmF2aWNvbi5wbmc="}},"statusCode":200},"environments":[{"name":"Motor Insurance Database API","id":"f28f3898-2ada-48e5-be2d-d2866bf09c86","owner":"50193515","values":[{"key":"baseUrl","value":"","enabled":true,"type":"default"},{"key":"accesToken","value":"","enabled":true,"type":"secret"},{"key":"accesTokenAllianz","value":"","enabled":true,"type":"secret"},{"key":"bearerToken_oko","value":"","enabled":true,"type":"default"},{"key":"baseURLLocal","value":"","enabled":true,"type":"default"},{"key":"apiKey","value":"","enabled":true,"type":"default"}],"published":true}],"user":{"authenticated":false,"permissions":{"publish":false}},"run":{"button":{"js":"https://run.pstmn.io/button.js","css":"https://run.pstmn.io/button.css"}},"web":"https://www.getpostman.com/","team":{"logo":"https://res.cloudinary.com/postman/image/upload/t_team_logo_pubdoc/v1/team/9e4e2950b85b77d49cc92efcc58fba72303bacba952f21e01eb039f258576aa4","favicon":"https://nic.gov.gh/favicon.ico"},"isEnvFetchError":false,"languages":"[{\"key\":\"csharp\",\"label\":\"C#\",\"variant\":\"HttpClient\"},{\"key\":\"csharp\",\"label\":\"C#\",\"variant\":\"RestSharp\"},{\"key\":\"curl\",\"label\":\"cURL\",\"variant\":\"cURL\"},{\"key\":\"dart\",\"label\":\"Dart\",\"variant\":\"http\"},{\"key\":\"go\",\"label\":\"Go\",\"variant\":\"Native\"},{\"key\":\"http\",\"label\":\"HTTP\",\"variant\":\"HTTP\"},{\"key\":\"java\",\"label\":\"Java\",\"variant\":\"OkHttp\"},{\"key\":\"java\",\"label\":\"Java\",\"variant\":\"Unirest\"},{\"key\":\"javascript\",\"label\":\"JavaScript\",\"variant\":\"Fetch\"},{\"key\":\"javascript\",\"label\":\"JavaScript\",\"variant\":\"jQuery\"},{\"key\":\"javascript\",\"label\":\"JavaScript\",\"variant\":\"XHR\"},{\"key\":\"c\",\"label\":\"C\",\"variant\":\"libcurl\"},{\"key\":\"nodejs\",\"label\":\"NodeJs\",\"variant\":\"Axios\"},{\"key\":\"nodejs\",\"label\":\"NodeJs\",\"variant\":\"Native\"},{\"key\":\"nodejs\",\"label\":\"NodeJs\",\"variant\":\"Request\"},{\"key\":\"nodejs\",\"label\":\"NodeJs\",\"variant\":\"Unirest\"},{\"key\":\"objective-c\",\"label\":\"Objective-C\",\"variant\":\"NSURLSession\"},{\"key\":\"ocaml\",\"label\":\"OCaml\",\"variant\":\"Cohttp\"},{\"key\":\"php\",\"label\":\"PHP\",\"variant\":\"cURL\"},{\"key\":\"php\",\"label\":\"PHP\",\"variant\":\"Guzzle\"},{\"key\":\"php\",\"label\":\"PHP\",\"variant\":\"HTTP_Request2\"},{\"key\":\"php\",\"label\":\"PHP\",\"variant\":\"pecl_http\"},{\"key\":\"powershell\",\"label\":\"PowerShell\",\"variant\":\"RestMethod\"},{\"key\":\"python\",\"label\":\"Python\",\"variant\":\"http.client\"},{\"key\":\"python\",\"label\":\"Python\",\"variant\":\"Requests\"},{\"key\":\"r\",\"label\":\"R\",\"variant\":\"httr\"},{\"key\":\"r\",\"label\":\"R\",\"variant\":\"RCurl\"},{\"key\":\"ruby\",\"label\":\"Ruby\",\"variant\":\"Net::HTTP\"},{\"key\":\"shell\",\"label\":\"Shell\",\"variant\":\"Httpie\"},{\"key\":\"shell\",\"label\":\"Shell\",\"variant\":\"wget\"},{\"key\":\"swift\",\"label\":\"Swift\",\"variant\":\"URLSession\"}]","languageSettings":[{"key":"csharp","label":"C#","variant":"HttpClient"},{"key":"csharp","label":"C#","variant":"RestSharp"},{"key":"curl","label":"cURL","variant":"cURL"},{"key":"dart","label":"Dart","variant":"http"},{"key":"go","label":"Go","variant":"Native"},{"key":"http","label":"HTTP","variant":"HTTP"},{"key":"java","label":"Java","variant":"OkHttp"},{"key":"java","label":"Java","variant":"Unirest"},{"key":"javascript","label":"JavaScript","variant":"Fetch"},{"key":"javascript","label":"JavaScript","variant":"jQuery"},{"key":"javascript","label":"JavaScript","variant":"XHR"},{"key":"c","label":"C","variant":"libcurl"},{"key":"nodejs","label":"NodeJs","variant":"Axios"},{"key":"nodejs","label":"NodeJs","variant":"Native"},{"key":"nodejs","label":"NodeJs","variant":"Request"},{"key":"nodejs","label":"NodeJs","variant":"Unirest"},{"key":"objective-c","label":"Objective-C","variant":"NSURLSession"},{"key":"ocaml","label":"OCaml","variant":"Cohttp"},{"key":"php","label":"PHP","variant":"cURL"},{"key":"php","label":"PHP","variant":"Guzzle"},{"key":"php","label":"PHP","variant":"HTTP_Request2"},{"key":"php","label":"PHP","variant":"pecl_http"},{"key":"powershell","label":"PowerShell","variant":"RestMethod"},{"key":"python","label":"Python","variant":"http.client"},{"key":"python","label":"Python","variant":"Requests"},{"key":"r","label":"R","variant":"httr"},{"key":"r","label":"R","variant":"RCurl"},{"key":"ruby","label":"Ruby","variant":"Net::HTTP"},{"key":"shell","label":"Shell","variant":"Httpie"},{"key":"shell","label":"Shell","variant":"wget"},{"key":"swift","label":"Swift","variant":"URLSession"}],"languageOptions":[{"label":"C# - HttpClient","value":"csharp - HttpClient - C#"},{"label":"C# - RestSharp","value":"csharp - RestSharp - C#"},{"label":"cURL - cURL","value":"curl - cURL - cURL"},{"label":"Dart - http","value":"dart - http - Dart"},{"label":"Go - Native","value":"go - Native - Go"},{"label":"HTTP - HTTP","value":"http - HTTP - HTTP"},{"label":"Java - OkHttp","value":"java - OkHttp - Java"},{"label":"Java - Unirest","value":"java - Unirest - Java"},{"label":"JavaScript - Fetch","value":"javascript - Fetch - JavaScript"},{"label":"JavaScript - jQuery","value":"javascript - jQuery - JavaScript"},{"label":"JavaScript - XHR","value":"javascript - XHR - JavaScript"},{"label":"C - libcurl","value":"c - libcurl - C"},{"label":"NodeJs - Axios","value":"nodejs - Axios - NodeJs"},{"label":"NodeJs - Native","value":"nodejs - Native - NodeJs"},{"label":"NodeJs - Request","value":"nodejs - Request - NodeJs"},{"label":"NodeJs - Unirest","value":"nodejs - Unirest - NodeJs"},{"label":"Objective-C - NSURLSession","value":"objective-c - NSURLSession - Objective-C"},{"label":"OCaml - Cohttp","value":"ocaml - Cohttp - OCaml"},{"label":"PHP - cURL","value":"php - cURL - PHP"},{"label":"PHP - Guzzle","value":"php - Guzzle - PHP"},{"label":"PHP - HTTP_Request2","value":"php - HTTP_Request2 - PHP"},{"label":"PHP - pecl_http","value":"php - pecl_http - PHP"},{"label":"PowerShell - RestMethod","value":"powershell - RestMethod - PowerShell"},{"label":"Python - http.client","value":"python - http.client - Python"},{"label":"Python - Requests","value":"python - Requests - Python"},{"label":"R - httr","value":"r - httr - R"},{"label":"R - RCurl","value":"r - RCurl - R"},{"label":"Ruby - Net::HTTP","value":"ruby - Net::HTTP - Ruby"},{"label":"Shell - Httpie","value":"shell - Httpie - Shell"},{"label":"Shell - wget","value":"shell - wget - Shell"},{"label":"Swift - URLSession","value":"swift - URLSession - Swift"}],"layoutOptions":[{"value":"classic-single-column","label":"Single Column"},{"value":"classic-double-column","label":"Double Column"}],"versionOptions":[],"environmentOptions":[{"value":"0","label":"No Environment"},{"label":"Motor Insurance Database API","value":"50193515-f28f3898-2ada-48e5-be2d-d2866bf09c86"}],"canonicalUrl":"https://middoc.nic.gov.gh/view/metadata/2sB3dHWD5H"}