Hello there,
I ran across a possible validation error when recording usage billing that I'd appreciate assistance troubleshooting.
When I execute a curl to "Record usage for a subscription" with
POST/1.0/kb/usages
{
"subscriptionId": "1fc44f4d-ce95-4890-81bf-910b354c74a2",
"unitUsageRecords": [
{
"unitType": "killowatt-hours-solar",
"usageRecords": [
{
"recordDate": 2019-10-19",
"amount": 677.13
}
]
}
]
}
I get the following error in the response body:
{
"className": "com.fasterxml.jackson.databind.JsonMappingException",
"code": null,
"message": "Unexpected character ('-' (code 45)): was expecting comma to separate OBJECT entries\n at [Source: org.apache.catalina.connector.CoyoteInputStream@70af675; line: 8, column: 30] (through reference chain: org.killbill.billing.jaxrs.json.SubscriptionUsageRecordJson[\"unitUsageRecords\"]->java.util.ArrayList[0]->org.killbill.billing.jaxrs.json.UnitUsageRecordJson[\"usageRecords\"]->java.util.ArrayList[0])",
"causeClassName": "com.fasterxml.jackson.core.JsonParseException",
"causeMessage": "Unexpected character ('-' (code 45)): was expecting comma to separate OBJECT entries\n at [Source: org.apache.catalina.connector.CoyoteInputStream@70af675; line: 8, column: 30]",
"stackTrace": []
}
I was expecting the `unitType` to be what I named/defined in the catalog. Is that incorrect?
I
have been having some difficulty finding the specific format /
validation for fields like the `recordDate` and `amount`. Could you
point me to where I can find `$date`, `$uuid`, `$int64`, and such
defined?
Also, could you point me to where in
the documentation the "TrackingId" of a usage record is defined or
generated? It did not seem to be required, but is this a correct
assumption?
Thanks for your help,
Savannah