Skip to main content

Documentation

List Plans

Retrieve a list of all plans.

Use the optional query parameters to filter the results. You can filter the results further by specifying one or more Plan fields as additional query parameters.

    • ending_before

    • The ID of the plan created after the last plan you want to retrieve.

    • limit

    • The maximum number of plans to return. Range: 1-100.

      10

    • starting_after

    • The ID of the plan created before the first plan you want to retrieve.

Code Samples
    • .NET

      • using System;
        
        namespace RapydApiRequestSample
        {
            class Program
            {
                static void Main(string[] args)
                {
                    try
                    {
                        int limit = 2;
        
                        string result = RapydApiRequestSample.Utilities.MakeRequest("GET", $"/v1/plans?limit={limit}");
        
                        Console.WriteLine(result);
                    }
                    catch (Exception e)
                    {
                        Console.WriteLine("Error completing request: " + e.Message);
                    }
                }
            }
        }
    • JavaScript

      • const makeRequest = require('<path-to-your-utility-file>/utilities').makeRequest;
        
        async function main() {
          try {
            const result = await makeRequest(
              'GET',
              '/v1/plans?limit=2'
            );
        
            console.log(result);
          } catch (error) {
            console.error('Error completing request', error);
          }
        }
    • PHP

      • <?php
        $path = $_SERVER['DOCUMENT_ROOT'];
        $path .= "/<path-to-your-utility-file>/utilities.php";
        include($path);
        
        try {
            $object = make_request('get', '/v1/plans?limit=2');
            var_dump($object);
        } catch(Exception $e) {
            echo "Error: $e";
        }
        ?>
    • Python

      • from pprint import pprint
        
        from utilities import make_request
        
        result = make_request(method='get', path='/v1/plans?limit=2')
        pprint(result)
  • /v1/plans

  • List Plans

  • curl -X get
    https://sandboxapi.rapyd.net/v1/plans?limit=2
    -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'
    
  • {
        "status": {
            "error_code": "",
            "status": "SUCCESS",
            "message": "",
            "response_code": "",
            "operation_id": "f163538c-1b86-47ff-864d-1b455d872067"
        },
        "data": [
            {
                "id": "plan_5a99897cdcd7175cb8119254d02befdb",
                "aggregate_usage": "sum",
                "amount": 3,
                "billing_scheme": "per_unit",
                "created_at": 1646897987,
                "currency": "USD",
                "interval": "month",
                "interval_count": 1,
                "metadata": {},
                "product": null,
                "nickname": "Basic",
                "tiers": [],
                "tiers_mode": "",
                "transform_usage": {
                    "divide_by": 0,
                    "round": "up"
                },
                "trial_period_days": 0,
                "usage_type": "licensed",
                "active": false
            },
            {
                "id": "plan_889a7dc707b2ca13a815b008bec61a7d",
                "aggregate_usage": "sum",
                "amount": 5,
                "billing_scheme": "per_unit",
                "created_at": 1616315917,
                "currency": "USD",
                "interval": "day",
                "interval_count": 1,
                "metadata": {},
                "product": null,
                "nickname": "Basic",
                "tiers": [],
                "tiers_mode": "",
                "transform_usage": {
                    "divide_by": 0,
                    "round": "up"
                },
                "trial_period_days": 0,
                "usage_type": "licensed",
                "active": false
            }
        ]
    }