Skip to main content
By the end of this page, a signed-in user of your app can fill in the formation wizard, pay in your checkout and land on their company’s dashboard, all in the test environment. Nothing is filed and nothing is charged.

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.
Put the secret key in your server’s environment:
.env

1. Install

2. Add a session route

This route creates a short-lived doola session for whoever is signed in to your app.
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
On your server, check that the company belongs to the signed-in user and still waits on payment, charge, then confirm:
app/api/checkout/[companyId]/pay/route.ts
Take payment covers pricing, retries, refunds and everything else a real checkout needs.

5. Try it

  1. 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.
  2. Fill it in and press Submit and pay. Your checkout replaces the SDK.
  3. 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.
  4. Read the company with your secret key: formationSubmissionStatus is now past AWAITING_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.
Last modified on October 8, 2026