Setting up split payments in 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

Setting Up Payment Splitting (Split Payments) on 1C-Bitrix

A split payment is the automatic distribution of a payment amount among multiple recipients at the moment of the transaction. This is relevant for marketplaces: the buyer pays one total amount, and the platform automatically transfers shares to sellers while retaining a commission. In 1C-Bitrix, this is non-standard functionality — it is implemented through a payment aggregator that supports splits.

When Split Payments Are Needed

  • Marketplace — an order contains goods from multiple sellers, each of whom must receive their share
  • Partner model — a percentage of the payment goes to a referrer or agent
  • Holding structure — multiple legal entities, one website

Without split payments, the alternative is manual transfers at the end of a period (weekly/monthly). This does not scale well and creates cash flow gaps.

YooKassa: Split via Marketplace API

YooKassa supports split payments via the transfers parameter when creating a payment:

$payment = $yookassaClient->createPayment([
    'amount'      => ['value' => '10000.00', 'currency' => 'RUB'],
    'capture'     => true,
    'description' => 'Order with multiple sellers',
    'transfers'   => [
        [
            // Transfer to seller 1 (7,000 RUB)
            'account_id'  => 'seller_yookassa_account_id_1',
            'amount'      => ['value' => '7000.00', 'currency' => 'RUB'],
            'platform_fee_amount' => ['value' => '700.00', 'currency' => 'RUB'], // platform commission
            'description' => 'Order ' . $orderId . ': seller 1 goods',
            'metadata'    => ['seller_id' => $sellerId1],
        ],
        [
            // Transfer to seller 2 (2,000 RUB; remaining 1,000 RUB is the platform commission)
            'account_id'  => 'seller_yookassa_account_id_2',
            'amount'      => ['value' => '2000.00', 'currency' => 'RUB'],
            'platform_fee_amount' => ['value' => '200.00', 'currency' => 'RUB'],
            'description' => 'Order ' . $orderId . ': seller 2 goods',
            'metadata'    => ['seller_id' => $sellerId2],
        ],
    ],
    'metadata'    => ['order_id' => $orderId],
], uniqid('', true));

The sum of all transfers.amount values must not exceed the total payment amount. The difference remains in the platform account.

Share Calculation in 1C-Bitrix

class SplitPaymentCalculator
{
    public function calculate(\Bitrix\Sale\Order $order): array
    {
        $transfers = [];
        $platformFeeRate = 0.10; // 10% platform commission

        foreach ($order->getBasket()->getOrderableItems() as $item) {
            $sellerId = $item->getField('SELLER_ID');
            $itemTotal = $item->getFinalPrice();
            $sellerAmount = $itemTotal * (1 - $platformFeeRate);
            $platformFee  = $itemTotal * $platformFeeRate;

            $transfers[$sellerId]['amount'] = ($transfers[$sellerId]['amount'] ?? 0) + $sellerAmount;
            $transfers[$sellerId]['fee']    = ($transfers[$sellerId]['fee'] ?? 0) + $platformFee;
        }

        // Convert to YooKassa format
        $result = [];
        foreach ($transfers as $sellerId => $data) {
            $seller = SellerTable::getById($sellerId)->fetch();
            $result[] = [
                'account_id'          => $seller['YOOKASSA_ACCOUNT_ID'],
                'amount'              => ['value' => number_format($data['amount'], 2, '.', ''), 'currency' => 'RUB'],
                'platform_fee_amount' => ['value' => number_format($data['fee'], 2, '.', ''), 'currency' => 'RUB'],
            ];
        }

        return $result;
    }
}

Refund with Split Payment

Refunding a split payment requires specifying from which account the refund is made:

$refund = $yookassaClient->createRefund([
    'payment_id' => $paymentId,
    'amount'     => ['value' => $refundAmount, 'currency' => 'RUB'],
    'sources'    => [
        [
            'account_id' => $sellerAccountId,
            'amount'     => ['value' => $refundAmount, 'currency' => 'RUB'],
            'platform_fee_amount' => ['value' => $platformFeeToRefund, 'currency' => 'RUB'],
        ],
    ],
], uniqid('', true));

Timeline

Task Duration
Share calculation + YooKassa transfers integration 2–3 days
Seller account table + linking 1 day
Refund logic for split payments 1 day