Credit Builder as a Service
This tutorial walks you through the basic steps of integrating your fintech product with the Upward Credit Builder as a Service (CBaaS) product.
Authentication
Tip
Your API Key and Secret will be shared with you by your Upward client team.
The first step in integrating your product is to configure authentication. All Upward components and APIs require Oauth tokens for access.
For a deeper dive into authentication, you can read these further details.
Consumer Onboarding
Once you are able to successfully request and receive authentication tokens, you can start onboarding your end users. Our onboarding process has three main steps:
- End User KYC
- View the Offer/Terms
- Accept the Credit Terms Agreement
These steps are all managed automatically using our onboarding UI component, and you can view a detailed overview of the onboarding process here.
Purchase Flow
The User Purchase Flow is a three stage process:
Recording transactions with Upward is a three stage process:
Requesting a Hold
The transaction starts by requesting a hold. If there are sufficient funds in the end user’s account, then a new transaction will be created and the funds will be held until the transaction is completed, or for 1 calendar day. If there are insufficient funds in the account, a 4XX
error will be returned with an error description in the body.
Clearing the Transaction
Once a hold is created, you can convert that hold into a transaction by calling the clear endpoint. This will disburse the funds from the end user’s line of credit and create the liability. This step should happen at the time of purchase in your system.
Close the Transaction
In this final step, the transaction is closed and recorded a complete. Successful closes will extinguish the liability that was created in the Clearing step and make those funds available, again, to the end user.
You can view further details about the Purchase Flow, and a detailed overview of the purchase cycle here.
APIs
All of our UI components use the same APIs that we make available to our consumers. You can view our full API documentation here.
Detailed UI Onboarding Walkthrough:
The following steps outline the steps encountered when onboarding a new consumer via our UI Components.
[Consumer] loads the onboarding embedded component in your app.
When you load the onboarding embedded component passing in the pcid property (your unique ID) as a query parameter. Once the consumer clicks “Get Started”, the UI component creates their consumer record using the Consumer API endpoint. The user’s pcid
will be set to the value you provide us, and we will generate a unique id on our side to identify this record internally and within our APIs.
[Upward] sends out a consumer.created webhook message to your server.
The Upward Severs will send a webhook message to you with the following general schema, indicating that the consumer record was created on our side.
[Consumer] Links the Upward ID to their Local Object
Upon receiving the webhook messge, you will parse it for the eventName property and determine that this message means that a new consumer was created. You can then call the url in the resources property to get information about that consumer.
Note
at the time of creation, the user has not completed KYC, so their personal data has not been captured and will be null
in the response body_
[Consumer] Completes the KYC step(s)
Once the user has successfully completed KYC, then we will send a further webhook with an event_name
of consumer.updated
When you retrieve the updated consumer record related to this webhook, you will see that the kyc_status
value has changed to complete
indicating that this consumer has successfully passed our KYC checks.
Tip
In the event that you do not receive the webhook or there are data processing/sync issues on your end, you can always call the get consumer by Partner Consumer ID endpoint: GET https://sandbox-api.upwardli.com/v2/consumer/pcid/{pcid}/
where the {pcid}
property is the internal ID you provided as a query parameter to the onboarding component.
Edge Cases / Unhappy path:
- If a user does not complete KYC, then you will only receive the first consumer.created message.
- If a user fails KYC, then we will send a consumer.updated webhook, with a kyc_status value of Failed. We will not open a credit line for any users who do not pass KYC.
The CBaaS Transaction Flow
Recording transactions with Upward is a three stage process:
- Request a Hold
- Clear the Transaction
- Close the Transaction
Requesting a Hold
The transaction starts by requesting a hold. If there are sufficient funds in the end user’s account, then a new transaction will be created and the funds will be held until the transaction is completed, or for 1 calendar day. If there are insufficient funds in the account, a 4XX
error will be returned with an error description in the body.
The system will then send a webhook with an eventName
of creditline.transaction.created
immediately.
Clearing the Transaction
Once a hold is created, you can convert that hold into a transaction by calling the clear endpoint. This will disburse the funds from the end user’s line of credit and create the liability. This step should happen at the time of purchase in your system.
The system will then send a webhook with an eventName
of creditline.transaction.cleared
when the funds have successfully been transfered to the user’s account.
note: This could be delayed for up to a couple minutes from the time that the clear api was called to allow funds to settle.
Close the Transaction
In this final step, The transaction is closed and recorded a complete. Successful closes will extinguish the liability that was created in the Clearing step and make those funds available, again, to the end user.
The system will then send a webhook with an eventName
of creditline.transaction.closed
when the funds have successfully been transfered to the user’s account.
note: This could be delayed for up to a couple minutes from the time that the clear api was called to allow funds to settle.
You can read more about the Credit Line API in our API Documentation.
Successful Transaction Flow
The Transaction flow is broken down into the individual system actions at each step of the purchase flow. You must complete each step as defined in the flow below before moving on to the next step.
The Hold Stage
- Consumer creates a transaction hold by calling
/v2/credit-line/{credit_line_id}/hold/
- The Upward API will immediately return a response containing the new transaction id. This transaction ID is immediately ready to use.
- Asychronously, the Upward platform will send you a webhook message corresponding to this hold action with an
eventName
ofcreditline.transaction.created
- The transaction status will be set to
Hold
The Clear Stage
- Consumer clears the hold and initiates a purchase agains the consumer credit line by calling
/v2/credit-line/{credit_line_id}/transactions/{transaction_id}/clear/
- The Upward API will immediately return a response indicating that the clear request was successful, or an error if the request was unable to be processed.
- The Upward Platform will begin the funds transfer from the consumer’s line of credit to their account.
- The transaction status will be set to
InProgress
- When the funds transfer is complete, the transaction status will be set to
Received
- Asychronously, the Upward platform will send you a webhook message corresponding to this hold action with an
eventName
ofcreditline.transaction.cleared
The Close Stage
Once the transaction is in Received
state, then it is ready to be closed.
- Consumer requests to record the closing of the transaction by calling
/v2/credit-line/{credit_line_id}/transactions/{transaction_id}/close/
- The Upward API will immediately return a response indicating that the close request was successful, or an error if the request was unable to be processed.
- The Upward Platform will begin to pay off the transaction balance from the consumer’s account.
- When the funds transfer is complete, the transaction status will be set to
Completed
- Asychronously, the Upward platform will send you a webhook message corresponding to this hold action with an
eventName
ofcreditline.transaction.closed
You can read more about transaction statuses here.