curl --request GET \
--url https://api.unprice.dev/v1/customer/{customerId}/getUsage \
--header 'Authorization: Bearer <token>'{
"planVersion": {
"description": "<string>",
"flatPrice": "<string>",
"currentTotalPrice": "<string>",
"billingConfig": {
"name": "<string>",
"billingInterval": "month",
"billingIntervalCount": 6,
"planType": "recurring",
"billingAnchor": "dayOfCreation"
}
},
"subscription": {
"planSlug": "<string>",
"status": "idle",
"currentCycleEndAt": 123,
"timezone": "<string>",
"currentCycleStartAt": 123,
"prorationFactor": 123,
"prorated": true
},
"phase": {
"trialEndsAt": 123,
"endAt": 123,
"trialDays": 123,
"isTrial": true
},
"entitlement": [
{
"featureSlug": "<string>",
"featureType": "flat",
"isCustom": true,
"limit": 123,
"usage": 123,
"freeUnits": 123,
"max": 123,
"units": 123,
"included": 123,
"featureVersion": {
"id": "<string>",
"projectId": "<string>",
"createdAtM": 123,
"updatedAtM": 123,
"planVersionId": "<string>",
"featureId": "<string>",
"featureType": "flat",
"config": {
"price": {
"dinero": {
"amount": 123,
"currency": {
"code": "<string>",
"base": 123,
"exponent": 123
},
"scale": 123
},
"displayAmount": "<string>"
},
"tiers": [
{
"unitPrice": {
"dinero": {
"amount": 123,
"currency": {
"code": "<string>",
"base": 123,
"exponent": 123
},
"scale": 123
},
"displayAmount": "<string>"
},
"flatPrice": {
"dinero": {
"amount": 123,
"currency": {
"code": "<string>",
"base": 123,
"exponent": 123
},
"scale": 123
},
"displayAmount": "<string>"
},
"firstUnit": 2,
"lastUnit": 2
}
],
"usageMode": "tier",
"tierMode": "volume",
"units": 2
},
"metadata": {
"stripeProductId": "<string>",
"realtime": true
},
"aggregationMethod": "sum",
"order": 123,
"hidden": true,
"feature": {
"id": "<string>",
"projectId": "<string>",
"createdAtM": 123,
"updatedAtM": 123,
"slug": "<string>",
"code": 123,
"title": "<string>",
"description": "<string>"
},
"defaultQuantity": 1,
"limit": 123
},
"price": "<string>"
}
]
}Get usage for a customer
curl --request GET \
--url https://api.unprice.dev/v1/customer/{customerId}/getUsage \
--header 'Authorization: Bearer <token>'{
"planVersion": {
"description": "<string>",
"flatPrice": "<string>",
"currentTotalPrice": "<string>",
"billingConfig": {
"name": "<string>",
"billingInterval": "month",
"billingIntervalCount": 6,
"planType": "recurring",
"billingAnchor": "dayOfCreation"
}
},
"subscription": {
"planSlug": "<string>",
"status": "idle",
"currentCycleEndAt": 123,
"timezone": "<string>",
"currentCycleStartAt": 123,
"prorationFactor": 123,
"prorated": true
},
"phase": {
"trialEndsAt": 123,
"endAt": 123,
"trialDays": 123,
"isTrial": true
},
"entitlement": [
{
"featureSlug": "<string>",
"featureType": "flat",
"isCustom": true,
"limit": 123,
"usage": 123,
"freeUnits": 123,
"max": 123,
"units": 123,
"included": 123,
"featureVersion": {
"id": "<string>",
"projectId": "<string>",
"createdAtM": 123,
"updatedAtM": 123,
"planVersionId": "<string>",
"featureId": "<string>",
"featureType": "flat",
"config": {
"price": {
"dinero": {
"amount": 123,
"currency": {
"code": "<string>",
"base": 123,
"exponent": 123
},
"scale": 123
},
"displayAmount": "<string>"
},
"tiers": [
{
"unitPrice": {
"dinero": {
"amount": 123,
"currency": {
"code": "<string>",
"base": 123,
"exponent": 123
},
"scale": 123
},
"displayAmount": "<string>"
},
"flatPrice": {
"dinero": {
"amount": 123,
"currency": {
"code": "<string>",
"base": 123,
"exponent": 123
},
"scale": 123
},
"displayAmount": "<string>"
},
"firstUnit": 2,
"lastUnit": 2
}
],
"usageMode": "tier",
"tierMode": "volume",
"units": 2
},
"metadata": {
"stripeProductId": "<string>",
"realtime": true
},
"aggregationMethod": "sum",
"order": 123,
"hidden": true,
"feature": {
"id": "<string>",
"projectId": "<string>",
"createdAtM": 123,
"updatedAtM": 123,
"slug": "<string>",
"code": 123,
"title": "<string>",
"description": "<string>"
},
"defaultQuantity": 1,
"limit": 123
},
"price": "<string>"
}
]
}Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
The customer ID
"cus_1H7KQFLr7RepUyQBKdnvY"
The result of the get usage
Show child attributes
Show child attributes
1month, year, day, minute, onetime 1 <= x <= 12recurring, onetime Days of the month. Pick a number between 1 and 31, if the month has less days, it will be the last day of the month
1 <= x <= 31Show child attributes
idle, renewing, changing, canceling, expiring, invoicing, invoiced, ending_trial, active, trialing, canceled, expired, past_due Show child attributes
flat, tier, package, usage Show child attributes
36363636flat, tier, package, usage Show child attributes
Show child attributes
Show child attributes
The amount of the dinero object
Show child attributes
The currency code of the dinero object
The base of the dinero object
The exponent of the dinero object
The scale of the dinero object
Show child attributes
Show child attributes
Show child attributes
The amount of the dinero object
Show child attributes
The currency code of the dinero object
The base of the dinero object
The exponent of the dinero object
The scale of the dinero object
Show child attributes
Show child attributes
The amount of the dinero object
Show child attributes
The currency code of the dinero object
The base of the dinero object
The exponent of the dinero object
The scale of the dinero object
x >= 1x >= 1tier, package, unit volume, graduated x >= 1sum, sum_all, last_during_period, count, count_all, max, max_all Show child attributes
363650