# Get subscription stats GET https://api-sandbox.payabli.com/api/Statistic/subscriptions/{interval}/{level}/{entryId} Retrieves the subscription statistics for a given interval for a paypoint or organization. Reference: https://docs.payabli.com/developers/api-reference/subscription/get-subscription-statistics-for-a-paypoint-or-organization ## OpenAPI Specification ```yaml openapi: 3.1.1 info: title: Get subscription statistics for a paypoint or organization version: endpoint_statistic.SubStats paths: /Statistic/subscriptions/{interval}/{level}/{entryId}: get: operationId: sub-stats summary: Get subscription statistics for a paypoint or organization description: >- Retrieves the subscription statistics for a given interval for a paypoint or organization. tags: - - subpackage_statistic parameters: - name: interval in: path description: |- Interval to get the data. Allowed values: - `all` - all intervals - `30` - 1-30 days - `60` - 31-60 days - `90` - 61-90 days - `plus` - +90 days required: true schema: type: string - name: level in: path description: |- The entry level for the request: - 0 for Organization - 2 for Paypoint required: true schema: type: integer - name: entryId in: path description: Identifier in Payabli for the entity. required: true schema: type: integer format: int64 - name: parameters in: query description: List of parameters required: false schema: type: object additionalProperties: type: string - name: requestToken in: header required: true schema: type: string responses: '200': description: Success content: application/json: schema: type: array items: $ref: '#/components/schemas/type_statistic:StatBasicQueryRecord' '400': description: Bad request/ invalid data content: {} '401': description: Unauthorized request. content: {} '500': description: Internal API Error content: {} '503': description: Database connection error content: {} components: schemas: type_statistic:StatBasicQueryRecord: type: object properties: statX: type: string description: Statistical grouping identifier inTransactions: type: integer description: Number of incoming transactions inTransactionsVolume: type: number format: double description: Volume of incoming transactions inWalletTransactions: type: integer description: Number of incoming wallet transactions inWalletVolume: type: number format: double description: Volume of incoming wallet transactions required: - statX - inTransactions - inTransactionsVolume - inWalletTransactions - inWalletVolume ``` ## SDK Code Examples ```python SubStatsExample from payabli import payabli client = payabli( api_key="YOUR_API_KEY", ) client.statistic.sub_stats( entry_id=1000000, interval="30", level=1, ) ``` ```typescript SubStatsExample import { PayabliClient } from "@payabli/sdk-node"; const client = new PayabliClient({ apiKey: "YOUR_API_KEY" }); await client.statistic.subStats("30", 1, 1000000); ``` ```go SubStatsExample import ( context "context" option "github.com/payabli/sdk-go/option" sdkgo "github.com/payabli/sdk-go" sdkgoclient "github.com/payabli/sdk-go/client" ) client := sdkgoclient.NewClient( option.WithApiKey( "", ), ) response, err := client.Statistic.SubStats( context.TODO(), 1000000, "30", 1, &sdkgo.SubStatsRequest{}, ) ``` ```csharp SubStatsExample using PayabliApi; var client = new PayabliApiClient("API_KEY"); await client.Statistic.SubStatsAsync(1000000, "30", 1, new SubStatsRequest()); ``` ```ruby SubStatsExample require 'uri' require 'net/http' url = URI("https://api-sandbox.payabli.com/api/Statistic/subscriptions/30/1/1000000") http = Net::HTTP.new(url.host, url.port) http.use_ssl = true request = Net::HTTP::Get.new(url) request["requestToken"] = '' response = http.request(request) puts response.read_body ``` ```java SubStatsExample HttpResponse response = Unirest.get("https://api-sandbox.payabli.com/api/Statistic/subscriptions/30/1/1000000") .header("requestToken", "") .asString(); ``` ```php SubStatsExample request('GET', 'https://api-sandbox.payabli.com/api/Statistic/subscriptions/30/1/1000000', [ 'headers' => [ 'requestToken' => '', ], ]); echo $response->getBody(); ``` ```swift SubStatsExample import Foundation let headers = ["requestToken": ""] let request = NSMutableURLRequest(url: NSURL(string: "https://api-sandbox.payabli.com/api/Statistic/subscriptions/30/1/1000000")! as URL, cachePolicy: .useProtocolCachePolicy, timeoutInterval: 10.0) request.httpMethod = "GET" request.allHTTPHeaderFields = headers let session = URLSession.shared let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in if (error != nil) { print(error as Any) } else { let httpResponse = response as? HTTPURLResponse print(httpResponse) } }) dataTask.resume() ```