Before you start
You need:- Your publishable test key (
pk_test_...), from your sandbox account in the Partner Portal, under SDK → Install. - Your secret test key (
dk_test_...), from Settings → API Keys in the same account. Keep it on your server. - An app with sign-in and a server that runs JavaScript. The steps use Next.js; the tabs show Express where it differs. For other languages, see Create sessions.
.env
1. Install
2. Add a session route
This route creates a short-lived doola session for whoever is signed in to your app.- Next.js
- Express
app/doola-session/route.ts
3. Mount the SDK
Render the SDK on a page your signed-in user can reach. When they submit the wizard,onFormed hands you the new company’s id.
app/formation/Formation.tsx
This keeps the quickstart short by passing
setCheckoutFor straight to loadDoola. That works here because the component never unmounts. In a real app, keep one instance outside your components, as shown in Embed the SDK.4. Take payment and confirm it
Your checkout charges the founder, then your server tells doola. Until then, doola files nothing. For this test, the checkout is a single button.app/formation/Checkout.tsx
app/api/checkout/[companyId]/pay/route.ts
5. Try it
- Sign in to your app and open the page with the SDK. The wizard appears, in your branding if you set it in the portal.
- Fill it in and press Submit and pay. Your checkout replaces the SDK.
- Press Pay for your company. The SDK mounts again and shows the founder’s company. Without an SSN, it first asks them to sign the IRS Form SS-4.
- Read the company with your secret key:
formationSubmissionStatusis now pastAWAITING_PAYMENT.
That is a complete integration. Each customer forms one company, so sign in as a new user, or send a new email, to run it again.
Next steps
Take payment
Price on your server, charge once per company, and handle every edge case.
Branding
Your logo, colors and font, set in the Partner Portal.
After payment
Webhooks, documents and signatures once filing starts.
Go-live checklist
Everything to check before you switch to live keys.