Developer forum

Forum » Development » unable to complete order through dwapi on DW 9.13.2

unable to complete order through dwapi on DW 9.13.2

Mikkel Hammer
Mikkel Hammer
Reply

Hi DW,

Im trying to complete an order through the dwapi on 9.13.2, and we're getting this error.

{
    "Message""An error has occurred.",
    "ExceptionMessage""Object reference not set to an instance of an object.",
    "ExceptionType""System.NullReferenceException",
    "StackTrace""   at Dynamicweb.Ecommerce.Orders.OrderFieldValue.set_Value(Object value)\r\n   at Dynamicweb.Ecommerce.Frontend.Cart.CartService.UpdateCartFromModel(Order cart, OrderViewModel cartModel)\r\n   at Dynamicweb.Ecommerce.WebAPI.Controllers.CartsController.CreateOrder(String secret, OrderViewModel cartModel)\r\n   at lambda_method(Closure , Object , Object[] )\r\n   at System.Web.Http.Controllers.ReflectedHttpActionDescriptor.ActionExecutor.<>c__DisplayClass10.<GetExecutor>b__9(Object instance, Object[] methodParameters)\r\n   at System.Web.Http.Controllers.ReflectedHttpActionDescriptor.ExecuteAsync(HttpControllerContext controllerContext, IDictionary`2 arguments, CancellationToken cancellationToken)\r\n--- End of stack trace from previous location where exception was thrown ---\r\n   at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()\r\n   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)\r\n   at System.Web.Http.Controllers.ApiControllerActionInvoker.<InvokeActionAsyncCore>d__0.MoveNext()\r\n--- End of stack trace from previous location where exception was thrown ---\r\n   at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()\r\n   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)\r\n   at System.Web.Http.Filters.ActionFilterAttribute.<CallOnActionExecutedAsync>d__5.MoveNext()\r\n--- End of stack trace from previous location where exception was thrown ---\r\n   at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()\r\n   at System.Web.Http.Filters.ActionFilterAttribute.<CallOnActionExecutedAsync>d__5.MoveNext()\r\n--- End of stack trace from previous location where exception was thrown ---\r\n   at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()\r\n   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)\r\n   at System.Web.Http.Filters.ActionFilterAttribute.<ExecuteActionFilterAsyncCore>d__0.MoveNext()\r\n--- End of stack trace from previous location where exception was thrown ---\r\n   at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()\r\n   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)\r\n   at System.Web.Http.Controllers.ActionFilterResult.<ExecuteAsync>d__2.MoveNext()\r\n--- End of stack trace from previous location where exception was thrown ---\r\n   at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()\r\n   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)\r\n   at System.Web.Http.Dispatcher.HttpControllerDispatcher.<SendAsync>d__1.MoveNext()"
}

here are the steps to recreate it:
create the cart: https://svsshop.websrv01.smartpage.dk/dwapi/ecommerce/carts?CurrencyCode=DKK&CountryCode=DK&LanguageId=LANG1
add product: https://svsshop.websrv01.smartpage.dk/dwapi/ecommerce/carts/8106a0cda70342058a34839c44fde1f5/items/ with body:
{
    "ProductId""SGK070",
    "ProductVariantId""SP10642.SP5786",
    "Quantity"1
}
complete cart: https://svsshop.websrv01.smartpage.dk/dwapi/ecommerce/carts/8106a0cda70342058a34839c44fde1f5/createorder with body:
{
    "Id""CART18168",
    "SecondaryUserName""",
    "Secret""8106a0cda70342058a34839c44fde1f5",
    "ShopId""",
    "DisplayName""",
    "VoucherCode""",
    "CreatedAt""2022-03-18T18:19:51.91",
    "Modified""2022-03-18T18:58:38.0725361+01:00",
    "Completed"false,
    "StateId""",
    "IntegrationOrderId""",
    "RecurringOrderId"0,
    "CustomerUserId"33119,
    "CustomerNumber""100083",
    "CustomerEan""",
    "CustomerRefId""",
    "CustomerCompany""Test user SVS",
    "CustomerTitle""",
    "CustomerName""Test user",
    "CustomerFirstName""",
    "CustomerSurname""",
    "CustomerMiddleName""",
    "CustomerHouseNumber""",
    "CustomerInitials""",
    "CustomerPrefix""",
    "CustomerAddress": "Test address 123",
    "CustomerAddress2""",
    "CustomerZip""4621",
    "CustomerCity""GADSTRUP",
    "CustomerCountry""Denmark",
    "CustomerCountryCode""DK",
    "CustomerRegion""",
    "CustomerPhone""*",
    "CustomerEmail""test.user@svsshop.com",
    "CustomerCell""",
    "CustomerAccepted"false,
    "CustomerComment""",
    "DeliveryCompany""",
    "DeliveryName""",
    "DeliveryFirstName""",
    "DeliverySurname""",
    "DeliveryMiddleName""",
    "DeliveryTitle""",
    "DeliveryHouseNumber""",
    "DeliveryInitials""",
    "DeliveryPrefix""",
    "DeliveryAddress""",
    "DeliveryAddress2""",
    "DeliveryZip""",
    "DeliveryCity""",
    "DeliveryCountry""",
    "DeliveryCountryCode""",
    "DeliveryRegion""",
    "DeliveryPhone""",
    "DeliveryEmail""",
    "DeliveryCell""",
    "Reference""",
    "TransactionCardnumber""",
    "TransactionCardType""",
    "TransactionNumber""",
    "TransactionStatus""",
    "TrackAndTraceName""",
    "TrackAndTraceURL""",
    "TrackAndTraceNumber""",
    "OrderLines": [
        {
            "Id""OL326828",
            "ProductId""SGK070",
            "ProductVariantId""SP10642.SP5786",
            "ProductLanguageId""LANG1",
            "ProductName""SANDEEL V2 12CM 22G SINKING BLUE PEARL SILVER 2+1",
            "ProductNumber""72491",
            "ProductVariantName""12CM / 22G - BLUE PEARL SILVER",
            "ProductImage""/Files/Images/missing_image.jpg",
            "PrimaryOrDefaultGroup": {
                "Id""SPSHOP12-10447",
                "Name""Ready-to-fish"
            },
            "Quantity"1.0,
            "OrderLineFields": {},
            "Price": {
                "Price"12.37,
                "PriceFormatted""kr. 12,37",
                "PriceWithoutVat"12.37,
                "PriceWithoutVatFormatted""kr. 12,37",
                "PriceWithVat"15.2151,
                "PriceWithVatFormatted""kr. 15,22",
                "Vat"2.8451,
                "VatFormatted""kr. 2,85",
                "VATPercent"23.0,
                "VATPercentFormatted""23%",
                "CurrencyCode""EUR"
            },
            "UnitPrice": {
                "Price"12.37,
                "PriceFormatted""kr. 12,37",
                "PriceWithoutVat"12.37,
                "PriceWithoutVatFormatted""kr. 12,37",
                "PriceWithVat"15.2151,
                "PriceWithVatFormatted""kr. 15,22",
                "Vat"2.8451,
                "VatFormatted""kr. 2,85",
                "VATPercent"23.0,
                "VATPercentFormatted""23%",
                "CurrencyCode""EUR"
            },
            "UnitPriceBeforeDiscount": {
                "PriceFormatted""kr. 0,00",
                "PriceWithoutVatFormatted""kr. 0,00",
                "PriceWithVatFormatted""kr. 0,00",
                "VatFormatted""kr. 0,00",
                "VATPercent"23.0,
                "VATPercentFormatted""23%",
                "CurrencyCode""EUR"
            },
            "TotalDiscount": {
                "PriceFormatted""kr. 0,00",
                "PriceWithoutVatFormatted""kr. 0,00",
                "PriceWithVatFormatted""kr. 0,00",
                "VatFormatted""kr. 0,00",
                "VATPercentFormatted""0%",
                "CurrencyCode""EUR"
            }
        }
    ],
    "OrderFields": {
        "SpAxOrderStatus": {
            "SystemName""SpAxOrderStatus",
            "Name""Order status",
            "Type""Text(255)"
        },
        "SpAxIsAxOrder": {
            "SystemName""SpAxIsAxOrder",
            "Name""Order is from AX",
            "Type""Checkbox"
        },
        "AXMiscFee": {
            "SystemName""AXMiscFee",
            "Name""AXMiscellaneousFee",
            "Type"""
        },
        "AXMiscText": {
            "SystemName""AXMiscText",
            "Name""AXMiscellaneousText",
            "Type"""
        },
        "AXDeliveryFee": {
            "SystemName""AXDeliveryFee",
            "Name""AXDeliveryFee",
            "Type"""
        },
        "AXTotalDiscount": {
            "SystemName""AXTotalDiscount",
            "Name""AXTotalDiscount",
            "Type"""
        },
        "AXDeliveryFeeTax": {
            "SystemName""AXDeliveryFeeTax",
            "Name""AXDeliveryFeeTax",
            "Type"""
        },
        "AXVoucherDisc": {
            "SystemName""AXVoucherDisc",
            "Name""AXVoucherDisc",
            "Type"""
        },
        "SpAxFirstAvailableDeliveryDate": {
            "SystemName""SpAxFirstAvailableDeliveryDate",
            "Name""First available delivery date",
            "Type""Date"
        },
        "SpAxChosenDeliveryDate": {
            "SystemName""SpAxChosenDeliveryDate",
            "Name""Chosen delivery date",
            "Type""Date"
        },
        "SpAxLastKnownVoucherValue": {
            "SystemName""SpAxLastKnownVoucherValue",
            "Name""Last known voucher value",
            "Type""Text(255)"
        },
        "SpGeneratedQuote": {
            "SystemName""SpGeneratedQuote",
            "Name""Sp generated quote",
            "Type""Checkbox"
        },
        "SpAxDWOrderId": {
            "SystemName""SpAxDWOrderId",
            "Name""Order Id from AX",
            "Type""Text(50)"
        },
        "SpAxIsJustImported": {
            "SystemName""SpAxIsJustImported",
            "Name""Order just imported from AX",
            "Type""Checkbox"
        },
        "SpAxUnknownDeliveryDate": {
            "SystemName""SpAxUnknownDeliveryDate",
            "Name""Unknown delivery date",
            "Type""Checkbox"
        }
    },
    "TotalDiscount": {
        "PriceFormatted""kr. 0,00",
        "PriceWithoutVatFormatted""kr. 0,00",
        "PriceWithVatFormatted""kr. 0,00",
        "VatFormatted""kr. 0,00",
        "VATPercentFormatted""0%",
        "CurrencyCode""EUR"
    },
    "TotalProductDiscount": {
        "PriceFormatted""kr. 0,00",
        "PriceWithoutVatFormatted""kr. 0,00",
        "PriceWithVatFormatted""kr. 0,00",
        "VatFormatted""kr. 0,00",
        "VATPercentFormatted""0%",
        "CurrencyCode""EUR"
    },
    "TotalOrderDiscount": {
        "PriceFormatted""kr. 0,00",
        "PriceWithoutVatFormatted""kr. 0,00",
        "PriceWithVatFormatted""kr. 0,00",
        "VatFormatted""kr. 0,00",
        "VATPercentFormatted""0%",
        "CurrencyCode""EUR"
    },
    "Price": {
        "Price"111.37,
        "PriceFormatted""kr. 111,37",
        "PriceWithoutVat"111.37,
        "PriceWithoutVatFormatted""kr. 111,37",
        "PriceWithVat"136.9851,
        "PriceWithVatFormatted""kr. 136,99",
        "Vat"25.6151,
        "VatFormatted""kr. 25,62",
        "VATPercent"23.0,
        "VATPercentFormatted""23%",
        "CurrencyCode""EUR"
    },
    "PriceBeforeFees": {
        "Price"12.37,
        "PriceFormatted""kr. 12,37",
        "PriceWithoutVat"12.37,
        "PriceWithoutVatFormatted""kr. 12,37",
        "PriceWithVat"15.2151,
        "PriceWithVatFormatted""kr. 15,22",
        "Vat"2.8451,
        "VatFormatted""kr. 2,85",
        "VATPercent"23.0,
        "VATPercentFormatted""23%",
        "CurrencyCode""EUR"
    },
    "TotalPriceBeforeFeesAndTaxes": {
        "Price"12.370000000000005,
        "PriceFormatted""kr. 12,37",
        "PriceWithoutVat"12.370000000000005,
        "PriceWithoutVatFormatted""kr. 12,37",
        "PriceWithVat"15.215099999999993,
        "PriceWithVatFormatted""kr. 15,22",
        "Vat"2.8451,
        "VatFormatted""kr. 2,85",
        "VATPercent"23.0,
        "VATPercentFormatted""23%",
        "CurrencyCode""EUR"
    },
    "TotalTaxes": {
        "PriceFormatted""kr. 0,00",
        "PriceWithoutVatFormatted""kr. 0,00",
        "PriceWithVatFormatted""kr. 0,00",
        "VatFormatted""kr. 0,00",
        "VATPercentFormatted""0%",
        "CurrencyCode""EUR"
    },
    "ShippingFee": {
        "Price"99.0,
        "PriceFormatted""kr. 99,00",
        "PriceWithoutVat"99.0,
        "PriceWithoutVatFormatted""kr. 99,00",
        "PriceWithVat"121.77,
        "PriceWithVatFormatted""kr. 121,77",
        "Vat"22.77,
        "VatFormatted""kr. 22,77",
        "VATPercent"23.0,
        "VATPercentFormatted""23%",
        "CurrencyCode""EUR"
    },
    "ShippingMethod": {
        "Id""SHIP24",
        "Name""Test Fragt",
        "Description""",
        "Icon""",
        "PriceOverMaxWeight"99.0,
        "FreeFeeAmount"3000.0,
        "Code""",
        "AgentCode""",
        "AgentName""",
        "AgentServiceCode""",
        "AgentServiceDescription"""
    },
    "PaymentMethod": {
        "Id""PAY3",
        "Name""Invoice",
        "Description""",
        "Icon""",
        "Code""",
        "TermsCode""",
        "TermsDescription"""
    },
    "PaymentFee": {
        "PriceFormatted""kr. 0,00",
        "PriceWithoutVatFormatted""kr. 0,00",
        "PriceWithVatFormatted""kr. 0,00",
        "VatFormatted""kr. 0,00",
        "VATPercentFormatted""0%",
        "CurrencyCode""EUR"
    }
}

We haven't been able to test on 9.13.3 since you can't access cart after adding a product atm (but you already fixed that for next ecommerce nuget release)
EDIT: i just tested on 9.13.3 by getting a cart via the dwapi on 9.13.2, and then rebuilding on 9.13.3 and then trying to use the /createorder endpoint, and it results in the same error.
{
    "Message""An error has occurred.",
    "ExceptionMessage""Object reference not set to an instance of an object.",
    "ExceptionType""System.NullReferenceException",
    "StackTrace""   at Dynamicweb.Ecommerce.Orders.OrderFieldValue.set_Value(Object value)\r\n   at Dynamicweb.Ecommerce.Frontend.Cart.CartService.UpdateCartFromModel(Order cart, OrderViewModel cartModel)\r\n   at Dynamicweb.Ecommerce.WebAPI.Controllers.CartsController.CreateOrder(String secret, OrderViewModel cartModel)\r\n   at lambda_method(Closure , Object , Object[] )\r\n   at System.Web.Http.Controllers.ReflectedHttpActionDescriptor.ActionExecutor.<>c__DisplayClass10.<GetExecutor>b__9(Object instance, Object[] methodParameters)\r\n   at System.Web.Http.Controllers.ReflectedHttpActionDescriptor.ExecuteAsync(HttpControllerContext controllerContext, IDictionary`2 arguments, CancellationToken cancellationToken)\r\n--- End of stack trace from previous location where exception was thrown ---\r\n   at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()\r\n   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)\r\n   at System.Web.Http.Controllers.ApiControllerActionInvoker.<InvokeActionAsyncCore>d__0.MoveNext()\r\n--- End of stack trace from previous location where exception was thrown ---\r\n   at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()\r\n   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)\r\n   at System.Web.Http.Filters.ActionFilterAttribute.<CallOnActionExecutedAsync>d__5.MoveNext()\r\n--- End of stack trace from previous location where exception was thrown ---\r\n   at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()\r\n   at System.Web.Http.Filters.ActionFilterAttribute.<CallOnActionExecutedAsync>d__5.MoveNext()\r\n--- End of stack trace from previous location where exception was thrown ---\r\n   at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()\r\n   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)\r\n   at System.Web.Http.Filters.ActionFilterAttribute.<ExecuteActionFilterAsyncCore>d__0.MoveNext()\r\n--- End of stack trace from previous location where exception was thrown ---\r\n   at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()\r\n   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)\r\n   at System.Web.Http.Controllers.ActionFilterResult.<ExecuteAsync>d__2.MoveNext()\r\n--- End of stack trace from previous location where exception was thrown ---\r\n   at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()\r\n   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)\r\n   at System.Web.Http.Dispatcher.HttpControllerDispatcher.<SendAsync>d__1.MoveNext()"
}


Hope you can help us out.


Best regards,
Mikkel

Replies

 
Matthias Sebastian Sort Dynamicweb Employee
Matthias Sebastian Sort
Reply

Hi Mikkel,

I can see that the /createorder endpoint calls the same function as I changed on your previus post, so my guess would be that is where the error occures. Once it has been release, try and see if that will fix the problem, if not, write again. :)

It's calling that function at the end of the code, so maybe you can already check in your backend and see if the cart has been upgrated to an order, if not then it's another bug/error?

BR

Matthias Sort

 
Mikkel Hammer
Mikkel Hammer
Reply

Hi Matthias,

Hopefully it fixes it, i'll make sure to get back if it doesn't!

It seems like it doesn't upgrade it to an order.


This is the log for the cart:


Best regards,
Mikkel

 
Matthias Sebastian Sort Dynamicweb Employee
Matthias Sebastian Sort
Reply

Hi Mikkel,

After looking into the error-msg you recieved, and also that your cart does not being upgradet to an order, then I think the error is located at your "OrderFields".. I don't have yours at my own local solution, but looking at your request some of them doesn't have a "type"? although I don't think adding types in your request will fix the error, but it could indicate something about your stored once at your solution are broken? :)

The other bugfix has now been released, but on version 1.13.25, so try it out and see if this does anything for you :)

BR

Matthias Sort

 
Mikkel Hammer
Mikkel Hammer
Reply

Hi Matthias,

Seems like the bugfix for the other problem fixed the issue here aswell, atleast the NullRefence error it returned.

Using the steps showed in the first post here, i tried creating a new cart, adding a product and then completing the order, the post request return 200 Ok.
But in the response message i noticed the Cart gets a new id and Completed is still false.



When i check in the administration, i now see the two Carts aswell.



The original cart Cart18177 has no products and nothing in the log. Looks like the cart isn't deleted correctly i guess.





The new cart Cart18178 has the product and log:



Looking at the log, it makes sense that that the order doens't complete since there are errors. But i guess it a bit confusing that the original cart is still there, but empty and the result code is 200 Ok on the request.

I'll look into the thing that you mentioned with the OrderFields that might be the cause of the problem and return back.
But we did have it working with completing an order through the dwapi with the current OrderFields in the cart before, after it got fixed in this post.


Best regards,
Mikkel

 
Mikkel Hammer
Mikkel Hammer
Reply

This no success after adding types to all OrderFields.

{
    "Id""CART18185",
    "ParentOrderId""",
    "SecondaryUserName""",
    "Secret""b39008525cef4c46b49ae6f1ee2477f2",
    "ShopId""",
    "DisplayName""",
    "VoucherCode""",
    "CreatedAt""2022-03-21T12:19:33.017",
    "Modified""2022-03-21T12:19:51.46",
    "Completed"false,
    "LedgerType""",
    "StateId""",
    "IntegrationOrderId""",
    "RecurringOrderId"0,
    "CustomerUserId"33119,
    "CustomerNumber""100083",
    "CustomerEan""",
    "CustomerRefId""",
    "CustomerCompany""Test user SVS",
    "CustomerTitle""",
    "CustomerName""Test user",
    "CustomerFirstName""",
    "CustomerSurname""",
    "CustomerMiddleName""",
    "CustomerHouseNumber""",
    "CustomerInitials""",
    "CustomerPrefix""",
    "CustomerAddress""Test address 2",
    "CustomerAddress2""",
    "CustomerZip""4621",
    "CustomerCity""GADSTRUP",
    "CustomerCountry""Denmark",
    "CustomerCountryCode""DK",
    "CustomerRegion""",
    "CustomerPhone""*",
    "CustomerEmail""testuser@svsshop.com",
    "CustomerCell""",
    "CustomerAccepted"false,
    "CustomerComment""",
    "DeliveryCompany""",
    "DeliveryName""",
    "DeliveryFirstName""",
    "DeliverySurname""",
    "DeliveryMiddleName""",
    "DeliveryTitle""",
    "DeliveryHouseNumber""",
    "DeliveryInitials""",
    "DeliveryPrefix""",
    "DeliveryAddress""",
    "DeliveryAddress2""",
    "DeliveryZip""",
    "DeliveryCity""",
    "DeliveryCountry""",
    "DeliveryCountryCode""",
    "DeliveryRegion""",
    "DeliveryPhone""",
    "DeliveryEmail""",
    "DeliveryCell""",
    "Reference""",
    "TransactionCardnumber""",
    "TransactionCardType""",
    "TransactionNumber""",
    "TransactionStatus""",
    "TrackAndTraceName""",
    "TrackAndTraceURL""",
    "TrackAndTraceNumber""",
    "OrderLines": [
        {
            "Id""OL326851",
            "ProductId""SGK070",
            "ProductVariantId""SP10642.SP5786",
            "ProductLanguageId""LANG1",
            "ProductName""SANDEEL V2 12CM 22G SINKING BLUE PEARL SILVER 2+1",
            "ProductNumber""72491",
            "ProductVariantName""12CM / 22G - BLUE PEARL SILVER",
            "ProductImage""/Files/Images/missing_image.jpg",
            "PrimaryOrDefaultGroup": {
                "Id""SPSHOP12-10447",
                "Name""Ready-to-fish"
            },
            "Reference""",
            "Quantity"1.0,
            "UnitId""",
            "UnitName""",
            "OrderLineFields": {},
            "Price": {
                "Price"12.37,
                "PriceFormatted""kr. 12,37",
                "PriceWithoutVat"12.37,
                "PriceWithoutVatFormatted""kr. 12,37",
                "PriceWithVat"15.2151,
                "PriceWithVatFormatted""kr. 15,22",
                "Vat"2.8451,
                "VatFormatted""kr. 2,85",
                "VATPercent"23.0,
                "VATPercentFormatted""23%",
                "CurrencyCode""EUR"
            },
            "UnitPrice": {
                "Price"12.37,
                "PriceFormatted""kr. 12,37",
                "PriceWithoutVat"12.37,
                "PriceWithoutVatFormatted""kr. 12,37",
                "PriceWithVat"15.2151,
                "PriceWithVatFormatted""kr. 15,22",
                "Vat"2.8451,
                "VatFormatted""kr. 2,85",
                "VATPercent"23.0,
                "VATPercentFormatted""23%",
                "CurrencyCode""EUR"
            },
            "UnitPriceBeforeDiscount": {
                "PriceFormatted""kr. 0,00",
                "PriceWithoutVatFormatted""kr. 0,00",
                "PriceWithVatFormatted""kr. 0,00",
                "VatFormatted""kr. 0,00",
                "VATPercent"23.0,
                "VATPercentFormatted""23%",
                "CurrencyCode""EUR"
            },
            "TotalDiscount": {
                "PriceFormatted""kr. 0,00",
                "PriceWithoutVatFormatted""kr. 0,00",
                "PriceWithVatFormatted""kr. 0,00",
                "VatFormatted""kr. 0,00",
                "VATPercentFormatted""0%",
                "CurrencyCode""EUR"
            }
        }
    ],
    "OrderFields": {
        "SpAxOrderStatus": {
            "SystemName""SpAxOrderStatus",
            "Name""Order status",
            "Type""Text(255)",
            "Value"""
        },
        "SpAxIsAxOrder": {
            "SystemName""SpAxIsAxOrder",
            "Name""Order is from AX",
            "Type""Checkbox",
            "Value"false
        },
        "AXMiscFee": {
            "SystemName""AXMiscFee",
            "Name""AXMiscellaneousFee",
            "Type""Decimal Number",
            "Value"0.0
        },
        "AXMiscText": {
            "SystemName""AXMiscText",
            "Name""AXMiscellaneousText",
            "Type""Text(255)",
            "Value"""
        },
        "AXDeliveryFee": {
            "SystemName""AXDeliveryFee",
            "Name""AXDeliveryFee",
            "Type""Decimal Number",
            "Value"0.0
        },
        "AXTotalDiscount": {
            "SystemName""AXTotalDiscount",
            "Name""AXTotalDiscount",
            "Type""Decimal Number",
            "Value"0.0
        },
        "AXDeliveryFeeTax": {
            "SystemName""AXDeliveryFeeTax",
            "Name""AXDeliveryFeeTax",
            "Type""Decimal Number",
            "Value"0.0
        },
        "AXVoucherDisc": {
            "SystemName""AXVoucherDisc",
            "Name""AXVoucherDisc",
            "Type""Decimal Number",
            "Value"0.0
        },
        "SpAxFirstAvailableDeliveryDate": {
            "SystemName""SpAxFirstAvailableDeliveryDate",
            "Name""First available delivery date",
            "Type""Date",
            "Value""1970-01-01T00:00:00"
        },
        "SpAxChosenDeliveryDate": {
            "SystemName""SpAxChosenDeliveryDate",
            "Name""Chosen delivery date",
            "Type""Date",
            "Value""1970-01-01T00:00:00"
        },
        "SpAxLastKnownVoucherValue": {
            "SystemName""SpAxLastKnownVoucherValue",
            "Name""Last known voucher value",
            "Type""Text(255)",
            "Value"""
        },
        "SpGeneratedQuote": {
            "SystemName""SpGeneratedQuote",
            "Name""Sp generated quote",
            "Type""Checkbox",
            "Value"false
        },
        "SpAxDWOrderId": {
            "SystemName""SpAxDWOrderId",
            "Name""Order Id from AX",
            "Type""Text(50)",
            "Value"""
        },
        "SpAxIsJustImported": {
            "SystemName""SpAxIsJustImported",
            "Name""Order just imported from AX",
            "Type""Checkbox",
            "Value"false
        },
        "SpAxUnknownDeliveryDate": {
            "SystemName""SpAxUnknownDeliveryDate",
            "Name""Unknown delivery date",
            "Type""Checkbox",
            "Value"false
        }
    },
    "TotalDiscount": {
        "PriceFormatted""kr. 0,00",
        "PriceWithoutVatFormatted""kr. 0,00",
        "PriceWithVatFormatted""kr. 0,00",
        "VatFormatted""kr. 0,00",
        "VATPercentFormatted""0%",
        "CurrencyCode""EUR"
    },
    "TotalProductDiscount": {
        "PriceFormatted""kr. 0,00",
        "PriceWithoutVatFormatted""kr. 0,00",
        "PriceWithVatFormatted""kr. 0,00",
        "VatFormatted""kr. 0,00",
        "VATPercentFormatted""0%",
        "CurrencyCode""EUR"
    },
    "TotalOrderDiscount": {
        "PriceFormatted""kr. 0,00",
        "PriceWithoutVatFormatted""kr. 0,00",
        "PriceWithVatFormatted""kr. 0,00",
        "VatFormatted""kr. 0,00",
        "VATPercentFormatted""0%",
        "CurrencyCode""EUR"
    },
    "Price": {
        "Price"111.37,
        "PriceFormatted""kr. 111,37",
        "PriceWithoutVat"111.37,
        "PriceWithoutVatFormatted""kr. 111,37",
        "PriceWithVat"136.9851,
        "PriceWithVatFormatted""kr. 136,99",
        "Vat"25.6151,
        "VatFormatted""kr. 25,62",
        "VATPercent"23.0,
        "VATPercentFormatted""23%",
        "CurrencyCode""EUR"
    },
    "PriceBeforeFees": {
        "Price"12.37,
        "PriceFormatted""kr. 12,37",
        "PriceWithoutVat"12.37,
        "PriceWithoutVatFormatted""kr. 12,37",
        "PriceWithVat"15.2151,
        "PriceWithVatFormatted""kr. 15,22",
        "Vat"2.8451,
        "VatFormatted""kr. 2,85",
        "VATPercent"23.0,
        "VATPercentFormatted""23%",
        "CurrencyCode""EUR"
    },
    "TotalPriceBeforeFeesAndTaxes": {
        "Price"12.370000000000005,
        "PriceFormatted""kr. 12,37",
        "PriceWithoutVat"12.370000000000005,
        "PriceWithoutVatFormatted""kr. 12,37",
        "PriceWithVat"15.215099999999993,
        "PriceWithVatFormatted""kr. 15,22",
        "Vat"2.8451,
        "VatFormatted""kr. 2,85",
        "VATPercent"23.0,
        "VATPercentFormatted""23%",
        "CurrencyCode""EUR"
    },
    "TotalTaxes": {
        "PriceFormatted""kr. 0,00",
        "PriceWithoutVatFormatted""kr. 0,00",
        "PriceWithVatFormatted""kr. 0,00",
        "VatFormatted""kr. 0,00",
        "VATPercentFormatted""0%",
        "CurrencyCode""EUR"
    },
    "ShippingFee": {
        "Price"99.0,
        "PriceFormatted""kr. 99,00",
        "PriceWithoutVat"99.0,
        "PriceWithoutVatFormatted""kr. 99,00",
        "PriceWithVat"121.77,
        "PriceWithVatFormatted""kr. 121,77",
        "Vat"22.77,
        "VatFormatted""kr. 22,77",
        "VATPercent"23.0,
        "VATPercentFormatted""23%",
        "CurrencyCode""EUR"
    },
    "ShippingMethod": {
        "Id""SHIP24",
        "Name""Test Fragt",
        "Description""",
        "Icon""",
        "PriceOverMaxWeight"99.0,
        "FreeFeeAmount"3000.0,
        "Code""",
        "AgentCode""",
        "AgentName""",
        "AgentServiceCode""",
        "AgentServiceDescription"""
    },
    "PaymentMethod": {
        "Id""PAY3",
        "Name""Invoice",
        "Description""",
        "Icon""",
        "Code""",
        "TermsCode""",
        "TermsDescription"""
    },
    "PaymentFee": {
        "PriceFormatted""kr. 0,00",
        "PriceWithoutVatFormatted""kr. 0,00",
        "PriceWithVatFormatted""kr. 0,00",
        "VatFormatted""kr. 0,00",
        "VATPercentFormatted""0%",
        "CurrencyCode""EUR"
    }
}
 
Matthias Sebastian Sort Dynamicweb Employee
Matthias Sebastian Sort
Reply

Hi Mikkel,

If you are using your input (copy/paste) from your forumpost then there is a missing " at your "CustomerAddress"Test address 123"" ("Test address 123" it should say :D), and if there is any errors in your json body it will not convert it to an OrderViewModel and then it will skip the function of UpdateCart.

seems like we posted at the same time.. I'll look into it :)

BR

Matthias Sort

 

 
Mikkel Hammer
Mikkel Hammer
Reply

Hi Matthias,

It's because i manually change it after to hide the customer name and address, my bad for the typo! :)

Best regards,
Mikkel

 
Matthias Sebastian Sort Dynamicweb Employee
Matthias Sebastian Sort
Reply

Hi Mikkel,

That's ok :)

I think I need someone elses help on this one, as I cannot reproduce it on my localhost with your inputs.. it's upgrading just fine here :(

I'm running on latest version (9.13.3), maybe that's why I have no errors? anyhow, I'll poke someone else at the office, and hopefully write back to you asap :)

BR

Matthias Sort

 
Mikkel Hammer
Mikkel Hammer
Reply

Hi Matthias,

Hmmm, i unfortunately don't have much more info to provide than the log provided in the administration which i already screenshotted...
Just an fyi, we're testing this on 9.13.3 now aswell since the other fix went through :)

Glad to hear you're trying get back asap

Best regard,
Mikkel

 
Vladimir Shushunov Dynamicweb Employee
Vladimir Shushunov
Reply

Hi guys,
I suppose that I had found a reason of bug: values for order fields are absent in createOrder post. This causes 'NullReferenceException'.

The otheer thing I had noticed is that order field values are empty after first 'add product post' and became filled after the second one.

I will register a task to fix these issues.

Btw: there is no need to send full order body in createorder request. Only new/updated values should be sent.

 

Best regards,

Vlaimir

 

 
Mikkel Hammer
Mikkel Hammer
Reply

Hi Vladimir,

Glad to hear, thanks for the help! :)
Is there an ETA on the fix so i can inform our customers?

Oh, i thought it was required since it has a required tag in the Swagger UI. Thanks for the heads up!



Best regards,
Mikkel

 
Matthias Sebastian Sort Dynamicweb Employee
Matthias Sebastian Sort
Reply
This post has been marked as an answer

Hi Mikkel,

It's been released on version 1.13.26 (already on nuget now) :)

BR

Matthias Sort

Votes for this answer: 1
 
Mikkel Hammer
Mikkel Hammer
Reply

Hi again,

It's working now!
Thanks a lot for your time and quick fixes, we really appreciate a lot :)

Just as a finishing note, we're now getting an error on updating stock for order.


Again, thanks alot for the quick responses and fixes!

Best regards,
Mikkel
 

 

You must be logged in to post in the forum