Skip to content

关于 客户

访问范围

需要多个访问范围—请参阅每个端点以了解访问范围要求。

需要访问受保护的客户数据。

客户模块旨在帮助商家维护和分析客户关系。Genstore 提供了一组 RESTful 接口,用于管理在线商店的客户信息。通过这些接口,商家可以高效处理客户信息,包括联系方式、订单历史记录以及营销邮件订阅等。

核心功能

  • 创建客户:创建新的客户记录。
  • 删除客户:移除已有的客户记录。
  • 查询客户:获取特定客户详情。
  • 查询客户列表:获取店铺客户列表。

TIP

在使用客户 API 之前,请确保您确保您的帐户具有足够的权限来执行接口操作。

应用场景

  • 客户资料同步:CRM 系统可通过查询客户详情接口,实现客户信息变更的实时同步更新。
  • 营销人群分层:营销平台可通过获取客户列表接口,基于客户属性和偏好创建精准的营销活动。

接口

EVENT customers/merge: 客户合并消息

EVENT customers/update: 客户更新消息

EVENT customers/delete: 客户删除消息

EVENT customers/create: 客户创建消息

客户 对象

创建与管理客户。

属性

customerobject
表示客户的个人信息。
- 收起属性
idnumber
客户的唯一标识符。
emailstring
客户的邮箱。
createTimestring
客户的创建时间(ISO 8601格式)。
updateTimestring
客户的更新时间(ISO 8601格式)。
phonestring
客户的手机号。
verifiedEmailboolean
客户是否验证邮箱。
statestring
客户在商店的帐户状态。枚举值: DECLINED - 用户拒绝成为客户;DISABLED - 无效账户;ENABLED - 活跃客户;INVITED - 邀请中的客户。
firstNamestring
客户的名称。
lastNamestring
客户的姓。
notesstring
关于客户的备注。
ordersCountobject
客户在商店下的总订单数量。
totalSpentobject
客户在商店下的总消费金额。
taxExemptboolean
客户的订单是否可以免税。
taxExemptionsobject
适用于客户的免税清单。
+ 展开属性
smsMarketingConsentobject
客户手机号当前的短信营销状态。
+ 展开属性
tagsarray
客户的标签列表。
emailMarketingConsentobject
客户邮箱地址当前的邮件营销状态。
+ 展开属性
defaultAddressobject
与客户关联的默认地址。
+ 展开属性
addressesarray
与客户关联的地址。
+ 展开属性
bash
{
  "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"
    }
  }
}

EVENT 客户合并消息

客户合并消息。

访问范围

需要以下任意访问权限: write_customers read_customers

消息

EVENT customers/merge 

消息数据

jobIdnumber
任务的唯一标识符。
customerKeptIdnumber
在合并中被保留的客户唯一标识符。
customerDeletedIdnumber
在合并中被删除的客户唯一标识符。
statusstring
客户合并的状态。枚举值:
* COMPLETED - 客户合并请求已完成;
* FAILED - 客户合并失败;
* IN_PROGRESS - 客户合并请求当前正在进行中;
* REQUESTED - 已请求客户合并。
errorFieldsarray
客户合并请求期间发生的错误。
+ 展开属性
json
{
  "jobId": "123456789",
  "customerDeletedId": "111222333",
  "customerKeptId": "987654321",
  "errorFields": [
    {
      "field": "deletedAt",
      "message": "The customer does not exist."
    }
  ],
  "status": "COMPLETED"
}

EVENT 客户更新消息

客户更新消息

访问范围

需要以下任意访问权限: write_customers read_customers

消息

EVENT customers/update 

消息数据

customerobject
表示客户的个人信息。
- 收起属性
idnumber
客户的唯一标识符。
emailstring
客户的邮箱。
createTimestring
客户的创建时间(ISO 8601格式)。
updateTimestring
客户的更新时间(ISO 8601格式)。
phonestring
客户的手机号。
verifiedEmailboolean
客户是否验证邮箱。
statestring
客户在商店的帐户状态。枚举值: DECLINED - 用户拒绝成为客户;DISABLED - 无效账户;ENABLED - 活跃客户;INVITED - 邀请中的客户。
firstNamestring
客户的名称。
lastNamestring
客户的姓。
notesstring
关于客户的备注。
ordersCountobject
客户在商店下的总订单数量。
totalSpentobject
客户在商店下的总消费金额。
taxExemptboolean
客户的订单是否可以免税。
taxExemptionsobject
适用于客户的免税清单。
+ 展开属性
smsMarketingConsentobject
客户手机号当前的短信营销状态。
+ 展开属性
tagsarray
客户的标签列表。
emailMarketingConsentobject
客户邮箱地址当前的邮件营销状态。
+ 展开属性
defaultAddressobject
与客户关联的默认地址。
+ 展开属性
addressesarray
与客户关联的地址。
+ 展开属性
json
{
  "lastName": "li",
  "addresses": [
    {
      "zip": "23456",
      "firstName": "heihei",
      "lastName": "du",
      "address2": "cao he jing",
      "city": "shang hai",
      "phone": "2345653464",
      "address1": "xu hui",
      "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": "shang hai",
    "phone": "13315035578",
    "address1": "xu hui",
    "countryCode": "CN",
    "provinceCode": "FJ",
    "company": "demo",
    "isDefaultAddress": "true",
    "id": "878"
  }
}

EVENT 客户删除消息

客户删除消息

访问范围

需要以下任意访问权限: write_customers read_customers

消息

EVENT customers/delete 

消息数据

customerobject
表示客户的个人信息。
- 收起属性
idnumber
客户的唯一标识符。
emailstring
客户的邮箱。
createTimestring
客户的创建时间(ISO 8601格式)。
updateTimestring
客户的更新时间(ISO 8601格式)。
phonestring
客户的手机号。
firstNamestring
客户的名称。
lastNamestring
客户的姓。
json
{
  "customer": {
    "firstName": "test23",
    "lastName": "li",
    "createTime": "2024-18-12T08:18:49",
    "phone": "13315034487",
    "updateTime": "2024-18-12T08:18:49",
    "id": "1020000013062",
    "email": "[email protected]"
  }
}

EVENT 客户创建消息

客户创建消息

访问范围

需要以下任意访问权限: write_customers read_customers

消息

EVENT customers/create 

消息数据

customerobject
表示客户的个人信息。
- 收起属性
idnumber
客户的唯一标识符。
emailstring
客户的邮箱。
createTimestring
客户的创建时间(ISO 8601格式)。
updateTimestring
客户的更新时间(ISO 8601格式)。
phonestring
客户的手机号。
verifiedEmailboolean
客户是否验证邮箱。
statestring
客户在商店的帐户状态。枚举值: DECLINED - 用户拒绝成为客户;DISABLED - 无效账户;ENABLED - 活跃客户;INVITED - 邀请中的客户。
firstNamestring
客户的名称。
lastNamestring
客户的姓。
notesstring
关于客户的备注。
ordersCountobject
客户在商店下的总订单数量。
totalSpentobject
客户在商店下的总消费金额。
taxExemptboolean
客户的订单是否可以免税。
taxExemptionsobject
适用于客户的免税清单。
+ 展开属性
smsMarketingConsentobject
客户手机号当前的短信营销状态。
+ 展开属性
tagsarray
客户的标签列表。
emailMarketingConsentobject
客户邮箱地址当前的邮件营销状态。
+ 展开属性
defaultAddressobject
与客户关联的默认地址。
+ 展开属性
addressesarray
与客户关联的地址。
+ 展开属性
json
{
  "lastName": "li",
  "addresses": [
    {
      "zip": "23456",
      "firstName": "heihei",
      "lastName": "du",
      "address2": "cao he jing",
      "city": "shang hai",
      "phone": "2345653464",
      "address1": "xu hui",
      "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": "shang hai",
    "phone": "13315035578",
    "address1": "xu hui",
    "countryCode": "CN",
    "provinceCode": "FJ",
    "company": "demo",
    "isDefaultAddress": "true",
    "id": "878"
  }
}