PHP code example of bagbaq / hepsiburada-api

1. Go to this page and download the library: Download bagbaq/hepsiburada-api library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

bagbaq / hepsiburada-api example snippets


$hb = new Hepsiburada("username", "password", "merchantId");

// Ürün Güncelleme
$items = [
    [
        "hbSku"              => "STOK-KOD-1",
        "productName"        => "Ürün 1",
        "productDescription" => "Ürün açıklaması",
        "image1"             => "https://productimages.hepsiburada.net/s/27/552/10194862145586.jpg",
        "image2"             => "https://productimages.hepsiburada.net/s/27/552/10194862145586.jpg",
        "image3"             => "https://productimages.hepsiburada.net/s/27/552/10194862145586.jpg",
        "image4"             => "https://productimages.hepsiburada.net/s/27/552/10194862145586.jpg",
        "image5"             => "https://productimages.hepsiburada.net/s/27/552/10194862145586.jpg",
        "video"              => "https://images.hepsiburada.net/assets/videos/ProductVideos/iPhone_14_Pro_PDP_Video_16x9__TR.mp4",
        "attributes"         => [
            "renk_variant_property"=> "Siyah",
            "numara_variant_property"=> "44",
            "malzeme"=> "Rugan"
        ]
    ]
];

$hb->updateProduct($items);

// Ürün Fiyat Güncelleme
$items = [
    [
        "hepsiburadaSku" => "SKU-456866",
        "merchantSku"    => "SKU12",
        "price"          => 120.50
    ]
];

$hb->updateProductPrice($items);

// Ürün Stok Güncelleme
$items = [
    [
        "hepsiburadaSku"             => "SKU-456866",
        "merchantSku"                => "SKU12",
        "availableStock"             => 30,
        "maximumPurchasableQuantity" => 1
    ]
];

$hb->updateProductStock($items);