# Pricing Plan Coupon only for first billing cycle (programmatically)

**URL:** <https://forum.wixstudio.com/t/pricing-plan-coupon-only-for-first-billing-cycle-programmatically/55723>\
**Category:** Ask the community\
**Tags:** wix-marketing-backend, technical-talk, wix, question, code\
**Created:** [January 24, 2024, 2:47pm UTC](https://forum.wixstudio.com/t/pricing-plan-coupon-only-for-first-billing-cycle-programmatically/55723 "2024-01-24T14:47:31Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![valentin\_wackermedia](https://sea1.discourse-cdn.com/wix/user_avatar/forum.wixstudio.com/valentin_wackermedia/32/81083_2.png) [@valentin\_wackermedia](https://forum.wixstudio.com/u/valentin_wackermedia)\
**Post date:** [January 24, 2024, 2:47pm UTC](https://forum.wixstudio.com/t/pricing-plan-coupon-only-for-first-billing-cycle-programmatically/55723/1 "2024-01-24T14:47:31Z")

</div>

**Question:**  
How can I change the code, so that the generated coupon code only applies to the first billing cycle?

**Product:**  
Wix Editor, Wix Pricing Plans, Wix Marketing Backend

**What are you trying to achieve:**  
I’m trying to create a coupon programmatically with a fixed amount of payment cycles it can be applied to a pricing plan. At the moment, when I use it in checkout, it’s applied to all billing cycles of the pricing plan.

**What have you already tried:**

This code:

```javascript
export function initCouponCreating(amountOff, couponCode) {
    let couponInfo = {
        "name": "Gutschrift",
        "code": couponCode,
        "startTime": new Date(),
        "usageLimit": 1,
        "limitedToOneItem": true,
        "limitPerCustomer": 1,
        "active": true,
        "scope": {
            "namespace": "pricingPlans"
        },
        "moneyOffAmount": amountOff
    };
    return coupons.createCoupon(couponInfo);
}

```

But I can’t seem to find the option to set it only to the first payment cycle.

@thomasj , @yisrael-wix any ideas?
