Use this method to retrieve changed dynamic prices if you are using the repricing functionalities in Channel Pilot Pro. The method will return all prices for a specific price (determined by priceId) that were changed since filterFrom.
The method only returns a maximum number of prices per call! This limit is configurable for your shop and the default is set to 1000. This limit is a “soft limit”, it can be exceeded in some cases. See the use cases for a detailed description.
GetDynamicArticlePricesResponse getDynamicArticlePrices(
CPAuth auth, //required
long priceId, //required
CPPagination pagination, //not used, should be null
String method, //required, ‘all’ or ‘filtered’
CPArticle[] filterArticles, //not used, should be null
String filterFrom
);
Input
Parameter | Type | Optional | Comment |
auth | CPAuth | no | Authentication data. |
priceId | Long | no | Id of the dynamicPrice in Channel Pilot Pro you want to retrieve changed prices for |
pagination | CPPagination | yes | Not yet used (may change in a future release). You should send as null. |
method | String | no | If ‘all’, filterFrom will be ignored and the method will return the oldest changed prices up to a maximum amount (see, Use Cases below). Send ‘all’ or ‘filtered’. |
filterArticles | CPArticle[] | yes | Not yet used (may change in a future release). You should send null or empty. |
filterFrom | String | yes | Can be null if method == ‘all’. Has to be set to the date/time you want to require changed prices from. All prices changed at this or after this date/time will be returned. |
Output
Method returns a "GetDynamicArticlePricesResponse".
Use Cases
The following diagram shows the best practice of integrating the API. You have to store the date time of the lastUpdate of the latest retrieved "CPManagedArticlePrice" within your system. Let’s call this variable myLastUpdate for now. For every run, you have to check if a valid myLastUpdate is available. If not, call the method with parameter method = ‘all’. Otherwise, set parameter method to ‘filtered’.
You will retrieve an array of CPManagedArticlePrice. Iterate over this array and store every price in your Shop- or ERP-system. In every iteration, you can set your variable myLastUpdate to the lastUpdate of the returned CPManagedArticlePrice. If no price is returned, you can keep your current myLastUpdate as it is! You may clean your dateLastCall from time to time, and you will retrieve all prices again.
All CPManagedArticlePrice that are retrieved are sorted by lastUpdate ascending, so the first price you retrieve will be the one with the oldest lastUpdate. Channel Pilot Pro guarantees that the lastUpdate of the last retrieved price will be at least one second after the first one. Because of that, the number of returned prices can exceed the limit of 1000, if the first 1000 prices have got exactly the same lastUpdate.
Example (SOAP-UI)
Request
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:v4="http://v4_2.seller.api.channelpilot.com/">
<soapenv:Header/>
<soapenv:Body>
<v4:getDynamicArticlePrices>
<auth>
<merchantId>xxxxxxxxxx</merchantId>
<shopToken>xxxxxxxxxx</shopToken>
</auth>
<priceId>7576630</priceId>
<method>all</method>
<filterFrom>2019-02-06T14:00:00+02:00</filterFrom>
</v4:getDynamicArticlePrices>
</soapenv:Body>
</soapenv:Envelope>
Response
<soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/">
<soap:Body>
<ns1:getDynamicArticlePricesResponse xmlns:ns1="http://v4_2.seller.api.channelpilot.com/">
<return>
<header>
<resultCode>200</resultCode>
<resultMessage/>
</header>
<moreAvailable>false</moreAvailable>
<countMoreAvailable>0</countMoreAvailable>
<managedArticlePrices>
<article>
<id>5031208-002</id>
</article>
<price>22</price>
<lastUpdate>2019-02-01T16:15:15+01:00</lastUpdate>
</managedArticlePrices>
</return>
</ns1:getDynamicArticlePricesResponse>
</soap:Body>
</soap:Envelope>

