Document Properties
Kbid24914U
Last Modified23-Jun-2020
Added to KB15-Jul-2013
Public AccessEveryone
StatusOnline
Doc TypeReferences
Product
  • ICM 7.6
  • ICM 7.7

REST API - Create new customer address (until 7.7)

URI

/customers/-/addresses

Http Method

POST

Short Description

Creates a new customer address by using POST data provided by the client

Query Parameters

none

Example Requests

/customers/-/addresses

HTTP Status Codes

201 Created
400 Bad Request

       Possible values for header ‘error-key’:

    • customer.address.missing_fields.error

401 Unauthorized

404 Not Found

       Possible values for header ‘error-key’:

    • customer.address.not_found.error

Description

 

POST-ing to this resource will create a new customer address. The address POST data should match the following requirements:

*Address Name (optional)
*CountryCode (mandatory)
*First Name (mandatory)
*Last Name (mandatory)
*Address Line 1 (mandatory)
*Address Line 2 (optional)
*Postal Code (mandatory)
*City (mandatory)
*State/Province (optional)
*Phone (optional)

Note

The country is represented as country code. A valid country code in ISO 3166-1 format is required!

Cartridge

app_sf_rest

ApplicationB2C Web Shop, SMB Web Shop

Product Version

7.5.1

Product To Version

7.7

Status

final

JSON

Request Data Format

application/json

Request related java object

com.intershop.sellside.rest.common.capi.resource.customer.address.CustomerAddressListResource
com.intershop.sellside.rest.common.capi.resourceobject.AddressRO

Request Example

{
  "state": "Berlin",
  "countryCode": "DE",
  "addressName": "Patricia Miller, Berliner Str. 20, Potsdam",
  "postalCode": "14482",
  "city": "Potsdam",
  "street": "Berliner Str. 20",
  "phoneHome": "049364112677",
  "firstName": "Patricia",
  "lastName": "Miller"
}

Response Data Format

application/json

Response related java object

com.intershop.sellside.rest.common.capi.resource.customer.address.CustomerAddressListResource
com.intershop.sellside.rest.common.capi.resourceobject.AddressRO
OR
om.intershop.component.rest.capi.resourceobject.LinkRO

Response Example

201 Created

When the create returns no suggestions:

{
  "type": "Address",
  "state": "Berlin",
  "country": "Germany",
  "id": "53QKCgoKBm0AAAFCj0k0MEy7",
  "city": "Potsdam",
  "street": "Berliner Str. 20",
  "street2": "",
  "street3": "",
  "mobile": "",
  "phoneHome": "049364112677",
  "firstName": "Patricia",
  "lastName": "Miller",
  "title": "",
  "countryCode": "DE",
  "postalCode": "14482",
  "phoneBusiness": "",
  "email": "",
  "addressName": "Patricia Miller, Berliner Str. 20, Potsdam"
}

When there are suggestions:

{
    "type": "Link",
    "title": "Suggested addresses",
	"uri": "PrimeTech-PrimeTechSpecials-Site/b2c-web-shop/customers/-/addresses/BOIKDgAOdNQAAAFCc_ZOHHCV/suggestions"
 }

XML

XML Request Data Format

text/xml

XML Request Java Objects

com.intershop.sellside.rest.common.capi.resource.customer.address.CustomerAddressListResource
com.intershop.sellside.rest.common.capi.resourceobject.AddressRO
OR
om.intershop.component.rest.capi.resourceobject.LinkRO

XML Request Example

<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<Address>
    <city>Potsdam</city>
    <countryCode>DE</countryCode>
    <firstName>Patricia</firstName>
    <lastName>Miller</lastName>
    <phoneHome>049364112677</phoneHome>
    <postalCode>14482</postalCode>
    <state>Berlin</state>
    <street>Berliner Str. 20</street>
</Address>

XML Response Data Format

text/xml

XML Response Java Objects

com.intershop.sellside.rest.common.capi.resource.customer.address.CustomerAddressListResource
com.intershop.sellside.rest.common.capi.resourceobject.AddressRO
OR
om.intershop.component.rest.capi.resourceobject.LinkRO

XML Response Example

 

201 Created and 303 See other:

<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<Address type="Address">
    <addressName>Patricia Miller, Berliner Str. 20, Potsdam</addressName>
    <city>Potsdam</city>
    <country>Germany</country>
    <countryCode>DE</countryCode>
    <email>
    </email>
    <firstName>Patricia</firstName>
    <ID>EH8KDgAOk7gAAAFC7YBOHG.o</ID>
    <lastName>Miller</lastName>
    <mobile>
    </mobile>
    <phoneBusiness>
    </phoneBusiness>
    <phoneHome>049364112677</phoneHome>
    <postalCode>14482</postalCode>
    <state>Berlin</state>
    <street>Berliner Str. 20</street>
    <street2>
    </street2>
    <street3>
    </street3>
    <title>
    </title>
</Address>

With 303 See other

<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<Link type="Link">
  <title>Suggested addresses</title>
  <uri>PrimeTech-PrimeTechSpecials-Site/b2c-web-shop/customers/-/addresses/BOIKDgAOdNQAAAFCc_ZOHHCV/suggestions</uri>
</Link>    

Disclaimer

The information provided in the Knowledge Base may not be applicable to all systems and situations. Intershop Communications will not be liable to any party for any direct or indirect damages resulting from the use of the Customer Support section of the Intershop Corporate Web site, including, without limitation, any lost profits, business interruption, loss of programs or other data on your information handling system.

Customer Support
Knowledge Base
Product Resources
Tickets