#MarkoBoras

1 messages · Page 1 of 1 (latest)

lavish isleBOT
ashen narwhal
#

👋 happy to help

#

are they active?

violet vale
#

[
{
"id": "promo_1N3FAILOgsxKeN5yspmFKX4m",
"object": "promotion_code",
"active": false,
"code": "TEXTTEST",
"coupon": {
"id": "v82sMi9T",
"object": "coupon",
"amount_off": null,
"created": 1683018390,
"currency": null,
"duration": "once",
"duration_in_months": null,
"livemode": false,
"max_redemptions": null,
"metadata": {},
"name": null,
"percent_off": 25,
"redeem_by": null,
"times_redeemed": 0,
"valid": false
},
"created": 1683018390,
"customer": null,
"expires_at": null,
"livemode": false,
"max_redemptions": null,
"metadata": {},
"restrictions": {
"first_time_transaction": false,
"minimum_amount": null,
"minimum_amount_currency": null
},
"times_redeemed": 0
},
]

#

they're not active

#

so when I delete coupon they become "active: false"

#

and I can filter by that property?

violet vale
#

tyy

#

and what field gets updated

#

when user uses this promotion code?

#

valid?

#

I've created to use code once

lavish isleBOT
violet vale
#

ok I need to create this requirement

#

I have successfully made creation of promotion codes that will be used once.

I want from user to enter that code in my app and if code is valid code is used, his purchase summary overview is decreased in price. When user goes to checkout he can see what promotion code he has used and how much was discount.

zenith mauve
violet vale
#

thanks

#

what if my user passes wrong promotion code

#

can I still allow him to enter promtoion code in checkout

zenith mauve
violet vale
#

but can I pass this

#

allow_promotion_codes: true,
discounts: [{ promotion_code: promotionCodeId }],

#

pass both

zenith mauve
#

No you can specify only one of these options.

violet vale
#

so I'll then client side validation of discount code