- [Home page](https://www.brimit.com/)
- [Blog](https://www.brimit.com/blog)

# How to Import Price Books Feature in Sitecore Commerce 9

[#How-to](https://www.brimit.com/blog?categories=#How-to) [DXP](https://www.brimit.com/blog?platforms=DXP)
[Andrei Paliakou](https://www.brimit.com/blog/author?authors=Andrei%20Paliakou) on June 24, 2020

![sitecore-techtalks](https://www.brimit.com/-/jssmedia/project/brimit/blog/2020/sitecore-techtalks.png?h=476&iar=0&w=716&hash=0BE2628F3BA744B18C11741903BB4DC2)

In my previous [blog post](https://www.brimit.com/blog/sitecore-commerce-9-export-price-books), I explained how to implement export Price Books feature.

 Now I am going to explain how to implement import Price Books feature.

Source code you can find here: [https://github.com/Frog911/Sitecore.Commerce.ImportExport](https://github.com/Frog911/Sitecore.Commerce.ImportExport)

First, let’s start from the endpoint implementation.

[![Sitecore Commerce 9: Import Price Books](https://www.brimit.com/-/media/project/brimit/blog/2020/apaliakou/post-3/3.png?w=900&hash=479BAB35FD33A806B6C5D6914C64BE1D)](https://www.brimit.com/-/media/project/brimit/blog/2020/apaliakou/post-3/3.png)

ImportPriceBook action will support some parameters like importFile, errorThreshold, mode and publishEntities. We have to implement ImportPriceBooksCommand, which we will invoke with the ExecuteLongRunningCommand operation. When we will call our custom endpoint for the import process, it can take quite a lot time. It depends how huge is our Price Books will be.

 In our case, ExecuteLongRunningCommand will return an object, which will contain TaskId. Sitecore Commerce provides an endpoint to track the task status.

The implementation of ImportPriceBooksCommand should look like below.

[![Sitecore Commerce 9: Import Price Books](https://www.brimit.com/-/media/project/brimit/blog/2020/apaliakou/post-3/4.png?w=900&hash=2FD3FD392547F113DD0F8726335FE999)](https://www.brimit.com/-/media/project/brimit/blog/2020/apaliakou/post-3/4.png)

Now we have to create custom argument. ImportPriceBooksArgument will be using by custom pipeline to share some data through the pipeline blocks.

[![Sitecore Commerce 9: Import Price Books](https://www.brimit.com/-/media/project/brimit/blog/2020/apaliakou/post-3/5.png?w=900&hash=9D9951DD2CAF526121C85A9D380521D3)](https://www.brimit.com/-/media/project/brimit/blog/2020/apaliakou/post-3/5.png)

Creating pipeline interface and implementing it:

[![Sitecore Commerce 9: Import Price Books](https://www.brimit.com/-/media/project/brimit/blog/2020/apaliakou/post-3/6.png?w=900&hash=BA2FF5997FC86CF1AED9B4F34EAF8624)](https://www.brimit.com/-/media/project/brimit/blog/2020/apaliakou/post-3/6.png)

[![Sitecore Commerce 9: Import Price Books](https://www.brimit.com/-/media/project/brimit/blog/2020/apaliakou/post-3/7.png?w=900&hash=FF8D101326A521D68D1DA3AA46CEBFCC)](https://www.brimit.com/-/media/project/brimit/blog/2020/apaliakou/post-3/7.png)

Let’s update the ConfigureSitecore.cs file with some pipeline registrations.

[![Sitecore Commerce 9: Import Price Books](https://www.brimit.com/-/media/project/brimit/blog/2020/apaliakou/post-3/9.png?w=900&hash=35DA8D3A54F79531831C59866AFEAB96)](https://www.brimit.com/-/media/project/brimit/blog/2020/apaliakou/post-3/9.png)

The implementation of blocks you can find in my GitHub repo with I mentioned above.

Now everything is ready for testing. Let’s try to call ImportPriceBooks endpoint from Postman.

[![Sitecore Commerce 9: Import Price Books](https://www.brimit.com/-/media/project/brimit/blog/2020/apaliakou/post-3/10.png?w=900&hash=53383B64B89040B4EA418331B0729909)](https://www.brimit.com/-/media/project/brimit/blog/2020/apaliakou/post-3/10.png)

[![Sitecore Commerce 9: Import Price Books](https://www.brimit.com/-/media/project/brimit/blog/2020/apaliakou/post-3/11.png?w=900&hash=C6FC6AB94DE4EDCE78C9E6B985BD2DB2)](https://www.brimit.com/-/media/project/brimit/blog/2020/apaliakou/post-3/11.png)

As you can see, Price Books were imported successfully.

In the next [blog post](https://www.brimit.com/blog/sitecore-commerce-9-extend-bizfx-part-1), I will explain how to extend BizFx interface to support import/export features.

Stay tuned!

###### Author

![apaliakou](https://www.brimit.com/-/jssmedia/feature/blogs/authors/apaliakou.jpg?h=216&iar=0&w=360&hash=5BE96F17AE5B47F66D9F684B87773675)

Andrei Paliakou

Sitecore MVP/ Lead Developer
[Andrei Paliakou](https://www.brimit.com/blog/author?authors=Andrei%20Paliakou)

###### More By Categories

[#Events](https://www.brimit.com/blog?categories=#Events) [#How-to](https://www.brimit.com/blog?categories=#How-to) [#News](https://www.brimit.com/blog?categories=#News) [#Guides](https://www.brimit.com/blog?categories=#Guides)

###### More by Platform

[Data and AI](https://www.brimit.com/blog?platforms=Data%20and%20AI) [DXP](https://www.brimit.com/blog?platforms=DXP) [E-commerce](https://www.brimit.com/blog?platforms=E-commerce) [Internet of Things](https://www.brimit.com/blog?platforms=Internet%20of%20Things) [Sales and marketing automation](https://www.brimit.com/blog?platforms=Sales%20and%20marketing%20automation)
