Skip to main content

Customer Registration

1 API call in this section.

Register New Customer

Express Shipping / Customer / Customer Registration
POST/express-shipping/customer/register?language=en

Register a new customer for express shipping services. If the customer already exists (based on phone number), returns existing customer data and sends a new OTP if not verified. 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: - full_name (required): Customer's full name - email (required): Valid email address - phone (required): Phone number in international format (e.g., +919876543210) - delivery_address (required): Comprehensive address object - lat (required): Latitude coordinates (-90 to 90) - lng (required): Longitude coordinates (-180 to 180) - full_address (required): Complete address text - address_line1 (optional): Primary address line - address_line2 (optional): Secondary address line - street (optional): Street name - building (optional): Building name/number - floor (optional): Floor number - city (optional): City name - state (optional): State/Province - country (optional): Country name - postal_code (optional): ZIP/Postal code - notes (optional): Additional delivery notes

Send a bearer token in the Authorization header for an authenticated OnDi user session.
Request
curl
1curl --request POST "$ONDI_BASE_URL/express-shipping/customer/register?language=en" \2  --header "Authorization: Bearer {{access_token}}" \3  --header "Content-Type: application/json" \4  --header "Content-Type: application/json" \5  --data '{6  "full_name": "John Doe",7  "email": "john.doe@example.com",8  "phone": "+919876543210",9  "delivery_address": {10    "title": "Home",11    "latitude": 19.076,12    "longitude": 72.8777,13    "full_address": "123 Main Street, Andheri West, Mumbai, Maharashtra 400058, India",14    "address_line1": "123 Main Street",15    "address_line2": "Apt 4B",16    "street": "Main Street",17    "building": "Sunrise Apartments",18    "floor": "4th Floor",19    "city": "Mumbai",20    "state": "Maharashtra",21    "country": "India",22    "postal_code": "400058",23    "notes": "Near the temple, blue building with security guard"24  },25  "tenant_id": "{{tenant_id}}"26}'
Request body
json
1{2  "full_name": "John Doe",3  "email": "john.doe@example.com",4  "phone": "+919876543210",5  "delivery_address": {6    "title": "Home",7    "latitude": 19.076,8    "longitude": 72.8777,9    "full_address": "123 Main Street, Andheri West, Mumbai, Maharashtra 400058, India",10    "address_line1": "123 Main Street",11    "address_line2": "Apt 4B",12    "street": "Main Street",13    "building": "Sunrise Apartments",14    "floor": "4th Floor",15    "city": "Mumbai",16    "state": "Maharashtra",17    "country": "India",18    "postal_code": "400058",19    "notes": "Near the temple, blue building with security guard"20  },21  "tenant_id": "{{tenant_id}}"22}

Query parameters

languageOptional
query string

en

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

Request body fields

full_nameExample
string

Example field from the request body.

emailExample
string

Example field from the request body.

phoneExample
string

Example field from the request body.

delivery_addressExample
object

Example field from the request body.

delivery_address.titleExample
string

Example field from the request body.

delivery_address.latitudeExample
number

Example field from the request body.

delivery_address.longitudeExample
number

Example field from the request body.

delivery_address.full_addressExample
string

Example field from the request body.

delivery_address.address_line1Example
string

Example field from the request body.

delivery_address.address_line2Example
string

Example field from the request body.

delivery_address.streetExample
string

Example field from the request body.

delivery_address.buildingExample
string

Example field from the request body.

delivery_address.floorExample
string

Example field from the request body.

delivery_address.cityExample
string

Example field from the request body.

delivery_address.stateExample
string

Example field from the request body.

delivery_address.countryExample
string

Example field from the request body.

delivery_address.postal_codeExample
string

Example field from the request body.

delivery_address.notesExample
string

Example field from the request body.

tenant_idExample
string

Example field from the request body.

Headers

AuthorizationOptional
header string

Bearer {{access_token}}

Content-TypeOptional
header string

application/json

Responses

Success - New Customer200OK
Response body
json
1{2  "success": true,3  "data": {4    "customer_id": "GAL1704067200000",5    "is_new_customer": true,6    "is_verified": false,7    "phone": "+919876543210",8    "full_name": "John Doe",9    "email": "john.doe@example.com"10  },11  "message": "Customer registered successfully. OTP sent to your phone."12}
Success - Existing Verified Customer200OK
Response body
json
1{2  "success": true,3  "data": {4    "customer_id": "GAL1704067200000",5    "is_new_customer": false,6    "is_verified": true,7    "phone": "+919876543210",8    "full_name": "John Doe",9    "email": "john.doe@example.com"10  },11  "message": "Customer already exists and is verified."12}
Error - Invalid Address400Bad Request
Response body
json
1{2  "success": false,3  "message": "delivery_address must contain lat, lng, and full_address"4}
Error - Missing Required Fields (400 Bad Request)400
Response body
json
1{2  "success": false,3  "message": "Missing required fields: full_name, email"4}
Error - Invalid Coordinates (400 Bad Request)400
Response body
json
1{2  "success": false,3  "message": "Invalid coordinates. Latitude must be between -90 and 90, longitude between -180 and 180"4}