Harman
Harman

Reputation: 1753

Stripe payment checkout mehod can we set own parameter which we will received in a webhook

I am using strip payment gateway for checkout/session api

curl https://api.stripe.com/v1/checkout/sessions \
-u sk_test_123: \
-d success_url="https://google.com/success" \
-d cancel_url="https://yahoo.com/cancel" \
-d "line_items[0][price_data][currency]"=USD \
-d "line_items[0][price_data][product_data][name]"=ABC \
-d "line_items[0][price_data][unit_amount]"=150 \
-d "line_items[0][quantity]"=1 \
-d mode=payment

can i set any parameter or identifiers manually in this which I will received in success strip web-hooks ?

Upvotes: 1

Views: 205

Answers (1)

Jaskaran singh Rajal
Jaskaran singh Rajal

Reputation: 2330

curl https://api.stripe.com/v1/checkout/sessions \
-u sk_test_123: \
-d success_url="https://google.com/success" \
-d cancel_url="https://yahoo.com/cancel" \
-d "line_items[0][price_data][currency]"=USD \
-d "line_items[0][price_data][product_data][name]"=ABC \
-d "line_items[0][price_data][unit_amount]"=150 \
-d "line_items[0][quantity]"=1 \
-d "metadata[order_id]"=waybill \
-d mode=payment

You can set metadata and you will received it in checkout.session.completed

Upvotes: 1

Related Questions