Configuring Payment Deferral for B2B in 1C-Bitrix
Payment deferral is a contract condition: the client receives goods but pays after 14, 30, or 45 days. On the website, this means the "Pay" button should not be available immediately — or completely absent for clients with deferral. Instead — an invoice with a payment due date.
How to Store Deferral Terms
Deferral terms are stored in 1C in the context of contracts with counterparties. In Bitrix, we duplicate them in Highload block b2b_payment_terms:
-
UF_COMPANY_ID— company ID -
UF_PAYMENT_DELAY_DAYS— number of deferral days (0 = no deferral) -
UF_PAYMENT_TYPE— type:prepay(prepayment),deferred(deferral),mixed(partial prepayment) -
UF_PREPAY_PERCENT— prepayment percentage formixed -
UF_ACTIVE_FROM,UF_ACTIVE_TO— period of validity
Synchronization from 1C when contract terms change — via agent or webhook.
Order Checkout Logic
When an order is created, the OnSaleOrderSaved handler reads the company's payment terms:
-
prepay— standard logic, payment via card or invoice available -
deferred— invoice is automatically created with payment date = order date +UF_PAYMENT_DELAY_DAYS, online payment button hidden -
mixed— invoice is issued for prepayment (X% of amount), remainder — on date with deferral
Payment date is recorded in the order's custom field UF_PAYMENT_DUE_DATE. In the client's cabinet in the orders section, this date is displayed explicitly.
Payment Deadline Notifications
An agent running daily checks orders with "Awaiting Payment" status, where UF_PAYMENT_DUE_DATE is approaching:
- 3 days before — email reminder to client via
CEvent::Send()with templateB2B_PAYMENT_REMINDER - On payment day — repeat email + manager task in Bitrix24 (if integration is set up)
- Next day after deadline — logging to overdue record, flag in
b2b_credit_status
Integration with Delivery and Payment Methods
For clients with deferral, when placing an order in the list of payment methods (b_sale_pay_system), we filter via OnSalePaySystemHandlerList handler — remove "Card Payment" and "Yandex.Kassa," keep only "Issue Invoice."
Timelines
Basic deferral setup for client group: 3-5 days. Full implementation with notifications, 1C synchronization, and mixed payment logic: 1-2 weeks.







