Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How to add lineitem in the order #222

Open
zev-rb2 opened this issue Aug 31, 2022 · 3 comments
Open

How to add lineitem in the order #222

zev-rb2 opened this issue Aug 31, 2022 · 3 comments

Comments

@zev-rb2
Copy link

zev-rb2 commented Aug 31, 2022

for now, I can't find a solution to add lineitem to the order. It seems we can only add/remove lineitem at Cart-level. Is it possible we can add or remove lineitems in a specific order?

@jenschude
Copy link
Contributor

Please take a look at the API documentation. Once an Order is placed it's not mutable regarding the ordered items https://docs.commercetools.com/api/projects/orders#update-order

In case an edit to the Order is needed you have to use the order edit endpoint https://docs.commercetools.com/api/projects/order-edits

@zev-rb2
Copy link
Author

zev-rb2 commented Aug 31, 2022

Thanks for the quick response. but it seems the methods we want are only available on SDK v2 (e.g., add/remove lineitem). but our .NET project is using v1. How can we resolve that

@jenschude
Copy link
Contributor

Just looked it up. All CartUpdateActions are implementing IStagedOrderUpdateAction. This means you can use them in the AddStagedActionUpdateAction

Else you are always able to implement the necessary interface e.g.:

    public class AddLineItemUpdateAction : IStagedOrderUpdateAction
    {
    }

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants