batch report usageRecordGroups
POST https://api.suger.cloud/org/{orgId}/batchCreateUsageRecordGroups
Batch report new usage record groups.
Parameters
| Name | In | Type | Required | Description |
|---|---|---|---|---|
orgId | path | string | yes | Organization ID |
Request Body
Required. Content-Type: application/json · Schema: array<NewUsageRecordGroup>
NewUsageRecordGroup fields:
| Field | Type | Required | Description |
|---|---|---|---|
billableRecords | array<MeteringUsageRecord> | no | for usage metering API v2, don't use it together with the records v1. |
entitlementID | string | yes | |
metaInfo | MeteringUsageRecordGroupMetaInfo | no | |
records | object | yes | for usage metering API v1, don't use it together with the billableRecords v2. |
timestamp | string | no | The timestamp of when the usage records were generated. Optional, if not provided, the current report timestamp will be used. This is not the timestamp of when the usage records were reported to Suger. |
usageAllocations | object | no | usage allocation information, dimension key -> usageAllocation array. Only supported for AWS marketplace usage metering at this moment. |
MeteringUsageRecord fields:
| Field | Type | Required | Description |
|---|---|---|---|
key | string | no | Key is the unique identifier of a billable metric. |
properties | object | no | Properties is the filters of a billable metric. It should be equal to the filters of the billable metric. |
quantity | number | no | The quantity (or numeric value) of a billable metric. |
MeteringUsageRecordGroupMetaInfo fields:
| Field | Type | Required | Description |
|---|---|---|---|
SkipValidation | boolean | no | If it is true, the validation of the usage record group is skipped. |
billableRecords | array<MeteringUsageRecord> | no | for usage metering API v2 |
erpInvoiceID | string | no | ERP invoice ID for tracking usage against external ERP service. |
lagoAmount | number | no | The lago amount (in dollars) of the customer. This field keeps the largest of the monthly amount. So it can only be updated when the invoice month increases. |
lagoSubscriptionID | string | no | The lago subscription ID of the customer. |
lagoUsageStartTime | string | no | The lago usage start time of the customer usage. |
metronomeDailyCostAmount | number | no | The metronome daily cost amount (in dollars) of the customer. |
metronomeInvoiceCreditBack | boolean | no | Whether the metronome invoice has been credited back. |
metronomeInvoiceCreditBackAmount | number | no | The metronome invoice amount (in dollars) of the customer. |
metronomeInvoiceID | string | no | The metronome invoice ID of the customer. |
metronomeMonthlyInvoiceAmount | number | no | The metronome monthly invoice amount (in dollars) of the customer. This field keeps the largest amount of the invoice month. So it can only be updated when the invoice month increases. |
metronomeMonthlyInvoiceAmountAdjusted | number | no | The metronome monthly invoice amount (in dollars) of the customer, which is adjusted by the seller. This field is populated only when the invoice amount is decreased by the seller via credit granting. |
orbInvoiceCreditBack | boolean | no | Whether the void orb invoice has been credited back. |
orbInvoiceCreditBackAmount | number | no | The credited-back amount (in dollars) for a voided orb invoice. |
orbInvoiceID | string | no | The orb invoice ID of the customer. |
originRecords | object | no | The original records reported by the customer before convertion. If no dimension mapping is applied, this field is the same as the records field. |
source | UsageRecordGroupSource | no | |
stripeInvoiceID | string | no | |
stripePeriodEndTime | string | no | The stripe period end time of the summary or invoice. UTC time in format "YYYY-MM-DDTHH:MM:SSZ". |
stripePeriodStartTime | string | no | The stripe period start time of the summary or invoice. UTC time in format "YYYY-MM-DDTHH:MM:SSZ". |
stripeSubscriptionItemID | string | no | |
stripeUsageRecordSummaryID | string | no | |
stripeUsageRecordSummaryTotalUsage | integer | no | |
timestamp | string | no | The timestamp (UTC)) of when the usage records were generated. Optional, if not provided, the current report timestamp will be used. |
usageAllocations | object | no | usage allocation information, dimension key -> UsageAllocation array. Only supported for AWS marketplace usage metering at this moment. |
Responses
200 — OK
Content-Type: application/json
MeteringUsageRecordGroup fields:
| Field | Type | Required | Description |
|---|---|---|---|
buyerID | string | no | |
creationTime | string | no | |
entitlementID | string | no | |
id | string | no | |
lastUpdateTime | string | no | |
metaInfo | MeteringUsageRecordGroupMetaInfo | no | |
organizationID | string | no | |
partner | string | no | |
records | object | no | |
reportedTime | string | no | nullable |
serialID | integer | no | |
status | string | no | |
usageRecordReportID | string | no |
MeteringUsageRecordGroupMetaInfo fields:
| Field | Type | Required | Description |
|---|---|---|---|
SkipValidation | boolean | no | If it is true, the validation of the usage record group is skipped. |
billableRecords | array<MeteringUsageRecord> | no | for usage metering API v2 |
erpInvoiceID | string | no | ERP invoice ID for tracking usage against external ERP service. |
lagoAmount | number | no | The lago amount (in dollars) of the customer. This field keeps the largest of the monthly amount. So it can only be updated when the invoice month increases. |
lagoSubscriptionID | string | no | The lago subscription ID of the customer. |
lagoUsageStartTime | string | no | The lago usage start time of the customer usage. |
metronomeDailyCostAmount | number | no | The metronome daily cost amount (in dollars) of the customer. |
metronomeInvoiceCreditBack | boolean | no | Whether the metronome invoice has been credited back. |
metronomeInvoiceCreditBackAmount | number | no | The metronome invoice amount (in dollars) of the customer. |
metronomeInvoiceID | string | no | The metronome invoice ID of the customer. |
metronomeMonthlyInvoiceAmount | number | no | The metronome monthly invoice amount (in dollars) of the customer. This field keeps the largest amount of the invoice month. So it can only be updated when the invoice month increases. |
metronomeMonthlyInvoiceAmountAdjusted | number | no | The metronome monthly invoice amount (in dollars) of the customer, which is adjusted by the seller. This field is populated only when the invoice amount is decreased by the seller via credit granting. |
orbInvoiceCreditBack | boolean | no | Whether the void orb invoice has been credited back. |
orbInvoiceCreditBackAmount | number | no | The credited-back amount (in dollars) for a voided orb invoice. |
orbInvoiceID | string | no | The orb invoice ID of the customer. |
originRecords | object | no | The original records reported by the customer before convertion. If no dimension mapping is applied, this field is the same as the records field. |
source | UsageRecordGroupSource | no | |
stripeInvoiceID | string | no | |
stripePeriodEndTime | string | no | The stripe period end time of the summary or invoice. UTC time in format "YYYY-MM-DDTHH:MM:SSZ". |
stripePeriodStartTime | string | no | The stripe period start time of the summary or invoice. UTC time in format "YYYY-MM-DDTHH:MM:SSZ". |
stripeSubscriptionItemID | string | no | |
stripeUsageRecordSummaryID | string | no | |
stripeUsageRecordSummaryTotalUsage | integer | no | |
timestamp | string | no | The timestamp (UTC)) of when the usage records were generated. Optional, if not provided, the current report timestamp will be used. |
usageAllocations | object | no | usage allocation information, dimension key -> UsageAllocation array. Only supported for AWS marketplace usage metering at this moment. |
MeteringUsageRecord fields:
| Field | Type | Required | Description |
|---|---|---|---|
key | string | no | Key is the unique identifier of a billable metric. |
properties | object | no | Properties is the filters of a billable metric. It should be equal to the filters of the billable metric. |
quantity | number | no | The quantity (or numeric value) of a billable metric. |
400 — all the quantity of usage records are zero
Content-Type: application/json
500 — Internal server error
Content-Type: application/json
View as Markdown · Interactive API reference
Spotted something wrong or out of date on this page? Tell us and we'll correct it.