I am able add tier prices using csv

$this->tierPrice->add($sku, $customerGroupId, $price, $qty);

but it is taking "value_type" as Fixed , i want to dynamically give the value for "value_type"


3 Answers 3


I done the same by doing

$product_obj = $this->_objectManager->create('Magento\Catalog\Model\Product')->load($prod_id);
    $tierPrices[] = array(
                                 'website_id'  => 0,
                                 'cust_group'  => 1,
                                 'price_qty'   => $qty,
                                 'price'       => $price,
                                 'percentage_value'  => $percentage);
Here in the above array   `percentage_value` is given for the price range having discount type.         

I used Rakesh Jesadiya article information and done some debugging to create more "elegant" solution for percentage_value tier price type. Here is my code:

use Magento\Catalog\Api\Data\ProductTierPriceInterface;
use Magento\Catalog\Api\Data\ProductTierPriceInterfaceFactory;
use Magento\Catalog\Api\ScopedProductTierPriceManagementInterface;

class ProductPriceListsResolver
     * @var ScopedProductTierPriceManagementInterface
    private $tierPriceManagement;
     * @var ProductTierPriceInterface
    private $productTierPriceFactory;

    public function __construct(
        ScopedProductTierPriceManagementInterface $tierPriceManagement,
        ProductTierPriceInterfaceFactory $productTierPriceFactory
    ) {

        $this->tierPriceManagement = $tierPriceManagement;
        $this->productTierPriceFactory = $productTierPriceFactory;

    public function resolve()
        $sku = 'sku_83519'; //Product sku
        $customerGroupId = 6; //premium group id
        $price = 50.00;
        $qty = 1.00;

        /** @var ProductTierPriceInterface $productTierPrice */
        $productTierPrice = $this->productTierPriceFactory->create();

        $extensionAttributes = $productTierPrice->getExtensionAttributes();
        try {
            $this->tierPriceManagement->add($sku, $productTierPrice);
        } catch (\Exception $e) {
            throw new $e;

I'm also looking for a solution to update tier price without call save() method.

So, I used @embed0 suggested solution but exception accured:

The data was invalid. Verify the data and try again. in /vendor/magento/module-catalog/Model/Product/TierPriceManagement.php:99

Can you please specified the expected result for $productTierPrice argument of add() method?

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.