customer
get active phase
Get active phase for a customer
GET
/
v1
/
customer
/
{customerId}
/
getActivePhase
Copy
curl --request GET \
--url https://api.unprice.dev/v1/customer/{customerId}/getActivePhase \
--header 'Authorization: Bearer <token>'
Copy
{
"id": "<string>",
"projectId": "<string>",
"createdAtM": 123,
"updatedAtM": 123,
"subscriptionId": "<string>",
"planVersionId": "<string>",
"paymentMethodId": "<string>",
"trialDays": 0,
"billingAnchor": 123,
"trialEndsAt": 123,
"startAt": 123,
"endAt": 123,
"metadata": {
"note": "<string>",
"reason": "payment_failed"
},
"items": [
{
"id": "<string>",
"projectId": "<string>",
"createdAtM": 123,
"updatedAtM": 123,
"units": 123,
"featurePlanVersionId": "<string>",
"subscriptionPhaseId": "<string>",
"subscriptionId": "<string>"
}
],
"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,
"billingAnchor": 16,
"planType": "recurring"
},
"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": {
"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
}
],
"price": {
"dinero": {
"amount": 123,
"currency": {
"code": "<string>",
"base": 123,
"exponent": 123
},
"scale": 123
},
"displayAmount": "<string>"
},
"usageMode": "tier",
"tierMode": "volume",
"units": 2
},
"metadata": {
"stripeProductId": "<string>",
"realtime": true
},
"aggregationMethod": "sum",
"order": 123,
"defaultQuantity": 1,
"limit": 123,
"hidden": true,
"feature": {
"id": "<string>",
"projectId": "<string>",
"createdAtM": 123,
"updatedAtM": 123,
"slug": "<string>",
"code": 123,
"title": "<string>",
"description": "<string>"
}
}
}
]
}
Authorizations
Bearer authentication header of the form Bearer <token>
, where <token>
is your auth token.
Path Parameters
The customer ID
Example:
"cus_1H7KQFLr7RepUyQBKdnvY"
Response
200
application/json
The result of the get active phase
The response is of type object
.
Copy
curl --request GET \
--url https://api.unprice.dev/v1/customer/{customerId}/getActivePhase \
--header 'Authorization: Bearer <token>'
Copy
{
"id": "<string>",
"projectId": "<string>",
"createdAtM": 123,
"updatedAtM": 123,
"subscriptionId": "<string>",
"planVersionId": "<string>",
"paymentMethodId": "<string>",
"trialDays": 0,
"billingAnchor": 123,
"trialEndsAt": 123,
"startAt": 123,
"endAt": 123,
"metadata": {
"note": "<string>",
"reason": "payment_failed"
},
"items": [
{
"id": "<string>",
"projectId": "<string>",
"createdAtM": 123,
"updatedAtM": 123,
"units": 123,
"featurePlanVersionId": "<string>",
"subscriptionPhaseId": "<string>",
"subscriptionId": "<string>"
}
],
"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,
"billingAnchor": 16,
"planType": "recurring"
},
"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": {
"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
}
],
"price": {
"dinero": {
"amount": 123,
"currency": {
"code": "<string>",
"base": 123,
"exponent": 123
},
"scale": 123
},
"displayAmount": "<string>"
},
"usageMode": "tier",
"tierMode": "volume",
"units": 2
},
"metadata": {
"stripeProductId": "<string>",
"realtime": true
},
"aggregationMethod": "sum",
"order": 123,
"defaultQuantity": 1,
"limit": 123,
"hidden": true,
"feature": {
"id": "<string>",
"projectId": "<string>",
"createdAtM": 123,
"updatedAtM": 123,
"slug": "<string>",
"code": 123,
"title": "<string>",
"description": "<string>"
}
}
}
]
}
Assistant
Responses are generated using AI and may contain mistakes.