Manage Add-Ons

Add-Ons are generic additional products that can be seen as templates for subscription Add-Ons. Subscription Add-Ons link an Add-On to a subscription, together with parameters like quantity and possible custom amount.

Add-Ons can be managed in the administration or through the API using the Add-on.

To create an add-on through the API:

curl -X POST "https://api.reepay.com/v1/add_on" -u "priv_dbd002cf1313cb4213efcfb3afebfb66:" \
  -H  "Accept: application/json" -H  "Content-Type: application/json" -d \
  '{
    "name": "Super Laptop X2",
    "handle": "super_laptop_x2",
    "description": "Additional specs",
    "type": "on_off",
    "amount": 12900,
    "eligible_plans": [
      "leasing_gold"
    ]
  }'

The Add-On represents the generic class of the "Super laptop X2" product.

The type of the Add-On is on_off as a subscription Add-On will represent a single laptop by serial number, so quantity does not make sense. The base product is represented by the subscription plan with handle leasing_gold. The subscription plan might have some base price, or a zero amount if all costs are induced by the leased computers.

Add-Ons can be limited to specific subscription plans in the case that Add-Ons only makes sense, or are limited to, specific plans. This could for example be the case if pricing for Add-Ons differs based on the subscription plan. It is also possible to allow for all plans.

In addition to the laptop Add-On, we also create an Add-On representing "extended support". This one has the type quantity as it is per laptop.

curl -X POST "https://api.reepay.com/v1/add_on" -u "priv_dbd002cf1313cb4213efcfb3afebfb66:" \
  -H  "Accept: application/json" -H  "Content-Type: application/json" -d \
  '{
    "name": "Extended laptop support",
    "handle": "extended_laptop_support",
    "type": "quantity",
    "amount": 50000,
    "all_plans": true
  }'