Advance Line
The Advance Line is a revolving facility. A supplier draws against a credit limit and repays automatically out of marketplace receipts.
State
Two slices, both registered by AdvanceLineFeatureModule.
|
Summary — the current facility. Actions |
|
Draw offers and their terms. Actions |
The authoritative product state also lives on the user object as
status.advanceLine (AdvanceLineStatusDto):
| Field | Meaning |
|---|---|
|
Credit currently available to draw. |
|
Amount drawn and not yet repaid. |
|
When the facility lapses. |
|
|
|
|
|
|
Legacy versus modern
|
|
Permissions
| Permission (dotted name) | Condition |
|---|---|
|
Active, or pending-and-expedited, or expired |
|
Expired and not active and not rejected |
|
|
|
Supplier pending and |
|
|
|
|
Expiry is evaluated client-side: new Date() > new Date(advanceLine.expirationDate).
|
|
Withdrawal
AdvanceLineWithdrawFlow (core/pyb/flows/advance-line/advance-line-withdraw.flow.ts)
composes the journey with the tasks engine.
taskFlow
.setContextData('data', this.prepareFlowContextData())
.addTask(this.openAdvanceLineInputModalTask, this.defaultHandler)
.addTask(this.openAdvanceLineConfirmationModalTask, this.defaultHandler);
if (!status.instantAdvanceSigned || this.userService.isAprUserContract()) {
taskFlow.addTask(this.docusignAdvanceLineTask); (1)
} else {
taskFlow
.addTask(this.withdrawAdvanceLineTask, this.defaultHandler) (2)
.addTask(this.updateUserStatusTask, this.defaultHandler)
.addTask(this.openAdvanceLineSuccessModalTask);
}
| 1 | Not yet signed, or on an APR contract → the supplier must sign. The flow ends here because the browser leaves for DocuSign; it resumes on return. |
| 2 | Already signed and not APR → withdraw inline, refresh status, show the success modal without leaving the app. |
Flow context is seeded with:
{
advanceLine, // the facility
id, // supplier key
autodebitPmtCfg, // repayment configuration
docuSignNoteVisible: !instantAdvanceSigned, // show the "you'll be asked to sign" note
}
The DocuSign branch
DocusignFlowEnum.AdvanceLineActive, handled on return by
DocusignVerificationService.handleAdvanceLineFlow():
clearDashboardNotifications()
confirmAdvanceLineDocuSignRequest(supplierKey, { event }, isAprUserContract())
track(AdvanceLineEventTypes.DOCUSIGN_VERIFIED)
advanceLineService.withdraw(supplierKey, advanceLineKey, amount, offerType)
→ fetchSupplierMarketplaces()
→ loadBalance()
→ loadSummary()
→ advanceLineWithdrawSuccess()
→ userStatusUpdateRequested()
→ track(AdvanceLineEventTypes.FUNDS_WITHDRAWN, { offerType, amount })
→ success modal: FEATURES.ADVANCE_LINE.MODALS.SUCCESS.HEADER / .BODY
Offer acceptance
AdvanceLineAcceptOfferFlow handles a supplier accepting a new offer, using:
|
Entry point. |
|
Present the terms. |
|
Accept via the API. |
|
Accept without the intermediate confirmation. |
Tracked with:
|
|
|
|
|
|
If a Long Term Contract offer is available at acceptance time, the LTC options modal is inserted into the journey — see Long Term Contract.
Pending activation (expedited)
AdvanceLinePendingActivationFlow covers an expedited supplier’s first
interaction. The DocuSign flow is DocusignFlowEnum.AdvanceLinePending, which
confirms the ACH agreement rather than the advance contract, and the handler
branches on whether an amount was supplied:
Amount present |
Confirm ACH, revoke |
Amount absent |
Confirm ACH, revoke the permission, dispatch |
The permission is revoked client-side immediately so the widget leaves its "pending activation" state before the status round-trip completes.
Legacy activation
AdvanceLineLegacyActivationFlow handles activation for suppliers still on the
legacy advance product.
UI surface
| Component | Role |
|---|---|
|
Dashboard card — available credit, outstanding balance, draw CTA. |
|
Open drawdowns. |
|
Historical drawdowns. |
|
The supplier’s advance rate. |
|
Formatted terms block. |
|
Input, confirmation and success dialogs. |
|
Builds the contextual tooltip copy shown on the widget. |
Reporting lives at /reports/instant-advance-report and
/reports/outstanding-balance; see Reports.
Analytics
| Constant | Segment event | Properties |
|---|---|---|
|
|
— |
|
|
— |
|
|
— |
|
|
— |
|
|
|
|
|
— |