stripe/stripe-python

Customer Creation Documentation is Unclear

Closed this issue · 1 comments

Describe the bug

Hello! This is not so much a bug as it is a request for clarification.

Our system is using Stripe via DJStripe. As part of our signup process, a corresponding Stripe customer is created. We discovered by listening for the incoming webhooks that whenever a customer is created, we receive a customer.created webhook immediately followed by a customer.updated webhook. This seemed a little inefficient to us, so we began investigating further and discovered that the update was related to the currency ("usd") being attributed to the customer. I am assuming that this update is being triggered by the customer subscription being created as part of the process.

That being said, it seems as though currency does not seem to be a valid parameter you can explicitly set when creating a new customer (we tried setting this dynamically on our end and received some attribute errors); however, the documentation seems to imply that customer creation will return a response body with the currency already set, thereby eliminating the need for the customer.updated webhook.
image

To Reproduce

Review the documentation here: https://stripe.com/docs/api/customers/create

  1. With a test Stripe env set up, open terminal session and trigger a customer.created event : stripe trigger customer.created
  2. If you follow the hyperlink in the response to view the event data, you should see that the usd field remains null, which seems to contradict the example response body provided in the documentation.

Expected behavior

Just need clarification as to the expected behavior for this: should a customer.created event return a currency value (without needing to subscribe to a plan, make a first payment, etc.), and if so, is there a way to set a default currency value and avoid the subsequent customer.updated communication.

Code snippets

No response

OS

Ubuntu

Language version

Python 3.11

Library version

dj-stripe==2.7.2

API version

2022-08-01

Additional context

No response

@anormang1992, Github issues should be limited to bugs with the library itself. This sounds like an integration question that our support team is more quipped to handle. Please reach out to https://support.stripe.com/contact