Send an approval OTP
POST/approvals/otp
Sends a 6 digit one-time code to one approver. This call takes no Idempotency-Key.
Behaviour
- The code is valid for 5 minutes and at most 3 codes can be sent for the same order, user and types.
- Sending the same body again is a resend; a resend inside the wait answers
409 OTP_RESEND_COOLDOWNwithdata.resend_after(this API never answers429). - The approver's phone number is never returned.
OTP_UNAVAILABLEmeans no code can be sent now;data.reasonisno_reachable_approver,quota_exhausted,provider_error,cashier_cap_reachedorresend_exhausted, anddata.fallback_authorizedis true: a PIN fallback is then open untildata.fallback_expires_at, so callPOST /approvals/pininstead.
Errors
| Status | Code | When |
|---|---|---|
| 400 | VALIDATION_FAILED | The body is not valid. |
| 400 | USER_ID_REQUIRED | X-User-ID is missing. |
| 403 | PLAN_FEATURE_REQUIRED | The plan has no approval by one-time code. |
| 403 | OTP_NOT_ENABLED | The outlet does not use approval by one-time code. |
| 403 | APPROVER_NOT_ELIGIBLE | The approver is not on the outlet's approval line, or cannot receive a code while another approver can. |
| 403 | PERMISSION_DENIED | The acting user may not do this. |
| 403 | OUTLET_FORBIDDEN | The outlet is not allowed. |
| 404 | NOT_FOUND | The order_id is not an order of the outlet in X-Outlet-ID. |
| 409 | PIN_LOCKED | The PIN check is locked; see data.unlock_at. |
| 409 | OTP_RESEND_COOLDOWN | A resend inside the wait; see data.resend_after. |
| 409 | OTP_UNAVAILABLE | No code can be sent now; see Behaviour. |
| 409 | SHIFT_NOT_OPEN | The acting user has no open shift. |
| 422 | INVALID_USER | The acting user is not valid. |
Request
Responses
- 200
- 400
- 401
- 403
- 404
- 409
- 422
The sent code
Error envelope
Error envelope
Error envelope
Error envelope
Error envelope
Error envelope