Skip to main content

customerVerifyOtp

Overview

After calling customerLogin or customerSignup, verify the one-time password (OTP) sent to the customer using this mutation. Successful verification returns an accessToken (and optional data).

Mutation

mutation CustomerVerifyOtp($input: CustomerVerifyOtpInput!) {
customerVerifyOtp(input: $input) {
success
message
accessToken
data
}
}

Variables

{
"input": {
"token": "<LOGIN_TOKEN>",
"otp": "123456"
}
}

Examples

curl -X POST \
https://subdomain.com \
-H "Content-Type": "application/json" \
--data-binary @- << 'EOF'
{
"query": "mutation CustomerVerifyOtp($input: CustomerVerifyOtpInput!) { customerVerifyOtp(input: $input) { success message accessToken data } }",
"variables": {
"input": {
"token": "<LOGIN_TOKEN>",
"otp": "123456"
}
}
}
EOF

Notes

  • The token parameter is typically the temporary token returned by customerLogin/customerSignup.
  • Store the returned accessToken securely (cookie/local storage) for authenticated calls.
  • Handle error messages (invalid/expired OTP) to prompt re-entry or resend.