Hi there,
In order to determine if a particular `Coupon` is already attached to a particular `Customer` object, you should inspect the `discounts` property on the `Customer` object (
https://stripe.com/docs/api/python#customer_object-discount). This property will have a null value if there are currently no `Discount` objects associated with that particular `Customer` object. If there is a `Discount` object associated with this particular `Customer` object, then the `discount` property will contain the associated `Coupon` object (as the value of the `coupon` property), and the timestamp of when this particular `Coupon` was associated with this particular `Customer` as the value for the `start` property.
A `Customer` can only have a single associated `Coupon` at a given time, so inspecting this property on the `Customer` object will be sufficient to determine if the `Customer` has already been associated with this `Coupon`.
If you want a clean mapping of `Customer` objects to `Coupon` objects, you should maintain this mapping in your own system. There is not an easy way via the Stripe API to retrieve all of the uses of a particular `Coupon`. Maintaining such a mapping in your own system would also allow you to easily create a single unique `Coupon` per `Customer`.
If you have specific questions about implementing this, I would suggest that you write in to
sup...@stripe.com instead of this list.
Good luck and happy hacking!
-zach