Delete Plan
Delete a pricing plan for services.
This method triggers the Plan Deleted webhook. This webhook contains the same information as the response.
Code Samples
.NET
using System; namespace RapydApiRequestSample { class Program { static void Main(string[] args) { try { string plan = "plan_495e5e4a63f4a89f424ccb3874ba5094"; string result = RapydApiRequestSample.Utilities.MakeRequest("DELETE", $"/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('DELETE', '/v1/plans/plan_495e5e4a63f4a89f424ccb3874ba5094'); 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('delete', '/v1/plans/plan_495e5e4a63f4a89f424ccb3874ba5094'); var_dump($object); } catch(Exception $e) { echo "Error: $e"; } ?>
Python
from pprint import pprint from utilities import make_request result = make_request(method='delete', path='/v1/plans/plan_495e5e4a63f4a89f424ccb3874ba5094') pprint(result)
/v1/plans/:plan
Delete Plan
curl -X delete '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": "689f7dc6-f066-4947-b874-0016a8a5805e" }, "data": { "deleted": true, "id": "plan_69dbb4984da69a24b32e464db94cc354" } }