#bk_whopper
1 messages · Page 1 of 1 (latest)
thanks so much @upbeat cargo
So if you are applying directly here you want the promotion code ID: https://stripe.com/docs/api/promotion_codes/object#promotion_code_object-id
one detail to add - this is a test promotion code that was created on stripe.com, not api generated.
Looks like you are trying to apply the promotion_code.code
so, in order to apply the promotion_code to a subscription, I need to get the promotion_code.id?
Correct. The code is the Customer-facing ID that would be input into some of our hosted flows. But if you are going to actually apply it manually yourself then you need the ID. So you would list by code: https://stripe.com/docs/api/promotion_codes/list#list_promotion_code-code
Then you can get the ID
I see. so to clarify:
- customer enters customer-facing coupon code.
- app gets list of all promotion codes
- app finds promotion code that matches the customer-facing coupon code, gets id
- app applies promotion_code.id to customer subscription.
Yep except you don't need to list all promo codes to find the match since you can filter by the code itself in the list request
oh, will you show me that? I don't see an example of how to filter by code in the request here: https://stripe.com/docs/api/promotion_codes/retrieve
Complete reference documentation for the Stripe API. Includes code snippets and examples for our Python, Java, PHP, Node.js, Go, Ruby, and .NET libraries.
oh wait
I linked it above