Inhalte aufrufen

Profilbild

Add Order Items through WebApi

webapi orderitems order

  • Bitte melden Sie sich an, um eine Antwort zu verfassen.
3 Antworten zu diesem Thema

#1 champcbg

champcbg

    Newbie

  • Members
  • Punkt
  • 8 Beiträge

Geschrieben: 07 April 2022 - 23:24

Can I get some help trying to add order items through the webapi?  I have looked at the code and the method is not implemented.  Is there another way to add order items without writing my own code?

 

Here is the OrderItemController

https://github.com/s...msController.cs



#2 Marcus Gesing

Marcus Gesing

    SmartStore AG

  • Administrators
  • 3799 Beiträge

Geschrieben: 08 April 2022 - 10:48

Why do you want to add OrderItems natively? This is quite an unusual process because they are created exclusively by PlaceOrder. A lot of code is run through this process and many calculations are made. Adding OrderItems here natively carries the risk of importing inconsistent data into the application.

Marcus Gesing

Smartstore AG


#3 champcbg

champcbg

    Newbie

  • Members
  • Punkt
  • 8 Beiträge

Geschrieben: 08 April 2022 - 11:28

So how do I achieve this via the API?  I don't see an endpoint for place order.

 

My Goal is create an order via the API and add/remove/review items to it progressively as any normal shopping experience an then finally close out the order.

 

I want to do all this via and is geared around custom shopping experience.



#4 Marcus Gesing

Marcus Gesing

    SmartStore AG

  • Administrators
  • 3799 Beiträge

Geschrieben: 08 April 2022 - 15:02

There is no way to do something like this via the API. It's too specific and goes far beyond the data exchange of an API. We once built something similar into a plugin and then made PlaceOrder accessible from the outside via its own API in this plugin. This was experimental and meant for testing POS scenarios. This is how I would approach this task.

Marcus Gesing

Smartstore AG