API Documentation

Overview

The Sunset API allows authorized clients to interact with placed orders, retrieve data, and manage subscriptions. All endpoints use https and require a valid Bearer Token for authentication.

Base URL: https://api.sunset.local/v1/

Authentication

All requests require an Authorization header with a valid token.

Authorization: Bearer <your_api_token>

Endpoints

GET /orders

Retrieve a list of all placed orders.

Query Parameters

  • status — Filter by order status (e.g. completed, pending).
  • limit — Max number of results (default: 50).

Response Example

{
  "success": true,
  "count": 2,
  "data": [
    {
      "order_id": "ORD-12345",
      "customer": "Redcentric",
      "status": "completed",
      "created_at": "2025-10-20T14:32:00Z"
    }
  ]
}

GET /orders/{id}

Retrieve details for a specific order.

Path Parameters

  • id — Unique order identifier.

Response Example

{
  "order_id": "ORD-12345",
  "status": "completed",
  "product": "FTTP L2",
  "installation_date": "2025-10-22",
  "details": {...}
}

POST /orders

Create a new order.

Request Body

{
  "customer_id": "CUST-001",
  "product_type": "FTTP L2",
  "appointment_date": "2025-10-25",
  "notes": "Test order placement"
}

Response Example

{
  "success": true,
  "order_id": "ORD-67890",
  "message": "Order successfully created"
}

Error Codes

CodeDescription
400Bad Request — Invalid parameters.
401Unauthorized — Missing or invalid token.
404Not Found — Resource not found.
500Server Error — Contact support.

Rate Limits

Standard plan: 60 requests per minute per API key.

Enterprise plan: Custom limits available on request.