Skip to main content

Implementation

Basic Implementation

This step-by-step guide walks you through everything needed to integrate Unit's Ready-to-Launch capital product. To get started, make sure you’ve signed up for Unit’s Sandbox environment—if you haven’t yet, please do so before proceeding.

Performing Prequalification Checks

By creating the prequalification resource, you can run a pre-qualification check to determine if the end customer is eligible for capital. You can choose to provide business information or run the check in anonymous mode.

  • Performing an anonymous check: Omit business information such as businessName and businessContact, and only pass an externalId as a unique identifier for the end customer on your side as a special tag.
  • Performing a pre-qualification check with business information: Pass businessName and businessContact along with an externalId as a special tag to identify the end customer.

Whether or not you provide business information, you can also run checks in bulk mode by calling the Bulk prequlification api call.

Create Prequalification

VerbPOST
Urlhttps://api.s.unit.sh/prequalifications
Data Typeprequalification
Timeout (Seconds)5

Attributes

FieldtypeDescription
businessNamestringOptional. Name of the business.
businessContactBusinessContactOptional. Primary contact of the business.
businessStructurestringOne of LLC, Sole Proprietor, S Corporation, C Corporation.
businessAddressAddressAddress of the business. Must be a US address
naicsCodestring6 digits business NAICS code, see https://www.census.gov/naics/2022NAICS/6-digit_2022_Codes.xlsx
dateOfIncorporationRFC3339 Date stringDate of incorporation of the business.
averageMonthlyRevenueintegerAverage monthly revenue (in cents).
dateOfBirthRFC3339 Date stringDate of birth of the applicant, must be over 18.
creditScoreintegerOptional. Applicant Fico's score.
requestedLoanAmountintegerOptional. Requested loan amount (in cents).
tagsobjectSee Tags.
Example Request:
curl -X POST 'https://api.s.unit.sh/capital/prequalifications'
-H 'Content-Type: application/vnd.api+json'
-H 'Authorization: Bearer ${TOKEN}'
--data-raw '{
"data": {
"type": "prequalification",
"attributes": {
"naicsCode": "112310",
"businessStructure": "LLC",
"businessAddress": {
"street": "20 Ingram St",
"city": "Forest Hills",
"state": "NY",
"postalCode": "11375",
"country": "US"
},
"dateOfIncorporation": "2001-08-10",
"averageMonthlyRevenue": "870000",
"dateOfBirth": "2001-08-10",
"creditScore": "700",
"requestedLoanAmount": 13000000,
"tags": {
"externalId": "2ab1f266-04b9-41fb-b728-cd1962bca52c"
}
}
}
}'

Response

Response is a JSON:API document.

201 Created

Prequalification is a JSON:API resource, top-level fields:

FieldtypeDescription
idstringIdentifier of the prequalification resource.
typestringType of the prequalification resource.
attributesJSON ObjectJSON object representing the prequalification data.

Attributes

FieldTypeDescription
createdAtRFC3339 Date stringThe date the resource was created.
amountintegerThe prequalified amount (in cents).
expiredAtRFC3339 Date stringDate only (e.g. "2001-08-15").
statusstringOne of Rejected, Prequalified, Expired.
tagsobjectSee Tags.
Example response:
{
"data": {
"type": "prequalification",
"id": "7345432",
"attributes": {
"createdAt": "2022-02-23T12:15:47.386Z",
"amount": 12000000,
"expiredAt": "2025-03-20",
"status": "Prequalified",
"tags": {
"externalId": "2ab1f266-04b9-41fb-b728-cd1962bca52c"
}
}
}
}

Embedding

5 minutes

If you have not done so already, embed the Ready-to-Launch component into your app.

  1. Add the script tag below to your HTML header
<script async src="https://ui.s.unit.sh/release/latest/components-extended.js"></script>
Note

In the production environment, use https://ui.unit.co/release/latest/components-extended.js as the script source.

  1. Add the prequalification component inside your app, the component is interacting with the prequalification resource and will appear as long as the prequalification is not expired. By hitting the apply button in the component, the customer will be redirected to the Ready-to-Launch capital app, where they can complete the application process. Paste the code below to the new page.
<unit-elements-prequalification jwt-token="demo.jwt.token"></unit-elements-prequalification>

Note demo.jwt.token is a real value you can use to preview the component without any setup.

  1. Add a new page to your app that will host the Ready-to-Launch capital experience. Paste the code below to the new page.
<unit-elements-white-label-app jwt-token="demo.jwt.token"></unit-elements-white-label-app>

You may choose to create unit-elements-white-label-app dynamically using JavaScript:

<html>
<head>
<script
async
src="https://ui.unit.co/release/latest/components-extended.js"
></script>
</head>
<body>
<div id="unit-app-placeholder"></div>
<script>
const unit = document.createElement("unit-elements-white-label-app");
unit.setAttribute("jwt-token", "demo.jwt.token");
document.querySelector("#unit-app-placeholder").append(unit);
</script>
</body>
</html>

Authentication

Up to 2 hours

In order to seamlessly authenticate with Unit's Ready-to-Launch Capital app, you need to pass it a JWT, that allows us to identify your user and verify that they are logged in.

Unit will not ask the user to log in using a separate set of credentials. However, before performing any sensitive banking activities, we will OTP the user.

In sandbox, please use code 000001 to complete the OTP.

Configuring your identity provider

20 minutes

If you use one of the following identity providers: Okta, Auth0, AWS Cognito, Stytch - follow the steps below. Otherwise, please follow the steps detailed in Unit’s custom jwt authentication guide.

Log into Unit's dashboard.

  • Under "Developer", go to "Org settings"
  • Under "JWT settings", choose the identity provider you use from the "Provider" drop down.
  • Paste the JWKs Path in the JWKs Field.

Passing The JWT

10 minutes

Pass your JWT to Unit's capital component (see example below), replacing the static token that was previously there.

<unit-elements-white-label-app jwt-token="{{JwtToken}}"></unit-elements-white-label-app>

Cleanup

10 minutes

Ready-to-Launch Capital will use 2 keys in local storage: unitCustomerToken and unitVerifiedCustomerToken. It's important to clean them up when the user logs out from your app.

localStorage.removeItem("unitCustomerToken");
localStorage.removeItem("unitVerifiedCustomerToken");

Content Security Policy

10 minutes

If you are using a Content-Security-Policy (CSP) header, you may need to add the following directives to allow the web components to work correctly:

<meta
http-equiv="Content-Security-Policy"
content="connect-src 'self' https://*.s.unit.sh https://*.unit.co"
/>