Skip to main content

OTP Verification

2 API calls in this section.

Verify OTP​

Express Shipping / Customer / OTP Verification
POST/express-shipping/customer/verify-otp

Verify 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_token must be sent as X-EXPRESS-KEY for order APIs.

  • Token TTL: ~5 minutes. Renew by re-verifying if expired.

Query parameters

ParameterTypeDescription
languagestring

Preferred language for response messages (en, ar, ku)

Example: en

Headers

ParameterTypeDescription
Authorizationstring

Example: Bearer {{access_token}}

Content-Typestring

Example: application/json

Body parameters

ParameterTypeDescription
phoneRequiredstring

Phone number in international format

codeRequiredstring

6-digit OTP code received via SMS

Staging
Request
curl
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

200OK
Response body
json
1{2  "success": true,3  "data": {4    "customer_id": "GAL1704067200000",5    "full_name": "John Doe",6    "email": "[email protected]",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 / OTP Verification
POST/express-shipping/customer/resend-otp

Resend 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

ParameterTypeDescription
languagestring

Preferred language for response messages (en, ar, ku)

Example: en

Headers

ParameterTypeDescription
Authorizationstring

Example: Bearer {{access_token}}

Content-Typestring

Example: application/json

Body parameters

ParameterTypeDescription
phonestring

International phone number

customer_idstring

Customer id (e.g., GAL1704067200000)

Staging
Request
curl
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

200OK
Response body
json
1{2  "success": true,3  "message": "OTP sent successfully to your phone."4}