[Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12 [System.Net.ServicePointManager]::ServerCertificateValidationCallback = {$true} $headers = @{ "fineract-platform-tenantid" = "default" "Content-Type" = "application/json" } $body = '{"username":"mifos", "password":"password"}' Write-Host "--- AUTHENTICATION ---" $authResponse = Invoke-RestMethod -Method Post -Uri "https://localhost:8443/fineract-provider/api/v1/authentication?username=mifos&password=password" -Headers $headers $authKey = $authResponse.base64EncodedAuthenticationKey $headers.Add("Authorization", "Basic $authKey") Write-Host "`n--- 1. GET /v1/clients/95/welcomekit ---" $res1 = Invoke-RestMethod -Method Get -Uri "https://localhost:8443/fineract-provider/api/v1/clients/95/welcomekit" -Headers $headers $res1 | ConvertTo-Json -Depth 10 Write-Host "`n--- 2. POST /v1/clients/95/welcomekit ---" $postBody = @{ deliveryAddress = "123 Main St, Springfield" deliveryMode = "POSTMAN" dispatchedOnDate = "30 July 2026" dateFormat = "dd MMMM yyyy" locale = "en" } | ConvertTo-Json Write-Host "Request Body: $postBody" $res2 = Invoke-RestMethod -Method Post -Uri "https://localhost:8443/fineract-provider/api/v1/clients/95/welcomekit" -Headers $headers -Body $postBody $res2 | ConvertTo-Json -Depth 10 $welcomeKitId = $res2.resourceId Write-Host "`n--- 3. GET /v1/clients/95/welcomekit (after POST) ---" $res3 = Invoke-RestMethod -Method Get -Uri "https://localhost:8443/fineract-provider/api/v1/clients/95/welcomekit" -Headers $headers $res3 | ConvertTo-Json -Depth 10 Write-Host "`n--- 4. PUT /v1/welcomekit/$welcomeKitId ---" $putBody = @{ status = "DELIVERED" } | ConvertTo-Json Write-Host "Request Body: $putBody" $res4 = Invoke-RestMethod -Method Put -Uri "https://localhost:8443/fineract-provider/api/v1/welcomekit/$welcomeKitId" -Headers $headers -Body $putBody $res4 | ConvertTo-Json -Depth 10 Write-Host "`n--- 5. GET /v1/clients/95/welcomekit (after PUT) ---" $res5 = Invoke-RestMethod -Method Get -Uri "https://localhost:8443/fineract-provider/api/v1/clients/95/welcomekit" -Headers $headers $res5 | ConvertTo-Json -Depth 10