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.







