Use cases
Delivery confirmation
Have the customer give the courier a code at the door, to prove the order was handed to the right person.
- When the courier is about to deliver (or when the order goes out), your server sends a code to the customer's verified number with
purpose: "order". Set your account's code validity to the maximum (15 minutes) if the courier needs time, or send the code when the courier arrives. - At the door, the customer reads the code to the courier.
- The courier types it into your courier app or page, which calls your server; your server checks it with the stored verification
idand marks the order delivered onvalid: true.
Notes
- The courier app must never hold the OTP.ps key: it calls your backend, which calls OTP.ps.
- If the customer didn't receive the code, the courier can request a new one after 30 seconds (each send cancels the previous code).
- Codes expire. For deliveries later in the day, send the code on arrival, not at dispatch.
- Record who checked the code (courier id) and when, for disputes.