/v0 endpoints.
Before you start
- Get sandbox credentials and make one successful call. See Set up sandbox.
- Have your program’s
product_config_id. A program is one product or set of products you run with Lead. Your Technical Account Manager gives you the ID. There is no endpoint to look it up. - Ask your Technical Account Manager which account number Lead has enabled to receive fundings, and have its ID.
What you’ll do
- Get a token with the scopes this flow needs.
- Create the borrower as an entity.
- Report the underwriting decision as an application.
- Open the user account.
- Define the loan as a user credit balance.
- Draw the principal with a funding.
- Post the funding in sandbox.
- Confirm the money moved.
Steps
Step 1: Get a token
One token covers the whole flow if you request every scope up front.Sample request
- Replace
CLIENT_IDandCLIENT_SECRETwith your sandbox credentials. - Store
access_tokenfrom the response asACCESS_TOKENand send it on every call in this flow.
Sample response
200. The token is valid for expires_in seconds, which is 24 hours by default.
Step 2: Create the borrower as an entity
The borrower is an individual who will hold the loan, so sendintended_eligibility: ["account_holder"]. Lead then checks that the entity has everything an account holder needs. If it doesn’t, the request fails now, not at account opening.
Sample request
- Replace
TAX_IDwith the borrower’s SSN, nine digits. For an ITIN, settax_identification.typetoitin. - Set
kycandofacto the result and time of your own screening. - Set
risk_scorefrom your own risk rating. - Generate a new
Idempotency-Keyfor this request. A UUID works. EveryPOSTfrom here on needs its own key. Reuse a key only to retry the same request.
Sample response (trimmed)
200. eligibility.account_holder.status is eligible. Store id as ENTITY_ID.
Step 3: Report the underwriting decision as an application
You underwrite in your own system and report the result. An application is reported in a terminal status, hereapproved. Amounts are in minor units, so a $5,000 limit is 500000.
Sample request
- Replace
PRODUCT_CONFIG_IDwith the value from your Technical Account Manager, andENTITY_IDwith the ID from Step 2. - Set
underwriting.grade,limit, andmax_limitfrom your decision, anddecision.detailsto the reason for it. - Send
documentsas[]. The full guide covers uploading loan documents. - Generate a new
Idempotency-Key.
Sample response (trimmed)
200. account_holder_type is consumer because the only account holder is an individual. Store id as APPLICATION_ID.
Step 4: Open the user account
The user account is the borrower’s credit relationship with Lead. Two fields decide what it is:requested_features says it’s underwritten credit, and balance_sheet_model says Lead holds the loan.
Sample request
- Replace
APPLICATION_IDwith the ID from Step 3, andENTITY_IDandPRODUCT_CONFIG_IDas before. - Send all seven fields in
underwriting. - Generate a new
Idempotency-Key.
Sample response (trimmed)
200. status is active and features is what Lead granted. Store id as USER_ACCOUNT_ID.
Step 5: Define the loan as a user credit balance
The user credit balance holds the loan’s terms, and later its running position. Anon_revolving loan needs all its terms up front: maturity date, maximum funding amount, duration, finance charge, and repayment schedule. This example is $5,000 over 12 months at 9.99%. That's 12 monthly payments of $439.56, and $274.72 in total interest.
Rates are decimal fractions, so 9.99% is 0.0999. The three rate fields mean different things:
effective_apr matches interest_rate here because this loan has no fees.
Sample request
- Replace
USER_ACCOUNT_IDwith the ID from Step 4. - Set
termsfrom your own loan. Every field is on The user credit balance object. - Generate a new
Idempotency-Key.
Sample response (trimmed)
200. The user credit balance is active with every amount at zero. Store id as USER_CREDIT_BALANCE_ID.
Step 6: Draw the principal with a funding
A funding moves the principal from Lead’s general ledger to an account number your program controls.amount is the whole principal. On a non_revolving balance, this funding plus any earlier ones can’t add up to more than max_funding_amount.
Sample request
- Replace
USER_CREDIT_BALANCE_IDwith the ID from Step 5. - Replace
ACCOUNT_NUMBER_IDwith the account number Lead enabled for fundings, from Before you start. - Store the funding ID when it comes back. There is no list endpoint for fundings.
- Generate a new
Idempotency-Key.
Sample response
200. status is processing. In production, Lead posts it. In sandbox, it waits for you. Store id as FUNDING_ID.
Step 7: Post the funding in sandbox
Nothing in sandbox moves on its own, so move the funding toposted yourself with the advance call. It’s the one call on this page that exists only in sandbox.
Sample request
- Replace
FUNDING_IDwith the ID from Step 6. - Keep this call out of your production code. In production it returns
404. - Generate a new
Idempotency-Key.
Sample response
200 with an empty object. The funding is now posted. Lead sends funding.posted when funding events are enabled for your program. Your Technical Account Manager can tell you whether they are.
Step 8: Confirm the money moved
Read the funding back. Don’t wait for a webhook: retrieving the object is the reliable check, in sandbox and in production. Then check that Lead recorded the draw on the user credit balance.Sample request
- Replace
FUNDING_IDwith the ID from Step 6. - Confirm the funding is
postedbefore you send money on to the borrower. The200from Step 6 doesn’t mean the money moved. - Do not post a user credit transaction for the draw yourself. Lead posts a
fundinguser credit transaction for you. It can arrive a few seconds afterfunding.posted.
Sample response (trimmed)
200 with status posted. A funding posted in sandbox has no core_transaction_id. In production it names the core transaction that moved the money. To see the draw, call GET /v2/user_credit_balances/USER_CREDIT_BALANCE_ID. amount_breakdown.principal is 500000. If it’s still 0, wait a few seconds and call again.
What happens next
In production, Step 7 doesn’t exist. Lead moves the funding toposted when the money reaches your account number, and sets core_transaction_id. If funding events are enabled for your program (your Technical Account Manager can tell you), Lead also sends funding.posted. The funding is the only object on this page with an event, so retrieve the entity, application, user account, and user credit balance when you need their current state. See Funding statuses.
Common errors
Errors you can hit in this flow:
Every call after Step 1 uses the v2 error body. See Errors. The token call in Step 1 uses Lead’s older error format.
Test in sandbox
Every step on this page runs in sandbox. For the full set of funding tests before you go live, see Test and go live with fundings.Next step
Build the full flow, with loan documents, the disbursement to the borrower, and repayment reporting.Related
- Originate and service an on-sheet loan: the full lending flow this page is the short version of
- Test and go live with fundings: moving a funding to
postedin sandbox, and a full test run - Move objects and trigger events in sandbox: the two sandbox-only calls, their rules, and their errors
- Entity eligibility: what an account holder needs and the checks Lead runs
- Idempotency: how the
Idempotency-Keyheader works on v2 requests

