事件分组事件标识
appsubscriptionappsubscription/create
当商家订阅应用内的商品时,平台会将相关订阅信息推送给开发者
请求头
  • X-Shopline-Topic string required
    事件操作标识
    Example: orders/edited
  • X-Shopline-Hmac-Sha256 string required
    签名
    Example: XWmrwMey6OsLMeiZKwP4FppHH3cmAiiJJAweH5Jo4bM=
  • X-Shopline-Shop-Domain string required
    店铺域名
    Example: shophub.myshopline.com
  • X-Shopline-Shop-Id string required
    店铺id
    Example: 1610418123456
  • X-Shopline-Merchant-Id string required
    商户ID
    Example: 2000001234
  • X-Shopline-API-Version string required
    版本号
    Example: v20210901
  • X-Shopline-Webhook-Id string required
    消息ID
    Example: b54557e48a5fbf7d70bcd043
请求体
  • appkey string
    应用唯一标识。
    Example: 56978e0b3f33365396d7786a62ed0a03727e3212
  • handle string
    店铺域名中的第一个单词,也是店铺的唯一标识,比如:www.discount.myshopline.com;"discount"即为handle
    Example: discount
  • secondChannelId string
    二级渠道ID,通常用于线下门店购买服务
    Example: 4567223323
  • subId string
    创建订阅时生成的对应订单号
    Example: 6578332207010012345
  • subPackageobject
    订阅记录对象
  • autoRenewStatus boolean
    当前订阅记录是否开启了自动续费
    Example: true
  • endAt long
    订阅的失效时间精确到秒。失效时间通常设定为生效时间加上一个周期时长后的整点。
  • featureKeyList array
    套餐包含的功能点
    Example: { demo:feature }
  • gracePeriod long
    宽限期数值,即在到期日之后仍然可以正常使用应用功能的时长。
    • 注意:宽限期为按照自然时间计算;比如套餐在22:33:33 到期后,设置1天宽限期,则应用套餐在第二天的 22:33:33 彻底失效
    Example: 2
  • gracePeriodUnit string
    宽恕期的单位,
    • SECOND:秒,应用套餐和增值服务使用这个单位
    • DAY:天,一次性付费商品使用这个单位
    Example: SECOND
  • isEnterpriseGift boolean
    当前订阅记录是否属于打包售卖时的附赠部分
    • true:是
    • false:否
    Example: true
  • period integer
    周期的数值
    Example: 1
  • periodType string
    周期单位,枚举值:
    • DAY:周期单位为天
    • YEAR:周期单位为年
    Example: DAY
  • serviceKeyListobject[]
    服务能力的列表,目前只有‘一次性付费套餐’有这个对象
  • availableQty long
    服务剩余可用的数值
    Example: 20
  • indefinite boolean
    是否无限期的商品
    • true:无限期商品 -false:非无限期商品
    Example: true
  • serviceKey string
    服务能力的唯一标识
    Example: email_100
  • totalQty long
    服务包含的总数值
    Example: 100
  • spuKey string
    在创建套餐时录入的套餐唯一标识
    Example: email
  • startAt long
    套餐的订阅生效时间,精确到秒
  • trial boolean
    这个订阅记录是否为试用
    • True:试用
    • False:非试用
    Example: true
  • subTime long
    支付成功的时间戳
    Example: 1706810461000
响应
收到 SHOPLINE 发送的 Webhook 通知后,你需要按照如下 SHOPLINE 要求的格式进行响应。
HTTP/1.1 200 OK
关于如何订阅 Webhooks 及更多 Webhook 响应规则说明,请参考 Webhook 概述
这篇文章对你有帮助吗?