Querying for subscriptions with subscription Add-On
Subscriptions can be fetched based on different filtering options. To get active subscriptions with a specific subscription Add-On the following can be used.
curl "https://api.reepay.com/v1/list/subscription?subscription_add_on_handle=sn764654216&state=active" \ -u "priv_dbd002cf1313cb4213efcfb3afebfb66:" -H "Accept: application/json"
{ "size": 20, "count": 1, "content": [ { "handle": "leasing_00425", "customer": "cust-0059", "plan": "leasing_gold", "state": "active", ... } ], ... }
In our use case this can be used to determine to whom a specific laptop is leased, and to determine under which terms the leasing is done by looking at the subscription plan.
Note
To get subscriptions with subscription Add-Ons based on a specific Add-On, the search parameter add_on.handle can be used.