Skip to content

Instantly share code, notes, and snippets.

@atwj
Created March 23, 2022 01:46
Show Gist options
  • Select an option

  • Save atwj/e5c4a79ab7cb98b01efc7a3e2538971f to your computer and use it in GitHub Desktop.

Select an option

Save atwj/e5c4a79ab7cb98b01efc7a3e2538971f to your computer and use it in GitHub Desktop.
Stripe Checkout Sessions and add line items on the fly
curl https://api.stripe.com/v1/checkout/sessions \
-u sk_test_: \
-d success_url="https://example.com/success" \
-d cancel_url="https://example.com/cancel" \
-d "line_items[0][price_data][currency]"="sgd" \
-d "line_items[0][price_data][product_data][name]"="School Fees" \
-d "line_items[0][price_data][unit_amount]"="300000" \
-d "line_items[0][quantity]"="1" \
-d "line_items[1][price_data][currency]"="sgd" \
-d "line_items[1][price_data][product_data][name]"="Convenience Fee" \
-d "line_items[1][price_data][unit_amount]"="8853" \
-d "line_items[1][quantity]"="1" \
-d "mode"="payment"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment