OTP Verification
2 API calls in this section.
Verify OTP
/express-shipping/customer/verify-otp?language=enVerify the OTP code sent to customer's phone number. Maximum 5 attempts allowed before code expires. Authentication: - Requires valid Bearer token OR X-API-Key - Bearer token: Authorization: Bearer {{access_token}} - API Key: X-API-Key: {{api_key}} (alternative authentication method) Request Body: - phone (required): Phone number in international format - code (required): 6-digit OTP code received via SMS Response: - Note: access_token must be sent as X-EXPRESS-KEY for order APIs. - Token TTL: ~5 minutes. Renew by re-verifying if expired.
1curl --request POST "$ONDI_BASE_URL/express-shipping/customer/verify-otp?language=en" \2 --header "Authorization: Bearer {{access_token}}" \3 --header "Content-Type: application/json" \4 --header "Content-Type: application/json" \5 --data '{6 "phone": "+919876543210",7 "code": "123456"8}'1{2 "phone": "+919876543210",3 "code": "123456"4}Query parameters
languageOptionalen
Preferred language for response messages (en, ar, ku)
Request body fields
phoneExampleExample field from the request body.
codeExampleExample field from the request body.
Headers
AuthorizationOptionalBearer {{access_token}}
Content-TypeOptionalapplication/json
Responses
1{2 "success": true,3 "data": {4 "customer_id": "GAL1704067200000",5 "full_name": "John Doe",6 "email": "john.doe@example.com",7 "phone": "+919876543210",8 "is_verified": true,9 "verified_at": "2024-01-01T12:00:00Z"10 },11 "message": "OTP verified successfully. Customer is now verified."12}1{2 "success": false,3 "message": "Invalid verification code",4 "attempts_remaining": 35}1{2 "success": false,3 "message": "Verification code has expired. Please request a new OTP."4}1{2 "success": true,3 "data": {4 "user_id": "UUID",5 "customer_id": "GAL1704067200000",6 "full_name": "John Doe",7 "email": "john.doe@example.com",8 "phone": "+919876543210",9 "address_id": "UUID",10 "delivery_address": { /* ... */ },11 "access_token": "<short-lived-jwt>"12 },13 "message": "OTP verified successfully. Customer is now verified."14}1{2 "success": false,3 "message": "Too many failed attempts. Please request a new OTP."4}Resend OTP
/express-shipping/customer/resend-otp?language=enResend OTP code. One of phone or customer_id is required. If customer_id is provided, the API resolves the customer's phone and sends the OTP. Request Body (one of): - phone: International phone number - customer_id: Customer id (e.g., GAL1704067200000) Response: Errors include rate limiting, already verified, and customer not found.
1curl --request POST "$ONDI_BASE_URL/express-shipping/customer/resend-otp?language=en" \2 --header "Authorization: Bearer {{access_token}}" \3 --header "Content-Type: application/json" \4 --header "Content-Type: application/json" \5 --data '{6 "phone": "+919876543210",7 "customer_id": ""8}'1{2 "phone": "+919876543210",3 "customer_id": ""4}Query parameters
languageOptionalen
Preferred language for response messages (en, ar, ku)
Request body fields
phoneExampleExample field from the request body.
customer_idExampleExample field from the request body.
Headers
AuthorizationOptionalBearer {{access_token}}
Content-TypeOptionalapplication/json
Responses
1{2 "success": true,3 "message": "OTP sent successfully to your phone."4}1{2 "success": false,3 "message": "Please wait before requesting another OTP",4 "wait_time": 455}1{2 "success": false,3 "message": "Customer is already verified"4}