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

# Campaign.cancelCampaign

This method cancels a Campaign, and sets its state to `Inactive`. Once cancelled, a campaign's discounts are unobtainable. Cancel cannot be reversed. To “reactivate” a cancelled Campaign, use the Subscribe Portal to clone the Campaign. (Note that in cloning a Campaign, you must assign a new `campaignId` to the clone.)

Use this method to cancel a Campaign if something goes wrong, such as lost Coupon Codes, or a security breach.

## Input

*srd*: sparse response description, a SOAP string (which must be a JSON object), in which you specify the elements you want returned.This parameter enables the calling system to constrain a `method` call to return only components you specify. This gives you greater control over returned content, and improves response time within the Vindicia platform by reducing the processing needed for the call.

Some fields are required, either practically or in the WSDL, and will be returned regardless of the *srd*. A null *srd* returns the complete response.

*campaign*: the `Campaign` object to be cancelled. Identify this object with its VID or `campaignId`.

## Output

*return*: an object of type `Return` that indicates the success or failure of the call.

## Returns

In addition to those listed in [The Return Object](The_Return_Object), this call returns:

| Return Code | Return String |
| - | - |
| `400` | One of the following: - `Failed to update SOAP object in DB.` - `Campaign is not in the right state for cancellation.` - `Failed to obtain SOAP object from DB.` - `Tried to cancelCampaign without doing createCampaign first.` - `Can't cancel campaign until campaign code generation is complete.` - `Can't cancel campaign: unable to invalidate campaign codes` - `Campaign codes requested = *&lt;requested&gt;*` - `Campaign codes generated = *&lt;generated&gt;*` |

## Example

```

$camp = new Campaign();
   $camp->setCampaignId('camp132');
   $campaign->cancelCampaign();
```

**Parent topic:**[Campaign Methods](../topics/Campaign_Methods)


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