Meter Event Adjustment v2

A billing meter event adjustment is a resource that allows you to cancel a meter event. For example, you might create a billing meter event adjustment to cancel a meter event that was created in error or attached to the wrong customer.

Create a billing meter event adjustment v2

Creates a meter event adjustment to cancel a previously sent meter event.

Learn more about calling API v2 endpoints.

Parameters

  • cancelobjectRequired

    Specifies which event to cancel.

  • event_namestringRequired

    The name of the meter event. Corresponds with the event_name field on a meter.

  • typeenumRequired

    Specifies whether to cancel a single event or a range of events for a time period. Time period cancellation is not supported yet.

    Possible enum values
    cancel

    Cancel a single meter event by identifier.

Returns

Response attributes

  • idstring

    The unique id of this meter event adjustment.

  • objectstring, value is "billing.meter_event_adjustment"

    String representing the object’s type. Objects of the same type share the same value of the object field.

  • cancelobject

    Specifies which event to cancel.

  • createdtimestamp

    The time the adjustment was created.

  • event_namestring

    The name of the meter event. Corresponds with the event_name field on a meter.

  • livemodeboolean

    Has the value true if the object exists in live mode or the value false if the object exists in test mode.

  • statusenum

    Open Enum. The meter event adjustment’s status.

    Possible enum values
    complete

    The event adjustment has been processed.

    pending

    The event adjustment is still being processed.

  • typeenum

    Open Enum. Specifies whether to cancel a single event or a range of events for a time period. Time period cancellation is not supported yet.

    Possible enum values
    cancel

    Cancel a single meter event by identifier.

Error Codes
400invalid_cancel_configuration

The adjustment configuration is invalid for the adjustment type.

POST /v2/billing/meter_event_adjustments
curl -X POST https://api.stripe.com/v2/billing/meter_event_adjustments \
-H "Authorization: Bearer sk_test_BQokikJ...2HlWgH4olfQ2sk_test_BQokikJOvBiI2HlWgH4olfQ2" \
-H "Stripe-Version: 2024-09-30.acacia" \
--json '{
"event_name": "ai_search_api",
"type": "cancel",
"cancel": {
"identifier": "idmp_12345678"
}
}'
Response
{
"object": "v2.billing.meter_event_adjustment",
"id": "mtr_event_adj_12345678",
"created": "2024-06-01T12:00:00.000Z",
"status": "pending",
"event_name": "ai_search_api",
"type": "cancel",
"cancel": {
"identifier": "idmp_12345678"
}
}

Meter Event Stream v2

You can send a higher-throughput of meter events using meter event streams. For this flow, you must first create a meter event session, which will provide you with a session token. You can then create meter events through the meter event stream endpoint, using the session token for authentication. The session tokens are short-lived and you will need to create a new meter event session when the token expires.

Meter Event Summary 

A billing meter event summary represents an aggregated view of a customer’s billing meter events within a specified timeframe. It indicates how much usage was accrued by a customer for that period.

Plans 

You can now model subscriptions more flexibly using the Prices API. It replaces the Plans API and is backwards compatible to simplify your migration.

Plans define the base price, currency, and billing cycle for recurring purchases of products. Products help you track inventory or provisioning, and plans help you track pricing. Different physical goods or levels of service should be represented by products, and pricing options should be represented by plans. This approach lets you change prices without having to change your provisioning scheme.

For example, you might have a single “gold” product that has plans for $10/month, $100/year, €9/month, and €90/year.

Related guides: Set up a subscription and more about products and prices.