canonical: https://jentic.com/apis/azure.com/commerce-management-client

# Microsoft Azure CommerceManagementClient

Jentic publishes the only available OpenAPI specification for CommerceManagementClient, keeping it validated and agent-ready. The Admin Commerce Management Client is the Azure Stack admin-side API for retrieving subscriber usage aggregates and rotating the encryption used to protect commerce data in a stamp. It exposes 3 endpoints: a list of supported provider operations, a query over subscriberUsageAggregates by reporting period, and a triggerable updateEncryption action. Use it from an Azure Stack operator context to feed billing pipelines or roll the storage encryption key.

## For AI agents

Pull subscriber usage aggregates and trigger encryption rotation on an Azure Stack stamp's commerce subsystem.

## Scope

Does not handle public Azure billing, invoicing, tax filing, or tenant-side cost analysis - use for Azure Stack admin-side commerce operations only.

## Capabilities

- Pull subscriber usage aggregates for a reporting window to feed downstream billing or chargeback systems
- Trigger an updateEncryption action to rotate the encryption protecting commerce data on the stamp
- List the supported provider operations exposed by Microsoft.Commerce.Admin
- Filter usage aggregates by subscription scope when reconciling cross-tenant billing
- Verify which Microsoft.Commerce.Admin operations are available before scripting an Azure Stack billing job

## Use cases

### Feed Azure Stack usage into a chargeback pipeline

Operators of an Azure Stack stamp need to bill internal tenants for the resources they consume. The Commerce Management Client returns subscriberUsageAggregates for a chosen reporting period, which can be flattened into a chargeback ledger and reconciled against tenant-side records. This avoids hand-extracting usage from the Azure Stack portal.

Example prompt: Retrieve subscriberUsageAggregates from the stamp for the previous calendar month and emit a CSV grouped by subscriptionId.

### Rotate commerce encryption on schedule

Compliance regimes commonly require encryption-at-rest keys to be rotated on a fixed cadence. The Commerce Management Client exposes an updateEncryption action that triggers a stamp-side key rotation, so an operator can run rotation as a scheduled job rather than a manual portal task.

Example prompt: Invoke POST /subscriptions/{subscriptionId}/providers/Microsoft.Commerce.Admin/updateEncryption on the stamp and confirm the operation status reaches Succeeded.

### Discover available admin operations

Before automating an Azure Stack workflow an operator needs to know which Microsoft.Commerce.Admin operations the stamp actually advertises. The operations endpoint returns the registered set, which can be diffed across stamp versions to detect deprecated or newly available actions.

Example prompt: GET /providers/Microsoft.Commerce.Admin/operations and return the names of all supported operations.

### Agent-driven Azure Stack billing extraction

An AI agent integrated through Jentic can run a monthly job that pulls subscriberUsageAggregates from the stamp, normalises the records, and posts them to a chargeback system or a finance warehouse. Jentic's intent search exposes the right CommerceManagementClient operation and the AAD token stays scoped through the vault.

Example prompt: On the first of each month, call subscriberUsageAggregates for the prior month and POST the JSON to the finance warehouse webhook.

## Key endpoints

| Method | Path | Description |
| --- | --- | --- |
| GET | /providers/Microsoft.Commerce.Admin/operations | List supported Microsoft.Commerce.Admin operations |
| GET | /subscriptions/{subscriptionId}/providers/Microsoft.Commerce.Admin/subscriberUsageAggregates | Retrieve subscriber usage aggregates for a reporting period |
| POST | /subscriptions/{subscriptionId}/providers/Microsoft.Commerce.Admin/updateEncryption | Rotate the encryption protecting commerce data |

## Key resources

- **SubscriberUsageAggregates** — Query usage aggregates by subscription and reporting period
- **UpdateEncryption** — Trigger rotation of the commerce subsystem's encryption
- **Operations** — List supported Microsoft.Commerce.Admin provider operations

## Why Jentic

- **Setup:** Wiring the CommerceManagementClient by hand means configuring Azure AD OAuth2 and pointing it at the Azure Stack admin host adminmanagement.local.azurestack.external rather than public Azure, then constructing the Microsoft.Commerce.Admin usage and encryption paths yourself. Through Jentic you install once, import the CommerceManagementClient from the API Directory, store the Azure AD credential once, and your agent calls it.
- **Permission scoping:** This API mixes a subscription-scoped path segment with operations whose targets travel in the request, so limit the agent to the operations it needs, such as reading subscriber usage aggregates rather than updating commerce encryption. Sensitive operations like updateEncryption are not reachable unless you add them.
- **Credential handling:** Your Azure AD credential is stored once, encrypted, by your own Jentic One instance and injected at execution time. It never enters the agent's prompt, logs, or context.
- **Discovery method:** Agents search Jentic by intent such as 'pull Azure Stack subscriber usage', and Jentic returns the matching Microsoft.Commerce.Admin operation with its input schema so the agent calls the right admin path without browsing the Azure Stack reference.

## Related APIs

- **Consumption Management Client** — Public Azure equivalent for usage aggregates and reservation reporting
- **Cost Management Client** — Public Azure cost analysis API that complements stamp-side usage extraction
- **Compute Admin Client** — Companion Azure Stack admin client for compute-side resource provider operations

## FAQ

### Why is there no official OpenAPI spec for CommerceManagementClient?

Microsoft Azure does not publish a consolidated OpenAPI specification for the Azure Stack Commerce Admin API. Jentic generates and maintains this spec so that AI agents and developers can call CommerceManagementClient via structured tooling. It is validated against the live API and kept up to date. Get started with Jentic One, the self-hosted execution layer.

### What authentication does the CommerceManagementClient use?

It uses Azure Active Directory OAuth 2.0 with the implicit flow at https://login.microsoftonline.com/common/oauth2/authorize and the user_impersonation scope. The caller must hold an Azure Stack operator role. Through Jentic the AAD token sits in the encrypted vault and never enters the agent context.

### Can I pull billing data with the CommerceManagementClient?

Yes - issue GET /subscriptions/{subscriptionId}/providers/Microsoft.Commerce.Admin/subscriberUsageAggregates with reportedStartTime and reportedEndTime query parameters. The response contains usage records aggregated per subscriber for the reporting window.

### What are the rate limits for the CommerceManagementClient?

The Azure Stack admin endpoints inherit Azure Resource Manager throttling (subscription-level read and write quotas). The spec does not declare separate rate-limit headers; expect ARM 429 responses if a billing job hammers the stamp.

### How do I rotate commerce encryption through Jentic?

Search Jentic for 'rotate azure stack commerce encryption', load the schema for POST /subscriptions/{subscriptionId}/providers/Microsoft.Commerce.Admin/updateEncryption, and execute it. Run pip install jentic to get the SDK.

### Is the CommerceManagementClient free?

The admin endpoints themselves are free; you must hold an Azure Stack operator role. Costs come from running the Azure Stack stamp, not from calling this management API.

### Can I limit what my agent is allowed to do with the CommerceManagementClient?

Yes. Because you run Jentic One yourself, your own rules decide which Microsoft.Commerce.Admin operations and credentials the agent may use. You can allow read-only calls such as GET subscriberUsageAggregates for billing while withholding sensitive actions like the updateEncryption key rotation, which stays unreachable unless you explicitly add it. This keeps a chargeback agent scoped to usage extraction without any path to alter commerce encryption on the stamp.
