0
votes

If I have a customer id cus_jkhjsa776757, is it possible to retrieve a charge associated with that customer id? For example, something like:

charge = Stripe::Charge.retrieve({ :id => 'cus_jkhjsa776757' })

For that I am getting an error:

"Stripe::InvalidRequestError (No such charge: cus_jkhjsa776757)"

1
did u find a solution? - 7urkm3n
No, I didn't. Any input on this would be very helpful. - BlueIvy

1 Answers

0
votes

Try this one it should return charges for the customer specified by this customer ID.

In DOCs

enter image description here

charge = Stripe::Charge.list(customer: "cus_jkhjsa776757")

Also good source for you: How to get charge id after creating a subscription using Stripe?