Skip to main content

Customer Portal

The customer portal allows end customers of each organization to manage their subscriptions, invoices, and payment methods autonomously.

Access

The portal is accessed via the organization's custom URL. Each organization configures its portal with branding, domain, and specific features.

Portal Features

  • View and pay invoices
  • Manage subscriptions (pause, cancel, if allowed)
  • Update payment methods
  • View transaction history
  • Accept/reject commercial proposals

Portal User (PortalUser)

FieldDescription
EmailUnique per billing account
Billing accountLink to the financial account
SSO onlyIf true, login only via SSO
StatusUser status

User Status

StatusDescription
activeActive user with full access
pending_verificationAwaiting email verification (signup)
pending_invitationAwaiting invitation acceptance
suspendedAccount suspended
lockedLocked due to failed login attempts

Security

  • Passwords hashed with bcrypt
  • Verification/reset tokens based on HMAC
  • Automatic lockout after failed login attempts
  • Verification tokens expire in 24 hours
  • Invitation tokens expire in 7 days

Invitations

The invitation system allows the organization to send email invitations:

  1. The invitation is sent with a temporary token (7 days)
  2. The recipient accepts and sets their password
  3. Status changes to active
  4. Pending invitations can be canceled or resent

Self-Service Signup

Organizations can enable public signup:

  1. The customer accesses the signup page via a unique slug
  2. Enters CNPJ (validated against Receita Federal via minhareceita.org API)
  3. Fills in company and administrator data
  4. A verification email is sent
  5. After verification, access is granted

CNPJ Validation

  • CNPJ must have an "Active" registration status
  • CNPJ cannot already be registered in the organization
  • CNPJs with "Closed" status are blocked

Portal Configuration

SettingDescription
Company nameName displayed in the portal
LogoLight and dark logo
ColorsLight and dark theme (HSL)
LanguagesAvailable languages (default: pt-BR, en-US)
PaymentsEnabled methods (card, boleto, PIX)
SubscriptionsAllow pause/cancel
InvitationsEnable invitations and allowed domains
SignupSlug and enable public signup
SSOPublic key, algorithm, and issuer

SSO (Single Sign-On)

The portal supports SSO via JWT:

  • Supported algorithms: RS256, RS384, RS512, ES256, ES384, ES512, PS256, PS384, PS512
  • Configure PEM public key and issuer (iss claim)
  • SSO-only users do not need a password