Get User Addresses
curl -X GET "https://api.example.com/api/user/address" \
-H "Authorization: Bearer YOUR_TOKEN" \
-H "Content-Type: application/json"
Retrieves all active addresses for the authenticated user, sorted by default status and creation date.
Bearer token for authentication
Query Parameters
Platform identifier (e.g., ‘web’, ‘mobile’)
Response
Returns an array of address objects.
Unique address identifier
User ID who owns this address
Secondary address line (apartment, suite, etc.)
Additional address information
Country calling code (default: ‘91’)
Address type: ‘HOME’, ‘WORK’, or ‘OTHER’
Default address flag (1 = default, 0 = not default)
Active status (1 = active, 0 = deleted)
Geographic latitude (up to 6 decimals)
Geographic longitude (up to 6 decimals)
Address creation timestamp
[
{
"id" : 567 ,
"user_id" : 12345 ,
"firstname" : "John" ,
"lastname" : "Doe" ,
"address1" : "123 Main Street" ,
"address2" : "Apt 4B" ,
"address3" : "Near Central Park" ,
"address4" : null ,
"flat" : "4B" ,
"city" : "Mumbai" ,
"postcode" : 400001 ,
"zone_id" : 45 ,
"state" : "Maharashtra" ,
"country_id" : 99 ,
"country_code" : "91" ,
"phone_no" : 9876543210 ,
"address_type" : "HOME" ,
"is_default" : 1 ,
"is_active" : 1 ,
"latitude" : "19.075983" ,
"longitude" : "72.877655" ,
"created_at" : "2025-01-15T10:30:00" ,
"updated_at" : "2025-01-15T10:30:00"
},
{
"id" : 568 ,
"user_id" : 12345 ,
"firstname" : "John" ,
"lastname" : "Doe" ,
"address1" : "456 Business Plaza" ,
"address2" : "Floor 12" ,
"address3" : "Opposite Metro Station" ,
"city" : "Mumbai" ,
"postcode" : 400051 ,
"zone_id" : 45 ,
"state" : "Maharashtra" ,
"country_id" : 99 ,
"country_code" : "91" ,
"phone_no" : 9876543210 ,
"address_type" : "WORK" ,
"is_default" : 0 ,
"is_active" : 1 ,
"latitude" : null ,
"longitude" : null ,
"created_at" : "2025-02-20T14:20:00" ,
"updated_at" : "2025-02-20T14:20:00"
}
]
Get Single Address
GET /api/user/address/{address_id}
curl -X GET "https://api.example.com/api/user/address/567" \
-H "Authorization: Bearer YOUR_TOKEN" \
-H "Content-Type: application/json"
Retrieves a specific address by ID. Only returns addresses belonging to the authenticated user.
Path Parameters
Unique identifier of the address
Response
Returns a single address object with same fields as the list response.
Response
Error - Not Found
{
"id" : 567 ,
"user_id" : 12345 ,
"firstname" : "John" ,
"lastname" : "Doe" ,
"address1" : "123 Main Street" ,
"address2" : "Apt 4B" ,
"address3" : "Near Central Park" ,
"city" : "Mumbai" ,
"postcode" : 400001 ,
"zone_id" : 45 ,
"state" : "Maharashtra" ,
"country_id" : 99 ,
"country_code" : "91" ,
"phone_no" : 9876543210 ,
"address_type" : "HOME" ,
"is_default" : 1 ,
"is_active" : 1 ,
"latitude" : "19.075983" ,
"longitude" : "72.877655" ,
"created_at" : "2025-01-15T10:30:00" ,
"updated_at" : "2025-01-15T10:30:00"
}
Create Address
curl -X POST "https://api.example.com/api/user/address" \
-H "Authorization: Bearer YOUR_TOKEN" \
-H "Content-Type: application/json" \
-d '{
"firstname": "John",
"lastname": "Doe",
"address1": "123 Main Street",
"address2": "Apt 4B",
"address3": "Near Central Park",
"flat": "4B",
"city": "Mumbai",
"postcode": "400001",
"zone_id": 45,
"country_id": 99,
"country_code": "91",
"phone_no": "9876543210",
"address_type": "HOME",
"is_default": true,
"location": {
"latitude": 19.075983,
"longitude": 72.877655
}
}'
Creates a new delivery address for the user. Validates phone number and postal code before saving.
Body Parameters
Last name for delivery (use ’.’ if only one name)
Additional address details
Valid postal code for the country
State/province ID (must be > 20)
Valid 10-digit phone number
Address type: ‘HOME’, ‘WORK’, or ‘OTHER’
Set as default address (unsets other defaults)
Geographic coordinates Latitude (up to 6 decimal places)
Longitude (up to 6 decimal places)
Set to true if creating address during user registration
Required if is_new_user is true
Required if is_new_user is true
Response
Returns array of all user addresses after creation.
Success Response
Error - Invalid Phone
Error - Invalid Postal Code
Error - Missing Email
[
{
"id" : 569 ,
"user_id" : 12345 ,
"firstname" : "John" ,
"lastname" : "Doe" ,
"address1" : "123 Main Street" ,
"address2" : "Apt 4B" ,
"address3" : "Near Central Park" ,
"flat" : "4B" ,
"city" : "Mumbai" ,
"postcode" : 400001 ,
"zone_id" : 45 ,
"state" : "Maharashtra" ,
"country_id" : 99 ,
"country_code" : "91" ,
"phone_no" : 9876543210 ,
"address_type" : "HOME" ,
"is_default" : 1 ,
"is_active" : 1 ,
"latitude" : "19.075983" ,
"longitude" : "72.877655" ,
"created_at" : "2026-03-08T11:45:00" ,
"updated_at" : "2026-03-08T11:45:00"
}
]
Update Address
POST /api/user/address (with action=put)
curl -X POST "https://api.example.com/api/user/address" \
-H "Authorization: Bearer YOUR_TOKEN" \
-H "Content-Type: application/json" \
-d '{
"action": "put",
"address_id": 567,
"firstname": "John",
"lastname": "Doe",
"address1": "123 Main Street Updated",
"address2": "Apt 4B",
"address3": "Near Central Park",
"city": "Mumbai",
"postcode": "400001",
"zone_id": 45,
"country_id": 99,
"country_code": "91",
"phone_no": "9876543210",
"address_type": "HOME",
"is_default": true
}'
Updates an existing address. If the address is used in past orders and content changes, the old address is soft-deleted and a new one is created to preserve order history.
Body Parameters
Must be “put” for update operation
All other parameters are the same as create address (firstname, lastname, address1, etc.)
Response
Returns array of all user addresses after update.
Success Response
Error - Invalid Input
[
{
"id" : 567 ,
"user_id" : 12345 ,
"firstname" : "John" ,
"lastname" : "Doe" ,
"address1" : "123 Main Street Updated" ,
"address2" : "Apt 4B" ,
"address3" : "Near Central Park" ,
"city" : "Mumbai" ,
"postcode" : 400001 ,
"zone_id" : 45 ,
"state" : "Maharashtra" ,
"country_id" : 99 ,
"country_code" : "91" ,
"phone_no" : 9876543210 ,
"address_type" : "HOME" ,
"is_default" : 1 ,
"is_active" : 1 ,
"created_at" : "2025-01-15T10:30:00" ,
"updated_at" : "2026-03-08T12:00:00"
}
]
Delete Address
POST /api/user/address?address_id=567 (with action=delete)
curl -X POST "https://api.example.com/api/user/address?address_id=567" \
-H "Authorization: Bearer YOUR_TOKEN" \
-H "Content-Type: application/json" \
-d '{
"action": "delete"
}'
Deletes an address by setting it as inactive. Addresses used in past orders are soft-deleted to preserve order history.
Body Parameters
Must be “delete” for delete operation
Query Parameters
Response
Returns array of remaining active addresses.
[
{
"id" : 568 ,
"user_id" : 12345 ,
"firstname" : "John" ,
"lastname" : "Doe" ,
"address1" : "456 Business Plaza" ,
"address2" : "Floor 12" ,
"address3" : "Opposite Metro Station" ,
"city" : "Mumbai" ,
"postcode" : 400051 ,
"zone_id" : 45 ,
"state" : "Maharashtra" ,
"country_id" : 99 ,
"country_code" : "91" ,
"phone_no" : 9876543210 ,
"address_type" : "WORK" ,
"is_default" : 0 ,
"is_active" : 1 ,
"created_at" : "2025-02-20T14:20:00" ,
"updated_at" : "2025-02-20T14:20:00"
}
]
Validate Pincode
GET /api/pincode/{pincode}
curl -X GET "https://api.example.com/api/pincode/400001" \
-H "Content-Type: application/json"
Checks if delivery is available to a specific pincode and provides estimated delivery dates.
Path Parameters
Query Parameters
Product ID for warehouse-specific delivery estimates
Response
Whether the pincode is serviceable
200 if serviceable, 201 if not
Delivery information 1 if serviceable, 0 if not
Earliest delivery date (DD/MM/YYYY)
Latest delivery date (DD/MM/YYYY)
Delivery zone (e.g., “ZONE A”, “ZONE B”)
Nearest warehouse (if product_id provided)
Distance from warehouse in kilometers
Serviceable Pincode
Non-Serviceable Pincode
{
"success" : true ,
"status_code" : 200 ,
"data" : {
"serviceability" : 1 ,
"check_cod" : true ,
"min_estimated_days" : 3 ,
"max_estimated_days" : 5 ,
"min_estimated_date" : "11/03/2026" ,
"max_estimated_date" : "13/03/2026" ,
"zone" : "ZONE A" ,
"warehouse_name" : "Mumbai Warehouse" ,
"distance_in_km" : 12.5
}
}