E-commerce integration with Yandex Market Seller API

Our company is engaged in the development, support and maintenance of sites of any complexity. From simple one-page sites to large-scale cluster systems built on micro services. Experience of developers is confirmed by certificates from vendors.
Development and maintenance of all types of websites:
Informational websites or web applications
Business card websites, landing pages, corporate websites, online catalogs, quizzes, promo websites, blogs, news resources, informational portals, forums, aggregators
E-commerce websites or web applications
Online stores, B2B portals, marketplaces, online exchanges, cashback websites, exchanges, dropshipping platforms, product parsers
Business process management web applications
CRM systems, ERP systems, corporate portals, production management systems, information parsers
Electronic service websites or web applications
Classified ads platforms, online schools, online cinemas, website builders, portals for electronic services, video hosting platforms, thematic portals

These are just some of the technical types of websites we work with, and each of them can have its own specific features and functionality, as well as be customized to meet the specific needs and goals of the client.

Our competencies:
Development stages
Latest works
  • image_web-applications_feedme_466_0.webp
    Development of a web application for FEEDME
    1161
  • image_ecommerce_furnoro_435_0.webp
    Development of an online store for the company FURNORO
    1041
  • image_crm_enviok_479_0.webp
    Development of a web application for Enviok
    822
  • image_crm_chasseurs_493_0.webp
    CRM development for Chasseurs
    847
  • image_website-sbh_0.png
    Website development for SBH Partners
    999
  • image_website-_0.png
    Website development for Red Pear
    451

Integration of Online Store with Yandex.Market (Seller Partner API)

Yandex.Market provides Partner API for managing products, prices, stock levels, and orders. Supports FBS (storage at seller), FBO (storage at Market warehouse), and DBS (seller delivery) models.

Authentication

Partner API uses OAuth2 tokens. Authorization through Yandex OAuth:

class YandexMarketClient
{
    private string $accessToken;
    private int    $campaignId;
    private int    $businessId;

    public function request(string $method, string $path, array $data = []): array
    {
        return Http::withHeaders([
            'Authorization' => "OAuth oauth_token={$this->accessToken}",
            'Content-Type'  => 'application/json',
        ])->{strtolower($method)}(
            "https://api.partner.market.yandex.ru{$path}",
            $data
        )->json();
    }
}

Loading/Updating Products

public function updateOffers(array $products): void
{
    $offers = array_map(fn($product) => [
        'offerId'     => $product['sku'],
        'name'        => $product['name'],
        'category'    => $product['category_name'],
        'pictures'    => $product['images'],
        'vendor'      => $product['brand'],
        'description' => $product['description'],
        'price'       => ['value' => $product['price'], 'currencyId' => 'RUR'],
        'count'       => $product['stock'],
        'barcodes'    => [$product['barcode']],
    ], $products);

    $this->request('PUT',
        "/businesses/{$this->businessId}/offer-mappings",
        ['offerMappings' => array_map(fn($o) => ['offer' => $o], $offers)]
    );
}

Prices and Stock

// Price update
public function updatePrices(array $items): void
{
    $offers = array_map(fn($item) => [
        'id'    => $item['sku'],
        'price' => ['value' => $item['price'], 'currencyId' => 'RUR', 'vat' => 'VAT_20'],
    ], $items);

    $this->request('POST',
        "/campaigns/{$this->campaignId}/offer-prices/updates",
        ['offers' => $offers]
    );
}

// Stock update FBS
public function updateStocks(array $items, int $warehouseId): void
{
    $skus = array_map(fn($item) => [
        'sku'   => $item['sku'],
        'items' => [['count' => $item['stock'], 'type' => 'FIT']],
    ], $items);

    $this->request('PUT',
        "/campaigns/{$this->campaignId}/offers/stocks",
        ['skus' => $skus, 'warehouseId' => $warehouseId]
    );
}

Order Processing

public function getNewOrders(): array
{
    $resp = $this->request('GET',
        "/campaigns/{$this->campaignId}/orders",
        ['status' => 'PROCESSING', 'substatus' => 'STARTED', 'pageSize' => 50]
    );

    return $resp['orders'] ?? [];
}

public function acceptOrder(int $orderId): void
{
    $this->request('PUT',
        "/campaigns/{$this->campaignId}/orders/{$orderId}/status",
        ['order' => ['status' => 'PROCESSING', 'substatus' => 'READY_TO_SHIP']]
    );
}

Push Notifications for Orders

Yandex.Market supports push notifications through seller's personal cabinet settings:

Route::post('/webhooks/yandex-market', function (Request $request) {
    $events = $request->input('data');

    foreach ($events as $event) {
        match($event['type']) {
            'ORDER_STATUS_CHANGED' => ProcessYandexOrderStatus::dispatch($event['orderId']),
            default                => null,
        };
    }

    return response()->json(['status' => 'ok']);
});

Timeline

Integration with Yandex.Market Partner API: 12–16 business days.