#thanos-kir_void-invoice-connect
1 messages ยท Page 1 of 1 (latest)
๐ Welcome to your new thread!
โฒ๏ธ We'll be here soon! We typically respond in a few minutes, but in some cases we might need a bit more time (e.g., server's busy, you've got a complex question, etc.).
โฑ๏ธ We close idle threads, which makes them read-only. Once a thread is closed it won't be reopened, but you can 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/1246023022150815804
๐ Have more to share? Add details, code, screenshots, videos, etc. below.
When I run the above code it returns that the invoice does not exist.
Hi there!
Can you share the ID (req_xxx) of the failing API request?
https://support.stripe.com/questions/finding-the-id-for-an-api-request
The account ID where the invoice belongs is this one: acct_1O0k4FLtNSGOnLOJ
And I will give you the invoice rigth now
Here is the invoice id: in_1PM4zuLtNSGOnLOJFaNkc054
So you should be using Stripe Account Headers
https://stripe.com/docs/connect/authentication#stripe-account-header
I imagine you are trying to make the request using the API secret key of this platform account acct_1NJcADCxgVJcbkxu (which is yours )?
So you need to use the Stripe Auth header in order to acces to your Connected Account's invoice
๐ taking over for my colleague. Let me know if there's any follow-up Qs I can answer!
back
yes
And to void this invoice
Sure
have you tried with this https://docs.stripe.com/api/connected-accounts
Complete reference documentation for the Stripe API. Includes code snippets and examples for our Python, Java, PHP, Node.js, Go, Ruby, and .NET libraries.
which is basically the same thing that my colleague suggested earlier
Hmm, what's the point of this request? So I will use this $stripe->charges->retrieve to get all the charges from the connected account and then what?
no that's not what I meant
the link I sent you shows you how to add the StripeAccount Header to any API call
ah ok! I have already made this
so if you want to void the invoice on a connected account you call the void invoice API
to my API services
with the Stripe Account header
Complete reference documentation for the Stripe API. Includes code snippets and examples for our Python, Java, PHP, Node.js, Go, Ruby, and .NET libraries.
that's the API I was referring to
yes please
$this
->stripe
->invoices
->voidInvoice(
$invoiceId,
['stripe_account' => $accountId]
);
๐
I have already created many services which create subscriptions, products, customers etc to the connected accounts
Maybe I will try to run the same request for the parent account to see if it is working
But I want to know if the stripe->invoices->voidInvoice will update the uncollectible invoice
And how I can update it to also to paid (for future cases)
void invoice will cancel the invoice entirely
which is different from https://docs.stripe.com/api/invoices/mark_uncollectible
Complete reference documentation for the Stripe API. Includes code snippets and examples for our Python, Java, PHP, Node.js, Go, Ruby, and .NET libraries.
from an accounting perspective
I know
thanks for the info but I want to void it
or to mark it as paid outside of stripe
these actions I made them via UI
but I can't find the right api call
yes you can do both actually
if you want to mark it as paid outside of Stripe you would call the pay invoice API with paid_out_of_band set to true https://docs.stripe.com/api/invoices/pay#pay_invoice-paid_out_of_band
Complete reference documentation for the Stripe API. Includes code snippets and examples for our Python, Java, PHP, Node.js, Go, Ruby, and .NET libraries.
Perfect, thanks!
And what about the void? Is this stripe->invoices->voidInvoice legit?
is it working? Because I tried to a connected account and it didn't work
what didn't work exactly? what was the exact error message?
but yes, it's possible to void a finalized invoice, as explained here: https://docs.stripe.com/api/invoices/void
When I run the above code it returns that the invoice does not exist.
I assume I can't void the invoice because it hasn't been finalized?
When I run the above code it returns that the invoice does not exist.
can you share the request ID (req_xxx)? you can find it here https://dashboard.stripe.com/test/logs
Does this API call works on uncollectible invoices?
if you are trying to void an invoice that doesn't exist, it's normal that it fails. I need to see the request ID in order to better untersant the issue
req_s2r1FpUgFptJNM
I see that the request send to the parent account instead of the connected account
Maybe that was the problem
indeed. you need to use the Stripe-Account header if the invoice is on a connected account
not in this request
Could you confirm that this api call stripe->invoices->voidInvoice works on uncollectible invoices?
not sure, I recommend testing this on your end. if it doesn't work, you'll get a clear error message about this.
Hmm, but I can make the same action via UI
It is a bit frustrating to not be supported via the API
if you can void an uncollectible invoice in the dashboard, it should also work with the API