#erluxman_api

1 messages ยท Page 1 of 1 (latest)

grand ibexBOT
#

๐Ÿ‘‹ Welcome to your new thread!

โฒ๏ธ We'll be here soon! Typically we respond in a few minutes, but sometimes we might take a bit longer if the server is busy or if you have a particularly tricky question.

โฑ๏ธ We close idle threads, which makes them read-only. Once a thread is closed it won't be reopened, but you can always start a new thread if you have another question.

๐Ÿ”— This thread will always be available, even after it's closed. You can find it again using Discord's search, or you can save this link: https://discord.com/channels/841573134531821608/1481259633124573326

๐Ÿ“ Have more to share? Add more details, code, screenshots, videos, etc. below.

worn tundra
#

Sorry I couldnt add all the details due to text's length limit on the form

dire vale
#

hey there ๐Ÿ‘‹ is there a specific value (i.e. an account ID) that you expected to be returned by your Search API call?

#

also could you share the request ID (req_123) for the Search call?

#

no worries!

worn tundra
#

yeah accountId would be perfect

#

let me check

dire vale
#

sorry I was a bit unclear, I meant to ask if you could share the account ID that you expected to be returned, so we can double check the details on our side

worn tundra
#

the problem isn't that it returns wrong or doesnt return at all, it says the search api isn't even available so you mean my account id not the connected user;s id right?

#

acct_1NgfRHG6b521Lrze

#

this is my account id

dire vale
#

what if you search the email in your dashboard - do you see a connected account then?

(I'm not suggesting this as a solution, I just want to understand if you actually have a connected account with that email - then we can work on an API-based solution)

worn tundra
#

yeah i have

#

let me confirm by searching

dire vale
#

perfect, thanks

worn tundra
dire vale
#

that looks like you only have a customer profile associated with that email, rather than a connected account

worn tundra
#

so lets try this one

grand ibexBOT
worn tundra
#
curl -G https://api.stripe.com/v1/accounts/search \                                                                                                                                                ๎‚ถ โœ” โ–“โ–’โ–‘
  -u "sk_test_51NgfRHG6b521LrzeeqGjN1eFyPpzjAxAi7GUPzDRvYH3DJbOgLrDOU5e3rTCjZyfGQA4G7Ye8OvV85rFwIHkfGax00jXBSarHO:" \
  -d query="email:'bridzan1@bridzan.com'"
{
  "error": {
    "message": "The provided key 'sk_test_***********************************************************************************************arHO' does not have access to account 'search' (or that account does not exist). Application access may have been revoked.",
    "type": "invalid_request_error",
    "code": "account_invalid",
    "doc_url": "https://stripe.com/docs/error-codes/account-invalid"
  }
}
#

I still face the same issue for this email as well..

steady wave
#

๐Ÿ‘‹ Hi there! I'm taking over for my colleague. Let me take a look

worn tundra
#

Sure Arran..

#

welcome to the thread

#

do you get the problem? or can i help you in any ways to understand it better?

#

please reply, i will eat.. i will join you

steady wave
#

Yeah, no worries

#

Thanks for sharing the request/response. Despite the confusing error message, the issue here is that we don't have a /v1/accounts/search endpoint

worn tundra
#

can you provide a curl command i am afraid i tried this

#

curl -G https://api.stripe.com/v1/accounts/list \ ๎‚ถ โœ” โ–“โ–’โ–‘
-u "sk_test_51NgfRHG6b521LrzeeqGjN1eFyPpzjAxAi7GUPzDRvYH3DJbOgLrDOU5e3rTCjZyfGQA4G7Ye8OvV85rFwIHkfGax00jXBSarHO:"
-d email="bridzan@bridzan.com'"
{
"error": {
"message": "The provided key 'sk_test_***********************************************************************************************arHO' does not have access to account 'list' (or that account does not exist). Application access may have been revoked.",
"type": "invalid_request_error",
"code": "account_invalid",
"doc_url": "https://stripe.com/docs/error-codes/account-invalid"
}
}

Review the list of error codes Stripe might return in an API response so you can handle responding to them in your integration.

steady wave
#

Sure, the documentation provides curl examples: curl -G https://api.stripe.com/v1/accounts -u "sk_test_โ€ฆ:"

worn tundra
#

but then how do i filter it by email?

#

curl -G https://api.stripe.com/v1/accounts \ ๎‚ถ โœ” โ–“โ–’โ–‘
-u "sk_test_51NgfRHG6b521LrzeeqGjN1eFyPpzjAxAi7GUPzDRvYH3DJbOgLrDOU5e3rTCjZyfGQA4G7Ye8OvV85rFwIHkfGax00jXBSarHO:"
-d email="bridzan@bridzan.com'"
{
"error": {
"code": "parameter_unknown",
"doc_url": "https://stripe.com/docs/error-codes/parameter-unknown",
"message": "Received unknown parameter: email",
"param": "email",
"request_log_url": "https://dashboard.stripe.com/acct_1NgfRHG6b521Lrze/test/workbench/logs?object=req_6jBaS6UWDmfyox",
"type": "invalid_request_error"
}
}

Review the list of error codes Stripe might return in an API response so you can handle responding to them in your integration.

#

this is what i get when trying to filter, which i had tried before as well..

#

going through each accounts and checking email (lets say i have 10000 users, i will have to go 100 times) and increasingly so, So the paginated user list isnt a solution for us

steady wave
#

Do you have 100,000 users?

#

Or what scale are you working at?

worn tundra
#
curl -G https://api.stripe.com/v1/customers/search \                                                                                                                                               ๎‚ถ โœ” โ–“โ–’โ–‘
  -u "sk_test_51NgfRHG6b521LrzeeqGjN1eFyPpzjAxAi7GUPzDRvYH3DJbOgLrDOU5e3rTCjZyfGQA4G7Ye8OvV85rFwIHkfGax00jXBSarHO:" \
  -d query="email:'bridzan@bridzan.com'" 
{
  "object": "search_result",
  "data": [
    {
      "id": "cus_U1jUDlHqJQvolx",
      "object": "customer",
      "address": null,
      "balance": 0,
      "created": 1771779671,
      "currency": null,
      "customer_account": null,
      "default_source": null,
      "delinquent": false,
      "description": null,
      "discount": null,
      "email": "bridzan@bridzan.com",
      "invoice_prefix": "S5Z8R9UW",
      "invoice_settings": {
        "custom_fields": null,
        "default_payment_method": null,
        "footer": null,
        "rendering_options": null
      },
      "livemode": false,
      "metadata": {
        "userId": "uPjiFuKXnhTRwCh1Nzz4BDSjDwn2"
      },
      "name": "brizan bhattarai",
      "next_invoice_sequence": 1,
      "phone": null,
      "preferred_locales": [],
      "shipping": null,
      "tax_exempt": "none",
      "test_clock": null
    }
  ],
  "has_more": false,
  "next_page": null,
  "url": "/v1/customers/search"
}%                               

I think i found the solution for me

steady wave
#

We do have an internal feature request to have a search API for accounts that could let you search directly by email, for example. I've added your use case to this as being interested

steady wave
worn tundra
#

yeah sorry..

#

it doesnt solve..

#

i want to search connected accounts just like this..

#

we do not have 10000 users as of now, but ride sharing drivers will have connect account to accumulate their money in wallet..

#

and we want to make sure no two drivers use same email to signup

steady wave
#

Understood. The best solution we have at the moment is the List Connected Accounts API, if you have no way of storing emails in your own database

worn tundra
#

can you help me create a request with the parameters i provided? i am lil confused here..

steady wave
#

You would list the connected accounts, and check the email parameter of each result

worn tundra
#

how do i filter? or do i have to filter in clientside?

steady wave
#

Yes, it would be client-side

#

Well server-side, where you're running this query

worn tundra
#

isn't that a turn off? or its designed in that way? can i know the reason?

worn tundra
#

the fact that we have to O(n) through the list of accounts to check email doesn't seem like a right solution to me..

Can i now the reason stripe doesn't provide that api for connected accounts but provides for customers?

steady wave
#

I couldn't tell you why there hasn't been an API for this built so far, but it's a known feature request

#

I can only guess, but I imagine that many platforms manage and authenticate users by storing information in their own database

worn tundra
#

i see

#

alright thanks

#

any idea when this feature might be available?

steady wave
#

No idea, sorry

worn tundra
#

sure arran.. thanks for your time

steady wave
#

You're welcome. We'll be here if you have any other questions!