- User Creation Endpoint:
- Order Creation and Payment Handling:
Hi Umar
Good questions
@1: Setting the password and adding groups to a user on an anonymous endpoint is a security issue that we have not solved as part of the delivery API yet. If these 2 settings where open anyone can create a user and put the user into any group giving access to things that might not be intended. So to solve this in a secure way, there need to be some kind of mechanism to validate that it is a real user and that the user is allowed to be put into given groups - and users might need admin approval. Using the regular frontend for Dynamicweb, there are settings on the user management module that will send emails to users when they are new and you have a list of groups the user is allowed to become member of. These settings are currently unavailable on the delivery APIs and that is why you cannot do that as of now.
Another issue related to this is that if we do send an email to the user - what URL should we give them to validate? Since the URL and logic is now in the JS implementation and not in Dynamicweb frontend we do not know.
The solution might be to send an email to the created user that provide a /dwapi/user/approve/{secret} url that will redirect the user to a URL you specify with the user creation.
I'll be happy to hear your thoughts on how you think this could and should be implemented.
Related to this, you also have the management API in Dynamicweb 10 - it requires authentication for the backend - but it can be used to do everything in the backend. I.e. setting the password, send out emails etc. So this can be used now to fill the gap.
@2: In the latest additions to the Dynamicweb 10 delivery API, a /carts/{secret}/checkout and /carts/{secret}/callback endpoint have been added (See below). Using these you can kind of start a checkout using Dynamicweb payment providers (as of current writing only Quickpay and Nets easy are supported on headless).
But - since you are doing a headless implementation, payments can be handled quite differently. You do not need our providers to do payments. You can pretty simple integrate to almost any payment gateway in your headless implementation and complete the order when done.
Headless implementations use "Micro services" - Dynamicweb being one, i.e. Clerk for personalisation and recommendations, Angolia for search and so on. Payments are one of these micro services and you can and should consider integrating them directly. Usually really simple. A competitor of ours that is a pure headless commerce tool, only support payment gateways in this way (they have recently added their own payment gateway integration that can be used more natively)
You can however as mentioned use the /checkout endpoint in DW10 - but it will return markup to actually start the payment window. Each payment provider have quite different ways of starting payments and what is needed to start the payment windows cannot be exposed in json data. So we return markup to start the payment and you have to inject that markup to your DOM of your app. Not 'pure' headless, but it works.
Yet another alternative is to have the actual payment checkout step on a regular Dynamicweb page (not the cart and not the options the user is making). So when the user walk through the cart, fills out information etc. and eventually clicks "Place order" you submit to a Dynamicweb page /default.aspx?id=123 that has nothing but the payment checkout step - this step will then imediately start the payment window and handle the callback etc. The receipt is then again shown in your JS app.
You must be logged in to post in the forum