Skip to navigation

Onboard a business with a link

Send a business's representative to hosted onboarding to apply for a card program, then read the outcome through the API.

POST /accountHolders/{accountHolderId}/onboardingLink returns a single-use link into hosted onboarding for one business account holder and one card program. Your user opens it from your application, completes the business’s application and submits it. They need no account and no sign-in for hosted onboarding: the link alone opens it. You read the outcome through the API.

Onboard a business

1

Create the account holder

Create the business with POST /accountHolders. The key needs accountHolders:write; do not send Account-Holder.

curl -X POST "https://$API_HOST/api/v2/accountHolders" \
-H "Authorization: Bearer $TOKEN" \
-H "Idempotency-Key: 8a1c4e2f-6b3d-4f7a-9c0e-2d5b8f1a4c63" \
-H "Content-Type: application/json" \
-d '{
"type": "BUSINESS",
"business": {
"legalName": "Atlas Travel LLC",
"email": "finance@atlas.example",
"phone": "+15125550100",
"annualRevenue": { "value": 125000000, "currency": "USD" },
"address": { "line1": "100 Market Street", "city": "Austin", "state": "TX", "postalCode": "78701", "country": "US" }
}
}'

The account holder has onboarding set to HOSTED, the default. Business details on the account holder appear already filled in, so the person checks them instead of typing them. annualRevenue.value is in whole cents: 125000000 is $1,250,000.

2

Choose a card program

List the card programs the account holder can apply for with GET /cardProgramOptions. The key needs cards:read, and the request sends Account-Holder with the account holder ID.

curl "https://$API_HOST/api/v2/cardProgramOptions" \
-H "Authorization: Bearer $TOKEN" \
-H "Account-Holder: $ACCOUNT_HOLDER_ID"
{
"data": [
{
"id": "0b6f1f9e-3c2a-5d4e-8f71-2a9c4e6b8d10",
"object": "cardProgramOption",
"livemode": false,
"name": "Business Debit",
"accountHolderType": "BUSINESS",
"programType": "DEBIT"
}
],
"pageInfo": { "hasNextPage": false, "endCursor": null }
}

Send the option’s id as cardProgramOptionId when you create the link. It is required even when the list has one option.

4

Redirect the person

Redirect your user to url straight away. They do not sign in again: url carries a single-use credential, and anyone who opens it can onboard the account holder.

  • Never email or text it.
  • Do not store it or log it.
  • Use a new Idempotency-Key for each link. A replay of the same key returns the same link, with url, for 24 hours.

A handler that creates a link and redirects to it can serve both your Apply button and refreshUrl:

// GET https://app.example.com/onboarding/new-link
// requireSignIn is your application's own sign-in.
app.get("/onboarding/new-link", requireSignIn, async (req, res) => {
// Your backend call to POST /accountHolders/{accountHolderId}/onboardingLink.
const link = await createOnboardingLink(req.user.accountHolderId);
res.redirect(303, link.url);
});
5

Read the outcome

The person goes to returnUrl once the application is submitted, whether it is in review, approved or declined, and also when they save to finish later. returnUrl carries no status: read GET /accountHolders/{accountHolderId}/verification from your backend to tell them apart, or wait for the events. A person who saved needs a new link to continue.

  • Open it within 30 minutes, by expiresAt.
  • Opening the page does not use the link up. Pressing Start does.
  • Creating a link cancels any unused earlier link for the account holder.
  • A link that expired, was used or was replaced sends the person to refreshUrl. Without refreshUrl, the person is asked to return to your application for a new link.

What the person does

  1. Opens the link and presses Start.
  2. Completes the application in hosted onboarding. For an issuer that hosts its own onboarding, the person completes it on the issuer’s pages instead.
  3. Saves their progress to finish later, if needed. The person goes to returnUrl, or without it sees that their progress is saved and can close the window. Continuing needs a new link from your application.
  4. Submits the application. The person goes to returnUrl, or without it stays on a page that shows the application’s status.

If the issuer later asks for documents, collect them with the verification documents component.

Events

EventSent when
accountHolder.verification.updatedThe application moved into review, or the issuer denied or closed it.
accountHolder.updatedA member of the account holder changed, such as status becoming ACTIVE once it is approved.

Read GET /accountHolders/{accountHolderId}/verification for each application’s status. See Webhooks and events to receive events.

Hosted and API onboarding

onboarding on a business account holder decides how its application reaches the issuers.

HOSTEDAPI
DefaultYesNo
Who enters the detailsThe business’s own people, in hosted onboardingYour platform, through the API
How it appliesPOST /accountHolders/{accountHolderId}/onboardingLinkPOST /accountHolders/{accountHolderId}/submit
PermissionsaccountHolders:verifyaccountHolders:verify and accountHolders:onboard
  • accountHolders:onboard is an add-on. Keys do not hold it by default, and it must be enabled for your platform before a key can be given it. Contact support to request it.
  • POST /accountHolders/{accountHolderId}/submit and POST /accountHolders/{accountHolderId}/resubmit refuse a HOSTED business with 409 INVALID_STATE.
  • Set onboarding on POST /accountHolders, or change it with POST /accountHolders/{accountHolderId}. Setting it to API needs accountHolders:onboard.
  • A person account holder has no onboarding. It applies with POST /accountHolders/{accountHolderId}/submit and cannot use a link.

Errors

ErrorCause
400 INVALID_REQUESTThe body does not match the schema, for example cardProgramOptionId is missing.
403 PERMISSION_DENIEDThe key lacks accountHolders:verify.
409 INVALID_STATEThe account holder is a person, the application for this card program was already submitted, or the card program is the first with an issuer that needs the ID of the business’s existing account there.
422 VALIDATION_FAILEDreturnUrl or refreshUrl is not https on port 443, or contains a user name or password.
422 RELATED_RESOURCE_NOT_FOUNDcardProgramOptionId is not a card program option your platform offers.