API Documentation
Errors
- Introduction
- Errors
Endpoints
- customer
- project
- plans
- paymentProvider
- analytics
plans
list all plan versions
List all plan versions for a project
POST
/
v1
/
plans
/
listPlanVersions
Copy
curl --request POST \
--url https://api.unprice.dev/v1/plans/listPlanVersions \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '{
"onlyPublished": true,
"onlyEnterprisePlan": false,
"onlyLatest": true,
"billingInterval": "month",
"currency": "USD"
}'
Copy
{
"planVersions": [
{
"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,
"plan": {
"id": "<string>",
"projectId": "<string>",
"createdAtM": 123,
"updatedAtM": 123,
"slug": "<string>",
"active": true,
"description": "<string>",
"metadata": {
"externalId": "<string>"
},
"defaultPlan": true,
"enterprisePlan": true
},
"planFeatures": [
{
"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,
"displayFeatureText": "<string>",
"feature": {
"id": "<string>",
"projectId": "<string>",
"createdAtM": 123,
"updatedAtM": 123,
"slug": "<string>",
"code": 123,
"title": "<string>",
"description": "<string>"
}
}
],
"flatPrice": "<string>"
}
]
}
Authorizations
Bearer authentication header of the form Bearer <token>
, where <token>
is your auth token.
Body
application/json
Body of the request
The body is of type object
.
Response
200
application/json
The result of the list plan versions
The response is of type object
.
Copy
curl --request POST \
--url https://api.unprice.dev/v1/plans/listPlanVersions \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '{
"onlyPublished": true,
"onlyEnterprisePlan": false,
"onlyLatest": true,
"billingInterval": "month",
"currency": "USD"
}'
Copy
{
"planVersions": [
{
"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,
"plan": {
"id": "<string>",
"projectId": "<string>",
"createdAtM": 123,
"updatedAtM": 123,
"slug": "<string>",
"active": true,
"description": "<string>",
"metadata": {
"externalId": "<string>"
},
"defaultPlan": true,
"enterprisePlan": true
},
"planFeatures": [
{
"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,
"displayFeatureText": "<string>",
"feature": {
"id": "<string>",
"projectId": "<string>",
"createdAtM": 123,
"updatedAtM": 123,
"slug": "<string>",
"code": 123,
"title": "<string>",
"description": "<string>"
}
}
],
"flatPrice": "<string>"
}
]
}
Assistant
Responses are generated using AI and may contain mistakes.