-
Notifications
You must be signed in to change notification settings - Fork 61
Open
Labels
Description
Description
The current API does not have a way to create a new billing plan
Acceptance Criteria
- A POST endpoint (/api/v1/billing-plans)
- Error handling
- Unit tests for the controller method
Request
POST - \api\v1\billing-plans
{
Authorization: "Bearer {auth-token}"
}
Request Body:
{
"name": "Free",
"description": "Free",
"frequency": "monthly",
"amount": 0,
"is_active": true
}
Responses
201- Successful billing plan creation
{
status: string,
message: string,
data: {
"name": "Free",
"description": "Free",
"frequency": "monthly",
"amount": 0,
"is_active": true
}
}
403 - Billing plan already exists
{
status: "error",
message: "This billing plan already exists",
data: {}
}
500 - Internal server error
{
status: "error",
message: "Internal server error",
data: {}
}
Expected Outcome
There is an endpoint for creating billing plans