curl --request GET \
--url https://api.unprice.dev/v1/customer/{customerId}/getActivePhase \
--header 'Authorization: Bearer <token>'{
"id": "<string>",
"projectId": "<string>",
"subscriptionId": "<string>",
"planVersionId": "<string>",
"paymentMethodId": "<string>",
"billingAnchor": 123,
"trialEndsAt": 123,
"startAt": 123,
"endAt": 123,
"planVersion": {
"id": "<string>",
"projectId": "<string>",
"createdAtM": 123,
"updatedAtM": 123,
"planId": "<string>",
"description": "<string>",
"latest": true,
"title": "<string>",
"tags": [
"<string>"
],
"active": true,
"status": "draft",
"publishedAt": 123,
"publishedBy": "<string>",
"archived": true,
"archivedAt": 123,
"archivedBy": "<string>",
"paymentProvider": "stripe",
"dueBehaviour": "cancel",
"currency": "USD",
"billingConfig": {
"name": "<string>",
"billingInterval": "month",
"billingIntervalCount": 6,
"planType": "recurring",
"billingAnchor": "dayOfCreation"
},
"whenToBill": "pay_in_advance",
"gracePeriod": 123,
"collectionMethod": "charge_automatically",
"trialDays": 123,
"autoRenew": true,
"metadata": {
"externalId": "<string>"
},
"paymentMethodRequired": true,
"version": 123
},
"customerEntitlements": [
{
"id": "<string>",
"projectId": "<string>",
"createdAtM": 123,
"updatedAtM": 123,
"customerId": "<string>",
"subscriptionId": "<string>",
"featurePlanVersionId": "<string>",
"subscriptionItemId": "<string>",
"subscriptionPhaseId": "<string>",
"limit": 123,
"units": 123,
"usage": "<string>",
"accumulatedUsage": "<string>",
"realtime": true,
"type": "feature",
"validFrom": 123,
"validTo": 123,
"bufferPeriodDays": 123,
"resetedAt": 123,
"active": true,
"isCustom": true,
"lastUsageUpdateAt": 123,
"metadata": {},
"featurePlanVersion": {
"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
}
}
],
"createdAtM": 123,
"updatedAtM": 123,
"trialDays": 0,
"metadata": {
"note": "<string>",
"reason": "payment_failed"
},
"items": [
{
"id": "<string>",
"projectId": "<string>",
"createdAtM": 123,
"updatedAtM": 123,
"units": 123,
"featurePlanVersionId": "<string>",
"subscriptionPhaseId": "<string>",
"subscriptionId": "<string>"
}
]
}Get active phase for a customer
curl --request GET \
--url https://api.unprice.dev/v1/customer/{customerId}/getActivePhase \
--header 'Authorization: Bearer <token>'{
"id": "<string>",
"projectId": "<string>",
"subscriptionId": "<string>",
"planVersionId": "<string>",
"paymentMethodId": "<string>",
"billingAnchor": 123,
"trialEndsAt": 123,
"startAt": 123,
"endAt": 123,
"planVersion": {
"id": "<string>",
"projectId": "<string>",
"createdAtM": 123,
"updatedAtM": 123,
"planId": "<string>",
"description": "<string>",
"latest": true,
"title": "<string>",
"tags": [
"<string>"
],
"active": true,
"status": "draft",
"publishedAt": 123,
"publishedBy": "<string>",
"archived": true,
"archivedAt": 123,
"archivedBy": "<string>",
"paymentProvider": "stripe",
"dueBehaviour": "cancel",
"currency": "USD",
"billingConfig": {
"name": "<string>",
"billingInterval": "month",
"billingIntervalCount": 6,
"planType": "recurring",
"billingAnchor": "dayOfCreation"
},
"whenToBill": "pay_in_advance",
"gracePeriod": 123,
"collectionMethod": "charge_automatically",
"trialDays": 123,
"autoRenew": true,
"metadata": {
"externalId": "<string>"
},
"paymentMethodRequired": true,
"version": 123
},
"customerEntitlements": [
{
"id": "<string>",
"projectId": "<string>",
"createdAtM": 123,
"updatedAtM": 123,
"customerId": "<string>",
"subscriptionId": "<string>",
"featurePlanVersionId": "<string>",
"subscriptionItemId": "<string>",
"subscriptionPhaseId": "<string>",
"limit": 123,
"units": 123,
"usage": "<string>",
"accumulatedUsage": "<string>",
"realtime": true,
"type": "feature",
"validFrom": 123,
"validTo": 123,
"bufferPeriodDays": 123,
"resetedAt": 123,
"active": true,
"isCustom": true,
"lastUsageUpdateAt": 123,
"metadata": {},
"featurePlanVersion": {
"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
}
}
],
"createdAtM": 123,
"updatedAtM": 123,
"trialDays": 0,
"metadata": {
"note": "<string>",
"reason": "payment_failed"
},
"items": [
{
"id": "<string>",
"projectId": "<string>",
"createdAtM": 123,
"updatedAtM": 123,
"units": 123,
"featurePlanVersionId": "<string>",
"subscriptionPhaseId": "<string>",
"subscriptionId": "<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 active phase
3636361Show child attributes
36363650draft, published 3636stripe, square cancel, downgrade USD, EUR The billing configuration for the plan version
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 <= 31pay_in_advance, pay_in_arrear charge_automatically, send_invoice Show child attributes
36363636363636feature, addon 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
363650x >= 0Show child attributes
Note about the subscription phase
Reason for the subscription phase
payment_failed, invoice_voided, payment_pending, payment_method_not_found, policy_violation, pending_cancellation, invoice_failed, invoice_pending, payment_received, pending_change, pending_expiration, trial_ended, user_requested, admin_requested, ending, renewed, cancelled, auto_renew_disabled, customer_signout Show child attributes
3636363636