需要 write_customers 权限点。
接口访问需要令牌,具体如何获取令牌参考:身份认证
创建新客户
Arguments
input ● CustomerInput!non-null
用于创建客户的输入字段
More
Return
customer ● Customer
创建的客户
More
错误信息
More
错误码
关于更多通用错误码说明,参考:状态码和错误码
Example
创建客户
{
"input": {
"addresses": [
{
"address1": "Chestnut Street 92",
"address2": "Apartment 2",
"city": "Louisville",
"company": "C*****",
"country": "United States",
"countryCode": "US",
"firstName": "S*****",
"lastName": "T*****",
"phone": "0086185****1234",
"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": "0086185****1234",
"smsMarketingConsent": {
"consentUpdatedAt": null,
"marketingState": "SUBSCRIBED"
},
"tags": [
"test1"
],
"taxExempt":true,
"taxExemptions": [
{
"countryCode":"US",
"provinceGCodeList":["AL","AK"]
}
]
}
}
Response
{
"data": {
"customerCreate": {
"customer": {
"email": "******@example.com",
"lastName": "T*****",
"note": "Placed an order that had a fraud warning",
"phone": "0086185****1234",
"tags": [
"test1"
],
"taxExempt": true,
"taxExemptions": [
{
"countryCode": "US",
"provinceGCodeList": [
"AL",
"AK"
]
}
],
"addresses": [
{
"city": "Louisville",
"district": "district",
"lastName": "T****",
"province": "Kentucky",
"firstName": "S*****",
"phone": "0086185****1234",
"address1": "Chestnut Street 92",
"address2": "Apartment 2",
"company": "C*****",
"countryCodeV2": "US",
"zip": "40202",
"country": "United States",
"id": "gid://shopline/MailingAddress/SL201UA6288180448515858676",
"provinceCode": null,
"town": "Street"
}
],
"createdAt": "2024-01-13T08:01:09.761Z",
"firstName": "S*****",
"id": "gid://shopline/Customer/4600508354",
"updatedAt": "2024-01-13T08:01:10.541Z",
"verifiedEmail": false,
"defaultAddress": {
"city": "Louisville",
"district": "district",
"phone": "0086185****1234",
"company": "C*****",
"lastName": "T*****",
"provinceCode": null,
"town": "Street",
"zip": "40202",
"province": "Kentucky",
"address1": "Chestnut Street 92",
"address2": "Apartment 2",
"country": "United States",
"firstName": "S*****",
"id": "gid://shopline/MailingAddress/SL201UA6288180448515858676",
"countryCodeV2": "US"
}
},
"userErrors": null
}
}
}
这篇文章对你有帮助吗?