
The short answer: to send the customer another code, use POST /v1/sms/otp/{id}/resend: a new code goes out under the same id and the validity starts again. To make a code stop working, use POST /v1/sms/otp/{id}/cancel. And remember that a new code for the same number, requested with POST /v1/sms/otp, always cancels the previous one.
Resend, cancel or request another
| Operation | What it does | When to use it |
| /resend | Sends a new code under the same id; validity restarts; attempts already used stay used | The customer says it did not arrive, or the code expired |
| /cancel | A pending code stops working; the SMS already sent is not refunded | The customer gave up, changed number or the transaction was called off |
| POST /v1/sms/otp | Creates a new code, with a new id and fresh attempts; the previous one for that number becomes cancelled | The code failed on attempts, or you want different rules (length, validity) |
What happens to the old code
Only the hash of the old code was ever kept, so there is no way to “send it again”. Each resend creates different digits, and the previous code stops working. If the customer gets two SMS in a row (say, one that was delayed and the resent one), only the latest works. Say so on screen: “Use the code from the latest SMS.”
The “Resend code” button on your screen
|
|
|
|
| By default there is no limit on resends. Each resend is a new SMS and uses credits. Without a wait, an impatient customer or a bot can press “Resend” dozens of times. Set the wait and the maximum per number per hour: see limits against abuse. |
| With a Sandbox key, the resend response includes the code too, just like the send response. You can test the “didn't get it, resend, check” flow without using credits. |
|
Want to resend and cancel codes without losing control? See Verification SMS. See Verification SMS |
RECOMMENDED PRODUCT Web hosting with cPanel Domain and SSL included, daily backups and the panel you already know. from 321,75 MT/mo (3-year plan, with coupon) See plans |











