Subscriptions
GET
Query parameters
teamIdstringRequired
Responses
200
Subscription details retrieved successfully
application/json
400
Invalid team ID
application/json
403
Access denied
application/json
404
Subscription not found
application/json
get
GET /subscriptions/me?teamId=text HTTP/1.1
Host:
Accept: */*
{
"teamId": "team_id",
"subscriptionId": "sub_1F7X2Y2eZvKYlo2C0q0G5Z2e",
"endDate": "2023-01-01T00:00:00Z",
"price": 1000,
"status": "active",
"tier": "Basic",
"priority": 1,
"usersLimit": 10,
"teamsLimit": 5
}
POST
Body
namestring | nullableRequiredExample:
Basic
descriptionstring | nullableRequiredExample:
Basic subscription tier
pricenumber | nullableRequiredExample:
1000
prioritynumber | nullableRequiredExample:
1
usersLimitnumber | nullableRequiredExample:
10
teamsLimitnumber | nullableRequiredExample:
5
isPopularboolean | nullableRequiredExample:
true
Responses
201
Subscription tier created successfully
application/json
400
Tier already exists
application/json
500
Internal server error
application/json
post
POST /subscriptions HTTP/1.1
Host:
Content-Type: application/json
Accept: */*
Content-Length: 164
{
"name": "Basic",
"description": "Basic subscription tier",
"features": [
{
"name": "Feature 1"
}
],
"price": 1000,
"priority": 1,
"usersLimit": 10,
"teamsLimit": 5,
"isPopular": true
}
{
"id": 1,
"title": "Basic",
"price": 1000,
"priority": 1,
"usersLimit": 10,
"teamsLimit": 5
}
Body
priceIdstringRequiredExample:
price_1F7X2Y2eZvKYlo2C0q0G5Z2e
quantitynumberRequiredExample:
1
teamIdstring | nullableRequiredExample:
team_id
isTeamCreationbooleanRequiredExample:
true
Responses
200
Subscription registered successfully
application/json
400
Invalid subscription parameters
application/json
403
Access denied
application/json
500
Internal server error
application/json
post
POST /subscriptions/register HTTP/1.1
Host:
Content-Type: application/json
Accept: */*
Content-Length: 98
{
"priceId": "price_1F7X2Y2eZvKYlo2C0q0G5Z2e",
"quantity": 1,
"teamId": "team_id",
"isTeamCreation": true
}
{
"redirect": true,
"url": "https://checkout.stripe.com/pay/cs_test_a1b2c3d4e5f6g7h8i9j0"
}
Body
subscriptionstringOptionalExample:
sub_1F7X2Y2eZvKYlo2C0q0G5Z2e
Responses
200
Subscription period cancelled successfully
application/json
ResponseanyExample:
{"message":"Subscription period cancelled successfully","description":"The subscription period has been cancelled successfully."}
400
Invalid subscription ID
application/json
403
Access denied
application/json
500
Internal server error
application/json
post
POST /subscriptions/cancel HTTP/1.1
Host:
Content-Type: application/json
Accept: */*
Content-Length: 47
{
"subscription": "sub_1F7X2Y2eZvKYlo2C0q0G5Z2e"
}
{
"message": "Subscription period cancelled successfully",
"description": "The subscription period has been cancelled successfully."
}
Body
subscriptionstringOptionalExample:
sub_1F7X2Y2eZvKYlo2C0q0G5Z2e
Responses
200
Subscription cancelled successfully
application/json
ResponseanyExample:
{"message":"Subscription cancelled successfully","description":"The subscription has been cancelled successfully."}
400
Invalid subscription ID
application/json
403
Access denied
application/json
500
Internal server error
application/json
post
POST /subscriptions/cancel-immediately HTTP/1.1
Host:
Content-Type: application/json
Accept: */*
Content-Length: 47
{
"subscription": "sub_1F7X2Y2eZvKYlo2C0q0G5Z2e"
}
{
"message": "Subscription cancelled successfully",
"description": "The subscription has been cancelled successfully."
}
Body
subscriptionstringOptionalExample:
sub_1F7X2Y2eZvKYlo2C0q0G5Z2e
Responses
200
Subscription period renewed successfully
application/json
ResponseanyExample:
{"message":"Subscription period renewed successfully","description":"The subscription period has been renewed successfully."}
400
Invalid subscription ID
application/json
403
Access denied
application/json
500
Internal server error
application/json
post
POST /subscriptions/renew HTTP/1.1
Host:
Content-Type: application/json
Accept: */*
Content-Length: 47
{
"subscription": "sub_1F7X2Y2eZvKYlo2C0q0G5Z2e"
}
{
"message": "Subscription period renewed successfully",
"description": "The subscription period has been renewed successfully."
}
PUT
Body
namestring | nullableRequiredExample:
Basic
descriptionstring | nullableRequiredExample:
Basic subscription tier
pricenumber | nullableRequiredExample:
1000
prioritynumber | nullableRequiredExample:
1
usersLimitnumber | nullableRequiredExample:
10
teamsLimitnumber | nullableRequiredExample:
5
isPopularboolean | nullableRequiredExample:
true
Responses
200
Subscription tier updated successfully
application/json
400
Tier not found
application/json
500
Internal server error
application/json
put
PUT /subscriptions HTTP/1.1
Host:
Content-Type: application/json
Accept: */*
Content-Length: 164
{
"name": "Basic",
"description": "Basic subscription tier",
"features": [
{
"name": "Feature 1"
}
],
"price": 1000,
"priority": 1,
"usersLimit": 10,
"teamsLimit": 5,
"isPopular": true
}
{
"id": 1,
"title": "Basic",
"price": 1000,
"priority": 1,
"usersLimit": 10,
"teamsLimit": 5
}
DELETE
Path parameters
idstringRequired
Responses
200
Subscription tier deleted successfully
application/json
ResponseanyExample:
{"message":"Subscription tier deleted successfully","description":"The subscription tier has been deleted successfully."}
400
Tier not found
application/json
500
Internal server error
application/json
delete
DELETE /subscriptions/{id} HTTP/1.1
Host:
Accept: */*
{
"message": "Subscription tier deleted successfully",
"description": "The subscription tier has been deleted successfully."
}
Last updated