Klarna Tags and ShippingAttributes are null

I’m no longer able to see “weight” and “dimensions” attribute in the shippingattributes. Tags and ShippingAttributes always return null.

For example:
klarnaCheckoutOrder.Tags
and
klarnaCheckoutOrder.OrderLines.FirstOrDefault().ShippingAttributes.Weight

I need to send weight to Klarna.
Any idea how to solve this?

Litium version: [Version number]

Are you adding the data in the call to Klarna?

Yes! In KlarnaPaymentConfigV3.UpdateDataSentToKlarna :slight_smile:

I would clear cookies so you are not getting an old order that isn’t updated. I have seen that for example confirmationurl and other setting are only applied first time order created and then it doesnt updated even if you reload the checkout and KlarnaPaymentConfigV3 is triggered again. So to make sure you are not just working with something old and cached clear your cart.

I’ve clear the cookies and the problem still remain.

Can you add some details about the issue?
You’re adding the data in UpdateDataSentToKlarna, where is it null later?
Is it not being picked up by Unifaun via KSS?

According to Unifaun, I have to add weight to every product for Unifaun delivery methods to be visible in checkout.
And I remember I could set weight in shipping attributes two months ago, but now I cannot anymore because shipping attributes are null.

I saw now in the log that there’s an error (I have the latest browser), but not sure what is causing the error. Do you know?

KCO CheckoutOrder:

{
  "order_id": "7688ffc5-f3ec-64f1-b3c2-98599f66ec38",
  "name": null,
  "purchase_country": "se",
  "purchase_currency": "SEK",
  "locale": "sv-SE",
  "status": "checkout_incomplete",
  "billing_address": {
    "organization_name": null,
    "reference": null,
    "attention": null,
    "given_name": null,
    "family_name": null,
    "email": null,
    "title": null,
    "street_address": null,
    "street_address2": null,
    "street_name": null,
    "street_number": null,
    "house_extension": null,
    "postal_code": null,
    "city": null,
    "region": null,
    "phone": null,
    "country": "se",
    "care_of": null
  },
  "shipping_address": {
    "organization_name": null,
    "reference": null,
    "attention": null,
    "given_name": null,
    "family_name": null,
    "email": null,
    "title": null,
    "street_address": null,
    "street_address2": null,
    "street_name": null,
    "street_number": null,
    "house_extension": null,
    "postal_code": null,
    "city": null,
    "region": null,
    "phone": null,
    "country": "se",
    "care_of": null
  },
  "order_amount": 179900,
  "order_tax_amount": 35980,
  "order_lines": [
    {
      "type": "physical",
      "reference": "21238181003",
      "name": "Knitted Melange Sweater - Stockholm Melange",
      "quantity": 1,
      "quantity_unit": "nos",
      "unit_price": 179900,
      "tax_rate": 2500,
      "total_amount": 179900,
      "total_discount_amount": 0,
      "total_tax_amount": 35980,
      "merchant_data": null,
      "product_url": null,
      "image_url": null,
      "product_identifiers": null,
      "shipping_attributes": null
    },
    {
      "type": "shipping_fee",
      "reference": "0",
      "name": "KSS",
      "quantity": 1,
      "quantity_unit": "nos",
      "unit_price": 0,
      "tax_rate": 2500,
      "total_amount": 0,
      "total_discount_amount": 0,
      "total_tax_amount": 0,
      "merchant_data": null,
      "product_url": null,
      "image_url": null,
      "product_identifiers": null,
      "shipping_attributes": null
    }
  ],
  "customer": {
    "date_of_birth": null,
    "type": null,
    "organization_registration_id": null
  },
  "merchant_urls": {
    "terms": "http://..../sv-se/",
    "cancellation_terms": null,
    "checkout": "http://..../sv-se/kassa?accountId=KCOV3_SE&transactionNumber={checkout.order.id}",
    "confirmation": "https://...../site.axd/KlarnaPayment/Confirmation?accountId=KCOV3_SE&transactionNumber={checkout.order.id}",
    "push": "https://...../site.axd/KlarnaPayment/PushNotification?accountId=KCOV3_SE&transactionNumber={checkout.order.id}",
    "validation": null,
    "shipping_option_update": "https://...../site.axd/KlarnaPayment/ShippingOptionUpdate?accountId=KCOV3_SE&transactionNumber={checkout.order.id}",
    "address_update": null,
    "notification": "http://...../PaymentProviderResult.axd/StaticCallback/KlarnaV3?accountId=KCOV3_SE&transactionNumber={checkout.order.id}",
    "country_change": null
  },
  "html_snippet": "<div id=\"klarna-checkout-container\" style=\"overflow-x: hidden;\">\n  <div id=\"klarna-unsupported-page\">\n  <style type=\"text/css\">\n  @-webkit-keyframes klarnaFadeIn{from{opacity:0}to{opacity:1}}@-moz-keyframes klarnaFadeIn{from{opacity:0}to{opacity:1}}@keyframes klarnaFadeIn{from{opacity:0}to{opacity:1}}#klarna-unsupported-page{opacity:0;opacity:1\\9;-webkit-animation:klarnaFadeIn ease-in 1;-moz-animation:klarnaFadeIn ease-in 1;animation:klarnaFadeIn ease-in 1;-webkit-animation-fill-mode:forwards;-moz-animation-fill-mode:forwards;animation-fill-mode:forwards;-webkit-animation-duration:.1s;-moz-animation-duration:.1s;animation-duration:.1s;-webkit-animation-delay:5s;-moz-animation-delay:5s;animation-delay:5s;text-align:center;padding-top:64px}#klarna-unsupported-page .heading{font-family: \"Klarna Headline\", Helvetica, Arial, sans-serif;color: rgb(23, 23, 23);font-size: 36px;letter-spacing: -0.2px;-webkit-font-smoothing: antialiased;}#klarna-unsupported-page .subheading{font-family: \"Klarna Text\", \"Klarna Sans\", Helvetica, Arial, sans-serif;color: rgb(23, 23, 23);-webkit-font-smoothing: antialiased;line-height: 28px;font-weight: 400;font-size: 19px;max-width: 640px;margin: 20px auto;}#klarna-unsupported-page .reload {cursor: pointer;outline: none;-webkit-tap-highlight-color: rgba(255, 255, 255, 0);border-width: 1px;background-color: rgb(38, 37, 37);border-color: rgb(38, 37, 37);padding: 15px 24px;margin-top: 15px;color: rgb(255, 255, 255);font-family: \"Klarna Text\", \"Klarna Sans\", Helvetica, Arial, sans-serif;font-weight: 500;text-rendering: geometricprecision;min-width: 650px;font-size: 100%;}\n  </style>\n  <h1 class=\"heading\">Something went wrong</h1>\n  <p class=\"subheading\">Sorry for any inconvenience, please try reloading the checkout page or try again later.</p>\n  <p class=\"subheading\">If the problem persists it maybe be because you are using an old version of the web browser which is not safe nor compatible with modern web sites. For a smoother checkout experience, please install a newer browser.</p>\n  <button class=\"reload\" onclick=\"reloadCheckoutHandler && reloadCheckoutHandler()\">Reload checkout</button>\n  </div>\n  <script type=\"text/javascript\">\n  /* <![CDATA[ */\n  var reloadCheckoutHandler;\n  (function(w,k,i,d,n,c,l){\n    w[k]=w[k]||function(){(w[k].q=w[k].q||[]).push(arguments)};\n    l=w[k].config={\n      container:w.document.getElementById(i),\n      ORDER_URL:'https://js.playground.klarna.com/eu/kco/checkout/orders/7688ffc5-f3ec-64f1-b3c2-98599f66ec38',\n      AUTH_HEADER:'KlarnaCheckout 68w6dxtuiisq9dfpvyg8',\n      LOCALE:'sv-SE',\n      ORDER_STATUS:'checkout_incomplete',\n      MERCHANT_NAME:'Your business name',\n      GUI_OPTIONS:[],\n      ALLOW_SEPARATE_SHIPPING_ADDRESS:true,\n      PURCHASE_COUNTRY:'swe',\n      PURCHASE_CURRENCY:'SEK',\n      TESTDRIVE:true,\n      BOOTSTRAP_SRC:'https://js.playground.klarna.com/kcoc/210406-5b55ab3/checkout.bootstrap.js',\n      CLIENT_EVENT_HOST:'https://eu.playground.klarnaevt.com'\n    };\n    n=d.createElement('script');\n    c=d.getElementById(i);\n    n.async=!0;\n    n.src=l.BOOTSTRAP_SRC;\n    c.appendChild(n);\n    try{\n      ((w.Image && (new w.Image))||(d.createElement && d.createElement('img'))||{}).src =\n        l.CLIENT_EVENT_HOST + '/v1/checkout/snippet/load' +\n        '?sid=' + l.ORDER_URL.split('/').slice(-1) +\n        '&order_status=' + w.encodeURIComponent(l.ORDER_STATUS) +\n        '&timestamp=' + (new Date).getTime();\n    }catch(e){}\n    reloadCheckoutHandler = function () {\n        try{\n            ((w.Image && (new w.Image))||(d.createElement && d.createElement('img'))||{}).src =\n            l.CLIENT_EVENT_HOST+'/v1/checkout/snippet/reload?sid='+l.ORDER_URL.split('/').slice(-1)+\n            '&order_status='+w.encodeURIComponent(l.ORDER_STATUS)+'&timestamp='+(new Date()).getTime();\n            window.location.reload();\n        }catch(e){}\n    }\n  })(this,'_klarnaCheckout','klarna-checkout-container',document);\n  /* ]]> */\n  </script>\n  <noscript>\nPlease <a href=\"http://enable-javascript.com\">enable JavaScript</a>.\n  </noscript>\n</div>",
  "merchant_reference1": null,
  "merchant_reference2": null,
  "started_at": "2021-04-07T16:49:56Z",
  "completed_at": null,
  "last_modified_at": "2021-04-07T16:49:56Z",
  "options": {
    "acquiring_channel": null,
    "allow_separate_shipping_address": true,
    "color_button": "#ff69b4",
    "color_button_text": null,
    "color_checkbox": null,
    "color_checkbox_checkmark": null,
    "colorheader": null,
    "color_link": null,
    "date_of_birth_mandatory": true,
    "shipping_details": null,
    "title_mandatory": false,
    "additional_checkbox": null,
    "national_identification_number_mandatory": false,
    "additional_merchant_terms": null,
    "radius_border": null,
    "allowed_customer_types": null,
    "show_subtotal_detail": false,
    "additional_checkboxes": null,
    "require_validate_callback_success": false,
    "vat_excluded": false,
    "phone_mandatory": false
  },
  "attachment": null,
  "external_payment_methods": [
    {
      "name": "Swish",
      "redirect_url": "https://..../site.axd/KlarnaPayment/ChangePaymentMethod?PaymentProvider=Dibs&PaymentMethod=SE%20DIRECT_SWISH&RedirectUrl=%2Fsv-se%2Fkassa.PlaceOrderDirect",
      "image_url": null,
      "fee": 0,
      "description": null,
      "countries": null
    }
  ],
  "external_checkouts": [],
  "shipping_countries": null,
  "shipping_options": [
    {
      "id": "a21d1efe-4b53-41d0-81b3-2eb98677e0ee",
      "name": "KSS",
      "description": null,
      "promo": null,
      "price": 0,
      "tax_amount": 0,
      "tax_rate": 0,
      "preselected": false,
      "shipping_method": "Own",
      "delivery_details": {
        "carrier": null,
        "class": null,
        "product": null,
        "pickup_location": null,
        "timeslot": null
      },
      "tms_reference": null
    }
  ],
  "merchant_data": null,
  "gui": null,
  "merchant_requested": null,
  "selected_shipping_option": {
    "id": "a21d1efe-4b53-41d0-81b3-2eb98677e0ee",
    "name": "KSS",
    "description": null,
    "promo": null,
    "price": 0,
    "tax_amount": 0,
    "tax_rate": 0,
    "preselected": false,
    "shipping_method": "Own",
    "delivery_details": {
      "carrier": null,
      "class": null,
      "product": null,
      "pickup_location": null,
      "timeslot": null
    },
    "tms_reference": null
  },
  "recurring": false,
  "recurring_token": null,
  "recurring_description": null,
  "billing_countries": null,
  "tags": null
}

PaymentAccount info:

{
  "PaymentMethods": [
    "KlarnaCheckout",
    "KlarnaPaymentsHpp"
  ],
  "Id": "KCOV3_SE",
  "MerchantId": "....",
  "IsTestAccount": true,
  "IsKlarnaCheckoutEnabled": true,
  "IsKlarnaPaymentsHppEnabled": true,
  "IsKlarnaShippingServiceEnabled": true,
  "SalesCountry": "SE",
  "SharedSecret": "...."
}

Stack trace: (For tracing the caller method, this may not be an error!)

   at System.Environment.GetStackTrace(Exception e, Boolean needFileInfo)
   at System.Environment.get_StackTrace()
   at Litium.AddOns.Klarna.ExtensionMethods.CheckoutOrderDataExtensions.TraceLog(CheckoutOrder arg, PaymentAccountInfo paymentAccountInfo, String titleSuffix, String msg)
   at Litium.AddOns.Klarna.Kco.LitiumKcoApi.CreateOrUpdateKcoOrder(OrderCarrier orderCarrier, ExecutePaymentArgs args)
   at Litium.Accelerator.Mvc.App_Start.KlarnaPaymentConfigV3.KlarnaWidget.GetWidget(OrderCarrier order, PaymentInfoCarrier paymentInfo) in C:\Git\Src\Litium.Accelerator.Mvc\App_Start\KlarnaPaymentConfigV3.cs:line 321
   at Litium.Accelerator.Builders.Checkout.PaymentMethodViewModelBuilder.BuildWidget(String paymentMethodId) in C:\Git\Src\Litium.Accelerator\Builders\Checkout\PaymentMethodViewModelBuilder.cs:line 47
   at Litium.Accelerator.Mvc.Controllers.Api.CheckoutController.SetPaymentProvider(CheckoutViewModel model) in C:\Git\Src\Litium.Accelerator.Mvc\Controllers\Api\CheckoutController.cs:line 119
   at lambda_method(Closure , Object , Object[] )
   at System.Web.Http.Controllers.ReflectedHttpActionDescriptor.ActionExecutor.<>c__DisplayClass6_2.<GetExecutor>b__2(Object instance, Object[] methodParameters)
   at System.Web.Http.Controllers.ReflectedHttpActionDescriptor.ExecuteAsync(HttpControllerContext controllerContext, IDictionary`2 arguments, CancellationToken cancellationToken)
   at System.Web.Http.Controllers.ApiControllerActionInvoker.<InvokeActionAsyncCore>d__1.MoveNext()
   at System.Runtime.CompilerServices.AsyncTaskMethodBuilder`1.Start[TStateMachine](TStateMachine& stateMachine)
   at System.Web.Http.Controllers.ApiControllerActionInvoker.InvokeActionAsyncCore(HttpActionContext actionContext, CancellationToken cancellationToken)
   at System.Web.Http.Controllers.ApiControllerActionInvoker.InvokeActionAsync(HttpActionContext actionContext, CancellationToken cancellationToken)
   at System.Web.Http.Tracing.ITraceWriterExtensions.TraceBeginEndAsync[TResult](ITraceWriter traceWriter, HttpRequestMessage request, String category, TraceLevel level, String operatorName, String operationName, Action`1 beginTrace, Func`1 execute, Action`2 endTrace, Action`1 errorTrace)
   at System.Web.Http.Tracing.Tracers.HttpActionInvokerTracer.System.Web.Http.Controllers.IHttpActionInvoker.InvokeActionAsync(HttpActionContext actionContext, CancellationToken cancellationToken)
   at System.Web.Http.Controllers.ActionFilterResult.<>c.<ExecuteAsync>b__5_0(ActionInvoker innerInvoker)
   at System.Web.Http.Controllers.ActionFilterResult.<>c__DisplayClass7_0`1.<InvokeActionWithActionFilters>b__0()
   at System.Web.Http.Filters.ActionFilterAttribute.<CallOnActionExecutedAsync>d__6.MoveNext()
   at System.Runtime.CompilerServices.AsyncTaskMethodBuilder`1.Start[TStateMachine](TStateMachine& stateMachine)
   at System.Web.Http.Filters.ActionFilterAttribute.CallOnActionExecutedAsync(HttpActionContext actionContext, CancellationToken cancellationToken, Func`1 continuation)
   at System.Web.Http.Filters.ActionFilterAttribute.<ExecuteActionFilterAsyncCore>d__5.MoveNext()
   at System.Runtime.CompilerServices.AsyncTaskMethodBuilder`1.Start[TStateMachine](TStateMachine& stateMachine)
   at System.Web.Http.Filters.ActionFilterAttribute.ExecuteActionFilterAsyncCore(HttpActionContext actionContext, CancellationToken cancellationToken, Func`1 continuation)
   at System.Web.Http.Filters.ActionFilterAttribute.System.Web.Http.Filters.IActionFilter.ExecuteActionFilterAsync(HttpActionContext actionContext, CancellationToken cancellationToken, Func`1 continuation)
   at System.Web.Http.Controllers.ActionFilterResult.<ExecuteAsync>d__5.MoveNext()
   at System.Runtime.CompilerServices.AsyncTaskMethodBuilder`1.Start[TStateMachine](TStateMachine& stateMachine)
   at System.Web.Http.Controllers.ActionFilterResult.ExecuteAsync(CancellationToken cancellationToken)
   at Litium.Accelerator.Mvc.Attributes.ApiValidateAntiForgeryTokenAttribute.ExecuteAuthorizationFilterAsync(HttpActionContext actionContext, CancellationToken cancellationToken, Func`1 continuation) in C:\Git\Src\Litium.Accelerator.Mvc\Attributes\ApiValidateAntiForgeryTokenAttribute.cs:line 47
   at System.Web.Http.Controllers.AuthorizationFilterResult.ExecuteAsync(CancellationToken cancellationToken)
   at System.Web.Http.Controllers.ExceptionFilterResult.<ExecuteAsync>d__6.MoveNext()
   at System.Runtime.CompilerServices.AsyncTaskMethodBuilder`1.Start[TStateMachine](TStateMachine& stateMachine)
   at System.Web.Http.Controllers.ExceptionFilterResult.ExecuteAsync(CancellationToken cancellationToken)
   at System.Web.Http.ApiController.ExecuteAsync(HttpControllerContext controllerContext, CancellationToken cancellationToken)
   at System.Web.Http.Tracing.Tracers.HttpControllerTracer.<ExecuteAsyncCore>d__10.MoveNext()
   at System.Runtime.CompilerServices.AsyncTaskMethodBuilder`1.Start[TStateMachine](TStateMachine& stateMachine)
   at System.Web.Http.Tracing.Tracers.HttpControllerTracer.ExecuteAsyncCore(HttpControllerContext controllerContext, CancellationToken cancellationToken)
   at System.Web.Http.Tracing.ITraceWriterExtensions.TraceBeginEndAsync[TResult](ITraceWriter traceWriter, HttpRequestMessage request, String category, TraceLevel level, String operatorName, String operationName, Action`1 beginTrace, Func`1 execute, Action`2 endTrace, Action`1 errorTrace)
   at System.Web.Http.Tracing.Tracers.HttpControllerTracer.System.Web.Http.Controllers.IHttpController.ExecuteAsync(HttpControllerContext controllerContext, CancellationToken cancellationToken)
   at System.Web.Http.Dispatcher.HttpControllerDispatcher.<SendAsync>d__15.MoveNext()
   at System.Runtime.CompilerServices.AsyncTaskMethodBuilder`1.Start[TStateMachine](TStateMachine& stateMachine)
   at System.Web.Http.Dispatcher.HttpControllerDispatcher.SendAsync(HttpRequestMessage request, CancellationToken cancellationToken)
   at System.Net.Http.HttpMessageInvoker.SendAsync(HttpRequestMessage request, CancellationToken cancellationToken)
   at System.Web.Http.Dispatcher.HttpRoutingDispatcher.SendAsync(HttpRequestMessage request, CancellationToken cancellationToken)
   at System.Net.Http.DelegatingHandler.SendAsync(HttpRequestMessage request, CancellationToken cancellationToken)
   at Litium.Accelerator.Mvc.Routing.RequestModelHandler.SendAsync(HttpRequestMessage request, CancellationToken cancellationToken) in C:\Git\Src\Litium.Accelerator.Mvc\Routing\RequestModelHandler.cs:line 123
   at System.Net.Http.DelegatingHandler.SendAsync(HttpRequestMessage request, CancellationToken cancellationToken)
   at System.Web.Http.Tracing.Tracers.MessageHandlerTracer.<>c__DisplayClass6_0.<SendAsync>b__0()
   at System.Web.Http.Tracing.ITraceWriterExtensions.TraceBeginEndAsync[TResult](ITraceWriter traceWriter, HttpRequestMessage request, String category, TraceLevel level, String operatorName, String operationName, Action`1 beginTrace, Func`1 execute, Action`2 endTrace, Action`1 errorTrace)
   at System.Web.Http.Tracing.Tracers.MessageHandlerTracer.SendAsync(HttpRequestMessage request, CancellationToken cancellationToken)
   at System.Net.Http.DelegatingHandler.SendAsync(HttpRequestMessage request, CancellationToken cancellationToken)
   at Litium.Web.WebApi.CachingHandler.<SendAsync>d__0.MoveNext()
   at System.Runtime.CompilerServices.AsyncTaskMethodBuilder`1.Start[TStateMachine](TStateMachine& stateMachine)
   at Litium.Web.WebApi.CachingHandler.SendAsync(HttpRequestMessage request, CancellationToken cancellationToken)
   at System.Net.Http.DelegatingHandler.SendAsync(HttpRequestMessage request, CancellationToken cancellationToken)
   at System.Web.Http.Tracing.Tracers.MessageHandlerTracer.<>c__DisplayClass6_0.<SendAsync>b__0()
   at System.Web.Http.Tracing.ITraceWriterExtensions.TraceBeginEndAsync[TResult](ITraceWriter traceWriter, HttpRequestMessage request, String category, TraceLevel level, String operatorName, String operationName, Action`1 beginTrace, Func`1 execute, Action`2 endTrace, Action`1 errorTrace)
   at System.Web.Http.Tracing.Tracers.MessageHandlerTracer.SendAsync(HttpRequestMessage request, CancellationToken cancellationToken)
   at System.Net.Http.DelegatingHandler.SendAsync(HttpRequestMessage request, CancellationToken cancellationToken)
   at Litium.Web.WebApi.CorrelationIdHandler.<SendAsync>d__0.MoveNext()
   at System.Runtime.CompilerServices.AsyncTaskMethodBuilder`1.Start[TStateMachine](TStateMachine& stateMachine)
   at Litium.Web.WebApi.CorrelationIdHandler.SendAsync(HttpRequestMessage request, CancellationToken cancellationToken)
   at System.Net.Http.DelegatingHandler.SendAsync(HttpRequestMessage request, CancellationToken cancellationToken)
   at System.Web.Http.Tracing.Tracers.MessageHandlerTracer.<>c__DisplayClass6_0.<SendAsync>b__0()
   at System.Web.Http.Tracing.ITraceWriterExtensions.TraceBeginEndAsync[TResult](ITraceWriter traceWriter, HttpRequestMessage request, String category, TraceLevel level, String operatorName, String operationName, Action`1 beginTrace, Func`1 execute, Action`2 endTrace, Action`1 errorTrace)
   at System.Web.Http.Tracing.Tracers.MessageHandlerTracer.SendAsync(HttpRequestMessage request, CancellationToken cancellationToken)
   at System.Net.Http.DelegatingHandler.SendAsync(HttpRequestMessage request, CancellationToken cancellationToken)
   at Litium.Web.WebApi.MethodOverrideHandler.SendAsync(HttpRequestMessage request, CancellationToken cancellationToken)
   at System.Net.Http.DelegatingHandler.SendAsync(HttpRequestMessage request, CancellationToken cancellationToken)
   at System.Web.Http.Tracing.Tracers.MessageHandlerTracer.<>c__DisplayClass6_0.<SendAsync>b__0()
   at System.Web.Http.Tracing.ITraceWriterExtensions.TraceBeginEndAsync[TResult](ITraceWriter traceWriter, HttpRequestMessage request, String category, TraceLevel level, String operatorName, String operationName, Action`1 beginTrace, Func`1 execute, Action`2 endTrace, Action`1 errorTrace)
   at System.Web.Http.Tracing.Tracers.MessageHandlerTracer.SendAsync(HttpRequestMessage request, CancellationToken cancellationToken)
   at System.Net.Http.DelegatingHandler.SendAsync(HttpRequestMessage request, CancellationToken cancellationToken)
   at System.Web.Http.Tracing.Tracers.RequestMessageHandlerTracer.<>c__DisplayClass2_0.<SendAsync>b__1()
   at System.Web.Http.Tracing.ITraceWriterExtensions.TraceBeginEndAsync[TResult](ITraceWriter traceWriter, HttpRequestMessage request, String category, TraceLevel level, String operatorName, String operationName, Action`1 beginTrace, Func`1 execute, Action`2 endTrace, Action`1 errorTrace)
   at System.Web.Http.Tracing.Tracers.RequestMessageHandlerTracer.SendAsync(HttpRequestMessage request, CancellationToken cancellationToken)
   at System.Net.Http.DelegatingHandler.SendAsync(HttpRequestMessage request, CancellationToken cancellationToken)
   at System.Web.Http.HttpServer.<SendAsync>d__24.MoveNext()
   at System.Runtime.CompilerServices.AsyncTaskMethodBuilder`1.Start[TStateMachine](TStateMachine& stateMachine)
   at System.Web.Http.HttpServer.SendAsync(HttpRequestMessage request, CancellationToken cancellationToken)
   at System.Net.Http.HttpMessageInvoker.SendAsync(HttpRequestMessage request, CancellationToken cancellationToken)
   at System.Web.Http.Owin.HttpMessageHandlerAdapter.<InvokeCore>d__20.MoveNext()
   at System.Runtime.CompilerServices.AsyncTaskMethodBuilder.Start[TStateMachine](TStateMachine& stateMachine)
   at System.Web.Http.Owin.HttpMessageHandlerAdapter.InvokeCore(IOwinContext context, IOwinRequest owinRequest, IOwinResponse owinResponse)
   at Microsoft.Owin.Host.SystemWeb.IntegratedPipeline.IntegratedPipelineContextStage.<RunApp>d__7.MoveNext()
   at System.Runtime.CompilerServices.AsyncTaskMethodBuilder.Start[TStateMachine](TStateMachine& stateMachine)
   at Microsoft.Owin.Host.SystemWeb.IntegratedPipeline.IntegratedPipelineContextStage.RunApp(Func`2 entryPoint, IDictionary`2 environment, TaskCompletionSource`1 tcs, StageAsyncResult result)
   at Microsoft.Owin.Host.SystemWeb.IntegratedPipeline.IntegratedPipelineContextStage.BeginEvent(Object sender, EventArgs e, AsyncCallback cb, Object extradata)
   at System.Web.HttpApplication.AsyncEventExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute()
   at System.Web.HttpApplication.ExecuteStepImpl(IExecutionStep step)
   at System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously)
   at System.Web.HttpApplication.PipelineStepManager.ResumeSteps(Exception error)
   at System.Web.HttpApplication.BeginProcessRequestNotification(HttpContext context, AsyncCallback cb)
   at System.Web.HttpRuntime.ProcessRequestNotificationPrivate(IIS7WorkerRequest wr, HttpContext context)
   at System.Web.Hosting.PipelineRuntime.ProcessRequestNotificationHelper(IntPtr rootedObjectsPointer, IntPtr nativeRequestContext, IntPtr moduleData, Int32 flags)
   at System.Web.Hosting.PipelineRuntime.ProcessRequestNotification(IntPtr rootedObjectsPointer, IntPtr nativeRequestContext, IntPtr moduleData, Int32 flags)
   at System.Web.Hosting.UnsafeIISMethods.MgdIndicateCompletion(IntPtr pHandler, RequestNotificationStatus& notificationStatus)
   at System.Web.Hosting.UnsafeIISMethods.MgdIndicateCompletion(IntPtr pHandler, RequestNotificationStatus& notificationStatus)
   at System.Web.Hosting.PipelineRuntime.ProcessRequestNotificationHelper(IntPtr rootedObjectsPointer, IntPtr nativeRequestContext, IntPtr moduleData, Int32 flags)
   at System.Web.Hosting.PipelineRuntime.ProcessRequestNotification(IntPtr rootedObjectsPointer, IntPtr nativeRequestContext, IntPtr moduleData, Int32 flags)

Those lines are from the Klarna addon trace logging, so it’s not an error, just a logging of the current values.

Shipping attributes are not set automatically, so you can create them in that method.

foreach (var orderLine in klarnaCheckoutOrder.OrderLines)
{
	orderLine.ShippingAttributes = new ShippingAttributes
	{
		Weight = 500,
	};    
}
  "order_lines": [
    {
      "type": "physical",
      "reference": "637224826069117379-10653104-0000-001",
      "name": "Greet New Shirt Black",
      "quantity": 1,
      "quantity_unit": "nos",
      "unit_price": 11920,
      "tax_rate": 2500,
      "total_amount": 11920,
      "total_discount_amount": 0,
      "total_tax_amount": 2384,
      "merchant_data": null,
      "product_url": null,
      "image_url": null,
      "product_identifiers": null,
      "shipping_attributes": {
        "weight": 500,
        "dimensions": null,
        "tags": null
      }
    },
    ...

My bad! Didn’t know I have to create them! I will try with that :pray:

Hi again!

I added weight but I’m not sure if it’s sent to Klarna. How can I check that?

Klarna will receives data from the UpdateDataSentToKlarna method before rendering the checkout page - correct?

If traceMode is enabled you can see it logged in the Litium log file. That’s what you shared earlier above.

And yes, the data is added before.

1 Like

We are checking with Unifaun & Klarna because we are still not getting any shipping methods using their test account that has rules based on weights.

But related to this, we are using another test-account where we are getting shipping methods. However we want the PreparedShipmentId that should be returned (from my discussions with Unifaun). We cannot find a key for this but maybe its hidden in some other field name.

There is no information regarding this in:
Klarna Shipping Service or Unifaun DeliveryCheckout Klarna

Found this on Klarna documentation:

But still isnt clear where we will find PreparedShipmentId Any ideas?

This is returned as the tms_reference as described here: FAQ - Klarna Shipping Assistant | Official Klarna Technical Documentation

It’s saved to the delivery’s additional delivery info with they key TmsReference.

1 Like

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