Skip to main content

GET /api/v1/internet-plans/

Retrieves detailed information about a specific internet plan. The level of detail returned depends on the plan type:
  • Simple Queue: Returns name, price, download speed, and upload speed
  • PPPOE: Returns name, price, download speed, and upload speed
  • PCQ: Returns only basic info (WispHub does not expose a detail endpoint for this type)

Authentication

No authentication required for this endpoint.

Path Parameters

plan_id
integer
required
The unique identifier of the internet plan to retrieve

Response Body

The response follows the standard BackendResponse wrapper format:
ok
boolean
required
Indicates if the request was successful
type
string
required
Response type: success, error, or info
action
string
required
Action identifier for this operation:
  • internet_plan_found - Plan was successfully retrieved
  • internet_plan_not_found - Plan with the specified ID does not exist
data
object
Plan details object. The structure varies by plan type.
message
string
Optional message with additional information
meta
object
Optional metadata object

Example Request

curl -X GET https://api.yourdomain.com/api/v1/internet-plans/1

Example Response

{
  "ok": true,
  "type": "success",
  "action": "internet_plan_found",
  "data": {
    "name": "Plan Basico 10MB",
    "price": 29.99,
    "download_speed": "10M",
    "upload_speed": "5M"
  },
  "message": null,
  "meta": null
}

Plan Type Details

The endpoint automatically determines the plan type by consulting the cached plan list. This avoids making an extra API call to determine the plan type.
For PPPOE plans, the endpoint retrieves complete details including:
  • Plan name
  • Price information
  • Download speed configuration
  • Upload speed configuration
The data is fetched from the WispHub PPPOE plan detail endpoint.
For Simple Queue plans, the endpoint retrieves complete details including:
  • Plan name
  • Price information
  • Download speed configuration
  • Upload speed configuration
The data is fetched from the WispHub queue plan detail endpoint.
For PCQ plans, limited information is available because WispHub does not expose a detail endpoint for this plan type. The response includes:
  • Plan ID
  • Plan name
  • Plan type
  • Explanatory note about the limitation
Speed and pricing information is not available for PCQ plans.

Response Actions

internet_plan_found
action
Returned when the plan is successfully retrieved from the system
internet_plan_not_found
action
Returned when the plan ID does not exist in the system

Implementation Notes

The endpoint first checks the cached plan list to determine if the plan exists and what type it is. This optimization avoids unnecessary API calls to the WispHub external service.
For PCQ plans, the endpoint returns immediately with basic information since WispHub does not provide a detail endpoint for this plan type.

Error Handling

If a plan with the specified plan_id does not exist, the endpoint returns an info response with the action internet_plan_not_found. The ok field will still be true since this is an expected condition, not an error.