Developer forum

Forum » Integration » Prices from Live Integration - BC Cloud

Prices from Live Integration - BC Cloud

Chris Søgaard
Chris Søgaard
Reply

Hi

I have a case with a client with D365 BC Cloud and we're trying to get Live Prices from DW Code Unit installed on the BC. The client has created prices in BC in the "Prices & Discount" menu, like shown in the image here:

 

When I request prices for the product to the DW Code Unit, using the syntax for live integration I get this response:

 

Request:

<GetEcomData ExternalUserId="CT002715" AccessUserCustomerNumber="C0000035">
  <tables>
    <Products type="filter" unitPrices="true">
      <Product>
        <ProductId>02716</ProductId>
      </Product>
    </Products>
  </tables>
</GetEcomData>

 

Response:

<?xml version="1.0" encoding="utf-16"?>
<tables version="1.2.0.11_NAV17.0.22463.23833">
  <table tableName="EcomProducts">
    <item table="EcomProducts">
      <column columnName="ProductId"><![CDATA[02716]]></column>
      <column columnName="ProductVariantId"><![CDATA[]]></column>
      <column columnName="ProductIdentifier"><![CDATA[]]></column>
      <column columnName="ProductNumber"><![CDATA[02716]]></column>
      <column columnName="ProductName"><![CDATA[Plan L Snowy Owl]]></column>
      <column columnName="ProductPrice"><![CDATA[0]]></column>
      <column columnName="ProductStock"><![CDATA[1,051]]></column>
      <column columnName="ProductCurrencyCode"><![CDATA[]]></column>
      <column columnName="ProductDefaultUnitId"><![CDATA[Unit_PCS]]></column>
    </item>
  </table>
  <table tableName="EcomPrices">
    <item table="EcomPrices">
      <column columnName="PriceProductId"><![CDATA[02716]]></column>
      <column columnName="PriceUserCustomerNumber"><![CDATA[C0000035]]></column>
      <column columnName="PriceProductUnitId"><![CDATA[Unit_INNER]]></column>
      <column columnName="PriceQuantity"><![CDATA[6]]></column>
      <column columnName="PriceAmount"><![CDATA[0]]></column>
    </item>
    <item table="EcomPrices">
      <column columnName="PriceProductId"><![CDATA[02716]]></column>
      <column columnName="PriceUserCustomerNumber"><![CDATA[C0000035]]></column>
      <column columnName="PriceProductUnitId"><![CDATA[Unit_OUTER]]></column>
      <column columnName="PriceQuantity"><![CDATA[24]]></column>
      <column columnName="PriceAmount"><![CDATA[0]]></column>
    </item>
    <item table="EcomPrices">
      <column columnName="PriceProductId"><![CDATA[02716]]></column>
      <column columnName="PriceUserCustomerNumber"><![CDATA[C0000035]]></column>
      <column columnName="PriceProductUnitId"><![CDATA[Unit_PCS]]></column>
      <column columnName="PriceQuantity"><![CDATA[1]]></column>
      <column columnName="PriceAmount"><![CDATA[0]]></column>
    </item>
  </table>
</tables>

 

All prices here are 0. I would have expected here to get the price of 49,00 DKK as stated in the price table in BC. Funny thing is that if I request specific prices for this customer with the request for importing prices I get the price, see example below:

Request:

<GetEcomData>
  <tables>
    <ProductPrices type="all" salesType="Customer" salesCode="C0000035" setLanguage="DAN" setCurrency="DKK"/> 
  </tables>
</GetEcomData>

 

Response:

...

    <item table="EcomProducts">
      <column columnName="ProductID"><![CDATA[02716]]></column>
      <column columnName="ProductVariantID"><![CDATA[]]></column>
      <column columnName="ProductLanguageID"><![CDATA[DAN]]></column>
      <column columnName="ProductNumber"><![CDATA[02716]]></column>
      <column columnName="ProductPrice"><![CDATA[49]]></column>
      <column columnName="ProductPriceBefore"><![CDATA[0.00]]></column>
    </item>

...

...

    <item table="EcomPrices">
      <column columnName="PriceId"><![CDATA[02716DANDKK1PCS]]></column>
      <column columnName="PriceProductId"><![CDATA[02716]]></column>
      <column columnName="PriceProductVariantId"><![CDATA[]]></column>
      <column columnName="PriceProductLanguageId"><![CDATA[DAN]]></column>
      <column columnName="PriceCurrency"><![CDATA[DKK]]></column>
      <column columnName="PriceQuantity"><![CDATA[1]]></column>
      <column columnName="PriceAmount"><![CDATA[0.00]]></column>
      <column columnName="PriceUnitId"><![CDATA[PCS]]></column>
      <column columnName="PriceValidFrom"><![CDATA[]]></column>
      <column columnName="PriceValidTo"><![CDATA[]]></column>
      <column columnName="PriceIsInformative"><![CDATA[true]]></column>
      <column columnName="PriceUserCustomerNumber"><![CDATA[]]></column>
    </item>
    <item table="EcomPrices">
      <column columnName="PriceId"><![CDATA[02716DANDKK120210101PCSC0000035Customer]]></column>
      <column columnName="PriceProductId"><![CDATA[02716]]></column>
      <column columnName="PriceProductVariantId"><![CDATA[]]></column>
      <column columnName="PriceProductLanguageId"><![CDATA[DAN]]></column>
      <column columnName="PriceCurrency"><![CDATA[DKK]]></column>
      <column columnName="PriceQuantity"><![CDATA[1]]></column>
      <column columnName="PriceAmount"><![CDATA[49.00]]></column>
      <column columnName="PriceUnitId"><![CDATA[PCS]]></column>
      <column columnName="PriceValidFrom"><![CDATA[2021/01/01]]></column>
      <column columnName="PriceValidTo"><![CDATA[2021/09/14]]></column>
      <column columnName="PriceIsInformative"><![CDATA[false]]></column>
      <column columnName="PriceUserCustomerNumber"><![CDATA[]]></column>
    </item>

...

 

Could someone please explain to me how the actual code behind the Live Integration works when requesting the Code Unit for Live Prices?

 

BR Chris

 


Replies

 
Dynamicweb Employee
Dmitriy Benyuk
Reply
This post has been marked as an answer

Hi Chris,

the Live integration generates the request xml that looks like that:
<GetEcomData ExternalUserId="CT002715" AccessUserCustomerNumber="C0000035">
  <tables>
    <Products type="filter">
      <Product>
        <ProductId>1900-S</ProductId>
        <ProductVariantId></ProductVariantId>
        <ProductNumber>1900-S</ProductNumber>
        <ProductIdentifier>1900-S..LANG1</ProductIdentifier>
        <CurrencyCode>GBP</CurrencyCode>
        <Quantity>1</Quantity>

      </Product>
    </Products>
  </tables>
</GetEcomData>
I think the problem is that you are missing the Currency and Quantity fields in your request, try to adjust it to look like the sample requst shown above.
Kind regards, Dmitrij

Votes for this answer: 1
 
Chris Søgaard
Chris Søgaard
Reply

Hi Dmitriy

Thank you for the quick response, and this solved the issue on this client.

It seems that these extra fields are not shown as part of the documentation for request/responses here: https://doc.dynamicweb.com/documentation-9/integration/integration-framework-2/requests-responses#10083, leaving us a little clueless, when testing this. Could this documentation be updated?

BR Chris

 
Dynamicweb Employee
Dmitriy Benyuk
Reply

Hi Chris,
nice found :) It is now updated. Thx.
Regards, Dmitrij

 

You must be logged in to post in the forum