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

# The Campaign Object

## V2

This topic shows information relevant specifically for Subscribe REST API version 20210401 referred to as V2

The Campaign object encapsulates the information for a Campaign, including Campaign Type, Status.

## Attributes

| Name | Type | Description |
| - | - | - |
| object | string | Value is “Campaign” |
| id | string | A merchant-specified unique identifier. If not specified, this object can be identified by its vid. |
| vid | string | A Globally Unique Identifier (GUID) for this object. Assigned by Subscribe. |
| name | string | Name of campaign. **Note:** Read-only once the Campaign is Active. |
| description | string | Description of the campaign.**Note:** Read-only once the Campaign is Active. |
| state | enum | The state of the campaign. Can be `Active`, `Canceled`, `Complete`, `Inactive`, `Pending`, `Undefined`**Note:** This attribute is optional in a Create Campaign call. Without it, the campaign is created in Pending state and requires activation. |
| offer\_start\_date | datetime | The first date on which the offers may be redeemed. |
| offer\_end\_date | datetime | The last date on which the offers may be redeemed. |
| type | enum | Campaign type. Can be:- `Coupon`: allow you to generate multiple unique Campaign codes that are used to redeem the special offer. - `Promotion`: allow you to generate a single Campaign code that can be distributed to multiple customers. This one code can be redeemed by multiple customers. |
| percentage\_discount | decimal | Defines the discount as a percentage. Use whole numbers to represent percentage. For a 50% discount, enter `50` .**Note:** flat\_amount\_discounts and percentage\_discount attributes are mutually exclusive. You can define one or the other but not both. |
| flat\_amount\_discounts | [Flat Discount](Flat_Discount) | Defines the discount as a currency-based flat amount discounted from the original price. |
| eligible\_products | [Product](Products) | List of the Products eligible for this campaign. |
| eligible\_billing\_plans | [Billing Plan](Billing_Plans) | List of the Billing Plans eligible for this campaign. |
| restrict\_to\_new\_subscription | boolean | If enabled (1), campaign offer is only applied to new [Subscriptions](Subscriptions), not existing ones. |
| expiration\_date | datetime | Expiration date of a **Fixed period** campaign. **Rolling** campaigns (defined by number of Billing Cycles) should leave this blank. |
| number\_of\_periods | integer | Number of times the promotion repeats, e.g. if you want to discount 3 cycles of a biweekly subscription, this would be 3. Relevant for **Rolling**Campaigns. |
| promotion\_code | string | The redemption code associated with the Promotion campaign. |
| promotion\_code\_aliases | array | A list array of alternative redemption codes for the Promotion. **Note:** Defining this array replaces any existing list of aliases; it does not add new values to an existing list. |
| metadata | hash | A set of key/value pairs that you can attach to an object. Useful for storing additional information. For more details, see [Metadata](Metadata). |
| max\_redemptions | integer | The maximum number of times a single Coupon code can be redeemed.​ |
| coupon\_code\_quantity | integer | For coupon campaigns: Defines the number of Coupon codes associated with the campaigns. |
| coupon\_code\_prefix | string | A unique string that you would like to appear at the beginning of the Coupon code. |
| coupon\_code\_separator | string | A symbol character to be used to separate the Coupon code Prefix string and the rest of the system generated Campaign Code string. Valid characters include any printable ASCII text symbol, that is neither a letter nor a number. Limited to 1 character. |
| coupon\_code\_requires\_activation | boolean | When enabled (1), coupon codes generated by the system require an additional security measure of activation through the API. For more details, see​ [Activate a Coupon Code](https://support.sm.vindicia.com/db/organizations/vindicia/repositories/master/documentation/documents/m1Subscribe/subscribeRESTAPIReferenceGuide/topics/Activate_Coupon_Code.xml)​.​ |
| on\_demand\_codes\_allowed | boolean | Defines whether incremental codes can be generated on demand. This would be additional Coupon Codes generated separately via the API. For more details, see [Generate Incremental Coupon Codes](Generate_Incremental_Coupon_Codes). |
| total\_code\_marked\_used | integer | The total number of coupon codes that have been marked as used. |
| discount\_method | enum | Select the discount method for stackable campaigns (simultaneous campaigns) that use a percentage\_ discount:- `Direct`: The stacked campaign discount is applied to the original price of the items. - `Compounded`:The stacked campaign discount is applied to the discounted amount of the items. |
| max\_redemptions\_per\_customer | integer | The maximum number of times a specific campaign can be redeemed by a customer (account ID).**Note:** It is highly recommended to define this value. |
| max\_redemptions\_per\_subscription | integer | The maximum number of times campaign codes belonging to a specific campaign can be redeemed for any given Subscription.**Note:** It is highly recommended to define this value. |
| apply\_discount\_per\_item | boolean | When enabled (1), discounts are applied per item (on the subscription, transaction, charge, or invoice) and are multiplied by the item quantity being purchased. |
| item\_display\_text | string | Display name associated with the [ItemDiscount](Discount_Tickets) generated for this Campaign. |
| stackability | enum | Defines whether the Campaign Discounts can be stacked with other Campaigns. Options are: - `Stackable`: campaign can be stacked with other campaigns for concurrent discounts. This is the default value for new campaigns. - `Unstackable`: Standalone campaign, cannot be combined with other campaigns for additional discounts. - `Undefined`: campaign of this sort can be stacked with a stackable campaign only. It cannot be stacked with any other value i.e. undefined campaign cannot be stacked with another undefined. This is the value inherited for existing campaigns. |

## Example Object

```

{
    "object": "Campaign",
   "id": "PROMO1_campaign_mbjUhpf-vf_dV1wabhfexablOb4",
   "vid": "524ec5c0a7534b6d00eaef45ae3a3c549f7618a9",
   "name": "PROMO1_campaign_mbjUhpf-vf_dV1wabhfexablOb4",
   "description": "25 pct Promo Campaign",
   "state": "Inactive",
   "offer_start_date": "2021-06-18T00:00:00-07:00",
   "offer_end_date": "2021-06-28T00:00:00-07:00",
   "discount_method": "Direct",
   "type": "Promotion",
   "percentage_discount": 25,
   "apply_discount_per_item": true,
   "eligible_products": {
      "object": "List",
      "data": [
         {
            "object": "Product",
            "id": "PTsthG_CWTPp2kWOmyZJbpLCErM",
            "vid": "7dabc07e2185f3fb28a859338d376df88ea593b9"
         }
      ],
      "total_count": 1
   },
   "eligible_billing_plans": {
      "object": "List",
      "data": [
         {
            "object": "BillingPlan",
            "id": "bp_8e0FtrtV_mQBpmCOeRdpe8dWKzk",
            "vid": "0defd34ddab0c39ce7f80499a97a5c44018b6e5a"
         }
      ],
      "total_count": 1
   },
   "number_of_periods": 1,
   "period_length": "BillingCycle",
   "promotion_code": "P1mbjUhpf-vf_dV1wabhfexablOb4",
   "item_display_text": "Definitely a 25 pct Promo Campaign",
   "max_redemptions_per_customer": 3,
   "max_redemptions_per_subscription": 4,
   "stackability": "Unspecified"
}
```

**Parent topic:**[Campaigns](../topics/Campaigns)


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