For the complete documentation index, see llms.txt. This page is also available as Markdown.

Usage management

Use the Usage object to manage (add, update, delete, retrieve, and import) usage via the 2Checkout API (JSON-RPC APIv6).

The usage-based / on-demand / pay-as-you-go pricing model allows merchants to charge their customers on the consumption or overage of a billable service or resource, usually on top of a recurring flat rate.

Request parameters

Parameter
Type / Description

UsageReference

Optional (integer)

The unique usage identifier. Example: 123459876.

SubscriptionReference

Required (string)

Unique code that represents a subscription. Example: 83FE4FEF2.

OptionCode

Required (string)

Unique 2Checkout option code. The pay-per-usage price options group for which the usage is uploaded. Example: metered pricing.

UsageStart

Required (datetime)

The datetime when the usage started; can be the same as UsageEnd. Example: 2018-09-03 17:28:32.

UsageEnd

Required (datetime)

The datetime when the usage ended and was recorded. Example: 2018-09-03 17:28:32.

Units

Required (integer)

Number of units recorded. Example: 10.

Description

Optional (string)

It can be used to store a short merchant comment of the usage being uploaded. This can be anything, from the source of usage (mobile, web, etc.), to why changes occurred, etc. Example: Subscription usage for September.

Last updated

Was this helpful?