Subscriptions

GET

Retrieves all subscription tiers.

get
Responses
200
Subscription tiers retrieved successfully
application/json
get
GET /subscriptions HTTP/1.1
Host: 
Accept: */*
[
  {
    "id": 1,
    "title": "Basic",
    "price": 1000,
    "priority": 1,
    "usersLimit": 10,
    "teamsLimit": 5
  }
]

Retrieves the subscription details for the authenticated user's team.

get
Query parameters
teamIdstringRequired
Responses
200
Subscription details retrieved successfully
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

Creates a new subscription tier.

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
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
}

Registers a new subscription for the team.

post
Body
priceIdstringRequiredExample: price_1F7X2Y2eZvKYlo2C0q0G5Z2e
quantitynumberRequiredExample: 1
teamIdstring | nullableRequiredExample: team_id
isTeamCreationbooleanRequiredExample: true
Responses
200
Subscription registered successfully
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"
}

Cancels the subscription period for the team.

post
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."}
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."
}

Cancels the subscription immediately for the team.

post
Body
subscriptionstringOptionalExample: sub_1F7X2Y2eZvKYlo2C0q0G5Z2e
Responses
200
Subscription cancelled successfully
application/json
ResponseanyExample: {"message":"Subscription cancelled successfully","description":"The subscription has been cancelled successfully."}
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."
}

Renews the subscription period for the team.

post
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."}
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

Updates a subscription tier.

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
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

Deletes a subscription tier by its ID.

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."}
delete
DELETE /subscriptions/{id} HTTP/1.1
Host: 
Accept: */*
{
  "message": "Subscription tier deleted successfully",
  "description": "The subscription tier has been deleted successfully."
}

Last updated