Skip to main content

Send preconfigured metered usage

note

This topic is about Metered usage V1. Marketplaces use the metered usage V1 API, metered usage V2 API, or both, to support metered usage billing. See also: Metered usage V2.

Send preconfigured metered usage

Description: Send usage data for preconfigured metered usage to the AppDirect marketplace that hosts the user account. For a description of preconfigured metered usage, see Preconfigured and custom metered usage.

Endpoint URL: {base marketplace URL}/api/integration/v1/billing/usage

The {base marketplace URL} is the base URL for the marketplace that hosts the user account.

Request operation: POST

Mandatory parameters in the request:

  • account—User account that incurred the usage.
  • accountIdentifier—Unique identifier that associates a vendor (ISV), customer company, and subscription. Represents company entitlement. Provided by the vendor when the subscription is purchased. Marketplace Managers can locate it in the user interface Integration Event logs; for SUBSCRIPTION_ORDER events, it is the account ID that appears in the Identifiers column (see View integration events). This is the same as the accountId that is used in the Metered usage V2 API.
  • unit—Unit type that you preconfigured, for which you are sending metered usage. For supported units, see Supported metered usage units.
  • quantity—Number of units of usage in the stated unit of measure incurred by the user.

Following is an example JSON request to send preconfigured metered usage to a marketplace. In this example scenario, you configured metered usage for unit type gigabyte, and unit type hour, and a price for each. Now, you POST the following JSON or XML to tell the marketplace to charge the user for usage of 34 gigabytes, and three hours.

JSON example

{
"account": { "accountIdentifier": "MY_ACCOUNT" },
"items": [
{
"unit": "GIGABYTE",
"quantity": "34"
},
{
"unit": "HOUR",
"quantity": "3"
}
]
}

Was this page helpful?