How to retrieve associated SubscriptionLine items for a Subscription with REST API?
Using the api call /record/v1/subscription/{subscriptionId}, is it possible to get the associated SubscriptionLine items as well? Checking the metadata, I see that they should be part of the response but I’m not seeing subscriptionLine in the API response.
https://system.netsuite.com/help/helpcenter/en_US/APIs/REST_API_Browser/record/v1/2021.2/index.html#/definitions/subscriptionCollection
This is the response I get –
{"links": [{"rel": "self","href": "https://{{REST_ENDPOINT}}/services/rest/record/v1/subscription/345"}],"autoRenewal": false,"billingAccount": {"links": [{"rel": "self","href": "https://{{REST_ENDPOINT}}//services/rest/record/v1/billingaccount/964"}],"id": "234","refName": "SECURITY SOLUTIONS"},"billingAccountStartDate": "2020-05-01","billingSchedule": {"links": [{"rel": "self","href": "https://{{REST_ENDPOINT}}//services/rest/record/v1/billingschedule/4"}],"id": "4","refName": "1 Quarterly Schedule"},"billingSubscriptionStatus": {"id": "ACTIVE","refName": "Active"},"currency": {"links": [{"rel": "self","href": "https://{{REST_ENDPOINT}}//services/rest/record/v1/currency/1"}],"id": "1","refName": "USD"},"customer": {"links": [{"rel": "self","href": "https://{{REST_ENDPOINT}}//services/rest/record/v1/customer/736"}],"id": "7234","refName": "SECURITY SOLUTION"},"custrecord154": 234,"custrecord160": 2343,"estimatedRevRecEndDate": "2025-05-31","frequency": {"id": "MONTHLY","refName": "Monthly"},"generateModificationElements": false,"id": "345,"idNumber": "2344","initialTerm": {"links": [{"rel": "self","href": "https://{{REST_ENDPOINT}}//services/rest/record/v1/subscriptionterm/-101"}],"id": "-101","refName": "Test Term"},"lastBillCycleDate": "2022-01-01","lastBillDate": "2022-01-01","name": "Generic SuiteBilling Subscription - 1/1/2020","nextBillCycleDate": "2022-01-01","priceBook": {"links": [{"rel": "self","href": "https://{{REST_ENDPOINT}}//services/rest/record/v1/pricebook/1"}],"id": "1","refName": "USD Price Book Monthly"},"priceInterval": {"links": [{"rel": "self","href": "https://{{REST_ENDPOINT}}//services/rest/record/v1/subscription/3200/priceInterval"}]},"startDate": "2020-01-01","subscriptionPlan": {"links": [{"rel": "self","href": "https://{{REST_ENDPOINT}}//services/rest/record/v1/subscriptionplan/335"}],"id": "3123","refName": "Generic SuiteBilling Subscription"},"subscriptionPlanName": "Generic SuiteBilling Subscription","subscriptionRevision": 1,"subsidiary": {"links": [{"rel": "self","href": "https://{{REST_ENDPOINT}}//services/rest/record/v1/subsidiary/53"}],"id": "343","refName": "Software, Inc."}}
I had selected ‘User Subsidiary’ in ‘Subsidiary Restrictions‘ for the api user role. I seem to be getting the ‘subscriptionLine‘ data after removing the restriction and selecting ‘ALL’.