stripe-python icon indicating copy to clipboard operation
stripe-python copied to clipboard

implement EphemeralKey.create_async

Open Numerlor opened this issue 8 months ago • 4 comments

Is your feature request related to a problem? Please describe.

EphemeralKey only provides delete async methods, and no create

Describe the solution you'd like

A create async method consistent with other objects

Describe alternatives you've considered

No response

Additional context

No response

Numerlor avatar Apr 22 '25 09:04 Numerlor

the sync create is also missing the return type hint

Numerlor avatar Apr 22 '25 09:04 Numerlor

Hi! Thanks for bringing this up. We'll look into why this isn't being generated. In the meantime, we do have an async create for StripeClient, which could satisfy your needs:

from stripe import StripeClient

client = StripeClient("sk_test_...")

client.ephemeral_keys.create_async({ <YOUR_CREATE_PARAMS> })

helenye-stripe avatar May 01 '25 19:05 helenye-stripe

Hi there! I've submitted a pull request (#1676) that implements the create_async method for EphemeralKey.

The implementation follows the same pattern as other async methods in the codebase (like delete_async) and includes comprehensive test coverage. I've also added return type annotations to both create() and create_async() methods to address the type hint concern mentioned in the comments.

The PR is ready for review whenever the maintainers have time. Happy to make any adjustments if needed.

praniketkw avatar Nov 18 '25 06:11 praniketkw

Re-opening until we ship an update with the fix next month

ramya-stripe avatar Nov 24 '25 23:11 ramya-stripe