#Nyxi

1 messages · Page 1 of 1 (latest)

ember flareBOT
nimble dove
#

and I get no matches with number:<myvalue>, which seems to support substring?

#

maybe I'm doing something wrong

dark heart
#

Hm can you share the request ID?

nimble dove
#

Yeah hold on

#

I'm doing this:

/** @var Invoice[] $invoices */
$invoices = $stripe->invoices->search(
    ['query' => 'number:"RKM" AND created>' . (time() - 3600 * 24 * 60)]
)
    ->autoPagingIterator();

And I want to match invoices that start with RKM. If I do number:"RKM160-0033", I get the one invoice, but obviously I want all of them

#

req_5C7vDPNtnI9Ioe

dark heart
#

Gotcha. I think substring just isn't allowed for invoice number, but let me see if I can find confirmation

nimble dove
#

Not really reflected in the docs that

#

I tried with number~"RKM" but that gave the original error I posted

dark heart
#

What version of the PHP library are you using?

nimble dove
#

9.x

dark heart
#

Oh you shared the request ID. Looking

nimble dove
#

9.8

dark heart
#

Yeah looks like substring isn't supported on Invoice number. We need to do a better job calling that out in the docs though, so I'll let the team know

nimble dove
#

Alright cool

#

Unfortunate, cause I have to loop so many other invoices since I can't filter on number

#

I suppose I could put some metadata on them though

dark heart
#

Yeah sorry about that. The metadata workaround seems like a good plan to me

#

I'll provide this feedback to the team though

nimble dove
#

No problem

#

While you're at it; being able to search on invoice status would help a alot

#

for some bizzare reason you cannot provide that in the search language, and the regular list API endpoint only supports 1 status as a parameter, not an array

#

I want uncollectible and open invoices, for instance

#

so I have to loop all of them and filter out on status post-API

dark heart
#

Yeah I don't have a clear cut answer on why we do that