POST /v1/subscriptions/subscribe
Subscribe to a package
Creates a subscription with pending status. Requires payment to activate.
Request
POST /v1/subscriptions/subscribe
Parameters
[]
Response
{
"200": {
"description": "Subscription created with pending status",
"content": {
"application/json": {
"schema": {
"type": "object",
"properties": {
"success": {
"type": "boolean"
},
"message": {
"type": "string"
},
"data": {
"type": "object",
"properties": {
"subscription": {
"type": "object",
"properties": {
"id": {
"type": "string"
},
"package_id": {
"type": "string"
},
"billing_cycle": {
"type": "string",
"enum": [
"monthly",
"yearly"
]
},
"status": {
"type": "string"
},
"current_period_start": {
"type": "string"
},
"current_period_end": {
"type": "string"
}
},
"required": [
"id",
"package_id",
"billing_cycle",
"status",
"current_period_start",
"current_period_end"
]
},
"payment_required": {
"type": "boolean"
},
"next_step": {
"type": "string"
}
},
"required": [
"subscription",
"payment_required",
"next_step"
]
}
},
"required": [
"success",
"message",
"data"
]
}
}
}
},
"400": {
"description": "Invalid package or user already has active subscription"
}
}
View in Interactive API Reference