Assist_Design/apps/bff/openapi/openapi.json

2075 lines
52 KiB
JSON

{
"openapi": "3.0.0",
"paths": {
"/api/orders": {
"post": {
"operationId": "OrdersController_create",
"parameters": [],
"requestBody": {
"required": true,
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/CreateOrderDto"
}
}
}
},
"responses": {
"201": {
"description": "Order created successfully"
},
"400": {
"description": "Invalid request data"
}
},
"security": [
{
"bearer": []
}
],
"summary": "Create Salesforce Order",
"tags": ["orders"]
}
},
"/api/orders/user": {
"get": {
"operationId": "OrdersController_getUserOrders",
"parameters": [],
"responses": {
"200": {
"description": ""
}
},
"security": [
{
"bearer": []
}
],
"summary": "Get user's orders",
"tags": ["orders"]
}
},
"/api/orders/{sfOrderId}": {
"get": {
"operationId": "OrdersController_get",
"parameters": [
{
"name": "sfOrderId",
"required": true,
"in": "path",
"schema": {
"type": "string"
}
}
],
"responses": {
"200": {
"description": ""
}
},
"security": [
{
"bearer": []
}
],
"summary": "Get order summary/status",
"tags": ["orders"]
}
},
"/api/me": {
"get": {
"operationId": "UsersController_getProfile",
"parameters": [],
"responses": {
"200": {
"description": "User profile retrieved successfully"
},
"401": {
"description": "Unauthorized"
}
},
"security": [
{
"bearer": []
}
],
"summary": "Get current user profile",
"tags": ["users"]
},
"patch": {
"operationId": "UsersController_updateProfile",
"parameters": [],
"requestBody": {
"required": true,
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/UpdateUserDto"
}
}
}
},
"responses": {
"200": {
"description": "Profile updated successfully"
},
"400": {
"description": "Invalid input data"
},
"401": {
"description": "Unauthorized"
}
},
"security": [
{
"bearer": []
}
],
"summary": "Update user profile",
"tags": ["users"]
}
},
"/api/me/summary": {
"get": {
"operationId": "UsersController_getSummary",
"parameters": [],
"responses": {
"200": {
"description": "User summary retrieved successfully"
},
"401": {
"description": "Unauthorized"
}
},
"security": [
{
"bearer": []
}
],
"summary": "Get user dashboard summary",
"tags": ["users"]
}
},
"/api/me/address": {
"get": {
"operationId": "UsersController_getAddress",
"parameters": [],
"responses": {
"200": {
"description": "Address retrieved successfully"
},
"401": {
"description": "Unauthorized"
}
},
"security": [
{
"bearer": []
}
],
"summary": "Get mailing address",
"tags": ["users"]
},
"patch": {
"operationId": "UsersController_updateAddress",
"parameters": [],
"requestBody": {
"required": true,
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/UpdateAddressDto"
}
}
}
},
"responses": {
"200": {
"description": "Address updated successfully"
},
"400": {
"description": "Invalid input data"
},
"401": {
"description": "Unauthorized"
}
},
"security": [
{
"bearer": []
}
],
"summary": "Update mailing address",
"tags": ["users"]
}
},
"/api/auth/validate-signup": {
"post": {
"operationId": "AuthController_validateSignup",
"parameters": [],
"requestBody": {
"required": true,
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/ValidateSignupDto"
}
}
}
},
"responses": {
"200": {
"description": "Validation successful"
},
"400": {
"description": "Customer number not found"
},
"409": {
"description": "Customer already has account"
},
"429": {
"description": "Too many validation attempts"
}
},
"summary": "Validate customer number for signup",
"tags": ["auth"]
}
},
"/api/auth/health-check": {
"get": {
"operationId": "AuthController_healthCheck",
"parameters": [],
"responses": {
"200": {
"description": "Health check results"
}
},
"summary": "Check auth service health and integrations",
"tags": ["auth"]
}
},
"/api/auth/signup-preflight": {
"post": {
"operationId": "AuthController_signupPreflight",
"parameters": [],
"requestBody": {
"required": true,
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/SignupDto"
}
}
}
},
"responses": {
"200": {
"description": "Preflight results with next action guidance"
}
},
"summary": "Validate full signup data without creating anything",
"tags": ["auth"]
}
},
"/api/auth/account-status": {
"post": {
"operationId": "AuthController_accountStatus",
"parameters": [],
"requestBody": {
"required": true,
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/AccountStatusRequestDto"
}
}
}
},
"responses": {
"200": {
"description": "Account status"
}
},
"summary": "Get account status by email",
"tags": ["auth"]
}
},
"/api/auth/signup": {
"post": {
"operationId": "AuthController_signup",
"parameters": [],
"requestBody": {
"required": true,
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/SignupDto"
}
}
}
},
"responses": {
"201": {
"description": "User created successfully"
},
"409": {
"description": "User already exists"
},
"429": {
"description": "Too many signup attempts"
}
},
"summary": "Create new user account",
"tags": ["auth"]
}
},
"/api/auth/login": {
"post": {
"operationId": "AuthController_login",
"parameters": [],
"responses": {
"200": {
"description": "Login successful"
},
"401": {
"description": "Invalid credentials"
}
},
"summary": "Authenticate user",
"tags": ["auth"]
}
},
"/api/auth/logout": {
"post": {
"operationId": "AuthController_logout",
"parameters": [],
"responses": {
"200": {
"description": "Logout successful"
}
},
"summary": "Logout user",
"tags": ["auth"]
}
},
"/api/auth/link-whmcs": {
"post": {
"operationId": "AuthController_linkWhmcs",
"parameters": [],
"requestBody": {
"required": true,
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/LinkWhmcsDto"
}
}
}
},
"responses": {
"200": {
"description": "WHMCS account linked successfully"
},
"401": {
"description": "Invalid WHMCS credentials"
},
"429": {
"description": "Too many link attempts"
}
},
"summary": "Link existing WHMCS user",
"tags": ["auth"]
}
},
"/api/auth/set-password": {
"post": {
"operationId": "AuthController_setPassword",
"parameters": [],
"requestBody": {
"required": true,
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/SetPasswordDto"
}
}
}
},
"responses": {
"200": {
"description": "Password set successfully"
},
"401": {
"description": "User not found"
},
"429": {
"description": "Too many password attempts"
}
},
"summary": "Set password for linked user",
"tags": ["auth"]
}
},
"/api/auth/check-password-needed": {
"post": {
"operationId": "AuthController_checkPasswordNeeded",
"parameters": [],
"responses": {
"200": {
"description": "Password status checked"
}
},
"summary": "Check if user needs to set password",
"tags": ["auth"]
}
},
"/api/auth/request-password-reset": {
"post": {
"operationId": "AuthController_requestPasswordReset",
"parameters": [],
"requestBody": {
"required": true,
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/RequestPasswordResetDto"
}
}
}
},
"responses": {
"200": {
"description": "Reset email sent if account exists"
}
},
"summary": "Request password reset email",
"tags": ["auth"]
}
},
"/api/auth/reset-password": {
"post": {
"operationId": "AuthController_resetPassword",
"parameters": [],
"requestBody": {
"required": true,
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/ResetPasswordDto"
}
}
}
},
"responses": {
"200": {
"description": "Password reset successful"
}
},
"summary": "Reset password with token",
"tags": ["auth"]
}
},
"/api/auth/change-password": {
"post": {
"operationId": "AuthController_changePassword",
"parameters": [],
"requestBody": {
"required": true,
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/ChangePasswordDto"
}
}
}
},
"responses": {
"200": {
"description": "Password changed successfully"
}
},
"summary": "Change password (authenticated)",
"tags": ["auth"]
}
},
"/api/auth/me": {
"get": {
"operationId": "AuthController_getAuthStatus",
"parameters": [],
"responses": {
"200": {
"description": ""
}
},
"summary": "Get current authentication status",
"tags": ["auth"]
}
},
"/api/auth/sso-link": {
"post": {
"operationId": "AuthController_createSsoLink",
"parameters": [],
"requestBody": {
"required": true,
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/SsoLinkDto"
}
}
}
},
"responses": {
"200": {
"description": "SSO link created successfully"
},
"404": {
"description": "User not found or not linked to WHMCS"
}
},
"summary": "Create SSO link to WHMCS",
"tags": ["auth"]
}
},
"/api/auth/admin/audit-logs": {
"get": {
"operationId": "AuthAdminController_getAuditLogs",
"parameters": [
{
"name": "page",
"required": true,
"in": "query",
"schema": {
"type": "string"
}
},
{
"name": "limit",
"required": true,
"in": "query",
"schema": {
"type": "string"
}
},
{
"name": "userId",
"required": true,
"in": "query",
"schema": {
"type": "string"
}
}
],
"responses": {
"200": {
"description": "Audit logs retrieved"
}
},
"security": [
{
"bearer": []
}
],
"summary": "Get audit logs (admin only)",
"tags": ["auth-admin"]
}
},
"/api/auth/admin/unlock-account/{userId}": {
"post": {
"operationId": "AuthAdminController_unlockAccount",
"parameters": [
{
"name": "userId",
"required": true,
"in": "path",
"schema": {
"type": "string"
}
}
],
"responses": {
"200": {
"description": "Account unlocked"
}
},
"security": [
{
"bearer": []
}
],
"summary": "Unlock user account (admin only)",
"tags": ["auth-admin"]
}
},
"/api/auth/admin/security-stats": {
"get": {
"operationId": "AuthAdminController_getSecurityStats",
"parameters": [],
"responses": {
"200": {
"description": "Security stats retrieved"
}
},
"security": [
{
"bearer": []
}
],
"summary": "Get security statistics (admin only)",
"tags": ["auth-admin"]
}
},
"/api/catalog/internet/plans": {
"get": {
"operationId": "CatalogController_getInternetPlans",
"parameters": [],
"responses": {
"200": {
"description": ""
}
},
"security": [
{
"bearer": []
}
],
"summary": "Get Internet plans filtered by customer eligibility",
"tags": ["catalog"]
}
},
"/api/catalog/internet/addons": {
"get": {
"operationId": "CatalogController_getInternetAddons",
"parameters": [],
"responses": {
"200": {
"description": ""
}
},
"security": [
{
"bearer": []
}
],
"summary": "Get Internet add-ons",
"tags": ["catalog"]
}
},
"/api/catalog/internet/installations": {
"get": {
"operationId": "CatalogController_getInternetInstallations",
"parameters": [],
"responses": {
"200": {
"description": ""
}
},
"security": [
{
"bearer": []
}
],
"summary": "Get Internet installations",
"tags": ["catalog"]
}
},
"/api/catalog/sim/plans": {
"get": {
"operationId": "CatalogController_getSimPlans",
"parameters": [],
"responses": {
"200": {
"description": ""
}
},
"security": [
{
"bearer": []
}
],
"summary": "Get SIM plans filtered by user's existing services",
"tags": ["catalog"]
}
},
"/api/catalog/sim/activation-fees": {
"get": {
"operationId": "CatalogController_getSimActivationFees",
"parameters": [],
"responses": {
"200": {
"description": ""
}
},
"security": [
{
"bearer": []
}
],
"summary": "Get SIM activation fees",
"tags": ["catalog"]
}
},
"/api/catalog/sim/addons": {
"get": {
"operationId": "CatalogController_getSimAddons",
"parameters": [],
"responses": {
"200": {
"description": ""
}
},
"security": [
{
"bearer": []
}
],
"summary": "Get SIM add-ons",
"tags": ["catalog"]
}
},
"/api/catalog/vpn/plans": {
"get": {
"operationId": "CatalogController_getVpnPlans",
"parameters": [],
"responses": {
"200": {
"description": ""
}
},
"security": [
{
"bearer": []
}
],
"summary": "Get VPN plans",
"tags": ["catalog"]
}
},
"/api/catalog/vpn/activation-fees": {
"get": {
"operationId": "CatalogController_getVpnActivationFees",
"parameters": [],
"responses": {
"200": {
"description": ""
}
},
"security": [
{
"bearer": []
}
],
"summary": "Get VPN activation fees",
"tags": ["catalog"]
}
},
"/api/invoices": {
"get": {
"description": "Retrieves invoices for the authenticated user with pagination and optional status filtering",
"operationId": "InvoicesController_getInvoices",
"parameters": [
{
"name": "page",
"required": false,
"in": "query",
"description": "Page number (default: 1)",
"schema": {
"type": "number"
}
},
{
"name": "limit",
"required": false,
"in": "query",
"description": "Items per page (default: 10)",
"schema": {
"type": "number"
}
},
{
"name": "status",
"required": false,
"in": "query",
"description": "Filter by invoice status",
"schema": {
"type": "string"
}
}
],
"responses": {
"200": {
"description": "List of invoices with pagination",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/InvoiceListDto"
}
}
}
}
},
"security": [
{
"bearer": []
}
],
"summary": "Get paginated list of user invoices",
"tags": ["invoices"]
}
},
"/api/invoices/payment-methods": {
"get": {
"description": "Retrieves all saved payment methods for the authenticated user",
"operationId": "InvoicesController_getPaymentMethods",
"parameters": [],
"responses": {
"200": {
"description": "List of payment methods"
}
},
"security": [
{
"bearer": []
}
],
"summary": "Get user payment methods",
"tags": ["invoices"]
}
},
"/api/invoices/payment-gateways": {
"get": {
"description": "Retrieves all active payment gateways available for payments",
"operationId": "InvoicesController_getPaymentGateways",
"parameters": [],
"responses": {
"200": {
"description": "List of payment gateways"
}
},
"security": [
{
"bearer": []
}
],
"summary": "Get available payment gateways",
"tags": ["invoices"]
}
},
"/api/invoices/test-payment-methods/{clientId}": {
"get": {
"description": "Direct test of WHMCS GetPayMethods API - TEMPORARY DEBUG ENDPOINT",
"operationId": "InvoicesController_testPaymentMethods",
"parameters": [
{
"name": "clientId",
"required": true,
"in": "path",
"description": "WHMCS Client ID to test",
"schema": {
"type": "number"
}
}
],
"responses": {
"200": {
"description": ""
}
},
"security": [
{
"bearer": []
}
],
"summary": "Test WHMCS payment methods API for specific client ID",
"tags": ["invoices"]
}
},
"/api/invoices/payment-methods/refresh": {
"post": {
"description": "Invalidates and refreshes payment methods cache for the current user",
"operationId": "InvoicesController_refreshPaymentMethods",
"parameters": [],
"responses": {
"200": {
"description": "Payment methods cache refreshed"
}
},
"security": [
{
"bearer": []
}
],
"summary": "Refresh payment methods cache",
"tags": ["invoices"]
}
},
"/api/invoices/{id}": {
"get": {
"description": "Retrieves detailed information for a specific invoice",
"operationId": "InvoicesController_getInvoiceById",
"parameters": [
{
"name": "id",
"required": true,
"in": "path",
"description": "Invoice ID",
"schema": {
"type": "number"
}
}
],
"responses": {
"200": {
"description": "Invoice details",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/InvoiceDto"
}
}
}
},
"404": {
"description": "Invoice not found"
}
},
"security": [
{
"bearer": []
}
],
"summary": "Get invoice details by ID",
"tags": ["invoices"]
}
},
"/api/invoices/{id}/subscriptions": {
"get": {
"description": "Retrieves all subscriptions that are referenced in the invoice items",
"operationId": "InvoicesController_getInvoiceSubscriptions",
"parameters": [
{
"name": "id",
"required": true,
"in": "path",
"description": "Invoice ID",
"schema": {
"type": "number"
}
}
],
"responses": {
"200": {
"description": "List of related subscriptions"
},
"404": {
"description": "Invoice not found"
}
},
"security": [
{
"bearer": []
}
],
"summary": "Get subscriptions related to an invoice",
"tags": ["invoices"]
}
},
"/api/invoices/{id}/sso-link": {
"post": {
"description": "Generates a single sign-on link to view/pay the invoice or download PDF in WHMCS",
"operationId": "InvoicesController_createSsoLink",
"parameters": [
{
"name": "id",
"required": true,
"in": "path",
"description": "Invoice ID",
"schema": {
"type": "number"
}
},
{
"name": "target",
"required": false,
"in": "query",
"description": "Link target: view invoice, download PDF, or go to payment page (default: view)",
"schema": {
"enum": ["view", "download", "pay"],
"type": "string"
}
}
],
"responses": {
"200": {
"description": "SSO link created successfully"
},
"404": {
"description": "Invoice not found"
}
},
"security": [
{
"bearer": []
}
],
"summary": "Create SSO link for invoice",
"tags": ["invoices"]
}
},
"/api/invoices/{id}/payment-link": {
"post": {
"description": "Generates a payment link for the invoice with a specific payment method or gateway",
"operationId": "InvoicesController_createPaymentLink",
"parameters": [
{
"name": "id",
"required": true,
"in": "path",
"description": "Invoice ID",
"schema": {
"type": "number"
}
},
{
"name": "paymentMethodId",
"required": false,
"in": "query",
"description": "Payment method ID",
"schema": {
"type": "number"
}
},
{
"name": "gatewayName",
"required": false,
"in": "query",
"description": "Payment gateway name",
"schema": {
"type": "string"
}
}
],
"responses": {
"200": {
"description": "Payment link created successfully"
},
"404": {
"description": "Invoice not found"
}
},
"security": [
{
"bearer": []
}
],
"summary": "Create payment link for invoice with payment method",
"tags": ["invoices"]
}
},
"/api/subscriptions": {
"get": {
"description": "Retrieves all subscriptions/services for the authenticated user",
"operationId": "SubscriptionsController_getSubscriptions",
"parameters": [
{
"name": "status",
"required": false,
"in": "query",
"description": "Filter by subscription status",
"schema": {
"type": "string"
}
}
],
"responses": {
"200": {
"description": "List of user subscriptions"
}
},
"security": [
{
"bearer": []
}
],
"summary": "Get all user subscriptions",
"tags": ["subscriptions"]
}
},
"/api/subscriptions/active": {
"get": {
"description": "Retrieves only active subscriptions for the authenticated user",
"operationId": "SubscriptionsController_getActiveSubscriptions",
"parameters": [],
"responses": {
"200": {
"description": "List of active subscriptions"
}
},
"security": [
{
"bearer": []
}
],
"summary": "Get active subscriptions only",
"tags": ["subscriptions"]
}
},
"/api/subscriptions/stats": {
"get": {
"description": "Retrieves subscription count statistics by status",
"operationId": "SubscriptionsController_getSubscriptionStats",
"parameters": [],
"responses": {
"200": {
"description": "Subscription statistics"
}
},
"security": [
{
"bearer": []
}
],
"summary": "Get subscription statistics",
"tags": ["subscriptions"]
}
},
"/api/subscriptions/{id}": {
"get": {
"description": "Retrieves detailed information for a specific subscription",
"operationId": "SubscriptionsController_getSubscriptionById",
"parameters": [
{
"name": "id",
"required": true,
"in": "path",
"description": "Subscription ID",
"schema": {
"type": "number"
}
}
],
"responses": {
"200": {
"description": "Subscription details"
},
"404": {
"description": "Subscription not found"
}
},
"security": [
{
"bearer": []
}
],
"summary": "Get subscription details by ID",
"tags": ["subscriptions"]
}
},
"/api/subscriptions/{id}/invoices": {
"get": {
"description": "Retrieves all invoices related to a specific subscription",
"operationId": "SubscriptionsController_getSubscriptionInvoices",
"parameters": [
{
"name": "id",
"required": true,
"in": "path",
"description": "Subscription ID",
"schema": {
"type": "number"
}
},
{
"name": "page",
"required": false,
"in": "query",
"description": "Page number (default: 1)",
"schema": {
"type": "number"
}
},
{
"name": "limit",
"required": false,
"in": "query",
"description": "Items per page (default: 10)",
"schema": {
"type": "number"
}
}
],
"responses": {
"200": {
"description": "List of invoices for the subscription"
},
"404": {
"description": "Subscription not found"
}
},
"security": [
{
"bearer": []
}
],
"summary": "Get invoices for a specific subscription",
"tags": ["subscriptions"]
}
},
"/api/subscriptions/{id}/sim/debug": {
"get": {
"description": "Retrieves subscription data to help debug SIM management issues",
"operationId": "SubscriptionsController_debugSimSubscription",
"parameters": [
{
"name": "id",
"required": true,
"in": "path",
"description": "Subscription ID",
"schema": {
"type": "number"
}
}
],
"responses": {
"200": {
"description": "Subscription debug data"
}
},
"security": [
{
"bearer": []
}
],
"summary": "Debug SIM subscription data",
"tags": ["subscriptions"]
}
},
"/api/subscriptions/{id}/sim": {
"get": {
"description": "Retrieves comprehensive SIM information including details and current usage",
"operationId": "SubscriptionsController_getSimInfo",
"parameters": [
{
"name": "id",
"required": true,
"in": "path",
"description": "Subscription ID",
"schema": {
"type": "number"
}
}
],
"responses": {
"200": {
"description": "SIM information"
},
"400": {
"description": "Not a SIM subscription"
},
"404": {
"description": "Subscription not found"
}
},
"security": [
{
"bearer": []
}
],
"summary": "Get SIM details and usage",
"tags": ["subscriptions"]
}
},
"/api/subscriptions/{id}/sim/details": {
"get": {
"description": "Retrieves detailed SIM information including ICCID, plan, status, etc.",
"operationId": "SubscriptionsController_getSimDetails",
"parameters": [
{
"name": "id",
"required": true,
"in": "path",
"description": "Subscription ID",
"schema": {
"type": "number"
}
}
],
"responses": {
"200": {
"description": "SIM details"
}
},
"security": [
{
"bearer": []
}
],
"summary": "Get SIM details",
"tags": ["subscriptions"]
}
},
"/api/subscriptions/{id}/sim/usage": {
"get": {
"description": "Retrieves current data usage and recent usage history",
"operationId": "SubscriptionsController_getSimUsage",
"parameters": [
{
"name": "id",
"required": true,
"in": "path",
"description": "Subscription ID",
"schema": {
"type": "number"
}
}
],
"responses": {
"200": {
"description": "SIM usage data"
}
},
"security": [
{
"bearer": []
}
],
"summary": "Get SIM data usage",
"tags": ["subscriptions"]
}
},
"/api/subscriptions/{id}/sim/top-up-history": {
"get": {
"description": "Retrieves data top-up history for the specified date range",
"operationId": "SubscriptionsController_getSimTopUpHistory",
"parameters": [
{
"name": "id",
"required": true,
"in": "path",
"description": "Subscription ID",
"schema": {
"type": "number"
}
},
{
"name": "fromDate",
"required": true,
"in": "query",
"description": "Start date (YYYYMMDD)",
"schema": {
"example": "20240101",
"type": "string"
}
},
{
"name": "toDate",
"required": true,
"in": "query",
"description": "End date (YYYYMMDD)",
"schema": {
"example": "20241231",
"type": "string"
}
}
],
"responses": {
"200": {
"description": "Top-up history"
}
},
"security": [
{
"bearer": []
}
],
"summary": "Get SIM top-up history",
"tags": ["subscriptions"]
}
},
"/api/subscriptions/{id}/sim/top-up": {
"post": {
"description": "Add data quota to the SIM service",
"operationId": "SubscriptionsController_topUpSim",
"parameters": [
{
"name": "id",
"required": true,
"in": "path",
"description": "Subscription ID",
"schema": {
"type": "number"
}
}
],
"requestBody": {
"required": true,
"description": "Top-up request",
"content": {
"application/json": {
"schema": {
"type": "object",
"properties": {
"quotaMb": {
"type": "number",
"description": "Quota in MB",
"example": 1000
}
},
"required": ["quotaMb"]
}
}
}
},
"responses": {
"200": {
"description": "Top-up successful"
}
},
"security": [
{
"bearer": []
}
],
"summary": "Top up SIM data quota",
"tags": ["subscriptions"]
}
},
"/api/subscriptions/{id}/sim/change-plan": {
"post": {
"description": "Change the SIM service plan. The change will be automatically scheduled for the 1st of the next month.",
"operationId": "SubscriptionsController_changeSimPlan",
"parameters": [
{
"name": "id",
"required": true,
"in": "path",
"description": "Subscription ID",
"schema": {
"type": "number"
}
}
],
"requestBody": {
"required": true,
"description": "Plan change request",
"content": {
"application/json": {
"schema": {
"type": "object",
"properties": {
"newPlanCode": {
"type": "string",
"description": "New plan code",
"example": "LTE3G_P01"
}
},
"required": ["newPlanCode"]
}
}
}
},
"responses": {
"200": {
"description": "Plan change successful"
}
},
"security": [
{
"bearer": []
}
],
"summary": "Change SIM plan",
"tags": ["subscriptions"]
}
},
"/api/subscriptions/{id}/sim/cancel": {
"post": {
"description": "Cancel the SIM service (immediate or scheduled)",
"operationId": "SubscriptionsController_cancelSim",
"parameters": [
{
"name": "id",
"required": true,
"in": "path",
"description": "Subscription ID",
"schema": {
"type": "number"
}
}
],
"requestBody": {
"required": false,
"description": "Cancellation request",
"content": {
"application/json": {
"schema": {
"type": "object",
"properties": {
"scheduledAt": {
"type": "string",
"description": "Schedule cancellation (YYYYMMDD)",
"example": "20241231"
}
}
}
}
}
},
"responses": {
"200": {
"description": "Cancellation successful"
}
},
"security": [
{
"bearer": []
}
],
"summary": "Cancel SIM service",
"tags": ["subscriptions"]
}
},
"/api/subscriptions/{id}/sim/reissue-esim": {
"post": {
"description": "Reissue a downloadable eSIM profile (eSIM only). Optionally provide a new EID to transfer to.",
"operationId": "SubscriptionsController_reissueEsimProfile",
"parameters": [
{
"name": "id",
"required": true,
"in": "path",
"description": "Subscription ID",
"schema": {
"type": "number"
}
}
],
"requestBody": {
"required": true,
"description": "Optional new EID to transfer the eSIM to",
"content": {
"application/json": {
"schema": {
"type": "object",
"properties": {
"newEid": {
"type": "string",
"description": "32-digit EID",
"example": "89049032000001000000043598005455"
}
},
"required": []
}
}
}
},
"responses": {
"200": {
"description": "eSIM reissue successful"
},
"400": {
"description": "Not an eSIM subscription"
}
},
"security": [
{
"bearer": []
}
],
"summary": "Reissue eSIM profile",
"tags": ["subscriptions"]
}
},
"/api/subscriptions/{id}/sim/features": {
"post": {
"description": "Enable/disable voicemail, call waiting, international roaming, and switch network type (4G/5G)",
"operationId": "SubscriptionsController_updateSimFeatures",
"parameters": [
{
"name": "id",
"required": true,
"in": "path",
"description": "Subscription ID",
"schema": {
"type": "number"
}
}
],
"requestBody": {
"required": true,
"description": "Features update request",
"content": {
"application/json": {
"schema": {
"type": "object",
"properties": {
"voiceMailEnabled": {
"type": "boolean"
},
"callWaitingEnabled": {
"type": "boolean"
},
"internationalRoamingEnabled": {
"type": "boolean"
},
"networkType": {
"type": "string",
"enum": ["4G", "5G"]
}
}
}
}
}
},
"responses": {
"200": {
"description": "Features update successful"
}
},
"security": [
{
"bearer": []
}
],
"summary": "Update SIM features",
"tags": ["subscriptions"]
}
},
"/api/subscriptions/sim/orders/activate": {
"post": {
"operationId": "SimOrdersController_activate",
"parameters": [],
"requestBody": {
"required": true,
"description": "SIM activation order payload",
"content": {
"application/json": {
"schema": {
"type": "string"
}
}
}
},
"responses": {
"200": {
"description": "Activation processed"
}
},
"security": [
{
"bearer": []
}
],
"summary": "Create invoice, capture payment, and activate SIM in Freebit",
"tags": ["sim-orders"]
}
},
"/health": {
"get": {
"operationId": "HealthController_getHealth",
"parameters": [],
"responses": {
"200": {
"description": ""
}
},
"tags": ["Health"]
}
}
},
"info": {
"title": "Customer Portal API",
"description": "Backend for Frontend API for customer portal",
"version": "1.0",
"contact": {}
},
"tags": [],
"servers": [],
"components": {
"securitySchemes": {
"bearer": {
"scheme": "bearer",
"bearerFormat": "JWT",
"type": "http"
}
},
"schemas": {
"CreateOrderDto": {
"type": "object",
"properties": {}
},
"UpdateUserDto": {
"type": "object",
"properties": {
"firstName": {
"type": "string",
"description": "User's first name"
},
"lastName": {
"type": "string",
"description": "User's last name"
},
"company": {
"type": "string",
"description": "User's company name"
},
"phone": {
"type": "string",
"description": "User's phone number"
},
"email": {
"type": "string",
"description": "User's email address"
}
}
},
"UpdateAddressDto": {
"type": "object",
"properties": {
"street": {
"type": "string",
"description": "Street address"
},
"streetLine2": {
"type": "string",
"description": "Street address line 2"
},
"city": {
"type": "string",
"description": "City"
},
"state": {
"type": "string",
"description": "State/Prefecture"
},
"postalCode": {
"type": "string",
"description": "Postal code"
},
"country": {
"type": "string",
"description": "Country (ISO alpha-2)"
}
}
},
"ValidateSignupDto": {
"type": "object",
"properties": {
"sfNumber": {
"type": "string",
"description": "Customer Number (SF Number) to validate",
"example": "12345"
}
},
"required": ["sfNumber"]
},
"AddressDto": {
"type": "object",
"properties": {
"street": {
"type": "string",
"example": "123 Main Street"
},
"streetLine2": {
"type": "string",
"example": "Apt 4B"
},
"city": {
"type": "string",
"example": "Tokyo"
},
"state": {
"type": "string",
"example": "Tokyo"
},
"postalCode": {
"type": "string",
"example": "100-0001"
},
"country": {
"type": "string",
"example": "JP",
"description": "ISO 2-letter country code"
}
},
"required": ["street", "city", "state", "postalCode", "country"]
},
"SignupDto": {
"type": "object",
"properties": {
"email": {
"type": "string",
"example": "user@example.com"
},
"password": {
"type": "string",
"example": "SecurePassword123!",
"description": "Password must be at least 8 characters and contain uppercase, lowercase, number, and special character"
},
"firstName": {
"type": "string",
"example": "John"
},
"lastName": {
"type": "string",
"example": "Doe"
},
"company": {
"type": "string",
"example": "Acme Corp"
},
"phone": {
"type": "string",
"example": "+81-90-1234-5678",
"description": "Contact phone number"
},
"sfNumber": {
"type": "string",
"example": "CN-0012345",
"description": "Customer Number (SF Number)"
},
"address": {
"description": "Address for WHMCS client (required)",
"allOf": [
{
"$ref": "#/components/schemas/AddressDto"
}
]
},
"nationality": {
"type": "string"
},
"dateOfBirth": {
"type": "string",
"example": "1990-01-01"
},
"gender": {
"type": "string",
"enum": ["male", "female", "other"]
}
},
"required": ["email", "password", "firstName", "lastName", "phone", "sfNumber", "address"]
},
"AccountStatusRequestDto": {
"type": "object",
"properties": {
"email": {
"type": "string",
"example": "user@example.com"
}
},
"required": ["email"]
},
"LinkWhmcsDto": {
"type": "object",
"properties": {
"email": {
"type": "string",
"example": "user@example.com"
},
"password": {
"type": "string",
"example": "existing-whmcs-password"
}
},
"required": ["email", "password"]
},
"SetPasswordDto": {
"type": "object",
"properties": {
"email": {
"type": "string",
"example": "user@example.com"
},
"password": {
"type": "string",
"example": "NewSecurePassword123!",
"description": "Password must be at least 8 characters and contain uppercase, lowercase, number, and special character"
}
},
"required": ["email", "password"]
},
"RequestPasswordResetDto": {
"type": "object",
"properties": {
"email": {
"type": "string",
"example": "user@example.com"
}
},
"required": ["email"]
},
"ResetPasswordDto": {
"type": "object",
"properties": {
"token": {
"type": "string",
"description": "Password reset token"
},
"password": {
"type": "string",
"example": "SecurePassword123!"
}
},
"required": ["token", "password"]
},
"ChangePasswordDto": {
"type": "object",
"properties": {
"currentPassword": {
"type": "string",
"example": "CurrentPassword123!"
},
"newPassword": {
"type": "string",
"example": "NewSecurePassword123!"
}
},
"required": ["currentPassword", "newPassword"]
},
"SsoLinkDto": {
"type": "object",
"properties": {
"destination": {
"type": "string",
"description": "WHMCS destination path",
"example": "index.php?rp=/account/paymentmethods"
}
}
},
"InvoiceItemDto": {
"type": "object",
"properties": {
"id": {
"type": "number",
"example": 101
},
"description": {
"type": "string",
"example": "Monthly hosting"
},
"amount": {
"type": "number",
"example": 19.99
},
"quantity": {
"type": "number",
"example": 1
},
"type": {
"type": "string",
"example": "Hosting"
},
"serviceId": {
"type": "number",
"example": 555
}
},
"required": ["id", "description", "amount", "type"]
},
"InvoiceDto": {
"type": "object",
"properties": {
"id": {
"type": "number",
"example": 1234
},
"number": {
"type": "string",
"example": "INV-2025-0001"
},
"status": {
"type": "string",
"example": "Unpaid"
},
"currency": {
"type": "string",
"example": "USD"
},
"currencySymbol": {
"type": "string",
"example": "¥"
},
"total": {
"type": "number",
"example": 19.99
},
"subtotal": {
"type": "number",
"example": 18.17
},
"tax": {
"type": "number",
"example": 1.82
},
"issuedAt": {
"type": "string",
"example": "2025-01-01T00:00:00.000Z"
},
"dueDate": {
"type": "string",
"example": "2025-01-15T00:00:00.000Z"
},
"paidDate": {
"type": "string",
"example": "2025-01-10T00:00:00.000Z"
},
"pdfUrl": {
"type": "string"
},
"paymentUrl": {
"type": "string"
},
"description": {
"type": "string"
},
"items": {
"type": "array",
"items": {
"$ref": "#/components/schemas/InvoiceItemDto"
}
}
},
"required": ["id", "number", "status", "currency", "total", "subtotal", "tax"]
},
"PaginationDto": {
"type": "object",
"properties": {
"page": {
"type": "number",
"example": 1
},
"totalPages": {
"type": "number",
"example": 5
},
"totalItems": {
"type": "number",
"example": 42
},
"nextCursor": {
"type": "string"
}
},
"required": ["page", "totalPages", "totalItems"]
},
"InvoiceListDto": {
"type": "object",
"properties": {
"invoices": {
"type": "array",
"items": {
"$ref": "#/components/schemas/InvoiceDto"
}
},
"pagination": {
"$ref": "#/components/schemas/PaginationDto"
}
},
"required": ["invoices", "pagination"]
}
}
}
}