关于 客户 ​
访问范围
需要多个访问范围—请参阅每个端点以了解访问范围要求。
需要访问受保护的客户数据。
客户模块旨在帮助商家维护和分析客户关系。Genstore 提供了一组 RESTful 接口,用于管理在线商店的客户信息。通过这些接口,商家可以高效处理客户信息,包括联系方式、订单历史记录以及营销邮件订阅等。
核心功能
- 创建客户:创建新的客户记录。
- 删除客户:移除已有的客户记录。
- 查询客户:获取特定客户详情。
- 查询客户列表:获取店铺客户列表。
TIP
在使用客户 API 之前,请确保您确保您的帐户具有足够的权限来执行接口操作。
应用场景
- 客户资料同步:CRM 系统可通过查询客户详情接口,实现客户信息变更的实时同步更新。
- 营销人群分层:营销平台可通过获取客户列表接口,基于客户属性和偏好创建精准的营销活动。
客户 对象 ​
创建与管理客户
属性 ​
{
"customer": {
"lastName": "li",
"addresses": [
{
"zip": "23456",
"firstName": "heihei",
"lastName": "du",
"address2": "上海闵行",
"city": "上海",
"phone": "2345653464",
"address1": "上海嘉定",
"countryCode": "CN",
"provinceCode": "SH",
"company": "公司地址",
"isDefaultAddress": "false",
"id": "879"
}
],
"notes": "this is new customer",
"totalSpent": "13",
"taxExempt": "true",
"taxExemptions": {
"applyToAllRegion": "true",
"taxExemptionRegions": [
{
"country": "US",
"applyToAllSubdivision": "false",
"subdivisions": "["NYC"]"
}
]
},
"updateTime": "2024-18-12T08:18:49",
"smsMarketingConsent": {
"state": "SUBSCRIBED",
"consentUpdateTime": "2024-11-12T08:18:49.125"
},
"tags": "[ "xinsheng", "human" ]",
"emailMarketingConsent": {
"state": "SUBSCRIBED",
"consentUpdateTime": "2024-11-12T08:18:49.125"
},
"firstName": "test23",
"ordersCount": "2",
"createTime": "2024-18-12T08:18:49",
"phone": "13315034487",
"id": "1020000013062",
"state": "DECLINED",
"email": "[email protected]",
"verifiedEmail": "true",
"defaultAddress": {
"zip": "20000",
"firstName": "heihei",
"lastName": "chen",
"address2": "cao he jing",
"city": "shanghai",
"phone": "13315035578",
"address1": "xu hui",
"countryCode": "CN",
"provinceCode": "FJ",
"company": "demo",
"isDefaultAddress": "true",
"id": "878"
}
}
}
POST
创建客户 ​
创建一个客户。
访问范围
需要以下任意访问权限: write_customers
接口
POST
/api/202412/customers
请求参数
响应数据
curl -X POST \
https://{shop}.genmystore.com/api/202412/customers" \
-H "X-Genstore-Access-Token: {access_token}" \
-H "Content-Type: application/json" \
-d '{
"customer":{
"lastName":"li",
"addresses":[
{
"zip":"23456",
"firstName":"heihei",
"lastName":"du",
"address2":"shanghai",
"city":"xuhui",
"phone":"2345653464",
"address1":"caohejing",
"countryCode":"CN",
"provinceCode":"SH",
"company":"demo",
"isDefaultAddress":"false",
"id":"879"
}
],
"notes":"this is new customer",
"totalSpent":"13",
"taxExempt":"true",
"taxExemptions":{
"applyToAllRegion":"true",
"taxExemptionRegions":[
{
"country":"US",
"applyToAllSubdivision":"false",
"subdivisions":[
"NYC"
]
}
]
},
"updateTime":"2024-18-12T08:18:49",
"smsMarketingConsent":{
"state":"SUBSCRIBED",
"consentUpdateTime":"2024-11-12T08:18:49.125"
},
"tags":[
"xinsheng",
"human"
],
"emailMarketingConsent":{
"state":"SUBSCRIBED",
"consentUpdateTime":"2024-11-12T08:18:49.125"
},
"firstName":"test23",
"ordersCount":"2",
"createTime":"2024-18-12T08:18:49",
"phone":"13315034487",
"id":"1020000013062",
"state":"DECLINED",
"email":"[email protected]",
"verifiedEmail":"true",
"defaultAddress":{
"zip":"20000",
"firstName":"heihei",
"lastName":"chen",
"address2":"cao he jing",
"city":"shanghai",
"phone":"13315035578",
"address1":"xu hui",
"countryCode":"CN",
"provinceCode":"FJ",
"company":"demo",
"isDefaultAddress":"true",
"id":"878"
}
}
}'
HTTP/1.1 200 OK
{
"customer": {
"lastName": "li",
"addresses": [
{
"zip": "23456",
"firstName": "heihei",
"lastName": "du",
"address2": "caohejing",
"city": "shanghai",
"phone": "2345653464",
"address1": "xuhui",
"countryCode": "CN",
"provinceCode": "SH",
"company": "demo",
"isDefaultAddress": "false",
"id": "879"
}
],
"notes": "this is new customer",
"totalSpent": "13",
"taxExempt": "true",
"taxExemptions": {
"applyToAllRegion": "true",
"taxExemptionRegions": [
{
"country": "US",
"applyToAllSubdivision": "false",
"subdivisions": [
"NYC"
]
}
]
},
"updateTime": "2024-18-12T08:18:49",
"smsMarketingConsent": {
"state": "SUBSCRIBED",
"consentUpdateTime": "2024-11-12T08:18:49.125"
},
"tags": [
"xinsheng",
"human"
],
"emailMarketingConsent": {
"state": "SUBSCRIBED",
"consentUpdateTime": "2024-11-12T08:18:49.125"
},
"firstName": "test23",
"ordersCount": "2",
"createTime": "2024-18-12T08:18:49",
"phone": "13315034487",
"id": "1020000013062",
"state": "DECLINED",
"email": "[email protected]",
"verifiedEmail": "true",
"defaultAddress": {
"zip": "20000",
"firstName": "heihei",
"lastName": "chen",
"address2": "cao he jing",
"city": "shanghai",
"phone": "13315035578",
"address1": "xu hui",
"countryCode": "CN",
"provinceCode": "FJ",
"company": "demo",
"isDefaultAddress": "true",
"id": "878"
}
}
}
POST
检索客户 ​
根据条件检索客户。
访问范围
需要以下任意访问权限: write_customers
接口
POST
/api/202412/customers/search
请求参数
响应数据
curl -X POST \
https://{shop}.genmystore.com/api/202412/customers/search" \
-H "X-Genstore-Access-Token: {access_token}" \
-H "Content-Type: application/json" \
-d '{
"query":"customer_id:1;orders_count:2",
"limit":"10",
"pageToken":"< url?pageToken=eyJwYWdlTnVtIjoxLCJwYWdlU2l6ZSI6MX0=&limit=1 >; rel=previous,< url?pageToken=eyJwYWdlTnVtIjozLCJwYWdlU2l6ZSI6MX0=&limit=1 >; rel=next",
"order":"createTime DESC"
}'
HTTP/1.1 200 OK
{
"customers": "cusomer"
}
PUT
修改客户信息 ​
修改客户信息。
访问范围
需要以下任意访问权限: write_customers
接口
PUT
/api/202412/customers/{customerId}
请求参数
响应数据
curl -X PUT \
https://{shop}.genmystore.com/api/202412/customers/{customerId}" \
-H "X-Genstore-Access-Token: {access_token}" \
-H "Content-Type: application/json" \
-d '{
"customer":{
"lastName":"li",
"addresses":[
{
"zip":"23456",
"firstName":"heihei",
"lastName":"du",
"address2":"上海闵行",
"city":"上海",
"phone":"2345653464",
"address1":"上海嘉定",
"countryCode":"CN",
"provinceCode":"SH",
"company":"公司地址",
"isDefaultAddress":"false",
"id":"879"
}
],
"notes":"this is new customer",
"totalSpent":"13",
"taxExempt":"true",
"taxExemptions":{
"applyToAllRegion":"true",
"taxExemptionRegions":[
{
"country":"US",
"applyToAllSubdivision":"false",
"subdivisions":[
"NYC"
]
}
]
},
"updateTime":"2024-18-12T08:18:49",
"smsMarketingConsent":{
"state":"SUBSCRIBED",
"consentUpdateTime":"2024-11-12T08:18:49.125"
},
"tags":[
"xinsheng",
"human"
],
"emailMarketingConsent":{
"state":"SUBSCRIBED",
"consentUpdateTime":"2024-11-12T08:18:49.125"
},
"firstName":"test23",
"ordersCount":"2",
"createTime":"2024-18-12T08:18:49",
"phone":"13315034487",
"state":"DECLINED",
"email":"[email protected]",
"verifiedEmail":"true",
"defaultAddress":{
"zip":"20000",
"firstName":"heihei",
"lastName":"chen",
"address2":"cao he jing",
"city":"shanghai",
"phone":"13315035578",
"address1":"xu hui",
"countryCode":"CN",
"provinceCode":"FJ",
"company":"demo",
"isDefaultAddress":"true",
"id":"878"
}
}
}'
HTTP/1.1 200 OK
{
"customer": {
"lastName": "li",
"addresses": [
{
"zip": "23456",
"firstName": "heihei",
"lastName": "du",
"address2": "上海闵行",
"city": "上海",
"phone": "2345653464",
"address1": "上海嘉定",
"countryCode": "CN",
"provinceCode": "SH",
"company": "公司地址",
"isDefaultAddress": "false",
"id": "879"
}
],
"notes": "this is new customer",
"totalSpent": "13",
"taxExempt": "true",
"taxExemptions": {
"applyToAllRegion": "true",
"taxExemptionRegions": [
{
"country": "US",
"applyToAllSubdivision": "false",
"subdivisions": [
"NYC"
]
}
]
},
"updateTime": "2024-18-12T08:18:49",
"smsMarketingConsent": {
"state": "SUBSCRIBED",
"consentUpdateTime": "2024-11-12T08:18:49.125"
},
"tags": [
"xinsheng",
"human"
],
"emailMarketingConsent": {
"state": "SUBSCRIBED",
"consentUpdateTime": "2024-11-12T08:18:49.125"
},
"firstName": "test23",
"ordersCount": "2",
"createTime": "2024-18-12T08:18:49",
"phone": "13315034487",
"id": "1020000013062",
"state": "DECLINED",
"email": "[email protected]",
"verifiedEmail": "true",
"defaultAddress": {
"zip": "20000",
"firstName": "heihei",
"lastName": "chen",
"address2": "cao he jing",
"city": "shanghai",
"phone": "13315035578",
"address1": "xu hui",
"countryCode": "CN",
"provinceCode": "FJ",
"company": "demo",
"isDefaultAddress": "true",
"id": "878"
}
}
}
DELETE
删除客户 ​
删除客户。注意:如果客户有现有订单,则无法删除。
访问范围
需要以下任意访问权限: write_customers
接口
DELETE
/api/202412/customers/{customerId}
请求参数
响应数据
curl -X DELETE \
https://{shop}.genmystore.com/api/202412/customers/{customerId}" \
-H "X-Genstore-Access-Token: {access_token}" \
HTTP/1.1 200 OK
{
"customer": {
"firstName": "test23",
"lastName": "li",
"createTime": "2024-18-12T08:18:49",
"phone": "13315034487",
"updateTime": "2024-18-12T08:18:49",
"id": "1020000013062",
"email": "[email protected]"
}
}
GET
获取客户详情 ​
获取客户详情。
访问范围
需要以下任意访问权限: write_customers
read_customers
接口
GET
/api/202412/customers/{customerId}
请求参数
响应数据
curl -X GET \
https://{shop}.genmystore.com/api/202412/customers/{customerId}" \
-H "X-Genstore-Access-Token: {access_token}" \
HTTP/1.1 200 OK
{
"customer": {
"lastName": "li",
"addresses": [
{
"zip": "23456",
"firstName": "heihei",
"lastName": "du",
"address2": "上海闵行",
"city": "上海",
"phone": "2345653464",
"address1": "上海嘉定",
"countryCode": "CN",
"provinceCode": "SH",
"company": "公司地址",
"isDefaultAddress": "false",
"id": "879"
}
],
"notes": "this is new customer",
"totalSpent": "13",
"taxExempt": "true",
"taxExemptions": {
"applyToAllRegion": "true",
"taxExemptionRegions": [
{
"country": "US",
"applyToAllSubdivision": "false",
"subdivisions": [
"NYC"
]
}
]
},
"updateTime": "2024-18-12T08:18:49",
"smsMarketingConsent": {
"state": "SUBSCRIBED",
"consentUpdateTime": "2024-11-12T08:18:49.125"
},
"tags": [
"xinsheng",
"human"
],
"emailMarketingConsent": {
"state": "SUBSCRIBED",
"consentUpdateTime": "2024-11-12T08:18:49.125"
},
"firstName": "test23",
"ordersCount": "2",
"createTime": "2024-18-12T08:18:49",
"phone": "13315034487",
"id": "1020000013062",
"state": "DECLINED",
"email": "[email protected]",
"verifiedEmail": "true",
"defaultAddress": {
"zip": "20000",
"firstName": "heihei",
"lastName": "chen",
"address2": "cao he jing",
"city": "shanghai",
"phone": "13315035578",
"address1": "xu hui",
"countryCode": "CN",
"provinceCode": "FJ",
"company": "demo",
"isDefaultAddress": "true",
"id": "878"
}
}
}
GET
查询客户列表 ​
查询客户列表。
访问范围
需要以下任意访问权限: write_customers
read_customers
接口
GET
/api/202412/customers
请求参数
响应数据
curl -X GET \
https://{shop}.genmystore.com/api/202412/customers" \
-H "X-Genstore-Access-Token: {access_token}" \
HTTP/1.1 200 OK
{
"customers": [
{
"lastName": "li",
"addresses": [
{
"zip": "23456",
"firstName": "heihei",
"lastName": "du",
"address2": "caohejing",
"city": "ShangHai",
"phone": "2345653464",
"address1": "xuhui",
"countryCode": "CN",
"provinceCode": "SH",
"company": "demo",
"isDefaultAddress": "false",
"id": "879"
}
],
"notes": "this is new customer",
"totalSpent": "13",
"taxExempt": "true",
"taxExemptions": {
"applyToAllRegion": "true",
"taxExemptionRegions": [
{
"country": "US",
"applyToAllSubdivision": "false",
"subdivisions": [
"NYC"
]
}
]
},
"updateTime": "2024-18-12T08:18:49",
"smsMarketingConsent": {
"state": "SUBSCRIBED",
"consentUpdateTime": "2024-11-12T08:18:49.125"
},
"tags": [
"xinsheng",
"human"
],
"emailMarketingConsent": {
"state": "SUBSCRIBED",
"consentUpdateTime": "2024-11-12T08:18:49.125"
},
"firstName": "test23",
"ordersCount": "2",
"createTime": "2024-18-12T08:18:49",
"phone": "13315034487",
"id": "1020000013062",
"state": "DECLINED",
"email": "[email protected]",
"verifiedEmail": "true",
"defaultAddress": {
"zip": "20000",
"firstName": "heihei",
"lastName": "chen",
"address2": "cao he jing",
"city": "shanghai",
"phone": "13315035578",
"address1": "xu hui",
"countryCode": "CN",
"provinceCode": "FJ",
"company": "demo",
"isDefaultAddress": "true",
"id": "878"
}
}
]
}
关于 客户
访问范围
需要多个访问范围—请参阅每个端点以了解访问范围要求。
需要访问受保护的客户数据。
客户模块旨在帮助商家维护和分析客户关系。Genstore 提供了一组 RESTful 接口,用于管理在线商店的客户信息。通过这些接口,商家可以高效处理客户信息,包括联系方式、订单历史记录以及营销邮件订阅等。
核心功能
- 创建客户:创建新的客户记录。
- 删除客户:移除已有的客户记录。
- 查询客户:获取特定客户详情。
- 查询客户列表:获取店铺客户列表。
TIP
在使用客户 API 之前,请确保您确保您的帐户具有足够的权限来执行接口操作。
应用场景
- 客户资料同步:CRM 系统可通过查询客户详情接口,实现客户信息变更的实时同步更新。
- 营销人群分层:营销平台可通过获取客户列表接口,基于客户属性和偏好创建精准的营销活动。
客户 对象
创建与管理客户
属性
POST
创建客户
创建一个客户。
访问范围
需要以下任意访问权限: write_customers
接口
POST
/api/202412/customers
POST
检索客户
根据条件检索客户。
访问范围
需要以下任意访问权限: write_customers
接口
POST
/api/202412/customers/search
PUT
修改客户信息
修改客户信息。
访问范围
需要以下任意访问权限: write_customers
接口
PUT
/api/202412/customers/{customerId}
DELETE
删除客户
删除客户。注意:如果客户有现有订单,则无法删除。
访问范围
需要以下任意访问权限: write_customers
接口
DELETE
/api/202412/customers/{customerId}
GET
获取客户详情
获取客户详情。
访问范围
需要以下任意访问权限: write_customers
read_customers
接口
GET
/api/202412/customers/{customerId}
GET
查询客户列表
查询客户列表。
访问范围
需要以下任意访问权限: write_customers
read_customers
接口
GET
/api/202412/customers