Commerce Engine is now in beta. We're working hard to make it better for you.
curl --request POST \
--url https://staging.api.commercengine.io/api/v1/{store_id}/storefront/auth/login/whatsapp \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"phone": "<string>",
"country_code": "<unknown>",
"register_if_not_exists": true
}
'{
"message": "<string>",
"success": true,
"content": {
"otp_token": "<string>",
"otp_action": "<string>"
}
}This API enables users to authenticate into the system using their WhatsApp Number. It provides a secure way for users to Login by verifying their identity through a one-time password (OTP) sent to their WhatsApp Number.
curl --request POST \
--url https://staging.api.commercengine.io/api/v1/{store_id}/storefront/auth/login/whatsapp \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"phone": "<string>",
"country_code": "<unknown>",
"register_if_not_exists": true
}
'{
"message": "<string>",
"success": true,
"content": {
"otp_token": "<string>",
"otp_action": "<string>"
}
}Access token
This param is used to enable debug mode. If debug mode is enabled, the API will return OTP as well. This is only for development and testing purposes.
10 digit phone number without country code linked with WhatsApp.
Two-letter code begin with a plus sign prefix that identifies different countries. By default it will be +91 if not provided.
This is used to send OTP to unregistered phone. By default it sends OTP to registered phone only. To send OTP to unregistered phone it should be pass with true value like this, "register_if_not_exists": true
OK
A descriptive message confirming the success or failure of the Login process.
Indicates whether the request was successful or failure (true for success, false for failure).
Was this page helpful?