#davila7
1 messages · Page 1 of 1 (latest)
Hello, are you asking about what webhook event to listen to or something else?
Yes, I have the webhook ready for regular payments, but I don't know if it work for subscriptions payments confirmation too
What event are you listening to there?
checkout.session.completed
So for subscriptions that will also be triggered but only for the first payment
For subscription payments in general you can listen to invoice.paid
That will trigger for the first payment and every recurring one. You can check the Invoice's billing_reason field to tell the difference, it will be set to something like subscription_start for the first payment and subscription_cycle for all others
ok, and I can get the $event->data->object->client_reference_id; ?
for every recurring one ?
Client reference ID only exists on the Checkout Session so it won't be available on the other events
So you will likely want to set that ID as metadata on the subscription and check the webhook for that
Or you can save what reference ID goes to what subscription in your own database