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

# Enable Subscribers to Purchase a Subscription Using a Coupon Code

Subscribers can redeem coupon codes in order to purchase a subscription at a promotional rate. To support this functionality, you must use the Subscribe APIs.

* **Use Case Number:** 2-2-08
* \*\*Completed By:\*\*Software Developer
* **Estimated Completion Time:** \<1 day

## Basic Scenario

A new subscriber purchases a subscription using a coupon code to access a promotional rate.

## Design Approach

While this use case is similar to the basic use case for creating subscriptions ([Enable Subscribers to Purchase a Subscription With a Credit Card](2202_r_allowCustomersPurchase#)), it has a slight modification in that you must pass a Campaign Code that references a Coupon style Campaign. The following diagram illustrates the use case sequence.

<img src="https://mintcdn.com/amdocs-slm/ifa3y22T11JlqvtT/portal/vindiciaSubscribeAndNewRetain/subscribeUseCases/images/2208_purchaseFlowCampaignDryRun.png?fit=max&auto=format&n=ifa3y22T11JlqvtT&q=85&s=c528d05847680b33153fa9f167a1b11d" alt="" width="924" height="691" data-path="portal/vindiciaSubscribeAndNewRetain/subscribeUseCases/images/2208_purchaseFlowCampaignDryRun.png" />

* **[Configure Support for Coupon Codes Using Subscribe APIs](../topics/2208_r_customerRedeemsCoupon#)**

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

## Configure Support for Coupon Codes Using Subscribe APIs

Set up one or more coupon codes using the Subscribe Portal. (See [Set Up Coupon Codes](2110_r_configureCouponCodes#).)

1. Call the subscriptions endpoint passing the coupon style campaign code created in the Subscribe Portal.

   **Sample Code**

   Endpoint : [https://api.staging.us-west.vindicia.com/subscriptions?dry\\\_run=0](https://api.staging.us-west.vindicia.com/subscriptions?dry\\_run=0)

   JSON Request:

   ```
   {
     "billing_plan": {
       "id": "MONTHLY"
     },
     "account": {
       "email_type": "html",
       "language": "EN",
       "id": "zC18eIhfp6Dx0Me6",
       "shipping_address": {
         "city": "Portland",
         "name": "Laura Drake",
         "district": "OR",
         "country": "US",
         "line1": "9454 Strawberry Fields",
         "postal_code": "97209"
       },
       "default_currency": "USD",
       "email": "foo@foo.com",
       "name": "Laura Drake"
     },
     "description": "Subscription_zC18eIhfp6Dx0Me6",
     "policy": {
       "ignore_avs_policy": 1,
       "validate_for_future_payment": 0,
       "ignore_cvn_policy": 1,
       "immediate_auth_failure_policy": "doNotSaveAutoBill",
       "min_chargeback_probability": 99
     },
     "currency": "USD",
     "payment_method": {
       "billing_address": {
         "city": "Portland",
         "name": "Laura Drake",
         "district": "OR",
         "country": "US",
         "line1": "9454 Strawberry Fields",
         "postal_code": "97209"
       },
       "account_holder": "Laura Drake",
       "credit_card": {
         "expiration_date": "202003",
         "account": "4113900000000007"
       },
       "customer_description": "Credit Card",
       "active": 1,
       "type": "CreditCard",
       "id": "CC_zC18eIhfp6Dx0Me6"
     },
     "items": [
       {
         "product": {
           "id": "Generic"
         },
         "id": "Item_zC18eIhfp6Dx0Me6_1",
         "campaign_code": "Sample-Coupon-AP6BFR6UKPN8HHA4"
       }
     ],
     "id": "Subscription_zC18eIhfp6Dx0Me6",
     "minimum_commitment": 0
   }
   ```

* A proper Subscription with Account and Payment Method objects are created in Subscribe.
* The Initial Transaction is generated, if applicable, including any applicable taxation.
* Future billings are correctly predicted.
* The Account has been granted appropriate Entitlements.
* The promotional rate is reflected in current and future transactions, if applicable.
* The Coupon Code has been marked as redeemed, if applicable.

**Parent topic:**[Enable Subscribers to Purchase a Subscription Using a Coupon Code](../topics/2208_r_customerRedeemsCoupon#)


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