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

sprinto's avatar

How to add customer details with Cashier newSubscription (Stripe)?

In Stripe it's now possible to use them to send out invoices etc. I'm looking into if it would be possible somehow to send this data when creating newSubscription: screenshot: https://screencast.com/t/f03Twahbhm5d Data:

  • Email

  • Send emails to:

  • Billing address

  • Phone

          $user->newSubscription('main', 'mo')->create($request->stripeToken, [
              'email' => $user->email,
          ]);
    

Works fine, but not sure how to add the other data?

0 likes
2 replies
sprinto's avatar
sprinto
OP
Best Answer
Level 1

Figured it out. For anyone else:

        $user->newSubscription('main', 'mo')->create($request->stripeToken, [
            'email' => $user->email,
            'shipping' => [
                'address' => [
                    'line1' => $user->address,
                    'city' => $user->city,
                    'country' => $user->country,
                    'postal_code' => $user->zip,
                ],
                'name' => $user->name,
                'phone' => $user->phone,
            ]
        ]);
1 like

Please or to participate in this conversation.