版本:202201
更新顾客
PUT/openapi/2022-01/customers/:id
通过顾客 ID 更新现有顾客的详细信息。
请求
Path参数
id string必填
Customer's ID
- application/json
- 请求体
- 示例
请求体
customer object
first_namestring
last_namestring
accepts_marketingboolean
Whether to subscribe marketing email campaign
默认值:
trueaccepts_sms_marketingboolean
Whether to subscribe marketing sms campaign
默认值:
truetagsstring
Tags, e.g. New Customer,Repeat Customer
{
"customer": {
"first_name": "string",
"last_name": "string",
"accepts_marketing": true,
"accepts_sms_marketing": true,
"tags": "string"
}
}
响应
- 200
- 400
- 404
200
- application/json
- 数据结构
- 示例
- Result
数据结构
- Array [
- ]
customer object
idstring
示例:
2dd957e3-2051-4cdf-8584-9c0046b4d1aefirst_namestring
示例:
ryanlast_namestring
示例:
zhangnamestring
示例:
ryan zhangemailstring
phonestring
示例:
+8615014471143phone_area_code
contact_typestring
示例:
emailaccepts_marketingboolean
默认值:
true示例:
truesource
free_taxboolean
默认值:
true示例:
falseregisteredboolean
默认值:
true示例:
falseorders_countinteger
默认值:
0示例:
0last_order_at
total_spentstring
示例:
0.00tagsstring
示例:
New Customercreated_atstring
示例:
2024-04-17T11:10:33Zupdated_atstring
示例:
2024-04-17T11:10:33Zsubscribed_flaginteger
默认值:
0示例:
5sms_subscribed_flaginteger
默认值:
0示例:
5accepts_sms_marketingboolean
默认值:
true示例:
truedefault_address object
idstring
示例:
9ffa8dc0-25b8-4424-832e-bab46fcfeb20customer_idstring
示例:
2dd957e3-2051-4cdf-8584-9c0046b4d1aefirst_namestring
示例:
testlast_namestring
示例:
testcompanystring
示例:
citystring
示例:
深圳provincestring
示例:
countrystring
示例:
Aland lslandszipstring
示例:
515300province_codestring
示例:
country_codestring
示例:
AXgenderstring
示例:
phonestring
示例:
+86 150 1447 1143phone_area_code
areastring
示例:
emailstring
namestring
示例:
test testaddress1string
示例:
6 三聖街address2string
示例:
1111country_namestring
示例:
Aland lslandsdefaultboolean
默认值:
true示例:
trueaddresses object[]
idstring
示例:
9ffa8dc0-25b8-4424-832e-bab46fcfeb20customer_idstring
示例:
2dd957e3-2051-4cdf-8584-9c0046b4d1aefirst_namestring
示例:
testlast_namestring
示例:
testcompanystring
示例:
citystring
示例:
深圳provincestring
示例:
countrystring
示例:
Aland lslandszipstring
示例:
515300province_codestring
示例:
country_codestring
示例:
AXgenderstring
示例:
phonestring
示例:
+86 150 1447 1143phone_area_code
areastring
示例:
emailstring
namestring
示例:
test testaddress1string
示例:
6 三聖街address2string
示例:
1111country_namestring
示例:
Aland lslandsdefaultboolean
默认值:
true示例:
true{
"customer": {
"id": "2dd957e3-2051-4cdf-8584-9c0046b4d1ae",
"first_name": "ryan",
"last_name": "zhang",
"name": "ryan zhang",
"phone": "+8615014471143",
"phone_area_code": {},
"contact_type": "email",
"accepts_marketing": true,
"source": {},
"free_tax": false,
"registered": false,
"orders_count": 0,
"last_order_at": {},
"total_spent": "0.00",
"tags": "New Customer",
"created_at": "2024-04-17T11:10:33Z",
"updated_at": "2024-04-17T11:10:33Z",
"subscribed_flag": 5,
"sms_subscribed_flag": 5,
"accepts_sms_marketing": true,
"default_address": {
"id": "9ffa8dc0-25b8-4424-832e-bab46fcfeb20",
"customer_id": "2dd957e3-2051-4cdf-8584-9c0046b4d1ae",
"first_name": "test",
"last_name": "test",
"company": "",
"city": "深圳",
"province": "",
"country": "Aland lslands",
"zip": "515300",
"province_code": "",
"country_code": "AX",
"gender": "",
"phone": "+86 150 1447 1143",
"phone_area_code": {},
"area": "",
"name": "test test",
"address1": "6 三聖街",
"address2": "1111",
"country_name": "Aland lslands",
"default": true
},
"addresses": [
{
"id": "9ffa8dc0-25b8-4424-832e-bab46fcfeb20",
"customer_id": "2dd957e3-2051-4cdf-8584-9c0046b4d1ae",
"first_name": "test",
"last_name": "test",
"company": "",
"city": "深圳",
"province": "",
"country": "Aland lslands",
"zip": "515300",
"province_code": "",
"country_code": "AX",
"gender": "",
"phone": "+86 150 1447 1143",
"phone_area_code": {},
"area": "",
"name": "test test",
"address1": "6 三聖街",
"address2": "1111",
"country_name": "Aland lslands",
"default": true
}
]
}
}
{
"customer": {
"id": "2dd957e3-2051-4cdf-8584-9c0046b4d1ae",
"first_name": "ryan",
"last_name": "zhang",
"name": "ryan zhang",
"phone": "+8615014471143",
"phone_area_code": null,
"contact_type": "email",
"accepts_marketing": true,
"source": null,
"free_tax": false,
"registered": false,
"orders_count": 0,
"last_order_at": null,
"total_spent": "0.00",
"tags": "New Customer",
"created_at": "2024-04-17T11:10:33Z",
"updated_at": "2024-04-17T11:10:33Z",
"subscribed_flag": 5,
"sms_subscribed_flag": 5,
"accepts_sms_marketing": true,
"default_address": {
"id": "9ffa8dc0-25b8-4424-832e-bab46fcfeb20",
"customer_id": "2dd957e3-2051-4cdf-8584-9c0046b4d1ae",
"first_name": "test",
"last_name": "test",
"company": "",
"city": "深圳",
"province": "",
"country": "Aland lslands",
"zip": "515300",
"province_code": "",
"country_code": "AX",
"gender": "",
"phone": "+86 150 1447 1143",
"phone_area_code": null,
"area": "",
"name": "test test",
"address1": "6 三聖街",
"address2": "1111",
"country_name": "Aland lslands",
"default": true
},
"addresses": [
{
"id": "9ffa8dc0-25b8-4424-832e-bab46fcfeb20",
"customer_id": "2dd957e3-2051-4cdf-8584-9c0046b4d1ae",
"first_name": "test",
"last_name": "test",
"company": "",
"city": "深圳",
"province": "",
"country": "Aland lslands",
"zip": "515300",
"province_code": "",
"country_code": "AX",
"gender": "",
"phone": "+86 150 1447 1143",
"phone_area_code": null,
"area": "",
"name": "test test",
"address1": "6 三聖街",
"address2": "1111",
"country_name": "Aland lslands",
"default": true
}
]
}
}
400
- application/json
- 数据结构
- 示例
- Result
数据结构
errorsstring[]
{
"errors": [
""
]
}
{
"errors": [
""
]
}
404
- application/json
- 数据结构
- 示例
- Result
数据结构
errorsstring[]
{
"errors": [
"Record not found"
]
}
{
"errors": [
"Record not found"
]
}