Stripe, is it possible to search a customer by their email?

前端 未结 12 1445
暗喜
暗喜 2020-12-08 06:32

Update: Since around January 2018, it is now possible to search using the email parameter on Stripe. See the accepted answer.


I

12条回答
  •  没有蜡笔的小新
    2020-12-08 06:40

    Since you specified that

    The documentation only indicate to search by created, ending_before, limit and starting_after, but no "email".

    You are right, you can't search using emails.

    If you still wish to do that, What you can do instead is to get a list of all the customer and filter on the response you get using email.

    For Example, in ruby you can do it as follows:

    customers = Stripe::Customer.all
    
    customer_i_need = customers.select do |c|
      c.email == "foo@bar.com"
    end
    

    PS: Stripe can have multiple customers associated with one email address.

提交回复
热议问题