Hi folks,
I’m trying to create a new BillableService via the REST API (/ws/rest/v1/billing/billableService) on dev3.openmrs.org using it as a working example.
When I POST the following payload via Postman:
{
"name": "red",
"shortName": "ed",
"serviceType": "1592AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA",
"servicePrices": [
{
"paymentMode": "526bf278-ba81-4436-b867-c2f6641d060a",
"name": "Cash",
"price": 1.06
}
],
"serviceStatus": "ENABLED",
"concept": "140509AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA"
}
I get this error:
"error": {
"message": "[servicePrices on class org.openmrs.module.billing.api.model.BillableService => Cannot invoke \"java.util.Collection.toArray()\" because \"c\" is null]",
"code": "org.openmrs.module.webservices.rest.web.resource.impl.BaseDelegatingResource:692",
"detail": "org.openmrs.module.webservices.rest.web.response.ConversionException: servicePrices on class org.openmrs.module.billing.api.model.BillableService..."
}
with full json log here → { "error": { "message": "[servicePrices on class org.openmrs.modul - Pastebin.com
However, if I create the same service via the OpenMRS web UI, it succeeds, and the servicePrices are populated correctly and checking the request payload it is the same as i use for postman.
Has anyone been able to POST a BillableService successfully using Postman?
Any working example payloads into why the REST throws an Exception here would be appreciated.