> ## Documentation Index
> Fetch the complete documentation index at: https://docs.slm.m1amdocs.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Applying a Campaign Code to a Specific Product on an AutoBill

Using `AutoBill.addCampaign` will automatically calculate the Product(s) and Billing Plan(s) to which the Campaign should apply, based on the eligible products and billing plans, as defined in the Campaign.

To specify the Product and Billing Plan to which a Campaign Code should be applied, use `AutoBill.modify` to add a Product,Billing Plan, and Campaign Code simultaneously.

Add a Product and Billing Plan, with an attached Campaign Code, to an AutoBill:

Using `modify` with a Campaign Code as a parameter forces the discount to be applied to the added Product and Billing Plan. It will not be applied to any other Product or Billing Plan on the AutoBill.

```

 $response = $autobill->modify(
 $ab_item // AutoBillItem
 false, // addNextPeriod
 false, // proRate
 'promoABC' // promoCode
 );
  // check $response
```

**Note:** f you use a separator character between the Coupon Prefix string and the Coupon Code string, do not also use one in your prefix, as that might cause confusion about what is actually the prefix. The coupon prefix and autogenerated code: Holiday-2015-934sd553, for example, is ambiguous. Holiday2015-934sd553 is not.

Using `modify` without specifying the **campaignCode** parameter, then using `addCampaign` against the same AutoBill, will apply the Campaign discount to all Products and Billing Plans in the AutoBill eligible for the discount.

**Parent topic:**[Adding a Campaign Code to an AutoBill](../topics/Adding_a_Campaign_Code)


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.