Does anyone have a sample JSON structure to update...
# integrations
a
Does anyone have a sample JSON structure to update a customer address via REST? I can't seem to get it working.
e
Update an existing address for a customer? Or update an existing customer with a new address?
a
Update an existing customer address
e
Copy code
{
  "addressbook": {
    "items": [
      {
        "addressId": 14207371,
        "defaultBilling": true,
        "defaultShipping": true,
        "addressbookaddress": {
          "zip": "11111"
        }
      }
    ]
  }
}
a
"addressId" is the id found on the line level?
e
Yes, left side of the address sublist in the customer
image.png
a
thanks a bunch!
Hi Edgar, I got the patch call working now, but for some reason it is also adding a new address do you know why this behavior is happening?
e
Share the full example, please
a
Copy code
"method": "PATCH",
"endpoint": "https://{{acctId}}.<http://suitetalk.api.netsuite.com/services/rest/record/v1/customer/{{custId}}|suitetalk.api.netsuite.com/services/rest/record/v1/customer/{{custId}}>",
{
    "firstName": "John",
    "lastName": "Doe",
    "subsidiary": { "id": "1"},
    "companyname": "Test",
    "externalId" : "Test",
    "entityId": "Test",
    "autoname": false,
    "email": "<mailto:test@test.com|test@test.com>",
    "category": "1",
    "isperson": false,
    "entityStatus": "1",
    "addressBook": {
        "items": [{
            "addressId": "123",
            "defaultbilling": true,
            "addressBookAddress": {
                "addr1": "123 Test St.",
                "city" : "New Haven",
                "state": "CT",
                "zip": "06519",
                "country": { "id": "US" }
            }
        }]
    },
    "phone": "<tel:+1555-555-5555|+1 555-555-5555>",
    "comments": "Test Update"
}
e
In my tests, it only adds a new address when the
addressId
used doesn't exist.
a
I see, the
addressId
definitely exists because that's how I got the Id to begin with