NodeRings Docs

Batch Record Usage

Batch record multiple usage events (for bulk ingestion)

POST
/v1/usage/record:batch
Authorization<token>

Bearer token

In: header

X-Organization-ID<token>

Tenant or organization identifier

In: header

records?

Response Body

application/json

curl -X POST "https://api.nrings.io/v1/usage/record:batch" \  -H "Authorization: Bearer {your_token}" \  -H "X-Organization-ID: {your_org_id}" \  -H "Content-Type: application/json" \  -d '{  "records": [    {      "subscriptionId": "string",      "metricId": "string",      "metricCode": "string",      "quantity": "string",      "timestamp": "string",      "eventId": "string",      "properties": null,      "externalId": "string"    }  ]}'
{
  "usageRecords": [
    {
      "id": "string",
      "quantity": "string",
      "timestamp": "2019-08-24T14:15:22Z",
      "billingPeriodStart": "2019-08-24T14:15:22Z",
      "billingPeriodEnd": "2019-08-24T14:15:22Z",
      "eventId": "string",
      "properties": {},
      "usageRecordStatus": "USAGE_RECORD_STATUS_UNSPECIFIED",
      "errorMessage": "string",
      "processedAt": "2019-08-24T14:15:22Z",
      "externalId": "string",
      "subscriptionId": "string",
      "metricId": "string",
      "invoiceId": "string",
      "invoiceLineId": "string",
      "subscriptionName": "string",
      "metricName": "string",
      "metricCode": "string",
      "metadata": {},
      "status": "STATUS_UNSPECIFIED",
      "timestamps": {
        "createTime": "2019-08-24T14:15:22Z",
        "updateTime": "2019-08-24T14:15:22Z"
      }
    }
  ],
  "createdCount": 0,
  "duplicateCount": 0,
  "failedCount": 0,
  "errorMessages": [
    "string"
  ]
}