> ## 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 an existing AutoBill

Use `AutoBill.addCampaign` to add a Campaign Code to an existing AutoBill.

Add a Campaign Code to an existing AutoBill:

First, create the AutoBill:

```

 $autobill = new AutoBill();
 $autobill->update(
 'SucceedIgnore', // Duplicate Behavior
 false, // validate PaymentMethod?
 100, // min Chargeback Probability
 true, // ignore Avs Policy?
 true, // ignore Cvn Policy?
 null // NO promoCode
 ); 
```

**Note:** This example neither validates the Payment Method, nor checks the chargeback probability or AVS and CVN returns. The default behavior for **duplicateBehavior** is used. These parameters must be populated, simply to set a variable for the last in the sequence (**ignoreAvsPolicy**).

To attach the Campaign Code, use `AutoBill.update`, or `AutoBill.addCampaign`. (`AutoBill.addCampaign` works similarly to `AutoBill.update` when adding a Campaign Code to an existing AutoBill.)

```

 $response = $autobill->addCampaign(
'promoABC' // promoCode
);// check $response
```

If there is an error with the discount, Subscribe will not process the `AutoBill.update`, and will return an error code of 400, with a text string explanation. The error may be that no Product or Billing Plan on the AutoBill is eligible for the Promotion, or that the Coupon Code has already been used against its defined number of AutoBills, or that the Promotion Code is out of date.Applying a Campaign Code to a Specific Product on an AutoBill

**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.