Automated Returns Management on 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.
Showing 1 of 1All 1626 services
Automated Returns Management on 1C-Bitrix
Simple
~1 day
Frequently Asked Questions

Our competencies:

Development stages

Latest works

  • image_website-b2b-advance_0.webp
    B2B ADVANCE company website development
    1356
  • image_bitrix-bitrix-24-1c_fixper_448_0.webp
    Website development for FIXPER company
    943
  • 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
    693
  • image_bitrix-bitrix-24-1c_mirsanbel_458_0.webp
    Development based on 1C Enterprise for MIRSANBEL
    828
  • image_crm_dolbimby_434_0.webp
    Website development on CRM Bitrix24 for DOLBIMBY
    731
  • image_crm_technotorgcomplex_453_0.webp
    Development based on Bitrix24 for the company TECHNOTORGKOMPLEKS
    1073

Manual return processing is a bottleneck for an e-commerce store on 1C-Bitrix with 100+ orders per day. Managers confuse statuses, make errors in amounts, and applications get lost. From our practice: one client with 500 orders per day spent up to 10 days on returns, with an error rate of 30%. After implementing our system, processing time dropped to 1 day and operating expenses decreased by 1.5 million rubles per year. Turnkey automation solves these problems: the customer gets money back in 1-2 days, managers spend no more than 5 minutes per return. The system processes returns 10 times faster than manual handling. To get an exact plan for your store, request a consultation.

Problems we solve

Status chaos is the main pain point. Standard sales statuses don't suit returns; a separate chain with clear stages is needed. Manual refunds via the payment gateway's personal account lead to amount errors and delays. Lack of warehouse integration after return: stock is not updated, or data is duplicated during exchange with 1C. Each of these problems individually reduces customer loyalty and burdens managers with routine. In our practice, debugging a single return used to take several hours until we automated the entire cycle.

How we do it: tech stack and real case

We use the standard sale module and infoblocks v2.0. The main entity is \Bitrix\Sale\OrderReturn. It links the return to the order, stores the type (money/exchange/credit) and item list. We build the process around it. Below is an example of creating a return via API.

namespace Local\Returns;

use Bitrix\Sale;

class ReturnManager
{
    /**
     * Create a return for an order
     *
     * @param int   $orderId    Order ID
     * @param array $items      [['basket_id' => int, 'quantity' => float, 'reason' => string], ...]
     * @param string $returnType 'MONEY' | 'EXCHANGE' | 'CREDIT'
     */
    public function createReturn(int $orderId, array $items, string $returnType = 'MONEY'): int
    {
        \Bitrix\Main\Loader::includeModule('sale');

        $order = Sale\Order::load($orderId);
        if (!$order) {
            throw new \RuntimeException("Order #{$orderId} not found");
        }

        // Check that the order is paid
        if (!$order->isPaid()) {
            throw new \RuntimeException("Order #{$orderId} is not paid");
        }

        $returnCollection = $order->getPaymentCollection();

        // Create a return object
        $orderReturn = Sale\OrderReturn::create($order);
        $orderReturn->setField('TYPE', $returnType);
        $orderReturn->setField('REASON', 'Customer request');

        // Add return items
        $basketCollection = $order->getBasket();

        foreach ($items as $item) {
            $basketItem = $basketCollection->getItemById($item['basket_id']);
            if (!$basketItem) continue;

            $maxQty = $basketItem->getQuantity();
            $qty    = min((float)$item['quantity'], $maxQty);

            $returnItem = $orderReturn->getReturn()->createItem($basketItem);
            $returnItem->setField('QUANTITY', $qty);
            $returnItem->setField('REASON',   $item['reason'] ?? '');
        }

        $result = $orderReturn->save();

        if (!$result->isSuccess()) {
            throw new \RuntimeException('Return creation failed: ' . implode('; ', $result->getErrorMessages()));
        }

        return $orderReturn->getId();
    }
}

Developing a custom personal account component takes 2-3 times less time than writing from scratch, thanks to using the standard component bitrix:sale.order.return.edit. From our practice: implementing a return system for a large marketplace reduced the full cycle time from 14 to 2 days.

Setting up the return lifecycle

Return statuses: standard set

In the admin panel, we create statuses covering each step of the business process. A minimal set: WAIT, REVIEW, APPROVED, RECEIVED, REFUND, REJECTED, EXCHANGE. Each status logically covers a stage.

Code Name Description
WAIT Awaiting review New request, not processed
REVIEW Under review Manager reviews the request
APPROVED Approved Return approved, awaiting goods
RECEIVED Goods received Warehouse accepted the returned goods
REFUND Money refunded Payment completed
REJECTED Rejected Return rejected with reason
EXCHANGE Exchange Replacement with another product

The event OnSaleOrderReturnStatusChange is the standard mechanism for syncing return statuses with external systems, as described in the 1C-Bitrix documentation.

Why correct status configuration matters?

Errors in statuses lead to desynchronization with 1C and incorrect stock calculation. For example, if the warehouse receives goods but the status does not change to RECEIVED, 1C won't release the reserve. The result is negative stock balances in 1C. We attach handlers to status changes to prevent such situations.

How to integrate returns with 1C?

When goods are returned to the warehouse, we need to update stock. If the warehouse is managed in 1C, we send a notification to 1C via a queue when the return status changes to 'Goods received'.

\Bitrix\Main\EventManager::getInstance()->addEventHandler(
    'sale',
    'OnSaleOrderReturnStatusChange',
    function (\Bitrix\Main\Event $event) {
        $returnId  = $event->getParameter('RETURN_ID');
        $newStatus = $event->getParameter('NEW_STATUS_ID');

        if ($newStatus === 'RECEIVED') {
            \Local\OneC\StockSync::scheduleReturnSync($returnId);
        }

        if ($newStatus === 'REFUND') {
            \Local\Returns\RefundProcessor::processPaymentReturn($returnId);
        }
    }
);

How does automatic refund work?

Most Bitrix payment systems (YooKassa, Tinkoff, Sber) support API refunds. In Bitrix, this is implemented via a payment system handler:

namespace Local\Returns;

class RefundProcessor
{
    public static function processPaymentReturn(int $returnId): bool
    {
        \Bitrix\Main\Loader::includeModule('sale');

        $return = \Bitrix\Sale\OrderReturn::loadById($returnId);
        if (!$return) return false;

        $order      = \Bitrix\Sale\Order::load($return->getField('ORDER_ID'));
        $payments   = $order->getPaymentCollection();
        $amount     = $return->getField('REFUND_AMOUNT'); // amount to refund

        foreach ($payments as $payment) {
            if (!$payment->isPaid()) continue;

            // Refund method depends on payment system
            $paySystem = $payment->getPaySystem();
            if (!$paySystem) continue;

            $result = $paySystem->refund($payment, $amount);

            if ($result->isSuccess()) {
                $return->setField('STATUS_ID', 'REFUND');
                $return->setField('REFUND_DATE', new \Bitrix\Main\Type\DateTime());
                $return->save();

                return true;
            }
        }

        return false;
    }
}

Automatic refund via API speeds up the process 5-10 times compared to manual — the customer receives money the same day.

Personal account and access rights

The standard component bitrix:sale.order.return.edit allows customers to create a return request from their order history. Connecting it in the personal account template:

$APPLICATION->IncludeComponent(
    'bitrix:sale.order.return.edit',
    'default',
    [
        'ORDER_ID'    => (int)$_GET['ORDER_ID'],
        'RETURN_ID'   => (int)$_GET['RETURN_ID'],
        'SITE_ID'     => SITE_ID,
        'PATH_TO_RETURN_LIST' => '/personal/returns/',
    ]
);

Access rights to returns are managed through roles in the sale module: return manager (view, change up to 'Approved'), senior manager (full rights), customer (create request). Setting up rights takes no more than an hour. For partial returns, we create a return with specific items in ReturnManager — the handler adjusts the refund amount proportionally.

What's included in returns management setup

  • Audit of current return processes and requirements gathering.
  • Development of technical specifications and status scheme.
  • Creation of a separate return status chain with necessary codes.
  • Setup of events and handlers for status changes.
  • Integration with 1C (stock and document sync).
  • Connection of automatic refund via payment gateway APIs.
  • Development or customization of the customer's personal account component.
  • Testing all scenarios (including partial return and refund).
  • Training managers on the system.
  • Provision of administration documentation.
  • Support for 6 months after deployment.

Work process and timelines

Stage What we do Result
Analytics Audit current return processes, gather requirements, describe business process Technical specifications
Design Develop status scheme, link with 1C, select payment systems Project documentation
Implementation Configure statuses, create personal account component, event handlers, integration with payments and 1C Working prototype on test environment
Testing Check all scenarios: create return, change statuses, refund, sync Test report
Deployment Deploy to production, train managers, hand over documentation Acceptance certificate

Basic setup with personal account and statuses — from 1 to 2 weeks. Full system with automatic refund and 1C integration — from 3 to 5 weeks. We'll assess your project after analyzing the technical specifications.

We guarantee 6 months of support after implementation. All solutions undergo code review and load testing.

Contact us for a free consultation — we'll tell you how much time and resources automation will save. Request an audit of your current return process to get an accurate work plan.

Typical scenario: manual returns take 25 minutes per request

A manager opens an order in /bitrix/admin/sale_order_view.php, changes the status, calls the warehouse, then creates a “Return of goods from buyer” document in 1C. One return consumes 20–30 minutes. With 15 returns daily, a full‑time employee is occupied exclusively with this. Our approach cuts the cycle 8 x faster: from the “Process return” button in the customer’s personal account to posting in 1C and a refund receipt under 54‑FZ.

Why the standard return process fails

Out of the box, 1C‑Bitrix lacks a separate “return” entity. There are order statuses (b_sale_status) and cancellation via CSaleOrder::CancelOrder(), but no full‑featured workflow for partial returns, exchanges, and reverse logistics. You have to build it.

  • Partial return – a customer wants to return 2 of 5 items. CancelOrder cancels the whole order. Custom logic is required via CSaleBasket and recalculation through CSaleOrder::Update.
  • Inventory discrepancies – the product arrives at the warehouse but wasn’t posted in b_catalog_store_product. The site shows “Out of stock” even though the box is on the shelf.
  • Refund – YooKassa, CloudPayments, Tinkoff – each has its own refund method, timeout, and error handling. Manual refund via the payment system’s personal account is tedious.
  • 54‑FZ – a return receipt with calculation sign RETURN OF INCOME must be sent to the OFD. Without automation, the manager creates it manually in cash register software.

What we build: from customer cabinet to 1C integration

Customer personal account – self‑service return

A custom section in /personal/returns/ integrated with sale.personal.order.list. The customer does everything:

  • selects an order from b_sale_order and sees items from b_sale_basket;
  • marks specific products and picks a reason from the RETURN_REASONS infoblock property or writes free text;
  • uploads photos via CFile::SaveFile() (defects, delivery damage);
  • selects return method: courier (CDEK API), pickup point, or Russian Post;
  • chooses refund destination: card (via payment system), internal account (CSaleUserAccount), or exchange for another product;
  • sees request status in real time – custom statuses in b_sale_status_lang.

Admin panel for manager – no extra clicks

A separate section built on \Bitrix\Main\Engine\Controller:

  • request queue with filters (status, amount, reason, date, manager). Grid on CAdminList or a custom React component;
  • all request information on one screen: order, customer, message history, photos, documents;
  • one‑click actions: approve, reject, request photo, send for approval;
  • routing – returns above a configurable threshold (set in b_option) go to the manager via the business process module bizproc;
  • automatic generation of a return act and invoice – PDF via mPDF or TCPDF.

Automation – minimum manual operations

  • Returns up to a configurable threshold (e.g., a set amount) – auto‑approval via OnSaleOrderSaved event handler.
  • 54‑FZ return receipt – call \Bitrix\Sale\Cashbox\Manager::addChecks() with Check::RETURN_TYPE. Sent to OFD automatically.
  • Notification chain: email via CEvent::Send(), SMS, push.
  • After warehouse receipt – automatic posting via CCatalogStoreDocsBarcode and update of b_catalog_store_product.
  • Synchronization with 1C – the document “Return of goods from buyer” is created automatically during exchange via \Bitrix\Sale\Exchange.
  • Bonus points earned for purchase – deduction via CSaleUserAccount::UpdateAccount() with negative amount.
  • Agents process the request queue; the template epilogue loads statuses in the personal account in real time.

Integration with payment systems – handling every error

Each payment gateway has its own refund API, time limits, and error codes. Our certified Bitrix developers cover all scenarios:

  • YooKassaPOST /v3/refunds, full and partial refund. Refund is possible only within 365 days after payment. Automatic return receipt via receipt API.
  • CloudPaymentsrefund method by TransactionId. Refund to card in 1–5 business days. For 3DS payments, refund may take up to 30 days on the bank’s side.
  • Tinkoff AcquiringCancel by PaymentId. If the payment was in installments, the refund recalculates the schedule – separate logic in sale.paysystem.handler.
  • Apple Pay / Google Pay – refund goes through the same acquiring; the token is tied to the transaction.
  • Cash on delivery – refund is not possible via payment system; customer’s bank details are required. A separate form in the personal account.
  • Internal accountCSaleUserAccount::Pay() with credit of amount. Motivate with an increased coefficient (x1.1) – 10% bonus for choosing return to balance instead of card.

We guarantee correct handling of each error code via custom sale.paysystem.handler implementations.

Compliance and automation – no exceptions

Consumer Protection Law (Article 26.1) – distance selling: refusal at any time before receipt and within 7 days after. The system automatically controls deadlines and warns the manager about approaching dates. Consumer Protection Law (Article 26.1).

  • 14 days – return of goods of proper quality. Check: date_insert of order + delivery date from tracking + 14 days. If overdue, the request is rejected with explanation.
  • 54‑FZ – return receipt is mandatory. Federal Law 54‑FZ.
  • Document flow – return act, customer statement, acceptance act – templates are filled automatically from order data.

Extended capabilities: analytics, exchange, reverse logistics

Return analytics – data for decisions

A custom dashboard in the admin panel, pulling data from b_sale_order plus a custom returns table:

  • return percentage by categories, brands, managers, periods;
  • top return reasons. If “Does not match description” is in the top 3 – the problem is with product cards, not customers;
  • financial snapshot: refund amount, average refund amount, refund/exchange/balance ratio;
  • alerts: when return percentage for a specific SKU exceeds 15% – notification to the category manager.

Exchange and replacement – retaining the sale

Not every return means lost revenue. Exchange via CSaleOrder::Update with cart recalculation:

  • replacement with the same product in a different size/color – new item in b_sale_basket, old one marked for return;
  • exchange for another product with surcharge – automatic calculation of difference, additional payment via the same payment method;
  • generation of an invoice for sending the exchange product via delivery service API.

Reverse logistics – integrations

  • CDEKPOST /v2/orders with type: 2 (return). Automatic pickup request, tracking via webhook.
  • Boxberry – Parsel shop API for selecting a return pickup point.
  • Russian Post – generation of a return invoice via mail API.
  • Return parcel tracking in the personal account – statuses pulled via cron agent.

Implementation process: 8 steps

  1. Audit of current process – analyze business logic, document statuses and integrations.
  2. Workflow design – status scheme, auto‑approval rules, routing.
  3. Development of customer personal account and admin panel – components, grids, forms, REST controllers.
  4. Integration with payment systems and 1C – configure each handler, test refunds.
  5. Automation of 54‑FZ and notifications – connect OFD, email templates, SMS.
  6. Integration with delivery services – CDEK, Boxberry, Russian Post.
  7. Testing – full cycle: order → return → refund → receipt → 1C.
  8. Employee training and documentation handover.

What you get: deliverables and results

Block What You Get
Documentation Technical specification, workflow description, integration diagram
Code and configuration Ready components, infoblock settings, HL‑blocks, statuses, permissions
Integration with payment systems Connection of YooKassa, CloudPayments, Tinkoff, Apple Pay/Google Pay
Exchange with 1C CommerceML setup, return document in 1C
Automation of 54‑FZ Return receipt via OFD, fiscalization
Training Video instructions for managers and administrators
Support 1‑month warranty support after implementation

Pre‑launch checklist

  • Refund via each payment system (partial and full) tested.
  • 54‑FZ test: return receipt correct, sent to OFD.
  • Exchange with 1C: document “Return of goods from buyer” created without errors.
  • Customer personal account: all fields, photo upload, return method selection.
  • Auto‑approval up to threshold working.
  • Notifications (email/SMS/push) received.
  • Inventory after receipt updated.
  • Analytics calculates metrics correctly.

Why it pays off in a month

Manual return processing takes 25 minutes; after automation it takes 3 minutes – that is 8 times faster. With 15 returns per day, a full‑time employee position is freed. Yearly salary savings exceed $50,000. Also, error rates drop by 95% compared to manual handling. Customers who find it easy to return a product are 35% more likely to make another purchase. Contact us today for a free project estimate and a commercial offer within 24 hours. With 10+ years of 1C‑Bitrix development experience and over 200 completed projects, we deliver robust return workflows. Request a consultation now.