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/generate-otp \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"channel": "sms",
"phone": "<string>",
"otp_action": "register",
"country_code": "<string>"
}
'{
"message": "<string>",
"success": true,
"content": {
"otp_token": "<string>",
"otp_action": "<string>"
}
}Generating a One-Time Password (OTP) typically involves creating a random code that is sent to a user for authentication or verification purposes.
curl --request POST \
--url https://staging.api.commercengine.io/api/v1/{store_id}/storefront/auth/generate-otp \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"channel": "sms",
"phone": "<string>",
"otp_action": "register",
"country_code": "<string>"
}
'{
"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.
sms, whatsapp 10 digit phone number without country code.
register, reset-password, verify-phone, update-phone Two-letter code begin with a plus sign prefix that identifies different countries. By default it will be +91 if not provided.
OK
A descriptive message confirming the success or failure of the operation.
Indicates whether the request was successful or failure (true for success, false for failure).
Was this page helpful?