---
title: "List Usage Records"
source_url: https://docs.rapyd.net/en/list-usage-records.html
lang: en
---

# List Usage Records

Retrieve a list of usage records for a subscription item.

You can filter the list with query parameters.

### Parameters

### Request Path Parameters

- - subscription_item
  - ID of the subscription item. String starting with **subi_**.

### Request Query Parameters

- - ending_before
  - A filter for the latest date and time of the returned usage records. Format is in [Unix time](https://docs.rapyd.net/en/glossary.md#UUID-945d98cf-adae-e1cf-2606-c7fae8b4a7e1_unix_time "Unix time").
- - limit
  - A filter for the maximum number of usage records that are returned. Range: 1-100.

    10
- - starting_after
  - A filter for the earliest date and time of the returned usage records. Format is in [Unix time](https://docs.rapyd.net/en/glossary.md#UUID-945d98cf-adae-e1cf-2606-c7fae8b4a7e1_unix_time "Unix time").

### Request Header Parameters

- - access_key
  - Unique access key provided by Rapyd for each authorized user.

    See [Developers](https://docs.rapyd.net/en/developers.md "Developers").
- - Content-Type
  - Indicates that the data appears in JSON format. Set to **application/json**.
- - salt
  - Random string. Recommended length: 8-16 characters.
- - signature
  - Signature calculated for each request individually.

    See [Request Signatures](https://docs.rapyd.net/en/request-signatures.md "Request Signatures").
- - timestamp
  - Timestamp for the request, in [Unix time](https://docs.rapyd.net/en/glossary.md#UUID-945d98cf-adae-e1cf-2606-c7fae8b4a7e1_unix_time "Unix time") (seconds).

### Response Parameters

- - id
  - ID of the Usage Record object. String starting with **subiur_**.
- - quantity
  - The number of units of the service that the customer is billed for.
- - subscription_item
  - The ID of the subscription item that the usage record belongs to. String starting with **subi_**.
- - timestamp
  - The date and time that the change to the usage takes effect. [Unix time](https://docs.rapyd.net/en/glossary.md#UUID-945d98cf-adae-e1cf-2606-c7fae8b4a7e1_unix_time "Unix time").

### Code Samples

- - .NET

    - ```csharp
      using System;
      using System.Text.Json;

      namespace RapydApiRequestSample
      {
          class Program
          {
              static void Main(string[] args)
              {
                  try
                  {
                      string subscriptionItem = "subi_1b3355f074e60f9db947a1aa763d5c10";
                      int limit = 10;
                      int endingBefore = 1555491809;
                      int startingAfter = 1555491704;

                      string result = RapydApiRequestSample.Utilities.MakeRequest("POST", $"/v1/subscription_items/{subscriptionItem}/usage_record_summaries?{limit}&{endingBefore}&{startingAfter}");
                      Console.WriteLine(result);
                  }
                  catch (Exception e)
                  {
                      Console.WriteLine("Error completing request: " + e.Message);
                  }
              }
          }
      }
      ```
- - JavaScript

    - ```javascript
      const makeRequest = require('<path-to-your-utility-file>/utilities').makeRequest;

      async function main() {
        try {
          const result = await makeRequest(
            'GET',
            '/v1/subscription_items/subi_1b3355f074e60f9db947a1aa763d5c10/usage_record_summaries?limit=10&ending_before=1555491809&starting_after=1555491704'
          );

          console.log(result);
        } catch (error) {
          console.error('Error completing request', error);
        }
      }
      ```
- - PHP

    - ```php
      <?php
      $path = $_SERVER['DOCUMENT_ROOT'];
      $path .= "/<path-to-your-utility-file>/utilities.php";
      include($path);

      try {
          $object = make_request('get', '/v1/subscription_items/subi_1b3355f074e60f9db947a1aa763d5c10/usage_record_summaries?limit=10&ending_before=1555491809&starting_after=1555491704');
          var_dump($object);
      } catch(Exception $e) {
          echo "Error: $e";
      }
      ?>
      ```
- - Python

    - ```python
      from pprint import pprint

      from utilities import make_request

      subscription_item = "subi_1b3355f074e60f9db947a1aa763d5c10"
      response = make_request(method='get',
                              path=f'/v1/subscription_items/{subscription_item}/usage_record_summaries?limit=10&ending_before=1555491809&starting_after=1555491704')

      pprint(response)
      ```

- /v1/subscription_items/{subscription_item}/usage_record_summaries

- List Usage Records
- ```curl
  curl -X get  'https://sandboxapi.rapyd.net/v1/subscription_items/subi_56de709f3fc6f32c5db71d6c03611841/usage_record_summaries' \
  -H 'access_key: your-access-key-here' \
  -H 'Content-Type: application/json' \
  -H 'salt: your-random-string-here' \
  -H 'signature: your-calculated-signature-here' \
  -H 'timestamp: your-unix-timestamp-here'
  ```
- ```json
  {
      "status": {
          "error_code": "",
          "status": "SUCCESS",
          "message": "",
          "response_code": "",
          "operation_id": "180999f1-28c0-48a2-9304-2bf2cfbe3b99"
      },
      "data": [
          {
              "id": "subiur_0d04a5895a6ca6fbe9422e6d6af2f9c7",
              "quantity": 20,
              "timestamp": "1763462787",
              "subscription_item": "subi_56de709f3fc6f32c5db71d6c03611841"
          }
      ]
  }
  ```
