#manuel_api
1 messages ยท Page 1 of 1 (latest)
๐ Welcome to your new thread!
โฒ๏ธ We'll be here soon! Typically we respond in a few minutes, but sometimes we might take a bit longer if the server is busy or if you have a particularly tricky question.
โฑ๏ธ We close idle threads, which makes them read-only. Once a thread is closed it won't be reopened, but you can always start a new thread if you have another question.
๐ This thread will always be available, even after it's closed. You can find it again using Discord's search, or you can save this link: https://discord.com/channels/841573134531821608/1420066329481711756
๐ Have more to share? Add more details, code, screenshots, videos, etc. below.
Below are links to other discussions we've had with you in the past week in case you want to review that information. If your question is related to one of these previous discussions, please provide a comprehensive summary of the current state and what you need help with now. We help many users simultaneously, so a summary allows us to resolve your issue as soon as possible.
- manuel_subscription-retry-settings, 23 hours ago, 19 messages
this is the customer and the subscriptio IDs: cus_T4WTkf6qud7Xgw - sub_1SAXU3ESRxUGxqvhD3fvG3Mm
hi there, when using the List Subscriptions API, it'll return a list of subscriptions under the data attribute in the response. so you'll want to expand on data.discounts instead
ok, I understand and how can I find out which items the coupon applies to?
because I am "reactivating" (just creating another one) my customers' canceled subscriptions, and if they have a coupon for that subscription, I need to reapply it. Is that possible?
that would be under the applies_to attribute on the Coupon object https://docs.stripe.com/api/coupons/object#coupon_object-applies_to
so you can try expanding on data.discounts.coupon.applies_to
yeah but im getting the di_abc123... object id and i cant fetch the data with that id
right, that's expected. The Discount object represents the application of a coupon to a subscription, so you can't retrieve them individually. if you wanted to do that with a separate API request, you would use the Retrieve a Coupon API https://docs.stripe.com/api/coupons/retrieve
but how can I get the ID of a coupon if it doesn't give me the answer and only gives me a completely different ID that I can't retrieve?
do you understand?
i need to get the discount, yes but the discount key at the moment to list the subscription just give me an ID that i cant fetch...
if you expand with data.discounts.coupon on the List Subscriptions API request, that should get you the coupon data you need
can you share with me the request ID of that attempt you just made?
ok, give me a sec
i cant find the ID of the request but im doing this in my console:
stripe.Subscription.list(customer=cus_T4WTkf6qud7Xgw, status='all', limit=1)
and this is all the object:
that command doesn't have the expand parameter
yeah i know
im listing all the subscription because i cant get the canceled ones
so im using the status parameter with all or canceled
but i prefer using all
if you do this, does it get the result you want?
stripe.Subscription.list(customer=customer.stripe_id, status='all', limit=1, expand=['data.discounts.coupon'])
you're welcome, glad that worked!
that's all thank you again
also can i get the price ID of the applies_to key? or just only the product ID?
ok ok, thank you