Delete Subscription Item
Delete a subscription item from the Rapyd platform.
This method triggers the Customer Subscription Item Deleted webhook. This webhook contains the same information as the response.
subscription_item
ID of the subscription item. String starting with subi_.
deleted
Indicates whether the subscription item was deleted.
id
ID of the subscription item. String starting with subi_.
Code Samples
.NET
using System; using System.Text.Json; { class Program { static void Main(string[] args) { try { string subscriptionItem = "subi_ac2ea2de64cc45f664a095a1375b9b32"; string result = RapydApiRequestSample.Utilities.MakeRequest("DELETE", $"/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( 'DELETE', '/v1/subscription_items/subi_ac2ea2de64cc45f664a095a1375b9b32' ); 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/subscription_items/subi_ac2ea2de64cc45f664a095a1375b9b32'); 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/subscription_items/subi_ac2ea2de64cc45f664a095a1375b9b32') pprint(result)
/v1/subscription_items/:subscription_item
Delete Subscription Item
curl -X delete https://sandboxapi.rapyd.net/v1/subscription_items/subi_ac2ea2de64cc45f664a095a1375b9b32 -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": "fe3631d2-9bd2-4dc3-9330-201e37c67927" }, "data": { "deleted": true, "id": "subi_ac2ea2de64cc45f664a095a1375b9b32" } }