Stripe · sdk · fg-0156

subscription.items is a dict method, not the line items, in stripe-python before v15

If you see TypeError: 'builtin_function_or_method' object is not iterable, the cause and the fix for Stripe are below, last verified 2026-10-15.

Verified Oct 2026trust 50/100
Symptom
TypeError: 'builtin_function_or_method' object is not iterablesub.items prints a bound method instead of a list object
Cause
Before v15 StripeObject subclassed dict, so the attribute name items resolved to dict.items and shadowed the API field.
Fix
Use bracket access for the field. On v15 and later sub.items returns the line items and key iteration moves to to_dict().
Apply
for item in subscription["items"]["data"]: print(item["price"]["id"])
Affected
stripe-python before 15.0.0; behavior changes in 15.0.0
Sources

Last verified 2026-10-15 · Confirmed by 0 builders

Related traps

Have your agent know this before it fails

$ /plugin marketplace add getfootgun/footgun
$ /plugin install footgun@footgun