Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6936519
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T12:14:38+00:00 2026-05-27T12:14:38+00:00

I am using C#.NET to connect to the Magento API v2 via SOAP. Everything

  • 0

I am using C#.NET to connect to the Magento API v2 via SOAP. Everything is working fine until I try to update product with tier prices – “Invalid Tier Prices”.

I debuged what comes to Magento and two attributes of every tier price are missing – “qty” and “price”. Here’s an envelope that magento gets:

<s:Envelope xmlns:s="http://schemas.xmlsoap.org/soap/envelope/">
    <s:Body s:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
        <q1:catalogProductUpdate xmlns:q1="urn:Magento">
            <sessionId xsi:type="xsd:string">142163ba9058d5bc4d3b6b12445163a5</sessionId>
            <product xsi:type="xsd:string">R-0.1UF</product>
            <productData href="#id1" />
            <storeView xsi:type="xsd:string">default</storeView>
        </q1:catalogProductUpdate>
        <q2:catalogProductCreateEntity id="id1" xsi:type="q2:catalogProductCreateEntity" xmlns:q2="urn:Magento">
            <name xsi:type="xsd:string">Tantal PBF</name>
            <status xsi:type="xsd:string">1</status>
            <price xsi:type="xsd:string">0,25</price>
            <tier_price href="#id2" />
        </q2:catalogProductCreateEntity>
        <q3:Array id="id2" q3:arrayType="q4:catalogProductTierPriceEntity[3]" xmlns:q3="http://schemas.xmlsoap.org/soap/encoding/" xmlns:q4="urn:Magento">
            <Item href="#id3" />
            <Item href="#id4" />
            <Item href="#id5" />
        </q3:Array>
        <q5:catalogProductTierPriceEntity id="id3" xsi:type="q5:catalogProductTierPriceEntity" xmlns:q5="urn:Magento">
            <customer_group_id xsi:type="xsd:string">all</customer_group_id>
            <website xsi:type="xsd:string">all</website>
        </q5:catalogProductTierPriceEntity>
        <q6:catalogProductTierPriceEntity id="id4" xsi:type="q6:catalogProductTierPriceEntity" xmlns:q6="urn:Magento">
            <customer_group_id xsi:type="xsd:string">all</customer_group_id>
            <website xsi:type="xsd:string">all</website>
        </q6:catalogProductTierPriceEntity>
        <q7:catalogProductTierPriceEntity id="id5" xsi:type="q7:catalogProductTierPriceEntity" xmlns:q7="urn:Magento">
            <customer_group_id xsi:type="xsd:string">all</customer_group_id>
            <website xsi:type="xsd:string">all</website>
        </q7:catalogProductTierPriceEntity>
    </s:Body>
</s:Envelope>

And here’s how It’s built in C# (trivial way, I know, but I’m just trying to get it working):

private catalogProductTierPriceEntity[] addTierPrices(List<V_prices> prices)
{
    catalogProductTierPriceEntity[] mageTierPrices = new catalogProductTierPriceEntity[3];
    catalogProductTierPriceEntity mageTierPrice;

    int i = 0;
    foreach (V_prices price in prices)
    {
        mageTierPrice = new catalogProductTierPriceEntity();
        mageTierPrice.website = "all";
        mageTierPrice.customer_group_id = "all";
        mageTierPrice.qty = price.quantity;
        mageTierPrice.price = (double)price.value; // Conversion from decimal
        mageTierPrices[i] = mageTierPrice;
        i++;
    }

    return mageTierPrices;
}

And the result of the above method I am adding to the product/add request:

catalogProductCreateEntity mageProduct = new catalogProductCreateEntity();
// ..
mageProduct.name = product.name_db;
mageProduct.price = product.price.ToString();
mageProduct.status = "1";
mageProduct.tier_price = addTierPrices(prices);
handler.catalogProductUpdate(session_id, sku, mageProduct, "default", null);

PS. I am using Magento 1.5 and the WSDL was imported to Visual Studio as a service reference (the code generated automatically).

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-27T12:14:39+00:00Added an answer on May 27, 2026 at 12:14 pm

    Got it – the method should be fixed as such:

    private catalogProductTierPriceEntity[] addTierPrices(List<V_prices> prices)
    {
        catalogProductTierPriceEntity[] mageTierPrices = new catalogProductTierPriceEntity[3];
        catalogProductTierPriceEntity mageTierPrice;
    
        int i = 0;
        foreach (V_prices price in prices)
        {
            mageTierPrice = new catalogProductTierPriceEntity();
            mageTierPrice.website = "all";
            mageTierPrice.customer_group_id = "all";
            mageTierPrice.qty = price.quantity;
            mageTierPrice.price = (double)price.value; // Conversion from decimal
            mageTierPrices[i] = mageTierPrice;
    // FIX:
            mageTierPrice.priceSpecified = true;
            mageTierPrice.qtySpecified = true;
            i++;
        }
    
        return mageTierPrices;
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm using ADO.NET to connect to an Oracle DB through ODBC. Everything is working
when I try to connect to my server through MySQL Connector/NET using SSL with
I'm using WMI in .NET to connect to remote machines in a web app.
I'm developing an ASP.NET app (C#) that connect to SQL Server 2008 using ADO.NET
I'm trying to connect to a AS400 server using the .net classes. I have
When using java.net.Socket.connect() , both a refused connection and a timeout result in a
I'm using .NET Connector to connect to MySQL. In my application there are few
I'm trying to connect to a FTP AS/400 server using .NET, with a url
I'm a beginner at this. I'm using mysql connector .net to connect vb.net with
I am using ADO.Net + C# + VSTS 2008 + ADO.Net to connect to

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.