#pepski

1 messages · Page 1 of 1 (latest)

pallid scrollBOT
sick atlas
#

Hi! Let me help you with this.

#

Could you provide an example event ID please? evt_xxx

daring edge
#

evt_1MOJbFFDkTksHoXpGIQWl9Lj

#

this invoice was created via checkout.session but I am not able to pair it.

sick atlas
#

Could you please share an Checkout Session ID as well cs_xxx? Are you creating a Subscription or one-time payment?

daring edge
#

cs_test_a1pLz5Uu1jninSgKwILVAR4jCQj25K219aFIP366DJpuNt9WltwW97auy7

#

subscription

#

I create a session, attach the session to my subscription object in the api, but I don't know how to to get proper stripe subscription id, ... I can do it with event checkout.session.completed, where are both id checkoutSessionId with subscriptionId. But this event is triggered after invoices and payments, and i don't know how to pair them.

sick atlas
daring edge
#

yes I know that, but i don't have the subscription ID

sick atlas
#

Why would you need to pair it with a Checkout Session?

daring edge
#

I have an subscription object in our api, i create a checkout session for it for creating the subscription also at your side, now I have to pair my object with your object.

sick atlas
daring edge
#

1] I have my subscription object
2] I create checkout session for creating subscription on your side
3] checkout session is filled by customer
4] I firstly receive the invoice.created event - there is identification of stripe.subscriptionId, but I don't have this ID in my database, so I cant pair it
5] than comes event about payments, again related to stripe.subscription but I still don't have this id in my database
6] then comes checkout.session.completed - there I am finally able to say hey, my subscription object = stripe.subscription from the checkout.session.completed

#

but its too late, because all other events already fails

sick atlas
#

I see now

#

Please, give me a moment I need to check something for this.

daring edge
#

sure no problem

sick atlas
#

You can rely on the Customer object for this. When new Invoices are created they will be attached to the same customer.

daring edge
#

but customer can have multiple subscriptions rigt?

sick atlas
#

In theory, yes. But it depends on how your integration works.

daring edge
#

cool thanks