AppMage

ChargeRecordRpc

ChargeRecordRpc exposes an RPC endpoint for listing charge records associated with the current subscription context. The only documented public method validates pagination inputs, requires a subscriptionId in the request context, and delegates the retrieval work to BillingService.

Endpoints

POST /api/rpc (Method: ChargeRecordRpc.getData)

  • Description: Lists charge records for a subscription.

  • Request Body:

    {
      "method": "ChargeRecordRpc.getData",
      "params": {
        "filter": {},
        "sort": {},
        "page": 1,
        "pageSize": 20
      }
    }
  • Parameters:

    Name Type Required Description
    filter Any No Optional filter object passed through to the underlying charge-record listing logic. The schema accepts any JSON-compatible value.
    sort Any No Optional sort value passed through to the underlying charge-record listing logic. The schema accepts any JSON-compatible value.
    page Number Yes Positive integer page number.
    pageSize Number Yes Positive integer page size.
  • Response:

    {
      "success": true,
      "data": {
        "...": "Returned by BillingService.getChargeRecords(...)"
      }
    }

    The RPC returns whatever BillingService.getChargeRecords(subscriptionId, { page, pageSize, sort, filter }) returns. The file does not define the response shape beyond that delegation.

  • Example (cURL):

    curl -X POST "${APP_BASE_URL}/api/rpc" \
      -H "Content-Type: application/json" \
      -d '{
        "method": "ChargeRecordRpc.getData",
        "params": {
          "filter": {},
          "sort": {},
          "page": 1,
          "pageSize": 20
        }
      }'

Behavior Notes

ChargeRecordRpc.getData reads context.subscriptionId and throws an error with the message Subscription context is required to list charge records. when that value is missing. The method does not document any additional validation, authentication requirements, or response fields in the source provided.