#ythouma-payment-links

1 messages ยท Page 1 of 1 (latest)

earnest hazel
#

Hi there! You don't see the Price ID in the checkout.session.completed event?

#

Ah no you wouldn't

#

I forgot that we don't expand line items for payment links

#

So one way to handle this would be to attach metadata to your Payment Link

#

The other option is to retrieve the Checkout Session after checkout.session.completed hits your endpoint

warm carbon
earnest hazel
#

Or if you add metadata then it will also be there

warm carbon
#

ok, let me try to get the session object

earnest hazel
#

Sorry, I mispoke

#

Retrieving the session will give you the same thing as the checkout.session.completed event.

#

One sec. Let me check on best way to do this.

warm carbon
#

i was just coming to tell u that ๐Ÿ™‚

earnest hazel
#

I forgot that we return different properties for a Payment Link Checkout Session versus a normal Checkout Session

#

Okay yeah, so the first recommendation I had is the way to go here.

#

You want to add metadata to your Payment Link

#

Referencing the Product/Price

#

Then that metadata will appear in your checkout.session.completed event that hits your webhook endpoint

#

Sorry for the confusion!

warm carbon
#

ok Got it

#

so i need to make this refrence manullay

earnest hazel
#

Yeah you could either use your own string or you could literally put the Price/Product IDs as metadata

#

Up to you

warm carbon
#

but even with that solution , i'll still be unable to get the Quantity of this product!

earnest hazel
#

Are you using adjustable quantity?

earnest hazel
#

Okay okay okay

#

I realize what I missed

warm carbon
#

Oh MMMMAN, AMAZING, that's it, you made my day

#

Thanks