Related Documents
Document Properties
Kbid2B8427
Last Modified14-Sep-2018
Added to KB23-Aug-2017
Public AccessEveryone
StatusOnline
Doc TypeReferences
Product
  • ICM 7.9
  • ICM 7.10

REST API - Update individual customer's profile


Note

Starting with 7.10 our REST API is documented using Swagger notation accessible at developer.cloud.intershop.com.

URI

/customers/-

Http Method

PUT

Short Description

Updates individual customer's profile

Query Parameters

none

Example Requests

/customers/-

HTTP Status Codes

200 OK
400 Bad Request

Possible values for header value "error-key":

customer.missing_fields.error

customer.invalid_fields.error

customer.customerno.already_exists.error

401 Unauthorized

Description

Updates the profile of the currently logged in individual customer

Cartridge

app_sf_rest_b2c

Application

B2C Web Shop

Product Version

7.9

Product To Version

 

Status

final

JSON

Request Data Format

application/json

Request related java object

com.intershop.sellside.rest.b2c.capi.resource.customer.PrivateCustomerItemResource
com.intershop.sellside.rest.b2c.capi.resourceobject.PrivateCustomerRO

Request Example

{
	"customerNo" : "Patricia1",
	"firstName" : "Patricia",
	"lastName" : "Miller",
	"email" : "patricia@test.intershop.de",
	"preferredLanguage" : "de_DE",
    "preferredInvoiceToAddress": {
    	"urn" : "urn:address:customer:vTwKAB2YqvEAAAFb8BMYJJBT:I2MKAB2YsVUAAAFb9RMYJJBT"
    },
    "preferredShipToAddress": {
    	"urn" : "urn:address:customer:vTwKAB2YqvEAAAFb8BMYJJBT:I2MKAB2YsVUAAAFb9RMYJJBT"
    }
}

Note: To remove a preferred address, set the "urn" property to null.

Response Data Format

application/json

Response related java object

com.intershop.sellside.rest.b2c.capi.resource.customer.PrivateCustomerItemResource
com.intershop.sellside.rest.b2c.capi.resourceobject.PrivateCustomerRO

Response Example

With 200 status:

{
  "type": "PrivateCustomer",
  "customerNo": "Patricia1",
  "preferredInvoiceToAddress": {
    "type": "Address",
    "urn": "urn:address:customer:vTwKAB2YqvEAAAFb8BMYJJBT:I2MKAB2YsVUAAAFb9RMYJJBT",
    "id": "I2MKAB2YsVUAAAFb9RMYJJBT",
    "addressName": "customeraddr-ABCDEFGPRMuMCscyXgSRVU",
    "title": "Ms.",
    "firstName": "Patricia",
    "lastName": "Miller",
    "addressLine1": "Potsdamer Str. 20",
    "postalCode": "14483",
    "phoneHome": "049364112677",
    "country": "Germany",
    "countryCode": "DE",
    "city": "Berlin",
    "usage": [
      true,
      true
    ],
    "invoiceToAddress": true,
    "shipFromAddress": false,
    "serviceToAddress": false,
    "installToAddress": false,
    "shipToAddress": true,
    "street": "Potsdamer Str. 20"
  },
  "preferredShipToAddress": {
    "type": "Address",
    "urn": "urn:address:customer:vTwKAB2YqvEAAAFb8BMYJJBT:I2MKAB2YsVUAAAFb9RMYJJBT",
    "id": "I2MKAB2YsVUAAAFb9RMYJJBT",
    "addressName": "customeraddr-ABCDEFGPRMuMCscyXgSRVU",
    "title": "Ms.",
    "firstName": "Patricia",
    "lastName": "Miller",
    "addressLine1": "Potsdamer Str. 20",
    "postalCode": "14483",
    "phoneHome": "049364112677",
    "country": "Germany",
    "countryCode": "DE",
    "city": "Berlin",
    "usage": [
      true,
      true
    ],
    "invoiceToAddress": true,
    "shipFromAddress": false,
    "serviceToAddress": false,
    "installToAddress": false,
    "shipToAddress": true,
    "street": "Potsdamer Str. 20"
  },
  "title": "",
  "firstName": "Patricia",
  "lastName": "Miller",
  "phoneHome": "",
  "phoneBusiness": "",
  "phoneMobile": "",
  "fax": "",
  "email": "patricia@test.intershop.de",
  "preferredLanguage": "de_DE"
}

XML

XML Request Data Format

text/xml

XML Request Java Objects

com.intershop.sellside.rest.b2c.capi.resource.customer.PrivateCustomerItemResource
com.intershop.sellside.rest.b2c.capi.resourceobject.PrivateCustomerRO

XML Request Example

<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<PrivateCustomer type="PrivateCustomer">
    <customerNo>Patricia1</customerNo>
    <email>patricia@test.intershop.de</email>
    <firstName>Patricia</firstName>
    <lastName>Miller</lastName>
    <preferredLanguage>de_DE</preferredLanguage>
    <preferredInvoiceToAddress type="Address">
        <urn>urn:address:customer:vTwKAB2YqvEAAAFb8BMYJJBT:I2MKAB2YsVUAAAFb9RMYJJBT</urn>
    </preferredInvoiceToAddress>
    <preferredShipToAddress type="Address">
        <urn>urn:address:customer:vTwKAB2YqvEAAAFb8BMYJJBT:I2MKAB2YsVUAAAFb9RMYJJBT</urn>
    </preferredShipToAddress>
</PrivateCustomer>

Note: To remove a preferred address, pass an address without the "urn" property.

XML Response Data Format

text/xml

XML Response Java Objects

com.intershop.sellside.rest.b2c.capi.resource.customer.PrivateCustomerItemResource
com.intershop.sellside.rest.b2c.capi.resourceobject.PrivateCustomerRO

XML Response Example

With 200 status:

<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<PrivateCustomer type="PrivateCustomer">
    <customerNo>Patricia1</customerNo>
    <preferredInvoiceToAddress type="Address">
        <addressLine1>Potsdamer Str. 20</addressLine1>
        <addressName>customeraddr-ABCDEFGPRMuMCscyXgSRVU</addressName>
        <city>Berlin</city>
        <country>Germany</country>
        <countryCode>DE</countryCode>
        <firstName>Patricia</firstName>
        <id>I2MKAB2YsVUAAAFb9RMYJJBT</id>
        <installToAddress>false</installToAddress>
        <invoiceToAddress>true</invoiceToAddress>
        <lastName>Miller</lastName>
        <phoneHome>049364112677</phoneHome>
        <postalCode>14483</postalCode>
        <serviceToAddress>false</serviceToAddress>
        <shipFromAddress>false</shipFromAddress>
        <shipToAddress>true</shipToAddress>
        <street>Potsdamer Str. 20</street>
        <title>Ms.</title>
        <urn>urn:address:customer:vTwKAB2YqvEAAAFb8BMYJJBT:I2MKAB2YsVUAAAFb9RMYJJBT</urn>
        <usage/>
    </preferredInvoiceToAddress>
    <preferredShipToAddress type="Address">
        <addressLine1>Potsdamer Str. 20</addressLine1>
        <addressName>customeraddr-ABCDEFGPRMuMCscyXgSRVU</addressName>
        <city>Berlin</city>
        <country>Germany</country>
        <countryCode>DE</countryCode>
        <firstName>Patricia</firstName>
        <id>I2MKAB2YsVUAAAFb9RMYJJBT</id>
        <installToAddress>false</installToAddress>
        <invoiceToAddress>true</invoiceToAddress>
        <lastName>Miller</lastName>
        <phoneHome>049364112677</phoneHome>
        <postalCode>14483</postalCode>
        <serviceToAddress>false</serviceToAddress>
        <shipFromAddress>false</shipFromAddress>
        <shipToAddress>true</shipToAddress>
        <street>Potsdamer Str. 20</street>
        <title>Ms.</title>
        <urn>urn:address:customer:vTwKAB2YqvEAAAFb8BMYJJBT:I2MKAB2YsVUAAAFb9RMYJJBT</urn>
        <usage/>
    </preferredShipToAddress>
    <email>patricia@test.intershop.de</email>
    <fax></fax>
    <firstName>Patricia</firstName>
    <lastName>Miller</lastName>
    <phoneBusiness></phoneBusiness>
    <phoneHome></phoneHome>
    <phoneMobile></phoneMobile>
    <preferredLanguage>de_DE</preferredLanguage>
    <title></title>
</PrivateCustomer>

And header:

Location: -

With 400 status:

<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<Validation>
    <errors>error.customer.customerno.already-exists</errors>
    <reason>error.customer.customerno.already-exists</reason>
    <valid>false</valid>
</Validation>

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
Support Tickets