Closed GerFres closed 1 week ago
@GerFres the enabled
property of the underlying API is readonly:
If you'd like to set enabled
to a different value, use Hooks:
https://developer.salesforce.com/docs/commerce/commerce-api/guide/extensibility_via_hooks.html
In particular the dw.ocapi.shop.customer.afterPOST
hook should do what you want!
Summary
For the registerCustomer endpoint of the B2C Commerce API, even though it specifies that you can use the enabled property for the customer to mark the customer as enabled or not enabled, it doesn't seem to be working at all.
Not sure if this is an issue with the commerce-sdk that may be excluding this property from being sent to the API
Steps To Reproduce
Include the enabled attribute in the registration payload
Register a customer through the normal registration flow in the storefront
The customer is enabled even thought we specified false in the enabled property
Expected result
Customer to be registered but disabled
Actual result
Registered customer and enabled
System Information (as applicable)
Browser: Node version: pwa-kit version: Desktop OS: Mobile Device Info:
Additional information
Feel free to attach a screenshot.