#alecpope

1 messages · Page 1 of 1 (latest)

cosmic anchorBOT
rare vault
acoustic light
#

So it is not possible to search for multiple products with a certain ID, that are also active?

rare vault
#

it's not about IDs, it's just that AND and OR can't be used together.

acoustic light
#

Okay, but how is it possible to search for certain products that are active? I basically have an array of IDs and now I want to filter all products that have one of the ID in the array. Also one constraint is that these products need to be active

rare vault
acoustic light
#

Oh okay. Would the filter then look like this?

    params := &stripe.ProductListParams{}
    params.Filters.AddFilter("active", "", "true")
    params.Filters.AddFilter("ids", "", "prod_XXX,prod_YYY")
rare vault
#

Can you give it a try?

acoustic light
#

Sure, one moment

#

It's not working. It returns no result, although the products exists

rare vault
#
params := &stripe.ProductListParams{
        Active: stripe.Bool(true),
        IDs:  []*string{
            stripe.String("prod_XXX"),
            stripe.String("prod_YYY"),
          },
    }
#

Can you try this instead?

acoustic light
#

Yeah, that works. Thanks!
Is there a way to do similar things with Payment Intents? Like filter on IDs and Customer?

rare vault
acoustic light
#

Hmm. So how can I solve this? Just filter on customer and filter out received payment intents in my code?

rare vault
acoustic light
#

I want to retrieve multiple payment intents based on IDs in one request

rare vault
#

Not possible with the current API, I'm afraid.

#

You need to make multiple requests to retrieve the payment_intent one by one.

acoustic light
#

What about using the query language?

rare vault
acoustic light
#

Hmm okay.
In general: it is not possible to have an AND and OR inside a query? For example: (id:'XXX' AND customer:'ZZZ') OR (id:'YYY' AND customer:'ZZZ')

rare vault
#

Not possible I'm afraid

acoustic light
#

Do you know of any plans on adding more functionalities like that? I guess it could save a lot of unnecessary requests/bandwidth/time

rare vault
#

https://support.stripe.com/contact I don't have a roadmap, you can reach out to Stripe support and tell them your feature request.

acoustic light
#

Okay, thank you very much. This will help :)

acoustic light
#

One quick question: why are there always list and search params? What are the differences/Why is it separated?

rare vault
#

They are quite similar, my personal view is that the search API is a more advanced way of listing/filtering a collection of data