https://yourapp.com onboarding a dental
practice, Bayview Dental. For every field and status, see the API reference for
creating a link
and retrieving one.
Before you begin
Every Account Link follows a configuration. The configuration is your standing offer to merchants: what your platform can do on their account, what they pay, and which accounts they can use. You set it up once in the Dashboard, and each link you create uses it. Changing your pricing or permissions later means editing the configuration, not your code.- In Connect → Domains, add
https://yourapp.comunder Redirect domains. Ionic only sends merchants back to origins you list here. - In Connect → Onboarding → Links, choose New link. This is your
configuration.
- Choose Connect + live application and a pricing plan. The merchant signs an application with that plan’s rates.
- Choose the permissions your platform needs, such as taking payments.
- Under More options, set Accounts merchants can use to New accounts only.
- Choose Create link, which publishes it. Then choose Copy link ID
from its menu. This
ccfg_ID is theconfiguration_idfor your requests. - In Connect → API keys, create a platform secret key with
platform:actand the same permissions.
Start in test mode
Test mode is available as soon as Ionic enables Connect for your platform. Create a configuration and key in test mode and follow the same steps. Test configurations use Connect only: the merchant verifies their email and agrees to connect, with no application or pricing. Accounts created in test mode can take test payments as soon as the merchant agrees, sopayments_enabled is true when they return.
In test mode, return_url can also point at your machine, such as
http://localhost:3000/connect/callback, without adding it under Redirect
domains. Ionic sends real verification codes, so use an email address you can
receive. When you are ready for live merchants, create a live configuration
with Connect + live application and a pricing plan, switch to your live
secret key, and use an HTTPS return URL on a redirect domain.
1. Create the Account Link
Add an endpoint behind your Set up payments button. It creates the link, saves the link ID with the practice, and redirects the browser to Ionic.prefill requires business_name (up to 200 characters),
contact_first_name, contact_last_name, contact_email, contact_phone,
address_line1, city, state, postal_code, and country (US).
address_line2 is optional. A missing or invalid field returns 422 with a
message that names it.
contact_email becomes the account owner’s login. Ionic sends the
verification code to this address, and the merchant cannot change it during
onboarding. Use the email of the person who will own the account.account is Bayview Dental’s merchant ID. It exists now, but your platform
can’t act for the merchant until they agree to connect in the next step. Until
then, reading the link returns onboarding_status: "awaiting_consent" and no
connection_id. The url works once and expires after 30 minutes, so redirect
to it right away. Don’t email or message it, because link previews can open it
first.
Choose a return URL
return_url is where Ionic sends the merchant’s browser when their visit ends,
whether they finished or chose to leave. You set it on each link, so different
links can return to different pages of your app.
- Origin. The scheme, host, and port must match a redirect domain you
added under Connect → Domains.
https://yourapp.comallowshttps://yourapp.com/anything, but nothttps://www.yourapp.comorhttps://yourapp.com:8443. - Path and query. Anything you like, such as
https://yourapp.com/settings/payments/done?from=onboarding. Ionic keeps your query values and addsaccount_link. It may re-encode the query, so don’t rely on parameter order. account_linkis reserved. Ionic always sets it to the link ID and replaces any value you put there.- Not allowed. Fragments (
#…), credentials (user:pass@), and, in live mode, HTTP or loopback addresses. Write internationalized hostnames in punycode. - Test mode. Also accepts
http://localhost:<port>,http://127.0.0.1:<port>, andhttp://[::1]:<port>without registering them. - Checked twice. Ionic checks the origin when you create the link and again
when the merchant returns. Removing a redirect domain stops new links and
returns to it. Reading the link still works, and
resume_fromcan send the merchant to a new URL.
account_link value, so always find the link in your
own records and read its result from the API, as in the next steps.
2. The merchant onboards on Ionic
Ana receives a code at[email protected], enters it, and clicks
Connect. That one click creates her Ionic login as the account owner,
agrees to Ionic’s terms, and connects the account to your platform. She then
reviews the prefilled application, which carries your pricing plan’s rates,
and signs it. Ionic sends her back to your return URL.
If she chooses to leave instead, Ionic still sends her back to your return URL,
and the link’s outcome records that she left.
3. Handle the return
Ionic adds the link ID to your return URL:connected_account_id as the
Ionic-Account header on requests you make for the practice, as described in
Selecting a merchant.
Finding the practice by link ID, rather than by the signed-in user, keeps the
callback working when Ana finishes on a different device. Checking that it is
the practice’s latest link stops an older, abandoned visit from replacing a
working connection, and requiring connection_id keeps a merchant who left
before connecting from clearing your saved one. Use a key in the same
mode that created the link.
Three fields answer different questions, so check each one:
merchant_actions_completed means Ana did everything Ionic needed from her in
this visit. It doesn’t mean she can take payments yet. The
API reference
describes every field and value.
4. Know when payments are enabled
Ana’s application isunder_review. Ionic reviews it after she returns, and
payments_enabled becomes true when the account can take payments. Ionic
sends an account.updated event to your
connected-accounts webhook endpoint
when that happens. You can also call
GET /v1/account_links/{id}
at any time for the current state, including when the browser never returned.
Restart an unfinished visit
If a link expires or the merchant leaves before finishing, create a new link withresume_from set to the previous link ID. The merchant continues where
they stopped, with the same account and application. Send a new
Idempotency-Key, the same configuration_id and external_reference, and no
prefill. return_url can be the same or a new one on a redirect domain. Save
the new link ID as the practice’s current link and redirect to its url.
Creating a fresh link without resume_from starts over and can create a second
account for the same merchant.
Existing Ionic merchants
A configuration set to Existing accounts only or New or existing accepts merchants who already have an Ionic account. They sign in instead of verifying an email, andprefill is optional. A merchant who already takes
payments with Ionic keeps their current pricing and skips the application: the
link reports onboarding_status: "approved" and existing_terms_retained: true.
What’s next
Register payment domains
Add the websites your platform operates so connected accounts can take payments.
Send buyers to hosted checkout
Take a first payment for the connected account with no payment form to build.
Take payments on your own page
Collect card payments for the connected account with Ionic Blocks.
- Create a hosted onboarding link: every request field, error, and example.
- Retrieve hosted onboarding progress: every result field and status value.
- Connect overview: connected accounts and the
Ionic-Accountheader. - Webhook endpoints:
account_link.*,connection.*, andaccount.*events for your platform.

