/customers/id

Update a single address of an existing customer.
Addresses can be managed manually from the customer profile or flow from orders. Changing an address in a customer profile does not affect orders, but changing the address in an order may affect it in the customer profile.

URL parameters

Parameters that you can append to the URL, for example: ?parameter=value

TitleTypeDescriptionRequired?
idintID of a single customer to update. Can be used after the slash.
Example:
customers/27
update customer with ID 27
Yes

Request body parameters

Parameters that you can send in the request body in JSON format, for example:
{"email": "[email protected]","first_name": "James"}

TitleTypeDescriptionRequired?
addressarrayArray containing the details of the address that should be updatedYes
address.idintID of the address to updateYes
address.shipping.first_namestringFirst name for shippingNo
address.shipping.last_namestringLast name for shippingNo
address.shipping.companystringCompany for shippingNo
address.shipping.streetstringStreet name for shippingNo
address.shipping.suitestringSuite for shippingNo
address.shipping.citystringCity for shippingNo
address.shipping.countrystringCountry for shipping, 2-letter code as per ISO 3166-1No
address.shipping.statestringState/province/region for shipping, 2-letter code as per ISO 3166-2No
address.shipping.zipstringZip/postal code for shippingNo
address.billing.first_namestringFirst name for billingNo
address.billing.last_namestringLast name for billingNo
address.billing.streetstringStreet name for billingNo
address.billing.suitestringSuite for billingNo
address.billing.citystringCity for billingNo
address.billing.countrystringCountry for billing, 2-letter code as per ISO 3166-1No
address.billing.statestringState/province/region for billing, 2-letter code as per ISO 3166-2No
address.billing.zipstringZip/postal code for billingNo
address.phonestringPhone for the addressNo

Response attributes

Attributes that you will receive in response from the endpoint in JSON format, for example:
{"email": "[email protected]","first_name": "James"}

TitleTypeDescription
idintID of the customer
emailstringEmail of the customer
first_namestringFirst name of the customer
last_namestringLast name of the customer
addressobject containing arraysOne or multiple addresses assigned to the customer
address.ididID of the address
address.shipping.first_namestringFirst name for shipping
address.shipping.last_namestringLast name for shipping
address.shipping.companystringCompany for shipping
address.shipping.streetstringStreet name for shipping
address.shipping.suitestringSuite for shipping
address.shipping.citystringCity for shipping
address.shipping.countrystringCountry for shipping, 2-letter code as per ISO 3166-1
address.shipping.statestringState/province/region for shipping, 2-letter code as per ISO 3166-2
address.shipping.zipstringZip/postal code for shipping
address.billing.first_namestringFirst name for billing
address.billing.last_namestringLast name for billing
address.billing.streetstringStreet name for billing
address.billing.suitestringSuite for billing
address.billing.citystringCity for billing
address.billing.countrystringCountry for billing, 2-letter code as per ISO 3166-1
address.billing.statestringState/province/region for billing, 2-letter code as per ISO 3166-2
address.billing.zipstringZip/postal code for billing
address.phonestringPhone for the address
payment.typestringType of payment method. Can be: Visa, American Express, MasterCard, Discover, JCB, Diners Club, PayPal
payment.last4stringLast 4 digits of the card number, if paid by card
notesstringNotes about the customer, optionally set by the store owner
statistics.last_purchaseintTimestamp of last purchase by the customer
statistics.order_countintNumber of orders the customer has placed
statistics.lifetime_spentintAmount of money spent by customer on this store
ordersarray of intsArray of the customer's order IDs
tagsarray of stringsArray containing the tags of all the products that the customer bought
created_atintTimestamp of the customer creation time
updated_atintTimestamp of the customer last update time
PATCH https://mystore.commercehq.com/api/v1/customers/30
{
  "address": {
    "id": 77,
    "shipping": {
      "first_name": "jamie"
    },
    "phone": "123"
  }
}
{
  "id": 6,
  "email": "[email protected]",
  "first_name": "James",
  "last_name": "C Smith",
  "address": [
    {
      "id": 7,
      "shipping": {
        "first_name": "James",
        "last_name": "C Smith",
        "company": null,
        "street": "46 Leatherwood St.",
        "suite": "1432",
        "city": "North Hollywood",
        "country": "US",
        "state": "CA",
        "zip": "91605"
      },
      "billing": {
        "first_name": "James",
        "last_name": "C Smith",
        "street": "46 Leatherwood St.",
        "suite": "1432",
        "city": "North Hollywood",
        "country": "US",
        "state": "CA",
        "zip": "91605"
      },
      "phone": "any string here"
    }
  ],
  "payment": [],
  "notes": "Some Notes about customer",
  "statistics": {
    "last_purchase": null,
    "order_count": null,
    "lifetime_spent": 0
  },
  "orders": [],
  "tags": [],
  "created_at": 1485004452,
  "updated_at": 1485004452
}