Create a usage record

Creates a usage report.

SecurityAPI Key: SecretApiKey or HTTP: JWT
Request
Request Body schema: application/json
subscriptionId
required
string <= 50 characters

ID of the subscription for which a usage is reported.

planId
required
string <= 50 characters

ID of the plan for which a usage is reported.

quantity
required
number <float> >= 0.01

Number of used product units of a plan. Products are the goods and services that your business sells. Plans describe how the customer must pay for products.

usageTime
string <date-time>

Date and time, in ISO 8601 format, when a usage occurred. If this value is not provided or is empty, the date and time of the request is used.

post
/usages
Request samples
application/json
{ "subscriptionId": "sub_01HRF27SATGE4Z6PBJE6PD8328", "planId": "plan_0YV7DENSVGDBW9S71XZNNYYQ0X", "quantity": 0.01, "usageTime": "2019-08-24T14:15:22Z" }
Responses

201

Usage record created.

401

Unauthorized access. Invalid credentials used.

403

Access forbidden.

422

Invalid data sent.

Response samples
application/json
{ "id": "ord_usg_0YVJ636B95DNA9M3B1638HXBCQ", "subscriptionId": "sub_01HRF27SATGE4Z6PBJE6PD8328", "planId": "plan_0YV7DENSVGDBW9S71XZNNYYQ0X", "invoiceId": "in_0YVF9605RKC62BP14NE2R7V2XT", "invoiceItemId": "ii_0YVFDEQS2KCFTBN9HXWJFY55GV", "quantity": 0.01, "usageTime": "2019-08-24T14:15:22Z", "createdTime": "2019-08-24T14:15:22Z", "updatedTime": "2019-08-24T14:15:22Z", "_links": [ ] }