Stripe - 获取特定电子邮件的订阅
Stripe - get subscription for specific email
我有客户邮箱。如何检查客户是否有有效订阅?
我正在使用卷曲。
谢谢。
这将是一个 two-step 过程:
首先,使用客户的电子邮件查找客户 ID like this:
curl https://api.stripe.com/v1/customers \
-u sk_xxx: \
-d email=foo@bar.com \
-G
其次,使用客户 ID 列出他们所有的订阅 like this:
curl https://api.stripe.com/v1/subscriptions \
-u sk_xxx: \
-d customer=cu_xxx \
-G
条纹允许 expand responses。幸运的是 subscriptions
属性 of customer
object 是可扩展的。因此,您可以减少 API 请求和中间代码行数。
curl https://api.stripe.com/v1/customers/search \
-u $API_KEY: \
--data-urlencode query="email:'test@example.com'" \
-d "expand[]"="data.subscriptions" \
-G
我有客户邮箱。如何检查客户是否有有效订阅? 我正在使用卷曲。 谢谢。
这将是一个 two-step 过程:
首先,使用客户的电子邮件查找客户 ID like this:
curl https://api.stripe.com/v1/customers \
-u sk_xxx: \
-d email=foo@bar.com \
-G
其次,使用客户 ID 列出他们所有的订阅 like this:
curl https://api.stripe.com/v1/subscriptions \
-u sk_xxx: \
-d customer=cu_xxx \
-G
条纹允许 expand responses。幸运的是 subscriptions
属性 of customer
object 是可扩展的。因此,您可以减少 API 请求和中间代码行数。
curl https://api.stripe.com/v1/customers/search \
-u $API_KEY: \
--data-urlencode query="email:'test@example.com'" \
-d "expand[]"="data.subscriptions" \
-G