Setting up payment status exchange between 1C and 1C-Bitrix

Our company is engaged in the development, support and maintenance of Bitrix and Bitrix24 solutions of any complexity. From simple one-page sites to complex online stores, CRM systems with 1C and telephony integration. The experience of developers is confirmed by certificates from the vendor.
Our competencies:
Development stages
Latest works
  • image_website-b2b-advance_0.png
    B2B ADVANCE company website development
    1175
  • image_bitrix-bitrix-24-1c_fixper_448_0.png
    Website development for FIXPER company
    811
  • image_bitrix-bitrix-24-1c_development_of_an_online_appointment_booking_widget_for_a_medical_center_594_0.webp
    Development based on Bitrix, Bitrix24, 1C for the company Development of an Online Appointment Booking Widget for a Medical Center
    564
  • image_bitrix-bitrix-24-1c_mirsanbel_458_0.webp
    Development based on 1C Enterprise for MIRSANBEL
    747
  • image_crm_dolbimby_434_0.webp
    Website development on CRM Bitrix24 for DOLBIMBY
    655
  • image_crm_technotorgcomplex_453_0.webp
    Development based on Bitrix24 for the company TECHNOTORGKOMPLEKS
    976

Configuring Payment Status Exchange Between 1C and 1C-Bitrix

Order payment status is one of the main sources of conflicts during 1C and Bitrix integration. A payment may arrive in 1C via a bank statement while Bitrix is unaware of it. Or the reverse: a payment went through online acquiring on the site and was recorded in Bitrix, but no document was created in 1C. Synchronizing payment statuses eliminates these discrepancies.

Where Payment Information Comes From

Understanding the synchronization architecture is impossible without understanding where payment is actually recorded:

Scenario 1: Online payment on the site. The buyer pays by card via acquiring (Sberbank, Tinkoff, YuKassa). The payment is recorded in Bitrix via the payment system callback. The fact of payment needs to be transferred to 1C — so the accountant does not need to manually reconcile bank statements.

Scenario 2: Payment by invoice (B2B). The buyer receives an invoice (from 1C or from the site) and pays via bank transfer. The payment arrives in 1C via the bank statement (CashReceipt). The fact of payment needs to be transferred from 1C to Bitrix — so the order changes status and the buyer receives a notification.

Scenario 3: Cash on delivery. The courier or pickup point records the payment. Depends on the system: either via Bitrix (courier application) or via 1C (cash register document).

Each scenario has its own synchronization logic.

Transferring Online Payments from Bitrix to 1C

When a payment is successfully made in Bitrix, a payment object (Bitrix\Sale\Payment) is created with PAID = Y. At the next order exchange, this status is transferred in the XML:

<Document>
  <Id>order-guid</Id>
  <Paid>true</Paid>
  <PaymentAmount>4500.00</PaymentAmount>
  <PaymentDate>2024-03-15T14:30:00</PaymentDate>
</Document>

In 1C, when importing an order with <Paid>true</Paid>, automatic creation of a "Cash Receipt" document (for 1C:Accounting) or an operation in the mutual settlements register (for 1C:UT) can be configured.

This automates the reconciliation of online payments and removes routine work from the accountant.

Transferring Payment Status from 1C to Bitrix

When the bank statement is reconciled in 1C and the "Receipt" document is posted — the order in Bitrix needs to be updated.

Mechanism: when the order document status changes in 1C (or when a cash receipt is posted) — mark the order as "Paid." At the next order exchange, 1C sends the updated status to Bitrix.

On the Bitrix side, the order update handler from 1C:

// When receiving an order update from 1C
if ($arOrder['PAID'] === 'Y') {
    $payment = $order->getPaymentCollection()->getItemByIndex(0);
    if ($payment && $payment->isPaid() === false) {
        $payment->setPaid('Y');
        $order->save();
        // Trigger automatic events: email to buyer, notification to manager
    }
}

Partial Payment

In B2B scenarios, partial payment is common: 30% advance → 70% balance. In 1C this is two receipt documents. In Bitrix — one order with multiple payments.

When transferring partial payment from 1C to Bitrix: separate payments can be created for each receipt, or the single payment can be updated with a running total. The second option is simpler to implement.

Indication for the buyer: "Paid: 1,500 of 5,000 (30%)" — via a custom order property PAID_AMOUNT, updated on every exchange.

Refunds: Bidirectional Synchronization

A refund to the buyer is another critical case. If a refund is initiated in 1C (a manager issues a return) — Bitrix needs to be informed so that:

  • The order status is updated
  • The refund process through acquiring is initiated (if payment was made online)
  • The buyer receives a notification

If a refund is initiated via acquiring (the buyer made a chargeback) — Bitrix receives a notification from the payment system, the payment status changes to "Refunded," this needs to be transferred to 1C for creating a return document.

Case Study: Real-Time Payment Synchronization

An online store with a high share of B2B: 60% of orders are paid by invoice via bank transfer. Problem: an order in 1C transitioned to "Paid" status only after manual statement reconciliation (1–2 days). The buyer saw an outdated status.

Solution: configured automatic bank statement loading into 1C (via the "1C-DirectBank" service). The statement is loaded and automatically reconciled every 30 minutes. After reconciliation — a scheduled task triggers an exchange with Bitrix, updating the order status.

Delay from payment receipt to status update on the site: 30–60 minutes. The buyer receives an email confirming payment without manager involvement.

Additionally: when payment is received in Bitrix — stock reservation in 1C is automatically triggered (via the order status change event, which calls the 1C API).