{"record":{"id":"2fb1708051df4023","repo":"calcom/cal.diy","slug":"stripe-account-is-not-an-active-account","errorCode":null,"errorMessage":"Stripe account is not an active account","messagePattern":"Stripe account is not an active account","errorType":"http","errorClass":"BadRequestException","httpStatus":400,"severity":"error","filePath":"apps/api/v2/src/modules/stripe/stripe.service.ts","lineNumber":163,"sourceCode":"  async validateStripeCredentials(\n    credentials?: Credential | null\n  ): Promise<{ status: typeof SUCCESS_STATUS }> {\n    if (!credentials) {\n      throw new NotFoundException(\"Credentials for stripe not found.\");\n    }\n\n    if (credentials.invalid) {\n      throw new BadRequestException(\"Invalid stripe credentials.\");\n    }\n\n    const stripeKey = JSON.stringify(credentials.key);\n    const stripeKeyObject = JSON.parse(stripeKey);\n\n    const stripeAccount = await stripeInstance.accounts.retrieve(stripeKeyObject?.stripe_user_id);\n\n    // both of these should be true for an account to be fully active\n    if (!stripeAccount.payouts_enabled || !stripeAccount.charges_enabled) {\n      throw new BadRequestException(\"Stripe account is not an active account\");\n    }\n\n    return {\n      status: SUCCESS_STATUS,\n    };\n  }\n\n  async generateTeamCheckoutSession(pendingPaymentTeamId: number, ownerId: number) {\n    const stripe = this.getStripe();\n    const customer = await this.getStripeCustomerIdFromUserId(ownerId);\n\n    if (!customer) {\n      throw new BadRequestException(\"Failed to create a customer on Stripe.\");\n    }\n\n    const session = await stripe.checkout.sessions.create({\n      customer,\n      mode: \"subscription\",","sourceCodeStart":145,"sourceCodeEnd":181,"githubUrl":"https://github.com/calcom/cal.diy/blob/176037d0afbe572f870a3c702985e7cd83fe6c0c/apps/api/v2/src/modules/stripe/stripe.service.ts#L145-L181","documentation":"Thrown by StripeService.validateStripeCredentials after it retrieves the Stripe account. The comment states both flags must be true for a fully active account; if !payouts_enabled || !charges_enabled, the account is considered not active and the request is rejected as 400 BadRequest. This is a business-level check against the live Stripe account state.","triggerScenarios":"Calling validate when the connected Stripe account has payouts or charges disabled - e.g. a new account still pending KYC/verification, an account restricted by Stripe, or one where the owner manually disabled payouts/charges.","commonSituations":"A new Stripe account that hasn't completed identity verification. Stripe restricted the account due to compliance or a dispute. The account is in a region requiring extra setup. The user disabled charges/payouts in Stripe settings.","solutions":["Direct the user to their Stripe dashboard to complete account verification and resolve any restrictions.","Re-check validate after the user finishes Stripe's onboarding/verification; both flags must be true.","If testing, use a fully-activated Stripe test account rather than a partially-onboarded one."],"exampleFix":null,"handlingStrategy":"try-catch","validationCode":"async function stripeAccountFullyActive(api) {\n  try {\n    await api.validateStripe();\n    return true;\n  } catch (e) {\n    if (e.status === 400 && /not an active account/.test(e.message)) return false;\n    throw e;\n  }\n}","typeGuard":"function isFullyActiveAccount(acct: { payouts_enabled: boolean; charges_enabled: boolean }): boolean {\n  return acct.payouts_enabled && acct.charges_enabled;\n}","tryCatchPattern":"try {\n  await api.validateStripe();\n} catch (e) {\n  if (e.status === 400 && /not an active account/.test(e.message)) {\n    surfaceToUser('Complete Stripe account verification to accept payments.');\n  } else throw e;\n}","preventionTips":["Guide users through full Stripe onboarding (KYC, bank account) before relying on payments.","Re-validate after users finish Stripe verification rather than assuming instant activation.","Use a fully-activated Stripe test account in non-production environments."],"tags":["stripe","account","kyc","api-v2","verification"],"backgroundTag":null,"analyzedSha":"176037d0afbe572f870a3c702985e7cd83fe6c0c","analyzedAt":"2026-08-12T19:12:41.464Z","schemaVersion":2},"datasetVersion":"2026-08-12T23:17:12.415Z"}