#peterbuilt

1 messages · Page 1 of 1 (latest)

cursive yarrowBOT
river storm
#

hello! Are you using Checkout Sessions?

sick idol
#

yes

#

well I have two webhooks, listening payment_intent.succeeded which feels like an anitpattern

#

but I need to create a user when they initially purchase and do something different when they just purchase more additional things

river storm
sick idol
#

can I fetch the product w/ the paymentId?

river storm
#

no you can't

sick idol
#
{
  "id": "prod_NvNH8Xy57HwOGo",
  "object": "product",
  "active": true,
  "created": 1684515118,
  "default_price": "price_1N9WX5B8eFyY2JODNKjUtTQN",
  "description": "Create fun, unique coloring pages with the help of artificial intelligence.",
  "images": [],
  "livemode": false,
  "metadata": {
    "TYPE": "INITIAL_PAYMENT_USER_CREATION"
  },
  "name": "Gold Special",
  "package_dimensions": null,
  "shippable": null,
  "statement_descriptor": "AvatarArt.ai",
  "tax_code": "txcd_10000000",
  "unit_label": null,
  "updated": 1685586948,
  "url": null
}```
#

I am trying to gate my logic off the metadata object

#

@river storm what does the line_items key offer me ?

river storm
#

the line_items would allow you to see what Product was used in the Checkout Session

sick idol
#

by product id ?

river storm
#

yes the product id should be there, you should try it out and see if it provides the information you need

sick idol
#

what if 1 api I am usinig redirectToCheckout and then the other I am using sessions

#

ok

#

@river storm lets say I have 20 people at the same time in a checkout sessions will that return all 20 ?