Yandex Cloud
Search
Contact UsGet started
  • Blog
  • Pricing
  • Documentation
  • All Services
  • System Status
    • Featured
    • Infrastructure & Network
    • Data Platform
    • Containers
    • Developer tools
    • Serverless
    • Security
    • Monitoring & Resources
    • ML & AI
    • Business tools
  • All Solutions
    • By industry
    • By use case
    • Economics and Pricing
    • Security
    • Technical Support
    • Customer Stories
    • Gateway to Russia
    • Cloud for Startups
    • Education and Science
  • Blog
  • Pricing
  • Documentation
Yandex project
© 2025 Yandex.Cloud LLC
Yandex Cloud Marketplace
    • Getting started
    • Access management
      • Getting started with the API
        • Overview
          • Overview
          • Write
    • Access management
    • Audit Trails events

In this article:

  • gRPC request
  • WriteUsageRequest
  • UsageRecord
  • WriteUsageResponse
  • AcceptedUsageRecord
  • RejectedUsageRecord
  1. Partners
  2. Metering API reference
  3. gRPC
  4. ProductUsage
  5. Write

Marketplace Metering API, gRPC: ProductUsageService.Write

Written by
Yandex Cloud
Updated at December 17, 2024
  • gRPC request
  • WriteUsageRequest
  • UsageRecord
  • WriteUsageResponse
  • AcceptedUsageRecord
  • RejectedUsageRecord

Writes product's usage (authenticated by publisher's service account)

gRPC requestgRPC request

rpc Write (WriteUsageRequest) returns (WriteUsageResponse)

WriteUsageRequestWriteUsageRequest

{
  "dry_run": "bool",
  "product_instance_id": "string",
  "usage_records": [
    {
      "uuid": "string",
      "sku_id": "string",
      "quantity": "int64",
      "timestamp": "google.protobuf.Timestamp"
    }
  ]
}

Field

Description

dry_run

bool

Do not write usage, only validate

product_instance_id

string

Required field. Marketplace Product Instance's ID

usage_records[]

UsageRecord

List of product usage records (up to 25 per request)

UsageRecordUsageRecord

Field

Description

uuid

string

Required field. Unique identifier of the usage record (UUID format).

sku_id

string

Required field. Consumed Marketplace SKU ID, linked to UsageRecord.product_id.

quantity

int64

Quantity of SKU consumed, measured in sku.usage_unit units (e.g. bytes).

timestamp

google.protobuf.Timestamp

Required field. Timestamp in UTC for which the usage is being reported.

WriteUsageResponseWriteUsageResponse

{
  "accepted": [
    {
      "uuid": "string"
    }
  ],
  "rejected": [
    {
      "uuid": "string",
      "reason": "Reason"
    }
  ]
}

Field

Description

accepted[]

AcceptedUsageRecord

List of accepted product usage records

rejected[]

RejectedUsageRecord

List of rejected product usage records (with reason)

AcceptedUsageRecordAcceptedUsageRecord

Field

Description

uuid

string

Unique identifier of the usage record (UUID format).

RejectedUsageRecordRejectedUsageRecord

Field

Description

uuid

string

Unique identifier of the usage record (UUID format).

reason

enum Reason

The reason of rejection.

  • REASON_UNSPECIFIED
  • DUPLICATE
  • EXPIRED
  • INVALID_TIMESTAMP
  • INVALID_SKU_ID
  • INVALID_PRODUCT_ID
  • INVALID_QUANTITY
  • INVALID_ID

Was the article helpful?

Previous
Overview
Next
Getting started with the License Manager API
Yandex project
© 2025 Yandex.Cloud LLC