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": "c6cb2a70-0c88-4b78-940c-597b71f13ade"
      },
      "data": [
        {
          "id": "plan_test_1753886809",
          "aggregate_usage": "sum",
          "amount": 0,
          "billing_scheme": "per_unit",
          "created_at": 1753886811,
          "currency": "USD",
          "interval": "month",
          "interval_count": 1,
          "metadata": {},
          "product": {
            "id": "product_8bd3eeef73cb7213415cd1e3797319b0"
          },
          "nickname": "",
          "tiers": [],
          "tiers_mode": "",
          "transform_usage": {
            "divide_by": 0,
            "round": "up"
          },
          "trial_period_days": 0,
          "usage_type": "licensed",
          "active": true
        },
        {
          "id": "plan_a27ad39527e792117ba0ebd164e2e56c",
          "aggregate_usage": "sum",
          "amount": 0,
          "billing_scheme": "tiered",
          "created_at": 1711024403,
          "currency": "USD",
          "interval": "month",
          "interval_count": 1,
          "metadata": {},
          "product": {
            "id": "product_8bd3eeef73cb7213415cd1e3797319b0"
          },
          "nickname": "Cut flower delivery",
          "tiers": [
            {
              "amount": 150,
              "up_to": "inf",
              "flat_amount": 0
            }
          ],
          "tiers_mode": "volume",
          "transform_usage": {
            "divide_by": 0,
            "round": ""
          },
          "trial_period_days": 0,
          "usage_type": "licensed",
          "active": true
        }
      ]
    }