Add an existing loan
Create a loan token for a loan a lender already issued, so Preczn tracks the loan and you can request drawdowns against it.
Add an existing loan when a lender has already issued a loan and Preczn doesn't have a record of it yet. You create a loan token for the loan. Preczn looks up the loan at the lender, keeps a loan record, and returns a token that represents the loan as a payment method, the way a card token represents a card.
Some lenders send Preczn their loans automatically, so you don't need to add those. See the Lending Overview.
You add a loan through the API only.
The following diagram shows who sends what when you add a loan:
sequenceDiagram
participant P as Your platform
participant Z as Preczn
participant L as Lender
P->>Z: POST /v1/tokens (type: loan)
Z->>L: Look up the loan by externalLoanId
L-->>Z: Loan details
Z->>P: Token with the loan record
Z--)P: loan.created webhook
If Preczn already has a token for the loan, the request returns that token and sends loan.updated instead of loan.created.
Prerequisites
- A connection to the loan's lender on your platform, and a merchant connection to that lender with the merchant's credentials. See Supported connections.
- The lender's ID for the loan,
externalLoanId.
Add the loan
-
Send a Create Token request,
POST /v1/tokens, withtypeset toloan.- In
loan, setbrandto the lender,typeto the loan type (B2B2CorB2B), andexternalLoanIdto the lender's ID for the loan. The request takesbrandin lowercase. The response returns the lender's name with a capital first letter. - Set
merchantIdto the merchant the loan belongs to.
{ "type": "loan", "loan": { "brand": "{lender}", "type": "B2B2C", "externalLoanId": "{externalLoanId}" }, "merchantId": "mid_test_{merchantId}" }{ "createdOn": "{createdOn}", "modifiedOn": "{modifiedOn}", "id": "tkn_test_{tokenId}", "merchantId": "mid_test_{merchantId}", "type": "loan", "loan": { "tokenId": "tkn_test_{tokenId}", "externalLoanId": "{externalLoanId}", "brand": "{Lender}", "type": "B2B2C", "status": "Application Offers Presented", "merchantName": "{merchantName}", "customerFirst": "{customerFirst}", "customerLast": "{customerLast}", "applicationDate": "{applicationDate}", "creditLimit": 0, "availableCredit": 0, "currentBalance": 0 } }The response is abbreviated.
- In
-
Save the token
idfrom the response. You send it as the payment token when you request a drawdown.
For what each status value means, see Loan statuses.
Get the loan's latest data
The lender is the authoritative source for a loan. To get its latest data, send a Get Token request, GET /v1/tokens/{tokenId}, with the loan token's ID. The request has no body. Preczn asks the lender for the loan's current details, updates its loan record, and returns them.
{
"createdOn": "{createdOn}",
"modifiedOn": "{modifiedOn}",
"id": "tkn_test_{tokenId}",
"merchantId": "mid_test_{merchantId}",
"type": "loan",
"loan": {
"tokenId": "tkn_test_{tokenId}",
"externalLoanId": "{externalLoanId}",
"brand": "{Lender}",
"type": "B2B2C",
"status": "Active",
"merchantName": "{merchantName}",
"customerFirst": "{customerFirst}",
"customerLast": "{customerLast}",
"applicationDate": "{applicationDate}",
"creditLimit": 1500000,
"availableCredit": 1500000,
"currentBalance": 0,
"merchantDrawdownPercentageFee": 8.5
}
}The response is abbreviated. merchantDrawdownPercentageFee is the percentage fee the merchant pays on each drawdown: 8.5 means 8.5%. It appears when the lender reports a fee.
A Get Token request for a loan token can also send you a loan.updated webhook, because it updates the loan record. See Loan webhook payloads.
Next
When the loan is Active, request a drawdown against it.
Updated 6 days ago
