We are using the REST API to Upsert customer record. Included in the PUT is the address record.
Everytime we send the PUT, the customer record is updated as expected. The problem is that every time we run the request, a new address is added to the address book.
"companyName"=> $result['CLIENTNAME'],
"email"=> '',
"emailPreference"=> "PDF",
"emailTransactions"=> false,
"externalId"=> $netsuiteCustomerId,
"isinactive"=> false,
"phone"=> $result['TELEPHONENO'],
"subsidiary"=> ["id"=> "2"],
"terms"=> ["externalId"=> "PTTRM".$result["TERMID"]],
"vatRegNumber"=> $result['ABN'],
"addressbook" => array(
"items" => array(
array(
"label"=> $address['addr1'],
"addressbookaddress" => $address = array(
"addr1" => $result['ADDRESS1'],
"addressee" => $result['CLIENTNAME'],
"addrText"=> $result['ADDRESS1']."\n".$result['ADDRESS2'],
"externalId" => 'ADDR_'.$netsuiteCustomerId,
);
)
)
)
Adding the externalId to the address doesn't appear to work. We have multiple addresses with the same ID. The SOAP API allows a replaceAll attribute, but that doesn't exist on the REST API.