Skip to main content

Update Address

This API allows you to update an existing address for a customer in the system. You must pass the updated address fields in the request payload. The id parameter must be included to specify which address to update.

  • Endpoint: api/customer/profile/addresses/{id}

  • HTTP Method: POST

  • URL Parameters:

    • id (required): The unique identifier of the address.
tip

Updating an address will result in the creation of a new address object with a new ID, and the original address object will be marked as "soft deleted" to avoid data loss.

  • 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 image of the shop associated with the address.

we have added the apartment, building, floor, landmark, lat, and lng parameters to the request payload. These parameters provide additional details about the address, such as the specific apartment or building number, the floor of the building, and a nearby landmark.

{
"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"
}
  • 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 Update Address API Reference