2

I am working on Magento -2.2.4. and working with REST API.

When The customers are having multiple addresses. When i am trying to update one address from list of existed addresses of the customer, The current updating address is updating fine. But, Remaining all existed addresses are deleted.

I followed this : https://www.ipragmatech.com/edit-delete-address-magento-mobile-app/

How can i update the customer's address with out deleting remaining addresses in application with magento?

1 Answer 1

1

This is the formate of body to update delete and add address in magento rest API

{"customer":
  {"email": "[email protected]",
    "firstname": "test",
    "lastname": "test",
    "store_id": 13,
    "website_id": 5,
    "addresses": [
        {
            "id": 84,
            "customer_id": 31,
            "region": {
                "region_code": "AP",
                "region": "Andhra Pradesh",
                "region_id": 555
            },
            "region_id": 534,
            "country_id": "IN",
            "street": [
                "test",
                "test",
                "test"
            ],
            "company": "test",
            "telephone": "1234567890",
            "postcode": "00000",
            "city": "test",
            "firstname": "test",
            "lastname": "test"
        },
        {
            "id": 107,
            "customer_id": 31,
            "region": {
                "region_code": "test",
                "region": "test",
                "region_id": 0
            },
            "region_id": 0,
            "country_id": "IN",
            "street": [
                "test",
                "test",
                "test"
            ],
            "company": "test",
            "telephone": "78944561230",
            "postcode": "00000",
            "city": "test",
            "firstname": "test",
            "lastname": "test"
        }
    ]
  }
 }

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.