Developer forum

Forum » Development » more information about carts on /dwapi/ecommerce/carts/

more information about carts on /dwapi/ecommerce/carts/

Mikkel Hammer
Mikkel Hammer
Reply

Hi DW,

Is it possible to get more information about the carts thats returned by the /dwapi/ecommerce/carts/ endpoint.
We'd like to be able to distinct the active carts without having to acces them first with /dwapi/ecommerce/carts/{secret}

It could be fields like OrderDate, OrderModified and OrderDisplayName

Best regards,
Mikkel


Replies

 
Nicolai Pedersen
Reply
This post has been marked as an answer

Hi Mikkel

I have changed the response to this:

/// <summary>
        /// Returns the cart secret or list of cart secrets for an authenticated user
        /// </summary>
        public class UserCartsResponse
        {
            /// <summary>
            /// Secretid of cart for the users
            /// </summary>
            public string CartSecret { get; set; }

            /// <summary>
            /// Gets or sets the order display name.
            /// </summary>
            public string DisplayName { get; set; }

            /// <summary>
            /// Gets or sets the order record creation date.
            /// </summary>
            public DateTime CreatedAt { get; set; }

            /// <summary>
            /// Gets or sets the order record modified date.
            /// </summary>
            public DateTime Modified { get; set; }

            /// <summary>
            /// Gets or sets the order shop id.
            /// </summary>
            public string ShopId { get; set; }

            /// <summary>
            /// Gets or sets the order Id.
            /// </summary>
            public string Id { get; set; }
        }
Votes for this answer: 1
 
Mikkel Hammer
Mikkel Hammer
Reply

Hi Nicolai,

Great you could fit them all, plus some! Just what we're looking for. 
Any ETA on when we could expect it to be released?

Best regards,
Mikkel

 

 
Nicolai Pedersen
Reply

I have a major pull for you guys that is awaiting approval. So in a day or 2 hopefully.

BR Nicolai

 
Anders Ebdrup
Anders Ebdrup
Reply

Thanks, Nicolai!

We are looking very forward to that! :-)

 
Anders Ebdrup
Anders Ebdrup
Reply

Dear Nicolai,

 

Do you have an estimated time frame for this as these changes are urgent for two of our solutions

 

Best regards, Anders

 
Anders Ebdrup
Anders Ebdrup
Reply

Dear Nicolai,

 

Is there any progress? :-)

 

Best regards, Anders

 
Mikkel Hammer
Mikkel Hammer
Reply

Hi DW,

Is it possible to also extend it with a field showing show the cart status/mode? i.e if it's an "quote", "draft" or "active webshop cart"? :)

Best regards,
Mikkel

 
Mikkel Hammer
Mikkel Hammer
Reply

Hi DW,

Any news on this? :)

Best regards,
Mikkel

 
Nicolai Pedersen
Reply

The new object is released - if you get the latest version from here: https://www.nuget.org/packages/Dynamicweb.Ecommerce.WebAPI/

This response is part of the cart endpoint and will always return carts. It can never be a quote (as you convert a cart to a quote) and a cart and a draft is technically the same thing. Drafts a simply a concept of having more carts open - not converted to an order yet...

Or is it something else you are looking for?

BR Nicolai

 
Mikkel Hammer
Mikkel Hammer
Reply

Hi Nicolai,

Sorry for the confusion, we have it working with the latest Dynamicweb.Ecommerce.WebAPI :)

I wasn't aware about the quote part, so thanks for that!

What we're looking for is a way to "ensure" we open the correct cart in a app we're making.
Our problem is that we want to open the currently "active webshop cart", when you open the app.
But if we only use the "Modified" DateTime on the /cart endpoint, it could be a "draft" cart if you've just recently added something to a draft cart without manipulation your current cart in the webshop.

Hope it makes sense

Best regards,
Mikkel

 
Nicolai Pedersen
Reply

Hi Mikkel

The endpoint will always return the latest created cart on top. That should be the most recent - depending on your implementation of course.

Usually in a non-headless version, Dynamicweb will keep track of the current active cart - since you go headless this context is held in the app it self.

Let me know if that covers your question.

BR Nicolai

 
Mikkel Hammer
Mikkel Hammer
Reply

Hi Nicolai,

That covers it, thanks! :)

Best regards,
Mikkel

 

You must be logged in to post in the forum