POST /v1/syncCustomers| Key | Type | Description |
|---|---|---|
command | string | The action to perform: "create" or "update". |
info | object | The full Customer data object, including favorite_item_ids. |
{
"customers": [
{
"command": "update",
"info": {
"id": "cus_a1b2c3d4",
"full_name": "Fatima Al-Fahad",
"phone_number": "+966551234567",
"email": "fatima.alfahad@example.com",
"saved_addresses": [
{
"tag": "Home",
"house_number": "123",
"building_name": "Al-Fahad Tower",
"street": "Olaya Street",
"area": "Olaya",
"city": "Riyadh",
"postal_code": "12345",
"country": "SA",
"location": { "latitude": 24.7136, "longitude": 46.6753 }
}
],
"favorite_merchant_ids": ["mer_riyadh_burger_house", "mer_new_coffee_shop"],
"favorite_item_ids": [
"item_rbh_classic_burger",
"item_almarai_milk_1l",
"item_saudi_dates_500g"
],
"is_active": true,
"updated_at": "2025-10-17T16:25:00Z"
}
}
]
}{
"status": "partial_failure",
"errors": [
{
"id": "cus_a1b2c3d4", // Corresponds to the ID sent in the request's info object
"error": {
"code": "INVALID_DATA",
"message": "One or more favorite_item_ids are invalid."
}
}
// Succeeded customer updates are not listed
]
}