class UsageRecord extends Resource implements UsageRecordInterface

Usage records allow you to report customer usage and metrics to Stripe for metered billing of subscription plans.

Properties

string $id A unique identifier for the resource. from Resource
protected mixed $response A response from Stripe. from Resource

Methods

string
getId()

Returns the unique identifier for this resource.

from Resource
mixed
getResponse()

Returns the raw Stripe response.

from Resource
void
setProperties()

Set the response data as properties on the class.

from Resource
create(int $quantity, SubscriptionItemInterface $subscriptionItem, int $timestamp, array $arguments = [], string $key = null)

Creates a usage record for a specified subscription item and date, and fills it with a quantity.

usageRecordSummaries(SubscriptionItemInterface $subscriptionItem, array $arguments = [])

For the specified subscription item, returns a list of summary objects.

stripe(string $method, $arguments, string $idempotencyKey = null)

No description

Details

in Resource at line 29
string getId()

Returns the unique identifier for this resource.

Return Value

string

in Resource at line 39
mixed getResponse()

Returns the raw Stripe response.

Return Value

mixed

in Resource at line 47
protected void setProperties()

Set the response data as properties on the class.

Return Value

void

at line 31
UsageRecordInterface create(int $quantity, SubscriptionItemInterface $subscriptionItem, int $timestamp, array $arguments = [], string $key = null)

Creates a usage record for a specified subscription item and date, and fills it with a quantity.

Parameters

int $quantity
SubscriptionItemInterface $subscriptionItem
int $timestamp
array $arguments
string $key

Return Value

UsageRecordInterface

See also

at line 54
UsageRecordInterface usageRecordSummaries(SubscriptionItemInterface $subscriptionItem, array $arguments = [])

For the specified subscription item, returns a list of summary objects.

Each object in the list provides usage information that’s been summarized from multiple usage records and over a subscription billing period (e.g., 15 usage records in the billing plan’s month of September).

Parameters

SubscriptionItemInterface $subscriptionItem
array $arguments

Return Value

UsageRecordInterface

See also

at line 63
protected stripe(string $method, $arguments, string $idempotencyKey = null)

Parameters

string $method
$arguments
string $idempotencyKey