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

# Add Campaign Code to a Subscription

Apply a campaign code to an existing subscription. The campaign code can be a promotion code or a coupon code. The campaign code can be applied to all the subscription items or to specific ones. For more details, see [Campaign Codes](Campaign_Codes).

## HTTP Request

`POST https://api.vindicia.com/subscriptions/:subscription/actions/add_campaign_code`

## Route (URL) Parameters

| Parameter | Default | Description | Required |
| - | - | - | - |
| subscription | n/a | The `id` or the `vid` of the Subscription to which to apply the discount. | Yes |

## Query Parameters

| Parameter | Type | Default | Description | Required |
| - | - | - | - | - |
| subscription\_item | string | n/a | The subscription item for which to apply the campaign disccount. | No |
| product | string | n/a | The product for which to apply the campaign disccount. | No |
| apply\_to\_billing\_plan | boolean | false | Defines whether to apply the campaign code to the subscription's billing plan. | No |
| campaign\_code | string | n/a | Defines the coupon or promotion code discounting the subscription or specified subscription items. For more details, see [Campaign Codes](Campaign_Codes). | Yes |
| dryrun | boolean | false | Boolean flag that, if set to **true**, will return a quote of the updated subscription, without recording the result in the Subscribe database. | No |

## Accepts

None

## Returns

JSON - A full [Subscription](Subscriptions) object.

## Example Request

```

 curl -X POST 
 'https://api.staging.us-west.vindicia.com/subscriptions/Subscription_1617678380/actions/add_campaign_code?campaign_code=MultipleCampaignsPromo' \
```

## Example Response

The above command returns JSON structured like this:

```
{
    "object": "Subscription",
    "id": "Subscription_1617678380",
    "vid": "18707f5636252c2e19b643f89982e46f6c3e30e1",
    "created": "2021-04-06T03:06:20+00:00",
    "account": {
        "object": "Account",
        "id": "Account_1617678380",
        "external_id": "Account_1617678380",
        "vid": "849e7243f6455b5322043e9b346d36e0defa2199",
        "created": "2021-04-06T03:06:20+00:00",
        "default_currency": "USD",
        "email": "sbakaraju@vindicia.com",
        "email_type": "html",
        "language": "EN",
        "name": "Curtis Monahan",
        "shipping_address": {
            "object": "Address",
            "vid": "5c4764857675c44135b13982bc1eb6d519d94a92",
            "line1": "2988 Campus Dr",
            "city": "San Mateo",
            "district": "CA",
            "postal_code": "94403",
            "country": "US"
        },
        "payment_methods": {
            "object": "List",
            "data": [
                {
                    "object": "PaymentMethod",
                    "id": "CC_1617678380",
                    "vid": "9f08ce380d35579b5a2ae1ce6913d93529bf5419",
                    "created": "2021-04-06T03:06:21+00:00",
                    "type": "CreditCard",
                    "credit_card": {
                        "object": "CreditCard",
                        "vid": "dc9b99622d3b58288bfbb24e5addd95f70c0aaa8",
                        "account": "411111XXXXXX1111",
                        "bin": "411111",
                        "last_digits": "1111",
                        "account_length": 16,
                        "expiration_date": "202005",
                        "last_au_request_date": null,
                        "last_update_date": null
                    },
                    "account_holder": "Aida Dickinson",
                    "billing_address": {
                        "object": "Address",
                        "vid": "913b0a9553a0c06a82324bac7d26ecd0d66f85fb",
                        "line1": "2988 Campus Dr",
                        "city": "San Mateo",
                        "district": "CA",
                        "postal_code": "94403",
                        "country": "US"
                    },
                    "customer_description": "Credit Card",
                    "primary": true,
                    "active": true
                }
            ],
            "total_count": 1
        }
    },
    "billing_plan": {
        "object": "BillingPlan",
        "id": "MONTHLY",
        "vid": "56d680a86bfaea8b218db63e2ec16e380c7a9d75",
        "created": "2020-01-30T21:37:22+00:00",
        "description": "Monthly Billing Plan",
        "status": "Active",
        "periods": {
            "object": "List",
            "data": [
                {
                    "object": "BillingPlanPeriod",
                    "type": "Month",
                    "quantity": 1,
                    "cycles": 0,
                    "prices": {
                        "object": "List",
                        "data": [
                            {
                                "object": "BillingPlanPrice",
                                "amount": 0,
                                "currency": "CAD"
                            },
                            {
                                "object": "BillingPlanPrice",
                                "amount": 0,
                                "currency": "USD"
                            },
                            {
                                "object": "BillingPlanPrice",
                                "amount": 0,
                                "currency": "EUR"
                            }
                        ],
                        "total_count": 3
                    },
                    "do_not_notify_first_bill": false
                }
            ],
            "total_count": 1
        },
        "skip_initial_billing_notification": false,
        "billing_descriptor": "Monthly Billing Plan",
        "used_on_subscriptions": true
    },
    "payment_method": {
        "object": "PaymentMethod",
        "id": "CC_1617678380",
        "vid": "9f08ce380d35579b5a2ae1ce6913d93529bf5419",
        "created": "2021-04-06T03:06:21+00:00",
        "type": "CreditCard",
        "credit_card": {
            "object": "CreditCard",
            "vid": "dc9b99622d3b58288bfbb24e5addd95f70c0aaa8",
            "account": "411111XXXXXX1111",
            "bin": "411111",
            "last_digits": "1111",
            "account_length": 16,
            "expiration_date": "202005",
            "last_au_request_date": null,
            "last_update_date": null
        },
        "account_holder": "Aida Dickinson",
        "billing_address": {
            "object": "Address",
            "vid": "913b0a9553a0c06a82324bac7d26ecd0d66f85fb",
            "line1": "2988 Campus Dr",
            "city": "San Mateo",
            "district": "CA",
            "postal_code": "94403",
            "country": "US"
        },
        "customer_description": "Credit Card",
        "primary": true,
        "active": true
    },
    "currency": "USD",
    "description": "Subscription_1617678380",
    "status": "Active",
    "billing_state": "Good Standing",
    "starts": "2021-04-06T03:06:20+00:00",
    "ends": "2021-09-02T00:00:00+00:00",
    "entitled_through": "2021-09-02T00:00:00+00:00",
    "items": {
        "object": "List",
        "data": [
            {
                "object": "SubscriptionItem",
                "id": "Item_1617678380",
                "vid": "413cc720f9733bdd73cfed0244160dae052d41da",
                "index": 0,
                "product": {
                    "object": "Product",
                    "id": "BOOTCAMP",
                    "vid": "0a1211615efa29c705435745e65e1b7cf39a56df",
                    "created": "2020-01-30T21:42:55+00:00",
                    "descriptions": {
                        "object": "List",
                        "data": [
                            {
                                "object": "ProductDescription",
                                "language": "EN",
                                "description": "Bootcamp Subscription"
                            }
                        ],
                        "total_count": 1
                    },
                    "status": "Active",
                    "entitlements": {
                        "object": "List",
                        "data": [
                            {
                                "object": "Entitlement",
                                "id": "bootcamp",
                                "description": "bootcamp"
                            }
                        ],
                        "total_count": 1
                    },
                    "billing_descriptor": "Bootcamp Subscription",
                    "credit_granted": {
                        "object": "Credit"
                    },
                    "prices": {
                        "object": "List",
                        "data": [
                            {
                                "object": "ProductPrice",
                                "amount": 8.99,
                                "currency": "USD"
                            },
                            {
                                "object": "ProductPrice",
                                "amount": 10.99,
                                "currency": "CAD"
                            },
                            {
                                "object": "ProductPrice",
                                "amount": 8.99,
                                "currency": "EUR"
                            }
                        ],
                        "total_count": 3
                    }
                },
                "quantity": 1,
                "created": "2021-04-06T03:06:20+00:00",
                "starts": "2021-04-06T00:00:00+00:00",
                "campaign_id": "MultipleCampaigns"
            }
        ],
        "total_count": 1
    },
    "billing_day": 6,
    "minimum_commitment": 0,
    "notify_on_transition": false,
    "next_billing": {
        "object": "Transaction",
        "created": "2021-08-06T00:00:00+00:00",
        "amount": 8.72,
        "currency": "USD",
        "items": {
            "object": "List",
            "data": [
                {
                    "object": "TransactionItem",
                    "sku": "BOOTCAMP",
                    "item_type": "Purchase",
                    "name": "Bootcamp Subscription",
                    "price": 8.72,
                    "quantity": 1,
                    "tax_type": "Exclusive Sales",
                    "subtotal": 8.72,
                    "total": 8.72
                }
            ],
            "total_count": 1
        }
    },
    "balance": 0
}
```

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


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