How to allow for Stripe Coupon code in checkout

Options

I was wondering how to allow for coupon codes in the stripe checkout when it is initialized from Xano?

If I go to the stripe dashboard and create a payment link for a product in Stripe you can choose "coupon codes" and it will appear in the Stripe checkout, but when sending to the stripe checkout url from Xano it doesn't appear.

P.s. Stack is Xano, Wized and Webflow so the action is through Wized

Tagged:

Answers

  • Pawel Magdanski
    Pawel Magdanski Member ✭✭✭
    Options

    Hi,

    I think you need to include the coupon id as one of your checkout parameters. Below is the example curl command I found.

    curl https://api.stripe.com/v1/checkout/sessions \
    -u API_key: \
    -d "success_url"="https://your-website.com/success" \
    -d "cancel_url"="https://your-website.com/cancel" \
    -d "payment_method_types[]"="card" \
    -d "line_items[][price]"="price_id" \
    -d "line_items[][quantity]"="2" \
    -d "mode"="payment" \
    -d "discounts[][coupon]"="your_coupon_id_here"