{"record":{"id":"30841b57c2fe8abe","repo":"SigNoz/signoz","slug":"license-key-is-required","errorCode":null,"errorMessage":"license key is required","messagePattern":"license key is required","errorType":"validation","errorClass":"model.ApiError","httpStatus":400,"severity":"warning","filePath":"ee/query-service/app/api/license.go","lineNumber":69,"sourceCode":"\ntype billingData struct {\n\tBillingPeriodStart int64   `json:\"billingPeriodStart\"`\n\tBillingPeriodEnd   int64   `json:\"billingPeriodEnd\"`\n\tDetails            details `json:\"details\"`\n\tDiscount           float64 `json:\"discount\"`\n\tSubscriptionStatus string  `json:\"subscriptionStatus\"`\n}\n\ntype billingDetails struct {\n\tStatus string      `json:\"status\"`\n\tData   billingData `json:\"data\"`\n}\n\nfunc (ah *APIHandler) getBilling(w http.ResponseWriter, r *http.Request) {\n\tlicenseKey := r.URL.Query().Get(\"licenseKey\")\n\n\tif licenseKey == \"\" {\n\t\tRespondError(w, model.BadRequest(fmt.Errorf(\"license key is required\")), nil)\n\t\treturn\n\t}\n\n\tclaims, err := authtypes.ClaimsFromContext(r.Context())\n\tif err != nil {\n\t\tRespondError(w, model.InternalError(err), nil)\n\t\treturn\n\t}\n\n\torgID := valuer.MustNewUUID(claims.OrgID)\n\tevalCtx := featuretypes.NewFlaggerEvaluationContext(orgID)\n\tuseZeus := ah.Signoz.Flagger.BooleanOrEmpty(r.Context(), flagger.FeatureGetMetersFromZeus, evalCtx)\n\n\tif useZeus {\n\t\tdata, err := ah.Signoz.Zeus.GetMeters(r.Context(), licenseKey)\n\t\tif err != nil {\n\t\t\tRespondError(w, model.InternalError(err), nil)\n\t\t\treturn","sourceCodeStart":51,"sourceCodeEnd":87,"githubUrl":"https://github.com/SigNoz/signoz/blob/5069bf80b08f1f00d7e014eccc09902f9871004f/ee/query-service/app/api/license.go#L51-L87","documentation":"The /billing endpoint (getBilling) requires a licenseKey query parameter and returns BadRequest when it is absent or empty. This is an input-validation error, not a server fault.","triggerScenarios":"GET /api/v1/billing (or the EE billing route) without ?licenseKey=... or with an empty value.","commonSituations":"Frontend not forwarding the license key, manual API calls omitting the param, or URL encoding stripping the value.","solutions":["Include a non-empty licenseKey query parameter in the request","Check the caller/UI code that builds the billing URL","Verify the value is not being dropped by encoding or redirects"],"exampleFix":"// before\nGET /api/v1/billing\n// after\nGET /api/v1/billing?licenseKey=<your-license-key>","handlingStrategy":"validation","validationCode":"if licenseKey == \"\" {\n    return errors.New(\"licenseKey query parameter is required\")\n}","typeGuard":null,"tryCatchPattern":"Not applicable — validate the query parameter before making the request.","preventionTips":["Centralize license-key handling in the client","Add request-building tests that assert required params"],"tags":["validation","billing","license","http-api"],"backgroundTag":"missing-required-parameter","analyzedSha":"5069bf80b08f1f00d7e014eccc09902f9871004f","analyzedAt":"2026-08-28T06:22:12.824Z","schemaVersion":2},"datasetVersion":"2026-08-28T11:17:15.048Z"}