Retrieve Plan
Retrieve the details of a pricing plan for services.
Code Samples
.NET
using System; namespace RapydApiRequestSample { class Program { static void Main(string[] args) { try { string plan = "plan_51788cf4ed1b672cb0a2a97773887f5b"; string result = RapydApiRequestSample.Utilities.MakeRequest("GET", $"/v1/plans/{plan}"); 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/plan_51788cf4ed1b672cb0a2a97773887f5b'); 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/plan_51788cf4ed1b672cb0a2a97773887f5b'); 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/plan_51788cf4ed1b672cb0a2a97773887f5b') pprint(result)
/v1/plans/:plan
Retrieve Plan
curl -X get 'https://sandboxapi.rapyd.net/v1/plans/plan_69dbb4984da69a24b32e464db94cc354' \ -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": "c32ad968-9fff-4d51-a03e-82e5b7c53a75" }, "data": { "id": "plan_69dbb4984da69a24b32e464db94cc354", "aggregate_usage": "sum", "amount": 9.99, "billing_scheme": "per_unit", "created_at": 1761210640, "currency": "USD", "interval": "month", "interval_count": 1, "metadata": {}, "product": { "id": "product_8bd3eeef73cb7213415cd1e3797319b0", "active": true, "attributes": [ "location", "size" ], "created_at": 1606060264, "description": "Monthly parking - covered area, compact car", "images": [ "64bit-encoded-image-1", "64bit-encoded-image-2" ], "metadata": {}, "name": "Monthly parking", "package_dimensions": { "height": 0, "length": 0, "weight": 0, "width": 0 }, "shippable": false, "skus": [], "statement_descriptor": "STATEMENT DESCRIPTOR", "type": "services", "unit_label": "month", "updated_at": 1606060264 }, "nickname": "Unlimited Plan", "tiers": [], "tiers_mode": "", "transform_usage": { "divide_by": 1, "round": "up" }, "trial_period_days": 7, "usage_type": "licensed", "active": false } }