Skip to main content

Documentation

Retrieve Subscription Item

Retrieve the details of a subscription item.

    • subscription_item

    • ID of the subscription item. String starting with subi_.

Code Samples
    • .NET

      • using System;
        using System.Text.Json;
        
        namespace RapydApiRequestSample
        {
            class Program
            {
                static void Main(string[] args)
                {
                    try
                    {
        
                        string subscriptionItem = "subi_e5dbbf84c68e5bb7db761625158d4262";
        
                        string result = RapydApiRequestSample.Utilities.MakeRequest("GET", $"/v1/subscription_items/{subscriptionItem}");
        
                        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/subscription_items/subi_e5dbbf84c68e5bb7db761625158d4262'
            );
        
            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/subscription_items/subi_e5dbbf84c68e5bb7db761625158d4262');
            var_dump($object);
        } catch(Exception $e) {
            echo "Error: $e";
        }
        ?>
    • Python

      • from utilities import make_request
        
        result = make_request(method='get', path='/v1/subscription_items/subi_e5dbbf84c68e5bb7db761625158d4262')
        pprint(result)
  • /v1/subscription_items/:subscription_item

  • Retrieve Subscription Item

  • curl -X get
    https://sandboxapi.rapyd.net/v1/subscription_items/subi_e5dbbf84c68e5bb7db761625158d4262
    -H 'access_key: your-access-key-here'
    -H 'Content-Type: application/json'
    -H 'idempotency: your-idempotency-parameter-here'
    -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": "4995a894-b091-4d5e-b960-6c526ff4235a"
        },
        "data": {
            "id": "subi_e5dbbf84c68e5bb7db761625158d4262",
            "created": 1560329454,
    				"metadata": {
    					"merchant_defined": true
    				},
            "quantity": 2,
            "subscription_id": "sub_0de9c79c1e2beee09499dc8220493d59",
            "plan": {
                "id": "plan_dad429f5e16c41499c9c23356a5e8dea",
                "aggregate_usage": "sum",
                "amount": 0,
                "billing_scheme": "per_unit",
                "created_at": 1559803170,
                "currency": "USD",
                "interval": "month",
                "interval_count": 1,
                "metadata": {},
                "product": {
                    "id": "product_97f34708270f13d95d9c505eb785e3c5",
                    "active": true,
                    "attributes": [],
                    "created_at": 1546179439,
                    "description": "",
                    "images": [],
                    "metadata": {},
                    "name": "Monthly parking",
                    "package_dimensions": {
                        "height": 0,
                        "length": 0,
                        "weight": 0,
                        "width": 0
                    },
                    "shippable": false,
                    "skus": [],
                    "statement_descriptor": "MONTHLY PARKING",
                    "type": "service",
                    "unit_label": "",
                    "updated_at": 1546179439
                },
                "nickname": "",
                "tiers": [],
                "tiers_mode": "",
                "transform_usage": {
                    "divide_by": 0,
                    "round": ""
                },
                "trial_period_days": 0,
                "usage_type": "metered"
            }
        }
    }