#textualmold9830

1 messages · Page 1 of 1 (latest)

marsh groveBOT
sudden kayak
#

Here is how I create them:

CouponCreateParams couponCreateParams = new CouponCreateParams.Builder().setDuration(CouponCreateParams.Duration.ONCE).setCurrency("ron").setPercentOff(BigDecimal.valueOf(10.0)).setMaxRedemptions(1L).build();
                Coupon coupon = Coupon.create(couponCreateParams);
                coupon.setDuration("once");
                coupon.setCurrency("ron");
                coupon.setDurationInMonths(1L);
                coupon.setPercentOff(BigDecimal.valueOf(10.0));
                coupon.setMaxRedemptions(1L);
                PromotionCodeCreateParams codeCreateParams = PromotionCodeCreateParams.builder().setCoupon(coupon.getId()).setMaxRedemptions(1L).setActive(true).build();
                PromotionCode code = PromotionCode.create(codeCreateParams);
                System.out.println(sessionWithLineItems.getCustomerDetails().getEmail());
                System.out.println(coupon.getId());
                System.out.println(code.getId());```
teal dock
#

hello! can you share the coupon / promo code and a Checkout Session id?

sudden kayak
#

coupon: yl3seGig

sudden kayak
teal dock
#

can i get a Checkout Session that isn't expired?

sudden kayak
teal dock
#

create a new Checkout Session

sudden kayak
teal dock
#

how did you create the session id initially?

#

you just need to go through that flow again

sudden kayak
#

I didn't create the ID.

sudden kayak
teal dock
#

ah, that's a Payment Link

#

no worries, let me try accessing the Payment Link

sudden kayak
#

Thanks!

teal dock
#

hrm, gimme a while to get back to you

teal dock
#

i think you input the coupon id / code

#

you should use VFG9LJDC

#

it worked for me

sudden kayak
#

Where did you get that ID from?

teal dock
#

it's in the promo object

sudden kayak
#

I see

#

How do I get it's code instead of ID?

#

getCode()?

teal dock
sudden kayak
#

Got it. Thanks!