# Store and use prices previously fetched

**URL:** <https://forum.litium.com/t/store-and-use-prices-previously-fetched/1785>\
**Category:** Questions\
**Created:** [November 25, 2020, 1:35pm UTC](https://forum.litium.com/t/store-and-use-prices-previously-fetched/1785 "2020-11-25T13:35:54Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![ChrisAugustsson](https://avatars.discourse-cdn.com/v4/letter/c/94ad74/32.png) [@ChrisAugustsson](https://forum.litium.com/u/ChrisAugustsson)\
**Post date:** [November 25, 2020, 1:35pm UTC](https://forum.litium.com/t/store-and-use-prices-previously-fetched/1785/1 "2020-11-25T13:35:54Z")

</div>

We have some products that we don’t store the price for in the PIM. When we list the product, we get the price from a third party API. To reduce the number of calls to the API, we would like to use the price we get when listing the products, when we add the product the cart.

The `Cart.Add` method doesn’t allow us to pass the price as an argument, so we have currently passed som additional product information as JSON in the comments, and we are then parsing it in the `OrderRowFactory` and adjust the price that way.

Is there any better way to achieve what we are looking for?

Litium version: 7.2.3

---

<div class="post-metadata">

**Author:** ![steve.redstorm](https://yyz2.discourse-cdn.com/flex030/user_avatar/forum.litium.com/steve.redstorm/32/14_2.png) [@steve.redstorm](https://forum.litium.com/u/steve.redstorm)\
**Post date:** [November 25, 2020, 4:06pm UTC](https://forum.litium.com/t/store-and-use-prices-previously-fetched/1785/2 "2020-11-25T16:06:21Z")

</div>

Try to use OrderCarrier.AdditionalOrderInfo instead if possible.

---

<div class="post-metadata">

**Author:** ![marten](https://yyz2.discourse-cdn.com/flex030/user_avatar/forum.litium.com/marten/32/11_2.png) [@marten](https://forum.litium.com/u/marten)\
**Post date:** [November 26, 2020, 1:38pm UTC](https://forum.litium.com/t/store-and-use-prices-previously-fetched/1785/3 "2020-11-26T13:38:30Z")

</div>

The scenario for getting and showing prices from external sources can be found in the developer training:

[1. Get prices from external source](https://github.com/LitiumAB/Education/tree/master/Developer%20Education/Tasks/Pricing%20rules)  
[2. Use distributed cache and distributed lock to store prices in redis](https://github.com/LitiumAB/Education/tree/master/Developer%20Education/Tasks/Redis#1-distributed-cache)

Full sample can be found [here](https://github.com/LitiumAB/Education/blob/master/Developer%20Education/Tasks/Redis/Resources/ERPPriceCalculator%20(distributed%20lock).cs)

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex030/uploads/litium/original/1X/12eddac3b8b661de1db86af10ac8151b571e6fb9.png) [@system](https://forum.litium.com/u/system)\
**Post date:** [December 24, 2020, 1:38pm UTC](https://forum.litium.com/t/store-and-use-prices-previously-fetched/1785/4 "2020-12-24T13:38:31Z")

</div>

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.
