#marlon2k
1 messages · Page 1 of 1 (latest)
Are you using both Payment Intent and Checkout Sessions, or just Checkout Session only?
Tried Zapiers direct integration too. Missing it there too.
Both
If it matters, this is when I'm purchasing a product through a payment link
@open bison
Payment Intent is a direct custom payment integration and no product/price details is set. Payment Intent will only charge to the amount set in the request that Stripe does not have product information with Payment Intent integration. No product data will be available.
For Checkout Session, it's possible to get the product information with Retrieve Checkout Session API by expanding line_items:
- Retrieve Checkout Session API: https://stripe.com/docs/api/checkout/sessions/retrieve
- Expand an object: https://stripe.com/docs/api/expanding_objects
@open bison I ended up creating an invoice upon payment and I have the product info & quantity there. However I'm still missing 1 thing that I can't retrieve from invoice data or charge data.
On the payment link I have a custom field. This custom field answer is not coming through.
How can I get that?
Can you share the example invoice ID (in_xxx) or Checkout Session (cs_xxx), so that I can check how your integration works?
in_1NepOzH3dtB8toVXoHRe1nqV
charge ID ch_3NepM5H3dtB8toVX16qU8S58
checkout session I dont have that
@open bison
this is the field I need
The value of custom field will only be available in Checkout Session object, but not Invoice object.
The correct way to get product information and custom field is by using checkout.session.completed events. After receiving checkout.session.completed event, an additional Retrieve Checkout Session API should be made with expanding line_items.data.price.product field. You will be able to find:
- Product information under
line_items: https://stripe.com/docs/api/checkout/sessions/object#checkout_session_object-line_items - Custom field values under
custom_fields.text.value: https://stripe.com/docs/api/checkout/sessions/object#checkout_session_object-custom_fields-text-value
"After checkout.session.completed event, an additional Retrieve Checkout Session API should be made with expanding line_items.data.price.product field."
@open bison how do I do this?
For Checkout Session, it's possible to get the product information with Retrieve Checkout Session API by expanding
line_items.data.price.product:
Retrieve Checkout Session API: https://stripe.com/docs/api/checkout/sessions/retrieve
Expand an object: https://stripe.com/docs/api/expanding_objects
@open bison Is checkout session Id in this format? cs_live_xxxxxxxxx
Yes, correct!
Ok thank you, and how do I get my secret key for authorization header?
nvm found it
Failed to create a request in Webhooks by Zapier
https://stripe.com/docs/error-codes/parameter-unknown (HTTP Status Code: 400)
Can you share the request ID (req_xxx) of the error? Here’s how you can find it: https://support.stripe.com/questions/finding-the-id-for-an-api-request
Find help and support for Stripe. Our support center provides answers on all types of situations, including account information, charges and refunds, and subscriptions information. Get your questions answered and find international support for Stripe.
Do you have the full error message? It might be the error thrown from Zapier, but not Stripe
Thats what its showing me
And in Stripe in the logs I cant even see it coming through as a request
It looks like it doesn't reach Stripe. If it reaches to Stripe, it should be shown in the logs page
yeah its not reaching
can you check my screenshot abvoe and see if you spot any erorrs in my GET checkout session request?
yes thats it, sorry idk why I couldnt find it
Can you remove all the query parameters from the request?
Somehow Zapier includes other query parameters in the request
fixed it its working now
thank you!!
@open bison If I trigger on checkout session completed, does that mean only successful payments will trigger the webhook?
Yes
thanks a lot
you were rly helpful, I was talking with support for 4 hours today and didn't get anywhere near a solution 🙂
No problem! Happy to help 😄
so 1 more thing
@open bison so i need to expand the line items so i can see the product name and quantity in my retrieve checkout session request
how do I do this?
could you please send me JSON string I need to include in the data?
Thanks for waiting! Discord is busy now
so i need to expand the line items so i can see the product name and quantity in my retrieve checkout session request
It should look something like:expand: ['line_items.data.price.product']
sorry thats not working
im reading the articles but really having a hard time understanding
I don't know how Zapier works and how their format should be like.
How about following?
{
expand: ['line_items.data.price.product']
}
thats json right?
Yup, this is JSON body with curly bracket
If it still doesn't work, I'd recommend checking with Zapier since they control your integration with Stripe that we don't know how it works
Yeah still not working. Its Zapier but its a fully custom request - not a direct integration.
Like a postman
Does the expand stuff need to go in the data field or headers?
Stripe uses form-encoded (not JSON) request bodies [0]. I'm not too sure how Zapier maps the one shown in your UI to Stripe's request body.
Is there any specific request I can make using payment intent ID or charge ID and pull the product info from there?
No! It's only possible through Checkout Session ID
or an additioanl request using the checkout session ID
yeah this is what zapier is saying:
or an additioanl request using the checkout session ID
Isn't that we have been discussed about using Checkout Session Retrieval API?
I'd recommend checking with Zapier how to send the request correctly in their UI
This is the example using curl
Not JSON
Stripe can't help much with sending request from Zapier UI
This channel is for direct technical integration with Stripe. For third-party integration, I'd recommend reaching out to their Support