Skip to content

Charge dimensions tied to a subscription

Request

Reports usage for one metered dimension of a subscription and relays Microsoft's verdict. This is a billing action: accepted usage lands on the customer's Azure invoice.

Idempotency. Microsoft accepts one usage event per subscription, dimension and hour (the hour of effectiveStartTime). WeTransact applies the same rule before calling Microsoft, but only against reports Microsoft has accepted, so a failed attempt never blocks its own retry.

Safe retry recipe. Store the effectiveStartTime you send. After a timeout, 429 or 502, resend the identical request. You will get 200 (landed now) or 409 (had already landed, with the original ids), never a double charge. Every error body from this endpoint says whether a retry is safe (Retryable on 409/422/502, retryable on 400/404); the 429 from the concurrency limiter has no body.

HTTPMeaningRetry?
200Microsoft accepted the usage eventNo
400Invalid inputFix first
404Subscription or dimension unknownFix first
409Already reported for this hour (ours or Microsoft Duplicate)No
422Microsoft rejected the event, see Microsoft.StatusFix first
429Too many concurrent chargesYes, same effectiveStartTime
502Microsoft unreachable, timed out or 5xx; outcome unknownYes, same effectiveStartTime
Security
api_key
Path
subscriptionIdstringrequired

The marketplace subscription id.

Example:aa930163-2330-45c2-a17c-dd325f9f2d44
Query
dimensionIdstringrequired

The Partner Center dimension id to charge. GET /subscriptions?includeMeters=true returns it as MeterId on each meter.

Example:dimensionId=transaction_tier_1
quantitystringrequired

The quantity to charge. Whole number, at least 1.

Example:quantity=5
effectiveStartTimestring, (date-time)

Optional. The usage hour being reported, ISO 8601 UTC (e.g. 2026-09-07T10:00:00Z). Defaults to now. Must not be in the future or older than 24 hours. Resend the same value when retrying.

Example:effectiveStartTime=2026-09-07T10:00:00Z
curl -i -X POST \
  'https://apidocs.wetransact.io/_mock/openapi/api/v1.0/subscriptions/aa930163-2330-45c2-a17c-dd325f9f2d44/actions/charge?dimensionId=transaction_tier_1&quantity=5&effectiveStartTime=2026-09-07T10%3A00%3A00Z' \
  -H 'x-api-key: YOUR_API_KEY_HERE'

Responses

Microsoft accepted the usage event.

Bodyapplication/json
Timestampstring, (date-time)
MeterIdstring

The Partner Center dimension id that was charged.

Example:"transaction_tier_1"
MeterNamestring
Example:"Transactions tier 1"
Unitstring
Example:"transaction"
Quantityinteger
Example:5
Successboolean
Messagestring
UsageReportEventIdstring, (uuid)

WeTransact's record of this report. Quote it to support when a charge is disputed.

EffectiveStartTimestring, (date-time)

The usage hour that was reported, UTC. Resend the same value when retrying.

Example:"2026-09-07T10:00:00Z"
Retryableboolean

True only when Microsoft was unreachable or answered 5xx (HTTP 502). Never true on 2xx, 409 or 422.

Warningstring or null

Set on an accepted charge when the caller is doing something that will hurt them later. Today: effectiveStartTime was omitted, so a retry after the hour boundary would be a new, billable event. Null when there is nothing to warn about.

Microsoftobject

Microsoft's own verdict, relayed unchanged. Microsoft is the authority on whether usage landed.

Response
{ "Timestamp": "2026-09-07T10:42:11Z", "MeterId": "transaction_tier_1", "MeterName": "Transactions tier 1", "Unit": "transaction", "Quantity": 5, "Success": true, "Message": "Success", "UsageReportEventId": "2b7f0c3a-5e1d-4a9b-9c2e-7d8f1a2b3c4d", "EffectiveStartTime": "2026-09-07T10:00:00Z", "Retryable": false, "Microsoft": { "StatusCode": 200, "Status": "Accepted", "UsageEventId": "6f8b3c1e-9a2d-4b7e-8c1f-2d3e4f5a6b7c", "Message": null } }