0

fineract Post recurringdepositaccount api in postman responds with the error message:

{
    "timestamp": 1568640270686,
    "status": 500,
    "error": "Internal Server Error",
    "exception": "java.lang.NullPointerException",
    "message": null,
    "path": "/fineract-provider/api/v1/recurringdepositaccounts"
}

Here is my request body:

{
  "clientId": 67,
  "productId": 6,
  "locale": "en",
  "dateFormat": "dd MMMM yyyy",
  "submittedOnDate": "13 September 2019",
  "depositPeriodFrequencyId":1,
  "depositPeriod":1,
  "recurringFrequencyType":1,
  "recurringFrequency":1,
  "mandatoryRecommendedDepositAmount":1000,
  "isCalendarInherited":false,
  "preClosurePenalApplicable":false,
  "isMandatoryDeposit":true,
   "allowWithdrawal": false,
   "adjustAdvanceTowardsFuturePayments":false
}
manoj
  • 3,391
  • 2
  • 20
  • 30
  • HTTP Error 500 is a standard error for any request. If you have a working application use a sniffer like wireshark or fiddler and compare first request of working against non working. 500 indicates an authentication error which usually means the TLS is failing and/or certificate is bad. – jdweng Sep 16 '19 at 13:47
  • I don't know fineract, but as mentioned by @jdweng above, `500` is a standard error code when something goes wrong at the server-side (hence the error `Internal Server Error`). Based on the exception `java.lang.NullPointerException` and message `null`, it seems something went wrong in the Java part of the code. I'm not sure if you can somehow access/debug that Java code, or have a log file stating the line number where this NulPointerException is occurring? Or is the Java server-side a black box? – Kevin Cruijssen Sep 16 '19 at 14:01
  • Found this: https://demo.openmf.org/api-docs/apiLive.htm#rdaccounts Your code triggers an NPE, so if you are running this yourself, try hooking the server to a debugger to step through. If you have no control over the server, perhaps you're missing a required parameter? – Thomas Timbul Sep 16 '19 at 14:01
  • @ThomasTimbul, I am running the server locally myself. I am also suspecting a missing required parameter but the api documentation: demo.openmf.org/api-docs/apiLive.htm#rdaccounts does not cover post recurringdepositaccount and if it a missing parameter it will respond with a custom error message indicating the missing parameter ... – SukurujuShabangu Sep 16 '19 at 14:19
  • @SukurujuShabangu it does if you scroll down (quite a bit). `Mandatory fields: clientId or groupId, productId, submittedOnDate, depositPeriod, depositPeriodFrequencyId, recurringFrequency, recurringFrequencyType, depositAmount,isCalendarInherited, mandatoryRecommendedDepositAmount`. You appear to be missing `depositAmount`. – Thomas Timbul Sep 16 '19 at 15:07

1 Answers1

0

The documentation I could find at https://demo.openmf.org/api-docs/apiLive.htm#rdaccounts (scroll down beyond all the GET examples to get to the POST part) states the following mandatory fields:

clientId or groupId,
productId,
submittedOnDate,
depositPeriod,
depositPeriodFrequencyId,
recurringFrequency,
recurringFrequencyType,
depositAmount,
isCalendarInherited,
mandatoryRecommendedDepositAmount

Of these you appear to be missing depositAmount.

Thomas Timbul
  • 1,634
  • 6
  • 14
  • I did find it in the documentation but still responded with the same error message. My request body:{ "clientId": "66", "productId": "9", "locale": "en", "dateFormat": "dd MMMM yyyy", "submittedOnDate": "13 September 2019", "depositPeriod":"1", "depositPeriodFrequencyId":"0", "depositAmount":"100", "isCalendarInherited":false, "recurringFrequency":"1", "recurringFrequencyType":"0", "mandatoryRecommendedDepositAmount":"100" } – SukurujuShabangu Sep 16 '19 at 16:46
  • Then I'd strongly suggest step-debugging to find the problem. If the tool allows, set an Exception break point so that the debugger suspends once it hits the NPE. – Thomas Timbul Sep 17 '19 at 12:41