{
  "info": {
    "name": "Insurex24 API v1",
    "schema": "https://schema.getpostman.com/json/collection/v2.1.0/collection.json",
    "description": "Run the folders top to bottom: each request saves the ID the next one needs.\n\n1. Set `apiKey` (sandbox keys start with `sk_test_`).\n2. `baseUrl` defaults to a local mock: `npx @stoplight/prism-cli mock https://insurex24.com/openapi.yaml`. Switch it to `https://sandbox.insurex24.com/v1` once you have sandbox access.\n\nFull docs: https://insurex24.com/docs.html"
  },
  "auth": {
    "type": "bearer",
    "bearer": [
      {
        "key": "token",
        "value": "{{apiKey}}",
        "type": "string"
      }
    ]
  },
  "variable": [
    {
      "key": "baseUrl",
      "value": "http://127.0.0.1:4010"
    },
    {
      "key": "apiKey",
      "value": "sk_test_demo"
    },
    {
      "key": "kyc_id",
      "value": ""
    },
    {
      "key": "quote_id",
      "value": ""
    },
    {
      "key": "policy_id",
      "value": ""
    },
    {
      "key": "claim_id",
      "value": ""
    }
  ],
  "item": [
    {
      "name": "1. Onboard & issue",
      "item": [
        {
          "name": "Verify KYC",
          "request": {
            "method": "POST",
            "header": [
              {
                "key": "Content-Type",
                "value": "application/json"
              },
              {
                "key": "Idempotency-Key",
                "value": "{{$guid}}"
              }
            ],
            "url": {
              "raw": "{{baseUrl}}/kyc/verify",
              "host": [
                "{{baseUrl}}"
              ],
              "path": [
                "kyc",
                "verify"
              ]
            },
            "description": "Aadhaar eKYC + name/DOB match. Aadhaar ending 0000 fails in sandbox.",
            "body": {
              "mode": "raw",
              "raw": "{\n  \"aadhaar_number\": \"XXXX-XXXX-1234\",\n  \"name\": \"Priya Mehta\",\n  \"dob\": \"1988-03-22\",\n  \"consent\": true,\n  \"purpose\": \"insurance_onboarding\"\n}",
              "options": {
                "raw": {
                  "language": "json"
                }
              }
            }
          },
          "event": [
            {
              "listen": "test",
              "script": {
                "type": "text/javascript",
                "exec": [
                  "pm.test('Status is 2xx', () => pm.expect(pm.response.code).to.be.within(200, 299));",
                  "const j = pm.response.json(); if (j.id) pm.collectionVariables.set('kyc_id', j.id);"
                ]
              }
            }
          ]
        },
        {
          "name": "Create quote",
          "request": {
            "method": "POST",
            "header": [
              {
                "key": "Content-Type",
                "value": "application/json"
              },
              {
                "key": "Idempotency-Key",
                "value": "{{$guid}}"
              }
            ],
            "url": {
              "raw": "{{baseUrl}}/quotes",
              "host": [
                "{{baseUrl}}"
              ],
              "path": [
                "quotes"
              ]
            },
            "description": "Quotes are valid for 7 days.",
            "body": {
              "mode": "raw",
              "raw": "{\n  \"product\": \"motor_comprehensive\",\n  \"kyc_id\": \"{{kyc_id}}\",\n  \"vehicle\": {\n    \"registration\": \"MH12AB1234\",\n    \"year\": 2022,\n    \"idv\": 650000\n  },\n  \"add_ons\": [\n    \"zero_depreciation\"\n  ]\n}",
              "options": {
                "raw": {
                  "language": "json"
                }
              }
            }
          },
          "event": [
            {
              "listen": "test",
              "script": {
                "type": "text/javascript",
                "exec": [
                  "pm.test('Status is 2xx', () => pm.expect(pm.response.code).to.be.within(200, 299));",
                  "const j = pm.response.json(); if (j.id) pm.collectionVariables.set('quote_id', j.id);"
                ]
              }
            }
          ]
        },
        {
          "name": "Issue policy",
          "request": {
            "method": "POST",
            "header": [
              {
                "key": "Content-Type",
                "value": "application/json"
              },
              {
                "key": "Idempotency-Key",
                "value": "{{$guid}}"
              }
            ],
            "url": {
              "raw": "{{baseUrl}}/policies/issue",
              "host": [
                "{{baseUrl}}"
              ],
              "path": [
                "policies",
                "issue"
              ]
            },
            "description": "Fires the policy.issued webhook.",
            "body": {
              "mode": "raw",
              "raw": "{\n  \"quote_id\": \"{{quote_id}}\",\n  \"insured\": {\n    \"name\": \"Priya Mehta\",\n    \"dob\": \"1988-03-22\",\n    \"mobile\": \"+919812345678\",\n    \"email\": \"priya@example.com\"\n  },\n  \"start_date\": \"2026-10-01\"\n}",
              "options": {
                "raw": {
                  "language": "json"
                }
              }
            }
          },
          "event": [
            {
              "listen": "test",
              "script": {
                "type": "text/javascript",
                "exec": [
                  "pm.test('Status is 2xx', () => pm.expect(pm.response.code).to.be.within(200, 299));",
                  "const j = pm.response.json(); if (j.id) pm.collectionVariables.set('policy_id', j.id);"
                ]
              }
            }
          ]
        },
        {
          "name": "Retrieve policy",
          "request": {
            "method": "GET",
            "header": [],
            "url": {
              "raw": "{{baseUrl}}/policies/{{policy_id}}",
              "host": [
                "{{baseUrl}}"
              ],
              "path": [
                "policies",
                "{{policy_id}}"
              ]
            },
            "description": ""
          },
          "event": [
            {
              "listen": "test",
              "script": {
                "type": "text/javascript",
                "exec": [
                  "pm.test('Status is 2xx', () => pm.expect(pm.response.code).to.be.within(200, 299));"
                ]
              }
            }
          ]
        },
        {
          "name": "List policies",
          "request": {
            "method": "GET",
            "header": [],
            "url": {
              "raw": "{{baseUrl}}/policies?status=active&limit=20",
              "host": [
                "{{baseUrl}}"
              ],
              "path": [
                "policies?status=active&limit=20"
              ]
            },
            "description": ""
          },
          "event": [
            {
              "listen": "test",
              "script": {
                "type": "text/javascript",
                "exec": [
                  "pm.test('Status is 2xx', () => pm.expect(pm.response.code).to.be.within(200, 299));"
                ]
              }
            }
          ]
        }
      ]
    },
    {
      "name": "2. Claims",
      "item": [
        {
          "name": "Submit claim",
          "request": {
            "method": "POST",
            "header": [
              {
                "key": "Content-Type",
                "value": "application/json"
              },
              {
                "key": "Idempotency-Key",
                "value": "{{$guid}}"
              }
            ],
            "url": {
              "raw": "{{baseUrl}}/claims/submit",
              "host": [
                "{{baseUrl}}"
              ],
              "path": [
                "claims",
                "submit"
              ]
            },
            "description": "estimated_loss > 500000 routes to under_review in sandbox.",
            "body": {
              "mode": "raw",
              "raw": "{\n  \"policy_id\": \"{{policy_id}}\",\n  \"incident\": {\n    \"type\": \"accident\",\n    \"date\": \"2026-09-15\",\n    \"location\": \"Pune, Maharashtra\"\n  },\n  \"estimated_loss\": 45000,\n  \"document_ids\": [\n    \"doc_claimform_91\"\n  ]\n}",
              "options": {
                "raw": {
                  "language": "json"
                }
              }
            }
          },
          "event": [
            {
              "listen": "test",
              "script": {
                "type": "text/javascript",
                "exec": [
                  "pm.test('Status is 2xx', () => pm.expect(pm.response.code).to.be.within(200, 299));",
                  "const j = pm.response.json(); if (j.id) pm.collectionVariables.set('claim_id', j.id);"
                ]
              }
            }
          ]
        },
        {
          "name": "Retrieve claim",
          "request": {
            "method": "GET",
            "header": [],
            "url": {
              "raw": "{{baseUrl}}/claims/{{claim_id}}",
              "host": [
                "{{baseUrl}}"
              ],
              "path": [
                "claims",
                "{{claim_id}}"
              ]
            },
            "description": ""
          },
          "event": [
            {
              "listen": "test",
              "script": {
                "type": "text/javascript",
                "exec": [
                  "pm.test('Status is 2xx', () => pm.expect(pm.response.code).to.be.within(200, 299));"
                ]
              }
            }
          ]
        }
      ]
    },
    {
      "name": "3. Services",
      "item": [
        {
          "name": "OCR extract",
          "request": {
            "method": "POST",
            "header": [
              {
                "key": "Idempotency-Key",
                "value": "{{$guid}}"
              }
            ],
            "body": {
              "mode": "formdata",
              "formdata": [
                {
                  "key": "file",
                  "type": "file",
                  "src": []
                },
                {
                  "key": "document_type",
                  "value": "claim_form",
                  "type": "text"
                }
              ]
            },
            "url": {
              "raw": "{{baseUrl}}/ocr/extract",
              "host": [
                "{{baseUrl}}"
              ],
              "path": [
                "ocr",
                "extract"
              ]
            },
            "description": "Attach a PDF or image (max 10 MB)."
          }
        },
        {
          "name": "Send SMS",
          "request": {
            "method": "POST",
            "header": [
              {
                "key": "Content-Type",
                "value": "application/json"
              },
              {
                "key": "Idempotency-Key",
                "value": "{{$guid}}"
              }
            ],
            "url": {
              "raw": "{{baseUrl}}/notifications/send",
              "host": [
                "{{baseUrl}}"
              ],
              "path": [
                "notifications",
                "send"
              ]
            },
            "description": "",
            "body": {
              "mode": "raw",
              "raw": "{\n  \"channel\": \"sms\",\n  \"to\": \"+919812345678\",\n  \"template\": \"policy_issued\",\n  \"variables\": {\n    \"name\": \"Priya\",\n    \"policy_id\": \"{{policy_id}}\"\n  }\n}",
              "options": {
                "raw": {
                  "language": "json"
                }
              }
            }
          },
          "event": [
            {
              "listen": "test",
              "script": {
                "type": "text/javascript",
                "exec": [
                  "pm.test('Status is 2xx', () => pm.expect(pm.response.code).to.be.within(200, 299));"
                ]
              }
            }
          ]
        },
        {
          "name": "Trigger renewals",
          "request": {
            "method": "POST",
            "header": [
              {
                "key": "Content-Type",
                "value": "application/json"
              },
              {
                "key": "Idempotency-Key",
                "value": "{{$guid}}"
              }
            ],
            "url": {
              "raw": "{{baseUrl}}/renewals/trigger",
              "host": [
                "{{baseUrl}}"
              ],
              "path": [
                "renewals",
                "trigger"
              ]
            },
            "description": "Async \u2014 returns 202 with a job.",
            "body": {
              "mode": "raw",
              "raw": "{\n  \"policy_ids\": [\n    \"{{policy_id}}\"\n  ],\n  \"renewal_date\": \"2026-10-31\",\n  \"channels\": [\n    \"sms\",\n    \"email\"\n  ],\n  \"apply_loyalty_discount\": true\n}",
              "options": {
                "raw": {
                  "language": "json"
                }
              }
            }
          },
          "event": [
            {
              "listen": "test",
              "script": {
                "type": "text/javascript",
                "exec": [
                  "pm.test('Status is 2xx', () => pm.expect(pm.response.code).to.be.within(200, 299));"
                ]
              }
            }
          ]
        }
      ]
    }
  ]
}