#xfechx

1 messages · Page 1 of 1 (latest)

night quartzBOT
wind karma
#

Hello, what help do you need?

placid geode
#

Hello

#

I am looking onto creating vouchers, so - purchasable discount codes

#

promotional codes, but purchasable ones. Is this something I need to write myself or is there a functionality of coupons or promotion codes that I can use?

wind karma
#

We don'y have build in functionality for the purchasable part of that, but we don't restrict how many coupons/promotional codes that you can make. So you can definitely write your own code to do something like send the user a coupon code specific to them after they make a purchase through you

placid geode
#

Ok

#

In design terms, what is the best thing to do to purchase codes? Through payment links, invoices or checkout session?

wind karma
#

Good question, checking how they can be used other than the user inputting them directly

wind karma
#

Hey apologies on the long delay here. There are basically viable ways to use these discounts with Checkout, Payment Links, or Invoices
For Checkout, you can provide the coupon' code when creating the session https://stripe.com/docs/billing/subscriptions/coupons?dashboard-or-api=api#using-coupons-in-checkout
For PaymentLinks you can provide the promotion code in the URL you send https://stripe.com/docs/payments/payment-links#url-parameters
Invoices don't actually directly support coupons or promotion codes but you can create negative invoice items to give discounts https://stripe.com/docs/billing/invoices/subscription#adding-draft-invoice-items

placid geode
#

My question, was more about how to charge for them, I guess checkout will do.

#

However - I have another question. Can a coupon be applied without a payment? (i.e is there somewhere in the API where I can just mark the promotion code as used, without the need to attach it to a checkout or payment link?

#

Or can a payment link or checkout session be set out to be amount 0, just to check/use the promotional code?

carmine citrus
#

Hello 👋
Taking over as Pompey needs to step away soon

However - I have another question. Can a coupon be applied without a payment? (i.e is there somewhere in the API where I can just mark the promotion code as used, without the need to attach it to a checkout or payment link?
Or can a payment link or checkout session be set out to be amount 0, just to check/use the promotional code?
I don't think that's supported unfortunately.

#

Is this for a subscription payment or a one-off payment?

placid geode
#

it is for one off

#

basically would like to make a module/app that checks the purchased coupons against stripe, then just discards them if they haven't been used. And rejects them if they have been used.

carmine citrus
#

I see.. yeah can't think of an alternative here at the moment.