---
title: "Add usage record"
method: POST
path: "/v2/usage"
tags: ["Usage"]
---

# Add usage record

`POST /v2/usage`

Load usage records into the system

## Request body

- RawUsagesData — A list of RawUsage objects
  - `data` RawUsage[], required
    - `id` string — Unique identifier for a particular usage record
    - `aliasId` string — Alias ID for an usage based subscription item. This value is required if subscriptionId and subscriptionChargeId are not provided
    - `subscriptionId` string — SubscriptionId to attach usage record to. This value is required if aliasId is not provided
    - `chargeId` string — ChargeId of an usage based charge to attach usage record to. This value is required if aliasId is not provided
    - `usageTime` integer — Usage time in unix timestamp (seconds)
    - `usageQuantity` integer
    - `attributeReferences` AttributeReference[] — List of attribute references to derive the price for the usage record
      - `attributeDefinitionId` string
      - `attributeValue` string

## Response `200`

successful operation

- UsageBatchInsertResult
  - `rawUsagesTotal` integer
  - `totalFailed` integer
  - `totalDuplicates` integer
  - `entries` Entry[]
    - `rowNumber` integer
    - `failed` boolean
    - `failureReason` string

---

[API](https://skmtc.net/dealhub/apis/quote-api.md) · [All operations](https://skmtc.net/dealhub/apis/quote-api/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/dealhub/quote-api/versions/c30f5b9fbfab/schema)
