Skip to content

[FEAT] Billing Plans - Creation #633

@MuthoniMN

Description

@MuthoniMN

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

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions