Skip to main content

Create Address

This API enables the creation of a new customer address within the system. Customers, including guests, can create addresses using this API. However, please note that listing addresses is restricted to logged-in users.

  • Endpoint: api/customer/profile/addresses

  • HTTP Method: POST

tip

Customize address fields as required or optional using the Configuration API to suit your needs. This includes details like apartment, building, floor, landmark, and coordinates (latitude and longitude). The coordinates help determine delivery range from the shop, ensuring efficient service.

When the configuration ADD_ADDRESS_CONFIG for maps is enabled, a map will be displayed in the address form, allowing users to select locations automatically populate latitude and longitude (lat and lng) coordinates. If the configuration is disabled, this feature will not be available,

  • Request Body:
KeyTypeDescription
namestringThe name of the address, which can be "home", "work", or any other custom label
addressstringThe text of the address.
city_idintegerThe city ID of the address.
area_idintegerThe area ID of the address.
district_idintegerThe district ID of the address.
apartmentstringThe apartment number of the address.
buildingstringThe building number of the address.
floorstringThe floor number of the address.
landmarkstringA nearby landmark for the address.
latstringThe latitude coordinate of the address.
lngstringThe longitude coordinate of the address.
primarybooleanA boolean value that indicates whether the address is the primary address for the customer.
shop_namestringThe name of the shop associated with the address.
shop_imagestringThe Url image of the shop associated with the address.
attachment_2stringThe second url attachment of the address.
attachment_3stringThe third url attachment of the address.
contact_numberstringThe contact number of the shop.
bank_accountstringThe bank account of the shop.
commercial_recordstringThe commercial record of the shop.
{
"name": "Home",
"city_id": 10,
"area_id": 334,
"district_id": null,
"address": "test",
"apartment": "10",
"building": "10",
"floor": "10",
"landmark": "test",
"shop_name": null,
"shop_image": null,
"primary": true,
"lat": "30.105444",
"lng": "31.369139"
}
info
  • Success Response:
Address Resource

You can check more details about Address Resource.

{
"code": 200,
"data": {
//...
"token": "eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9..",
"addresses": [
{
"id": 49124,
"name": "Home",
"address": "test address",
"apartment": "1",
"building": "10",
"landmark": null,
"city_id": 10,
"area_id": 125,
"primary": false,
"lat": "30.105444",
"lng": "31.369139",
"district_id": null,
"floor": "1",
"language": "en",
"shop_name": null,
"shop_image": null,
"formatted_address_ar": "مبني 10, دور 1, شارع test address, شقة 1, المعادي, القاهرة",
"formatted_address_en": "building 10, floor 1, address test address, apartment 1, Maadi, Cairo",
//...
"area": {
"id": 125,
"name": "Maadi",
"name_ar": "المعادي",
"city_id": 10,
"active": true,
//...
},
"city": {
"id": 10,
"name": "Cairo",
"name_ar": "القاهرة",
"active": 1,
//...
},
"district": null
},
]
}
}
info

Check the following section to learn more about the Create Address API Reference