Delete Invoice Item
Delete an invoice item from the upcoming invoice.
Use this method in the following situations:
The invoice item is attached to an invoice.
The invoice item is not attached to an invoice.
This method triggers the Invoice Item Deleted webhook. This webhook contains the same information as the response.
invoice_item
ID of the invoice item you want to delete.
Code Samples
.NET
using System; namespace RapydApiRequestSample { class Program { static void Main(string[] args) { try { string invoiceItem = "ii_50f7127dd0f7725c6599697d971af8b8"; string result = RapydApiRequestSample.Utilities.MakeRequest("DELETE", $"/v1/invoice_items/{invoiceItem}"); 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/invoice_items/ii_50f7127dd0f7725c6599697d971af8b8' ); console.log(result); } catch (error) { console.error('Error completing request', error); } }
PHP
<?php $path .= "/<path-to-your-utility-file>/utilities.php"; include($path); try { $object = make_request('delete', '/v1/invoice_items/ii_50f7127dd0f7725c6599697d971af8b8'); 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/invoice_items/ii_50f7127dd0f7725c6599697d971af8b8') pprint(result)
/v1/invoice_items/:invoice_item
Delete Invoice Item
curl -X delete https://sandboxapi.rapyd.net/v1/invoice_items/ii_50f7127dd0f7725c6599697d971af8b8 -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": "01a2d430-7348-4930-a25e-0b18dfeedf0d" }, "data": { "deleted": true, "id": "ii_50f7127dd0f7725c6599697d971af8b8" } }