Cosmic Nebula

API Dokumentáció

A Galactica Code platform fejlesztői interfészének leírása. Az alábbi végpontok a rendszer fő funkcióit fedik le.

Authentication

POST
/api/auth/login
User Login
Authenticates a user and returns a session token.
{
  "token": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9...",
  "user": {
    "id": "uuid",
    "email": "user@example.com",
    "name": "John Doe"
  }
}
POST
/api/auth/register
User Registration
Creates a new user account.
{
  "message": "Registration successful",
  "user_id": "uuid"
}

Users

GET
/api/users/me
Get Current User Profile
Retrieves the profile information of the currently authenticated user.
{
  "id": "uuid",
  "name": "John Doe",
  "email": "user@example.com",
  "role": "user",
  "subscription": {
    "plan": "free",
    "status": "active"
  }
}
PATCH
/api/users/me
Update Profile
Updates the user's profile information.
{
  "id": "uuid",
  "name": "Jane Doe",
  "bio": "Astrology enthusiast",
  "updated_at": "2023-11-26T10:00:00Z"
}

Products

GET
/api/products
List Products
Returns a list of available products and bundles.

Parameters

NameTypeRequiredDescription
categorystringNoFilter by category (report, bundle, subscription)
{
  "data": [
    {
      "id": "prod_123",
      "name": "First Star Code",
      "price": 990,
      "currency": "HUF"
    },
    {
      "id": "bundle_all",
      "name": "Complete Cosmic Package",
      "price": 19990,
      "currency": "HUF"
    }
  ]
}
POST
/api/products/purchase
Purchase Product
Initiates a purchase flow for a specific product.
{
  "status": "success",
  "transactionId": "txn_789",
  "accessUrl": "/products/first-star-code/result"
}