# Klarna: Provide own value for merchant\_reference2 before payment is activated

**URL:** <https://forum.litium.com/t/klarna-provide-own-value-for-merchant-reference2-before-payment-is-activated/2654>\
**Category:** Questions\
**Tags:** accelerator, klarna, litium-7, litium-8\
**Created:** [August 22, 2022, 1:04pm UTC](https://forum.litium.com/t/klarna-provide-own-value-for-merchant-reference2-before-payment-is-activated/2654 "2022-08-22T13:04:00Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![kdxperbol](https://yyz2.discourse-cdn.com/flex030/user_avatar/forum.litium.com/kdxperbol/32/513_2.png) [@kdxperbol](https://forum.litium.com/u/kdxperbol)\
**Post date:** [August 22, 2022, 1:04pm UTC](https://forum.litium.com/t/klarna-provide-own-value-for-merchant-reference2-before-payment-is-activated/2654/1 "2022-08-22T13:04:00Z")

</div>

The Litium 7 Klarna plug-in sets the `merchant_reference2` (“Butiksreferens #2”) to the Delivery id/guid. Is there a way to provide our own value instead?

We don’t have the desired value at checkout when the payment is created, but we would like the value to be set in Klarna before the payment is activated. The Klarna plug-in activates the payment when the order/delivery is set to Delivered.

We can probably do this by manually updating the Klarna order (using the Klarna API), but this would be a completely separate Klarna API integration next to the one the plug-in already has. So something in the plug-in would be preferable.

So the flow would be:

1. Create Klarna order/payment (handled by plug-in already)
2. Create Litium Order (handled by plug-in already)
3. Set Litium order/delivery to Delivered (we do this already using Integration Kit)
4. Something to update Klarna `merchant_reference2` (set something on the Litium Payment?)
5. Activate/charge Klarna payment (handled by plug-in already)

Litium version: 7 & 8 + accelerator

---

<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:** [August 23, 2022, 8:32am UTC](https://forum.litium.com/t/klarna-provide-own-value-for-merchant-reference2-before-payment-is-activated/2654/2 "2022-08-23T08:32:48Z")

</div>

When public method _NotifyOrderCreated_ is called then Merchant reference 1 & 2 gets set in a private method like this:

```auto
if (string.IsNullOrEmpty(kcoOrderData.MerchantReference1))
{
    adapter.UpdateMerchantReferences(kcoOrderData.OrderId, new OrderManagementMerchantReferences()
    {
        MerchantReference1 = paymentInfo.Order.ExternalOrderID,
        MerchantReference2 = paymentInfo.OrderID.ToString()
    });
}

```

So if you need to change it then you need to call the Klarna API separately.  
[Klarna API Reference](https://developers.klarna.com/api/#metadata)

---

<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:** [September 20, 2022, 8:33am UTC](https://forum.litium.com/t/klarna-provide-own-value-for-merchant-reference2-before-payment-is-activated/2654/3 "2022-09-20T08:33:31Z")

</div>

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