Skip to main content

Developer Documentation

Changing subscription Add-Ons

Changing subscription Add-Ons is done using the subscription change operation. A subscription change can either be scheduled for next subscription renewal, or it can be performed immediately.

For an immediate change, it can be controlled whether compensation should be done by a prorated refund, and it can be controlled, how billing should be done for the remaining part of the period. Whether prorated refunding and billing should be done for immediate subscription Add-On change depends on the type of Add-Ons and the terms for the subscription.

To change Add-Ons at renewal the following call can be performed. The changes will take effect just before billing for the next billing period. The change removes the current extended support, adds an additional laptop and adds extended support for two laptops.

curl -X PUT "https://api.reepay.com/v1/subscription/leasing_00425" -u "priv_dbd002cf1313cb4213efcfb3afebfb66:" \
  -H  "Accept: application/json" -H  "Content-Type: application/json" -d \
  '{
  "timing": "renewal",
  "remove_add_ons": [
    "extended_laptop_support"
  ],
  "add_ons": [
    {      
      "add_on": "super_laptop_x2",
      "handle": "sn643674219"   
    },
    {
      "add_on": "extended_laptop_support",
      "quantity": 2
    }
  ]
  }'
{
  "handle": "leasing_00425",
  "customer": "cust-0059",
  "plan": "leasing_gold",
  "state": "active",
  "pending_change": {
    "pending": true,
    "subscription_add_ons": [
      {
        "handle": "sn643674219",
        ...
      },
      {
        "handle": "extended_laptop_support",
        "quantity": 2,
        ...        
      }
    ],
    "remove_add_ons": [
      "extended_laptop_support"
    ]
  },
  "subscription_add_ons": [
    "sn764654216",
    "extended_laptop_support"
  ]
}

To perform an immediate prorated change the following call can be used. This removes extended support.

curl -X PUT "https://api.reepay.com/v1/subscription/leasing_00425" -u "priv_dbd002cf1313cb4213efcfb3afebfb66:" \
  -H  "Accept: application/json" -H  "Content-Type: application/json" -d \
  '{
  "timing": "immediate",
  "remove_add_ons": [
    "extended_laptop_support"
  ]
  }'

Proration is default. An immediate change without any compensation and billing can be performed using the following call that adds another laptop.

curl -X PUT "https://api.reepay.com/v1/subscription/leasing_00425" -u "priv_dbd002cf1313cb4213efcfb3afebfb66:" \
  -H  "Accept: application/json" -H  "Content-Type: application/json" -d \
  '{
  "timing": "immediate",
  "compensation_method": "none",
  "billing": "none",
  "add_ons": [
    {      
      "add_on": "super_laptop_x2",
      "handle": "sn643624219"   
    }
  ]
  }'

The difference between a change at renewal and an immediate change without compensation and new billing, is the fact that the subscription Add-Ons will be added immediately. The customer will also receive a subscription changed email if this is enabled.