How to process multiple serviceids in one usage batch
Summary:
We have requirement to pass multiple service ids in one usage batch.
Below 3 steps are used to create usage events
Step1 url:crmRestApi/resources/11.13.18.05/subscriptionUsageEventBatches/
step2:/crmRestApi/resources/latest
Payload :
{
"parts": [
{
"id": "part1",
"path": "/subscriptionUsageEvents",
"operation": "create",
"payload": {
"EventStartTime": "2025-03-12T10:00:01+00:00",
"BatchNumber": "UsageEventBatch_Prerate01",
"UsageQuantity": 5,
"ReportedUsageQuantity": 5,
"UsageUnitOfMeasure": "Ea",
"RatingSource": "",
"ServiceId": "54036_1",
"usageCharges": [
{
"ChargeDefinition": "USAGE_PRERATED",
"PricedQuantity": 100,
"ExtendedAmount": 200,
"PricedQuantityUnitOfMeasure": "Ea"
}
],
"ServiceId": "54036_2",
"usageCharges": [
{
"ChargeDefinition": "USAGE_PRERATED",
"PricedQuantity": 200,
"ExtendedAmount": 250,
"PricedQuantityUnitOfMeasure": "Ea"
}
],
"ServiceId": "54036_3",
"usageCharges": [
{
"ChargeDefinition": "USAGE_PRERATED",
"PricedQuantity": 300,
"ExtendedAmount": 350,
"PricedQuantityUnitOfMeasure": "Ea"
}
],
"ServiceId": "54036_4",
"usageCharges": [
{
"ChargeDefinition": "USAGE_PRERATED",
"PricedQuantity": 400,
"ExtendedAmount": 450,
"PricedQuantityUnitOfMeasure": "Ea"
}
],
"ServiceId": "54036_5",
"usageCharges": [
{
"ChargeDefinition": "USAGE_PRERATED",
"PricedQuantity": 500,
"ExtendedAmount": 550,
"PricedQuantityUnitOfMeasure": "Ea"
}
],
}
}
]
}
Note: This is only create usage for last service id and rest all being ignored