需要 write_customers 权限点。
接口访问需要令牌,具体如何获取令牌参考:身份认证
按ID更新客户信息
Arguments
input ● CustomerInput!non-null
为客户提供更新的字段
More
Return
customer ● Customer
更新的客户
More
错误信息
More
错误码
关于更多通用错误码说明,参考:状态码和错误码
Example
更新客户信息
{
"input": {
"id": "gid://shopline/Customer/******018",
"addresses": [
{
"address1": "Chestnut Street 92",
"address2": "Apartment 2",
"city": "Louisville",
"company": "C*****",
"country": "United States",
"countryCode": "US",
"firstName": "S*****",
"lastName": "T*****",
"phone": "0086134****8765",
"province": "Kentucky",
"provinceCode": "4200021",
"zip": "40202",
"district":"district",
"town":"Street"
}
],
"email": "*****@example.com",
"emailMarketingConsent": {
"consentUpdatedAt": null,
"marketingState": "SUBSCRIBED"
},
"firstName": "S*****",
"lastName": "T*****",
"note": "Placed an order that had a fraud warning",
"phone": "0086138****1234",
"smsMarketingConsent": {
"consentUpdatedAt": null,
"marketingState": "SUBSCRIBED"
},
"tags": [
"test1"
],
"taxExempt":true,
"taxExemptions": [
{
"countryCode":"US",
"provinceGCodeList":["AK"]
}
]
}
}
Response
{
"data": {
"customerUpdate": {
"customer": {
"lastName": "T*****",
"note": "Placed an order that had a fraud warning",
"phone": "008138****1234",
"taxExemptions": [
{
"countryCode": "US",
"provinceGCodeList": [
"AK"
]
}
],
"defaultAddress": {
"zip": "40202",
"address1": "Chestnut Street 92",
"company": "C*****",
"country": "United States",
"countryCodeV2": "US",
"firstName": "S*****",
"phone": "0086138****1234",
"address2": "Apartment 2",
"city": "Louisville",
"id": "gid://shopline/MailingAddress/SL201UA6288183152684310781",
"lastName": "T*****",
"province": "Kentucky",
"provinceCode": null
},
"firstName": "S*****",
"id": "gid://shopline/Customer/******018",
"taxExempt": true,
"updatedAt": "2024-01-13T08:03:51.321Z",
"verifiedEmail": false,
"smsMarketingConsent": {
"consentUpdatedAt": "2024-01-13T08:03:52.337Z",
"marketingState": "SUBSCRIBED"
},
"tags": [
"test1"
],
"addresses": [
{
"provinceCode": null,
"firstName": "S*****",
"id": "gid://shopline/MailingAddress/SL201UA6288183152684310781",
"lastName": "T*****",
"province": "Kentucky",
"zip": "40202",
"address1": "Chestnut Street 92",
"address2": "Apartment 2",
"city": "Louisville",
"company": "C*****",
"country": "United States",
"countryCodeV2": "US",
"phone": "0086138****1234"
}
],
"createdAt": "2024-01-11T06:06:22.500Z",
"email": "*****@example.com",
"emailMarketingConsent": {
"consentUpdatedAt": "2024-01-13T08:03:52.257Z",
"marketingState": "SUBSCRIBED"
}
},
"userErrors": null
}
}
}
这篇文章对你有帮助吗?