How to store the Stripe sub_id after subscription?

When I create a subscription for a user, how can I store the sub_id in my database?

I’m not entirely sure what you’re asking specifically here…

Obviously to store the sub_id in the database, just run a workflow action to store it somewhere (I’m guessing you know that)…

I assume you’re looking for some more specific help than that, but without more specific information it’s a bit hard to give any… (are you using a plugin? If so which one? Or are you making your own API calls etc.)

In any case, I’d recommend using a webhook to trigger your workflow on the backend, then just save the sub_id wherever it is you want to save it (I’d recommend creating a subscription object in the DB).

@adamhholmes I am using the Stripe Marketplace Express Plugin. I am creating a session to subscribe a user to a subscription I created in Stripe. I was hoping to be able to get the sub_id during the process from Stripe somehow.

I can’t comment on that plugin (I’ve never used it)… it might be possible to retrieve the subscription through it… otherwise you’ll need to make your own API call to retrieve the subscription.

Maybe check the plugin docs… otherwise look into running a webhook once the subscription is set up, then you can set the Subscription ID on the backend.

1 Like

depending on the plugin you used, there should be a (result of step x)'s subscription id after subscribing user to plan.

You can also do it with a webhook upon a successful payment, or subscription created event

@doug.burden yes I thought so too. But I am only getting Session ID, Error and Intend ID as result of Step X. ( I am using the Stripe Marketplace Express plugin with “Create a session”.

yea, just setup a webhook to do this. if you need help with that, billflow has videos on youtube you can follow.

1 Like

This topic was automatically closed after 70 days. New replies are no longer allowed.