View as Markdown
Stripe icon

Stripe ACTION

Create Billing Meter

Creates a billing meter. See the documentation.
  • Action
  • Writes data
  • API key
  • SDK
  • MCP

IMPLEMENTATION

Call this tool

Connect a user's Stripe account once, then configure and run Create Billing Meter from your backend or agent.

import { PipedreamClient } from "@pipedream/sdk"

const pd = new PipedreamClient({
  projectId: process.env.PIPEDREAM_PROJECT_ID!,
  clientId: process.env.PIPEDREAM_CLIENT_ID!,
  clientSecret: process.env.PIPEDREAM_CLIENT_SECRET!,
  projectEnvironment: "production",
})

const result = await pd.actions.run({
  id: "stripe-create-billing-meter",
  externalUserId: "{external_user_id}", // any stable ID for this user in your system
  configuredProps: {
    stripe: { authProvisionId: "apn_xxxxxxx" },
    defaultAggregationFormula: "Default Aggregation Formula",
    displayName: "Display Name",
  },
})

console.log(result)

SCHEMA

Inputs

Pipedream supplies the connected account. Your application provides the operation-specific values below. Dynamic inputs are resolved against that user's account.

Create Billing Meter inputs
Property Type Description
defaultAggregationFormula Default Aggregation Formula string
Specifies how events are aggregated
Required
displayName Display Name string
The meter's name. Not visible to the customer.
Required
eventName Event Name string
The name of the meter event to record usage for. Corresponds with the event_name field on meter events.
Required
customerMappingEventPayloadKey Customer Mapping Event Payload Key string
The key in the meter event payload to use for mapping the event to a customer.
Optional
eventTimeWindow Event Time Window string
The time window to pre-aggregate meter events for, if any.
Optional
valueSettingsEventPayloadKey Value Settings Event Payload Key string
The key in the usage event payload to use as the value for this meter. For example, if the event payload contains usage on a bytes_used field, then set it to bytes_used.
Optional

REFERENCE

Tool details

Behavior hints are published with the component in the Pipedream registry and surface as MCP tool annotations, so an agent can reason about a tool before it calls it.

Registry key
stripe-create-billing-meter
Version
0.0.4
App
Stripe
Authentication
API key
Read-only
No
Destructive
No
Open world
Yes