#Leo-cli-account
1 messages · Page 1 of 1 (latest)
Do you have an example event I can look at? Where are you looking for the payload (e.g. DB, your server, or a local machine?)
yeah here is one from my local machine
{"webhook_id":"1659736356-wh_NGFMT3IsQlmn8o","webhook_conversation_id":"1659736356-wc_Jj86IGDMgzf6v4","event_payload":"{\n \"id\": \"evt_1LTYRcBMAMOLTEake3sn7vox\",\n \"object\": \"event\",\n \"api_version\": \"2020-08-27\",\n \"created\": 1659736356,\n \"data\": {\n \"object\": {\n \"id\": \"cus_MBwKA4u9FSdAxS\",\n \"object\": \"customer\",\n \"address\": null,\n \"balance\": 0,\n \"created\": 1659736355,\n \"currency\": null,\n \"default_currency\": null,\n \"default_source\": null,\n \"delinquent\": false,\n \"description\": \"(created by Stripe CLI)\",\n \"discount\": null,\n \"email\": null,\n \"invoice_prefix\": \"2D9C239D\",\n \"invoice_settings\": {\n \"custom_fields\": null,\n \"default_payment_method\": null,\n \"footer\": null,\n \"rendering_options\": null\n },\n \"livemode\": false,\n \"metadata\": {\n },\n \"name\": null,\n \"next_invoice_sequence\": 1,\n \"phone\": null,\n \"preferred_locales\": [\n\n ],\n \"shipping\": null,\n \"tax_exempt\": \"none\",\n \"test_clock\": null\n }\n },\n \"livemode\": false,\n \"pending_webhooks\": 3,\n \"request\": {\n \"id\": \"req_kZiIqQUOLFgL1X\",\n \"idempotency_key\": \"d340ee6f-ce33-4271-bc01-0592ff197a08\"\n },\n \"type\": \"customer.created\"\n}","http_headers":{"Content-Type":"application/json; charset=utf-8","Cache-Control":"no-cache","User-Agent":"Stripe/1.0 (+https://stripe.com/docs/webhooks)","Accept":"*/*","Stripe-Signature":"t=1659736356,v1=848f7861e8768715ca54f745b0d77444757fefb5f6ff550278d4c0b63b5b10aa,v0=3da674af39d122ee2a8defa9c45e4bfd7a0cd70d1f5533a6668fec176ef1ca14"
and one from the server:
Ah, okay. So this event was created by the platform and wasn't made on behalf of one of the platform's Connect accounts, so the payload won't have an account field. Only events made on behalf of connected accounts will have that field.
I am using this to create events:
how can I can trigger events on behalf of connect accounts?
Are you putting an actual account ID at the end of that command?
yes
and if it's invalid I get an error
see below
"error": {
"code": "account_invalid",
"doc_url": "https://stripe.com/docs/error-codes/account-invalid",
"message": "The provided key 'rk_test_*********************************************************************************************TBH48z' does not have access to account 'acct_1ASCSHBMAMOLTEa1' (or that account does not exist). Application access may have been revoked.",
"type": "invalid_request_error"
}
}
No account acct_1ASCSHBMAMOLTEa1 exists. So that ID is incorrect
I know, i sent you a wrong one to show you the error I see when I try an account that doesnt exist
I dont get an error when I used a valid account id - the event is produced properly but without an account id
(I have to be absent for a while, will respond back a bit later - thanks so much for looking into this @wise viper !)
Ah, okay. When you come back, feel free to post the full command that you ran (exactly how it was run) and I can continue to troubleshoot. Stripe CLI has a habit of ignoring flags that don't do anything, when it should be throwing errors, so I want to make sure I can fully repro on my end