Open2b versione 7.5

update-customer

Updates the customer's data given a customer key. Any fields left out of the request will remain unchanged.

Request

HTTP POST
X-Customer-Key: customer-key
/api/v10/storefront.update-customer
{
  "customer" : { // customer data to update
    "cart" : "ebe766e73af1128d13217f1bcea6b9d9", // cart (token) (can be null) - string(32)
    "invoiceRecipient" : "AB7TR6K", // electronic invoice recipient code or PEC email address - string(0…256)
    "billingAddress" : { // billing address
      "firstName" : "Sherlock", // first name - string(1…25)
      "lastName" : "Holmes", // last name - string(1…25)
      "personalCode" : "SH239IBA", // personal code - string(0…20)
      "companyName" : "Investigations Inc", // company name - string(0…100)
      "companyCode" : "INV8403MC1", // company code number - string(0…20)
      "companyCode2" : "7J BA3 006", // second company code number - string(0…20)
      "street1" : "221b Baker Street", // street, first row - string(1…60)
      "street2" : "", // street, second row - string(0…60)
      "city" : "London", // city - string(1…25)
      "postalCode" : "NW1 6XE", // postal code - string(1…20)
      "stateProv" : "LND", // state, province or county - string(0…3)
      "country" : "GB", // country (ISO code) - string(2)
      "phoneNumber" : "+44+207 2243688", // phone number - string(0…15)
      "mobileNumber" : "", // mobile number - string(0…15)
      "faxNumber" : "" // fax number - string(0…15)
    },
    "shippingAddress" : { // shipping address (can be null)
      "name" : "John", // recipient name - string(1…100)
      "street1" : "221b Baker Street", // street, first row - string(1…60)
      "street2" : "", // street, second row - string(0…60)
      "city" : "London", // city - string(1…25)
      "postalCode" : "NW1 6XE", // postal code - string(1…20)
      "stateProv" : "LND", // province, state or county - string(0…3)
      "country" : "GB" // country (ISO code) - string(2)
    },
    "wishList" : [ 340, 981, 18, … ], // products (id) on her wish list - int(1…)
    "newsletterLists" : [ 5, 7, … ], // newsletter lists (id) to which she is subscribed - int(1…)
    "privacyConsents" : [ 12, 3, … ] // privacy processings which the customer is giving consent to - int(1…255)
  }
}

Response

{
  "status" : "ok"
}

Errors

Field Type Description
cart NotFound Cart '<cart>' does not exist
invoiceRecipient Malformed '<invoiceRecipient>' is not a recipient code or email address
newsletterLists NotFound Newsletter list <list> does not exist
privacyConsents InvalidValue Consent to processing <id> is required