File tree 1 file changed +17
-3
lines changed 1 file changed +17
-3
lines changed Original file line number Diff line number Diff line change @@ -43,12 +43,26 @@ import stripe
43
43
stripe.api_key = " sk_test_..."
44
44
45
45
# list customers
46
- stripe.Customer.list()
46
+ customers = stripe.Customer.list()
47
47
48
- # retrieve single Customer
49
- stripe.Customer.retrieve(" cus_123456789" )
48
+ # print the first customer's email
49
+ print (customers.data[0 ].email)
50
+
51
+ # retrieve specific Customer
52
+ customer = stripe.Customer.retrieve(" cus_123456789" )
53
+
54
+ # print that customer's email
55
+ print (customer.email)
50
56
```
51
57
58
+ ### Handling exceptions
59
+
60
+ Unsuccessful requests raise exceptions. The class of the exception will reflect
61
+ the sort of error that occurred. Please see the [ Api
62
+ Reference] ( https://stripe.com/docs/api/errors/handling ) for a description of
63
+ the error classes you should handle, and for information on how to inspect
64
+ these errors.
65
+
52
66
### Per-request Configuration
53
67
54
68
Configure individual requests with keyword arguments. For example, you can make
You can’t perform that action at this time.
0 commit comments