Add Coupon to Subscription in Foxy Admin

This article covers how to add a coupon code to an existing subscription through the Foxy admin.
  1. Open the subscriptions section in the Foxy admin (link).
  2. Locate the customer's subscription (using filters if needed to search for it). Once you find it, click the Edit button to edit the subscription.
  3. While in edit mode, click the Advanced Edit button to reveal the transaction template for the subscription - this is an XML representation of the customers subscription which you can edit to change what it will charge moving forward.
  4. To add a coupon, look for the discounts node, and update it to add the desired coupon code.
    1. If the subscription doesn't yet have a coupon, it will look like this:
      <discounts/>

      Replace that empty discounts node with the following XML, replacing the "my_coupon_code" string with your desired coupon code:
      <discounts>
        <discount>
          <code><![CDATA[my_coupon_code]]></code>
        </discount>
      </discounts>

    2. If the subscription does already have a coupon applied, it will look like this (assuming the existing coupon code is foobar):
      <discounts>
        <discount>
          <code><![CDATA[foobar]]></code>
        </discount>
      </discounts>

      Add a new coupon by adding an additional code element like this, replacing the "my_coupon_code" string with your desired coupon code:
      <discounts>
        <discount>
          <code><![CDATA[foobar]]></code>
          <code><![CDATA[my_coupon_code]]></code>
        </discount>
      </discounts>
  5. Click Update to save the changes.

You'll then see the subscription summary again, and you should see the new coupon added, with an updated total order amount, and that will be what the customer is charged moving forward.