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
andbusinessContact
, and only pass anexternalId
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
andbusinessContact
along with anexternalId
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
Verb | POST |
Url | https://api.s.unit.sh/prequalifications |
Data Type | prequalification |
Timeout (Seconds) | 5 |
Attributes
Field | type | Description |
---|---|---|
businessName | string | Optional. Name of the business. |
businessContact | BusinessContact | Optional. Primary contact of the business. |
businessStructure | string | One of LLC , Sole Proprietor , S Corporation , C Corporation . |
businessAddress | Address | Address of the business. Must be a US address |
naicsCode | string | 6 digits business NAICS code, see https://www.census.gov/naics/2022NAICS/6-digit_2022_Codes.xlsx |
dateOfIncorporation | RFC3339 Date string | Date of incorporation of the business. |
averageMonthlyRevenue | integer | Average monthly revenue (in cents). |
dateOfBirth | RFC3339 Date string | Date of birth of the applicant, must be over 18. |
creditScore | integer | Optional. Applicant Fico's score. |
requestedLoanAmount | integer | Optional. Requested loan amount (in cents). |
tags | object | See Tags. |
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:
Field | type | Description |
---|---|---|
id | string | Identifier of the prequalification resource. |
type | string | Type of the prequalification resource. |
attributes | JSON Object | JSON object representing the prequalification data. |
Attributes
Field | Type | Description |
---|---|---|
createdAt | RFC3339 Date string | The date the resource was created. |
amount | integer | The prequalified amount (in cents). |
expiredAt | RFC3339 Date string | Date only (e.g. "2001-08-15" ). |
status | string | One of Rejected , Prequalified , Expired . |
tags | object | See Tags. |
{
"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
If you have not done so already, embed the Ready-to-Launch component into your app.
- Add the script tag below to your HTML header
<script async src="https://ui.s.unit.sh/release/latest/components-extended.js"></script>
In the production environment, use https://ui.unit.co/release/latest/components-extended.js
as the script source.
- 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-capital-prequalification jwt-token="demo.jwt.token"></unit-elements-capital-prequalification>
Note demo.jwt.token
is a real value you can use to preview the component without any setup.
- 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
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
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
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
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
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"
/>