POST
/
auth
/
generate-otp
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",
  "country_code": "<string>",
  "phone": "<string>",
  "email": "<string>",
  "otp_action": "login"
}'
{
  "message": "<string>",
  "success": true,
  "content": {
    "otp_token": "<string>",
    "otp_action": "<string>"
  }
}

Authorizations

Authorization
string
header
required

Access token

Body

application/json
channel
enum<string>
required

The communication channel for sending the OTP.

Available options:
sms,
email,
whatsapp
otp_action
enum<string>
required
Available options:
login,
register,
reset-password,
verify-phone,
verify-email,
update-phone,
update-email
country_code
string

Two-letter code begin with a plus sign prefix that identifies different countries. By default it will be +91 if not provided. Use this key along with phone. Not necessary for email.

phone
string

10 digit phone number without country code.

email
string

A string representing the email address.

Response

200 - application/json
OK
message
string

A descriptive message confirming the success or failure of the operation.

success
boolean

Indicates whether the request was successful or failure (true for success, false for failure).

content
object

An object containing the response content.