API Reference
Update Customer API
The Update Customer endpoint allows you to programmatically modify a customer's profile, including their billing and shipping addresses and merchant association.
Update Customer
PUT
/wp-json/wc/v3/customers/{id}Request Body (JSON)
{
"first_name": "James",
"merchant_id": "12345",
"billing": {
"first_name": "James",
"last_name": "Doe",
"company": "Tech Corp",
"address_1": "123 Tech Blvd",
"city": "Sandton",
"state": "GP",
"postcode": "2196",
"country": "ZA",
"email": "james.doe@example.com",
"phone": "+27 11 123 4567"
},
"shipping": {
"first_name": "James",
"last_name": "Doe",
"company": "Tech Corp",
"address_1": "Warehouse 4",
"address_2": "Business Park",
"city": "Midrand",
"state": "GP",
"postcode": "1685",
"country": "ZA"
}
}Response Schema (JSON)
{
"id": 25,
"date_created": "2023-01-15T10:00:00",
"email": "james.doe@example.com",
"first_name": "James",
"last_name": "Doe",
"username": "james.doe",
"role": "customer",
"merchant_id": "12345",
"billing": { ... },
"shipping": { ... },
"is_paying_customer": true,
"avatar_url": "https://secure.gravatar.com/avatar/...",
"meta_data": []
}