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