OTP Verification
2 API calls in this section.
Verify OTP
/express-shipping/customer/verify-otpVerify the OTP code sent to customer's phone number. Maximum 5 attempts allowed before code expires.
Requires valid Bearer token OR X-API-Key
Bearer token:
Authorization: Bearer {{access_token}}API Key:
X-API-Key: {{api_key}}(alternative authentication method)
Response
Note:
access_tokenmust be sent asX-EXPRESS-KEYfor order APIs.Token TTL: ~5 minutes. Renew by re-verifying if expired.
Query parameters
| Parameter | Type | Description |
|---|---|---|
language | string | Preferred language for response messages (en, ar, ku) Example: |
Headers
| Parameter | Type | Description |
|---|---|---|
Authorization | string | Example: |
Content-Type | string | Example: |
Body parameters
| Parameter | Type | Description |
|---|---|---|
phoneRequired | string | Phone number in international format |
codeRequired | string | 6-digit OTP code received via SMS |
1curl --globoff --request POST "https://staging-api.ondi.io/functions/v1/express-shipping/customer/verify-otp?language=en" \2 --header "Authorization: Bearer ${ONDI_ACCESS_TOKEN}" \3 --header "Content-Type: application/json" \4 --data-raw '{5 "phone": "+919876543210",6 "code": "123456"7}'Response examples
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}Resend OTP
/express-shipping/customer/resend-otpResend 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.
Response
Errors include rate limiting, already verified, and customer not found.
Query parameters
| Parameter | Type | Description |
|---|---|---|
language | string | Preferred language for response messages (en, ar, ku) Example: |
Headers
| Parameter | Type | Description |
|---|---|---|
Authorization | string | Example: |
Content-Type | string | Example: |
Body parameters
| Parameter | Type | Description |
|---|---|---|
phone | string | International phone number |
customer_id | string | Customer id ( |
1curl --globoff --request POST "https://staging-api.ondi.io/functions/v1/express-shipping/customer/resend-otp?language=en" \2 --header "Authorization: Bearer ${ONDI_ACCESS_TOKEN}" \3 --header "Content-Type: application/json" \4 --data-raw '{5 "phone": "+919876543210",6 "customer_id": ""7}'Response examples
1{2 "success": true,3 "message": "OTP sent successfully to your phone."4}