SubscriptionLineItemRpc
Overview
SubscriptionLineItemRpc exposes RPC methods for reading and updating active line items attached to the current subscription context. The endpoint uses context.subscriptionId to identify the target subscription and delegates data access and updates to BillingService.
Endpoints
POST /api/rpc (Method: SubscriptionLineItemRpc.getData)
Description: Retrieves the active line items for the subscription identified by
context.subscriptionId.Request Body:
{ "method": "SubscriptionLineItemRpc.getData", "params": { "filter": {} } }Parameters:
Name Type Required Description filterAnyNo Optional input accepted by the schema. The method does not inspect or apply this value in the shown source. Response:
{ "success": true, "data": { "data": [ { "_id": "feature-key", "featureKey": "feature-key" } ], "totalCount": 1 } }The
dataarray contains the subscription's active line items, with each returned item augmented with an_idfield set to the item'sfeatureKey. The source confirms thattotalCountequals the number of active line items returned byBillingService.Example (cURL):
curl -X POST "${APP_BASE_URL}/api/rpc" \ -H "Content-Type: application/json" \ -d '{ "method": "SubscriptionLineItemRpc.getData", "params": {} }'No authentication header is documented in the source. This method requires a request context that includes
subscriptionId; otherwise it throwsSubscription context (subscriptionId) is required.
POST /api/rpc (Method: SubscriptionLineItemRpc.update)
Description: Updates a single active line item for the subscription identified by
context.subscriptionId.Request Body:
{ "method": "SubscriptionLineItemRpc.update", "params": { "_id": "feature-key", "freeUnits": 0, "maxUnits": 0, "oneTimeFee": 0, "recurringFee": 0, "ratesheetId": "ratesheet-id" } }Parameters:
Name Type Required Description _idStringYes Identifies the line item to update. The source comments indicate this value is treated as the line item's featureKey.freeUnitsIntegerNo Optional integer update value. maxUnitsIntegerNo Optional integer update value. Nullable in the schema. oneTimeFeeIntegerNo Optional integer update value. Nullable in the schema. recurringFeeIntegerNo Optional integer update value. Nullable in the schema. ratesheetIdStringNo Optional string update value. Nullable in the schema. Response:
{ "success": true, "data": {} }The source shows that this method returns the result of
BillingService.updateSubscriptionLineItem(...). The exact response shape is not defined in the inspected file, so only the delegation is confirmed.Example (cURL):
curl -X POST "${APP_BASE_URL}/api/rpc" \ -H "Content-Type: application/json" \ -d '{ "method": "SubscriptionLineItemRpc.update", "params": { "_id": "feature-key", "freeUnits": 10 } }'No authentication header is documented in the source. This method requires a request context that includes
subscriptionId; otherwise it throwsSubscription context (subscriptionId) is required.
Notes
Both methods depend on context.subscriptionId. If it is missing, they throw an error before performing any service call.
The request schema for update requires _id and allows the other fields to be omitted. The schema for getData accepts an optional filter value, but the method does not use it in the inspected source.