DOCS
Build with the API

Embed sign-up with application sessions

Run merchant sign-up inside your platform site with a session, the embed script, and the completion webhook.

Platform guide

Embedded sign-up puts the merchant application inside your own site, in an iframe that sits inline on the page or opens as a modal. Applicants never leave your product. To see it working, try the public walkthrough or the test harness.

The flow has four parts. Your server creates a session. Your page loads the dhango script and mounts the form, and receives identifiers as the applicant moves through it. When the applicant agrees to the terms, dhango sends you an ApplicationSubmitted webhook.

1. Create a session

From your server, call POST /v1/applicationSessions with your platform API key and secret. The response contains the sessionId.

Anything you already know about the applicant can be pre-filled: names, email, phone, address, legal name, doing-business-as name, website, tax id, entity type, merchant category code, support contacts, and a description of the offering. All of these are optional.

embedConfig customizes the form:

  • embedConfig.readOnlyFields locks fields so the applicant cannot change them. The API enforces locked values, not just the page.
  • embedConfig.skipSteps skips steps by id: 1 Contact, 2 Organization, 3 Controllers and officers, 4 Financial. The confirmation step cannot be skipped.
  • embedConfig.theme sets colors, corner radius, type size, and a Google font, so the form matches your site.

Also send platformIdentifier, your own id for the applicant. It keeps a returning applicant from creating duplicate applications, and it comes back on the webhook so you can match the application to your record. autoOnboarding is optional. See Application sessions.

2. Register origins

Browsers refuse to load the form until your platform registers at least one origin that is allowed to embed it. In the dashboard, open Accounts, your platform account, API Credentials, then Embedded Sign Up Origins, under Webhook Integration. Add up to 10 HTTPS origins. For local development, http://localhost and http://127.0.0.1 are also allowed.

Each origin is a scheme, host, and optional port, with no path. A wildcard such as https://*.partner.com matches subdomains but not https://partner.com itself, so add that separately if you embed there. Changes take about five minutes to reach the sign-up host. See Register embedded sign-up origins.

3. Load the script

Load the script directly from the dhango sign-up host rather than hosting your own copy, so you always run the current version.

Use the Sandbox script while you test and the Production script when you go live. An unminified build is available at /embed.js on the same host. Because the script knows where it was loaded from, Dhango.signup does not need a url option. When the form is ready, the dhango:ready event fires with a capabilities array.

For an overlay, pass mode: "modal" instead of container. The iframe sizes itself and closes when the applicant finishes. To keep it open until you call destroy(), set autoClose: false.

For a tighter fit with your own UI, you can hide the stepper, the next and back buttons, the language menu, and the close button, then drive the flow yourself with next(), back(), and getState(). Events sent to your page carry identifiers only, never applicant data.

The form is available in English, Spanish, German, French, and Dutch (en, es, de, fr, nl). Set the language when you mount the embed, or change it later with setLanguage().

Hosted form

To skip embedding, send the applicant to the hosted sign-up URL with the same session id as ?sessionId=.

embed-script
<script src="https://signup.dhangodemo.com/embed.min.js"></script>
mount
var signup = Dhango.signup({ container: "#signup-slot", sessionId: sessionIdFromTheServer, config: { theme: { primaryColor: "#0057ff", fontFamily: "Poppins" } }, onComplete: function (event) { /* event.sessionId only */ }});

4. Verify the webhook

If you have not set up webhooks yet, go to API Credentials, then Webhook Integration, register your HTTPS URL, and generate the HMAC key.

ApplicationSubmitted fires when the applicant finishes sign-up, before the account exists. Data contains ApplicationId, PlatformIdentifier, OrganizationName, DoingBusinessAs, ContactEmailAddress, and SubmitDate. Use PlatformIdentifier to match it to your record. Webhooks explains how to verify the signature.