#jwerre
1 messages · Page 1 of 1 (latest)
Do you have the exact code with the query string that I can look at? My guess is that you're adding extra quotation marks, but I can't tell for sure without seeing what you're running on your end
customersSearch = await stripe.customers.search({ query: `metadata["user-id"]:"${id.toString()}"`});```
What's the Customer ID of the customer that has that metadata?
No, I mean the Customer object ID that Stripe uses. Should look like cus_abc123
It's delete after my unit tests complete but the request id is: req_I7sRdTGUmL32JS
Here is the search request: req_RbSDr8dPUBp2RK
I can run it again and not delete if you like
... going to hang it up for the day. I'll check on this tomorrow. Thanks for your help.
Ah, unfortunately I need a Customer ID from the Customer that has the metadata in order to confirm. Feel free to hop back in when you're back online
Ok so here is the customer:
{
id: 'cus_NeblNbN0eO01MT',
object: 'customer',
address: {
city: 'Orlando',
country: 'US',
line1: '123 Palm St.',
line2: null,
postal_code: '32789',
state: 'FL'
},
balance: 0,
created: 1680648108,
currency: null,
default_source: null,
delinquent: false,
description: null,
discount: null,
email: 'billing-lg2uhnd9@surveyplanet.com',
invoice_prefix: '89327431',
invoice_settings: {
custom_fields: null,
default_payment_method: null,
footer: null,
rendering_options: null
},
livemode: false,
metadata: {
'user-email': 'lg2uhnd9@surveyplanet.com',
'user-id': '642ca7ab5e2e801121957046'
},
name: 'Acme Inc.',
next_invoice_sequence: 1,
phone: '5555555555',
preferred_locales: [],
shipping: null,
tax_exempt: 'exempt',
tax_ids: {
object: 'list',
data: [ [Object] ],
has_more: false,
total_count: 1,
url: '/v1/customers/cus_NeblNbN0eO01MT/tax_ids'
},
test_clock: null
}
It is not deleted
Searching with the following produces nothing:
customersSearch = await stripe.customers.search({ query: `metadata["user-id"]:"642ca7ab5e2e801121957046"`});
👋 stepping in for my teammate. the search query above looks correct. one thing to note about the search API is that results may not be returned immediately: https://stripe.com/docs/search#data-freshness
Are you still receiving 0 results?