Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.

yafeearun's avatar

update invoice as void

Hi

i'm using cashier for stripe payment,now i'm trying to make some invoices as void, there is a function for retrieve invoices from stripe, but i didn't find out, how to update a invoice after scheduled.

kindly help me to solve this

0 likes
1 reply
yafeearun's avatar
yafeearun
OP
Best Answer
Level 1

I found the code

\Stripe\Stripe::setApiKey("");

  $invoices = \Stripe\Invoice::all(["limit" => 100,"customer"=>'','status'=>'open']);
  foreach ($invoices['data'] as $key => $value) {
    $value->voidInvoice();
  }

Please or to participate in this conversation.