You will need to apply an existing coupon by swapping the user's subscription:
$user->subscription('monthly')
->withCoupon('code')
->swap();
Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.
Is there anyway in cashier to add credit to a users stripe account? I don't currently see anything that indicates I can add credit to their account. This functionality exists in the stripe dashboard, but I'm definitely not going to process these things manually :P
Variety of applications for this but mine revolves around giving users credit based on a referral.
Many thanks :)
@carlcassar That wouldn't work because it's for the use case of a referral, if they got two in one month it would be as if he only got 1.
Either way I figured this out with the following:
use Stripe\Customer as StripeAccount;
$customer= StripeAccount::retrieve($user->stripe_id);
$customer->account_balance = $customer->account_balance + -100;
$customer->save();
Quite simple to understand that I use the Stripe-php package (the same as Cashier) but just go direct with an API request to update the users details. Example of what you can update here: https://stripe.com/docs/api/php#update_customer
Why this functionality isn't inside of Cashier I don't really know, but no matter easy enough to implement.
Please or to participate in this conversation.