Add a new Customer Address

Service URL: POST /customers/addresses

Request Body:

addressAndContact – IAddressAndContact – The address with associated contact details to add to the customer

Response Headers:

Location: /customers/addresses/{addressId}

Remarks:

This service is used to add a new address associated with the customer. The address may include a phone number and mobile phone number. This service can also be used to change the preferred contact and delivery addresses, in which case the existing preferred contact and delivery address is changed to not have the preferred flag.

Request Body:

addressAndContact – IAddressAndContact – The address with associated contact details to add to the customer

Response Headers:

Location: /customers/addresses/{addressId}

Remarks:

This service is used to add a new address associated with the customer. The address may include a phone number and mobile phone number. This service can also be used to change the preferred contact and delivery addresses, in which case the existing preferred contact and delivery address is changed to not have the preferred flag.

Example Request:

POST: http://localhost:8080/WebRestApi/rest/customers/addresses
Content-Type: application/json

{
  "@entity" : "retail:addCustomerAddressRequest",
  "address" : {
    "@entity" : "retail:address",
    "country" : "UK",
    "countryCodeId" : {
      "@entity" : "retail:countryCodeKey"
    },
    "organisation" : "Enactor Limited",
    "typeId" : {
      "@entity" : "retail:contactTypeKey",
      "id" : "ADDRESS WORK"
    },
    "county" : "Hertfordshire",
    "street1" : "1 Bluecoats Avenune",
    "town" : "Hertord",
    "isTemplate" : false
  }
}

Example Response:

Status: 201 Created
Location: http://localhost:8080/WebRestApi/rest/customers/addresses/2
Go to Top